/**
 * Cocimundo — Cotizador de envío en la ficha de producto.
 *
 * Los tokens se redeclaran aquí en lugar de importarse: los de cart.css están
 * scoped a `.cocimundo-cart` y esa hoja no se encola en la ficha de producto.
 * Los valores son los mismos, para que el lenguaje visual no se rompa entre
 * ficha, carrito y checkout.
 */

.psq {
    --cc-ink: #111827;
    --cc-ink-soft: #4b5563;
    --cc-muted: #6b7280;
    --cc-line: #e9eaec;
    --cc-line-strong: #d3d6db;
    --cc-accent: #f5b301;
    --cc-accent-dark: #d99a00;
    --cc-accent-soft: #fff8e6;
    --cc-success: #15803d;
    --cc-danger: #b91c1c;
    --cc-radius-sm: 10px;

    margin: 1rem 0 1.25rem;
    padding: .875rem 1rem;
    background: var(--cc-accent-soft);
    border: 1px solid rgba(245, 179, 1, .35);
    border-radius: 12px;
    color: var(--cc-ink);
}

/* -------------------------------------------------------------------------
 * Encabezado
 * ---------------------------------------------------------------------- */

.psq__head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .625rem;
}

.psq__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--cc-accent-dark);
}

.psq__title {
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--cc-ink);
}

/* -------------------------------------------------------------------------
 * Formulario
 * ---------------------------------------------------------------------- */

.psq__row {
    display: flex;
    gap: .5rem;
}

.psq__row + .psq__row {
    margin-top: .5rem;
}

.psq__row[hidden] {
    display: none;
}

.psq__input {
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    padding: 0 .75rem;
    border: 1px solid var(--cc-line-strong);
    border-radius: var(--cc-radius-sm);
    background: #fff;
    font-size: .875rem;
    color: var(--cc-ink);
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.psq__input::placeholder {
    color: #9ca3af;
}

.psq__input:focus {
    outline: none;
    border-color: var(--cc-accent);
    box-shadow: 0 0 0 3px rgba(245, 179, 1, .18);
}

.psq__btn {
    flex: 0 0 auto;
    height: 42px;
    padding: 0 1.1rem;
    border: 0;
    border-radius: var(--cc-radius-sm);
    background: var(--cc-ink);
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease;
}

.psq__btn:hover:not(:disabled) {
    background: #000;
}

.psq__btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* iOS hace zoom al enfocar un campo con fuente < 16px. */
@media (max-width: 640px) {
    .psq__input {
        font-size: 16px;
    }
}

/* En móvil el botón baja a su propia línea, como .cfs-calc__fields. */
@media (max-width: 480px) {
    .psq__row {
        flex-direction: column;
    }

    .psq__btn {
        width: 100%;
    }
}

/* -------------------------------------------------------------------------
 * Resultado
 * ---------------------------------------------------------------------- */

.psq__result {
    margin-top: .75rem;
    font-size: .8125rem;
    line-height: 1.5;
    color: var(--cc-ink-soft);
}

.psq__result[hidden] {
    display: none;
}

.psq__result strong {
    font-weight: 700;
    color: var(--cc-ink);
}

.psq__result-line {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}

.psq__result-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.psq__result-sub {
    display: block;
    margin-top: .1875rem;
    font-size: .75rem;
    color: var(--cc-muted);
}

.psq__result a {
    color: var(--cc-accent-dark);
    font-weight: 600;
    text-decoration: underline;
}

/* Estados */
.psq.is-free .psq__result,
.psq.is-free .psq__result strong {
    color: var(--cc-success);
    font-weight: 600;
}

.psq.is-error .psq__result {
    color: var(--cc-danger);
}

.psq.is-colony .psq__result {
    color: var(--cc-accent-dark);
}

.psq.is-loading .psq__result {
    color: var(--cc-muted);
}

.psq.is-loading .psq__btn {
    opacity: .6;
    pointer-events: none;
}

/* -------------------------------------------------------------------------
 * Nota
 * ---------------------------------------------------------------------- */

.psq__note {
    margin: .625rem 0 0;
    font-size: .6875rem;
    line-height: 1.45;
    color: var(--cc-muted);
}
