/* ===========================================================================
   Cotizador Avíos Estilo — estilos del widget público.

   - Hereda las variables --ae-* del :root del sitio. NO redeclara ninguna.
   - Variables propias con prefijo --cot-*.
   - Todas las clases propias con prefijo cot-, salvo .btn/.btn-primary que se
     reutilizan del sitio a propósito (consistencia de marca) en el botón final.
   - Fallbacks var(--ae-x, #hex) para que el widget se vea aceptable standalone.
   - Sin position fixed/sticky; nada con z-index alto (el header del sitio es 50).
   =========================================================================== */

.cot-root {
  --cot-gap: 1.2rem;
  --cot-radius-pill: var(--radius-pill, 999px);
  --cot-border: 1.5px solid rgba(23, 23, 23, .18);

  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 720px;
  margin: 2rem auto;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  background: var(--ae-white, #FFFFFF);
  border-radius: var(--radius-lg, 28px);
  box-shadow: 0 14px 40px rgba(23, 23, 23, .06);
  text-align: center;
  color: var(--ae-ink, #171717);
}

.cot-root *,
.cot-root *::before,
.cot-root *::after { box-sizing: border-box; }

/* ---- Pasos (flujo progresivo) ------------------------------------------- */
.cot-steps {
  display: flex;
  flex-direction: column;
  gap: var(--cot-gap);
}

.cot-step {
  /* scroll-margin-top fallback; el JS calcula offset real al hacer scroll. */
  scroll-margin-top: 96px;
}

.cot-step-hidden {
  display: none;
}

.cot-step-label {
  margin: 0 0 .8rem;
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--ae-ink, #171717);
  text-align: center;
}

/* ---- Opciones: radios estilizados como botones (§7.2) ------------------- */
.cot-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
}

.cot-option {
  position: relative;
  cursor: pointer;
}

.cot-option input[type="radio"] {
  /* Cubre exactamente el área visible del span estilizado: así el browser sabe
     que el input "ocupa" un rect ya visible y NO scrollea automáticamente al
     recibir foco. La posición absolute con inset:0 vs solo `position:absolute`
     evita el efecto de autoscroll al click programático sobre el label. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.cot-option > span {
  display: block;
  padding: .85rem 1.4rem;
  border: var(--cot-border);
  border-radius: var(--cot-radius-pill);
  background: var(--ae-white, #FFFFFF);
  color: var(--ae-ink, #171717);
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.1;
  transition: all .18s ease;
  user-select: none;
}

.cot-option:hover > span {
  border-color: var(--ae-purple, #7B2A80);
}

.cot-option input[type="radio"]:checked + span {
  background: var(--ae-purple, #7B2A80);
  color: var(--ae-white, #FFFFFF);
  border-color: var(--ae-purple, #7B2A80);
}

.cot-option input[type="radio"]:focus-visible + span {
  outline: 3px solid var(--ae-purple-bright, #B85BE7);
  outline-offset: 3px;
}

/* ---- Resultado (§7.3) --------------------------------------------------- */
.cot-resultado {
  scroll-margin-top: 96px;
  margin-top: 1.8rem;
  padding: clamp(1.4rem, 3.5vw, 2.2rem);
  background: var(--ae-textile-warm, #EFECE7);
  border-radius: var(--radius-md, 18px);
  text-align: center;
}

.cot-resumen {
  margin: 0 0 1.1rem;
  font-weight: 700;
  font-size: 1.12rem;
  line-height: 1.4;
  color: var(--ae-ink, #171717);
  text-align: center;
}

.cot-desglose {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin: 0 auto 1.2rem;
  max-width: 460px;
  text-align: left;
}

.cot-linea {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: .15rem 1rem;
}

.cot-linea-label {
  color: var(--ae-ink-soft, #2B2B2B);
}

.cot-linea-monto {
  text-align: right;
  font-weight: 700;
  color: var(--ae-ink, #171717);
}

.cot-linea-detalle {
  grid-column: 1 / -1;
  color: var(--ae-gray-dark, #6D6D72);
  font-size: .85rem;
}

/* El total se destaca: más grande, más peso, separado del resto. */
.cot-total {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: .15rem 1rem;
  margin-top: .65rem;
  padding-top: .85rem;
  border-top: 2px solid rgba(23, 23, 23, .12);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ae-ink, #171717);
  text-align: left;
}

.cot-total small {
  grid-column: 1 / -1;
  font-size: .85rem;
  font-weight: 400;
  color: var(--ae-gray-dark, #6D6D72);
}

/* Estado "consultá" — para combinaciones válidas sin celda cargada (Hangtags).
 * Cartel limpio en lugar de precio + nota; el botón de WhatsApp lleva el
 * mensaje pre-armado con calidad + cantidad. */
.cot-consulta {
  text-align: center;
  padding: 1rem 1.1rem;
}
.cot-consulta-titulo {
  margin: 0 0 .35rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ae-ink, #171717);
}
.cot-consulta-sub {
  margin: 0;
  color: var(--ae-gray-dark, #6D6D72);
  font-size: .95rem;
  line-height: 1.4;
}

.cot-aclaracion {
  margin: 0 auto 1.3rem;
  max-width: 460px;
  color: var(--ae-gray-dark, #6D6D72);
  font-size: .9rem;
  line-height: 1.55;
  text-align: center;
}

.cot-acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Botón WhatsApp del resultado — reutiliza .btn .btn-primary del sitio.
   Forzamos box-sizing y permitimos wrap del texto para que en pantallas chicas
   no se desborde del card. */
.cot-acciones .cot-whatsapp {
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

/* Reset: terciario, que no compita con el primario. */
.cot-reset {
  background: none;
  border: none;
  padding: .4rem .25rem;
  cursor: pointer;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ae-purple, #7B2A80);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cot-reset:hover {
  color: var(--ae-purple-bright, #B85BE7);
}

.cot-reset:focus-visible {
  outline: 3px solid var(--ae-purple-bright, #B85BE7);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Error -------------------------------------------------------------- */
.cot-error {
  margin: 1.2rem 0 0;
  padding: .9rem 1.1rem;
  background: rgba(179, 38, 30, .08);
  border: 1px solid var(--ae-error, #B3261E);
  border-radius: var(--radius-md, 18px);
  color: var(--ae-error, #B3261E);
  font-size: .95rem;
  line-height: 1.45;
  text-align: center;
}

/* ---- Calculadora de etiquetas (estampadas.html — §7.6) ------------------ */
.cot-calc-card {
  max-width: 540px;
  margin: 0 auto;
  padding: clamp(1.4rem, 3.5vw, 2rem);
  background: rgba(123, 42, 128, .06);
  border: 1.5px solid rgba(123, 42, 128, .28);
  border-radius: var(--radius-lg, 28px);
  text-align: center;
  box-sizing: border-box;
}
.cot-calc-card *,
.cot-calc-card *::before,
.cot-calc-card *::after { box-sizing: border-box; }

.cot-calc-title {
  margin: 0 0 .55rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--ae-purple, #7B2A80);
  letter-spacing: -.01em;
  line-height: 1.1;
}

.cot-calc-sub {
  margin: 0 0 1.2rem;
  color: var(--ae-ink-soft, #2B2B2B);
  font-size: .98rem;
  line-height: 1.5;
}

.cot-calc-inputs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .8rem;
  margin: 0 auto 1rem;
  max-width: 460px;
}

.cot-calc-field {
  flex: 1 1 200px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  text-align: left;
  font-weight: 700;
  font-size: .85rem;
  color: var(--ae-ink-soft, #2B2B2B);
}

.cot-calc-field input {
  width: 100%;
  min-height: 46px;
  border: 1.5px solid rgba(123, 42, 128, .25);
  border-radius: 12px;
  padding: .55rem .85rem;
  font-family: inherit;
  font-size: 1rem;
  background: var(--ae-white, #FFFFFF);
  color: var(--ae-ink, #171717);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.cot-calc-field input:focus {
  border-color: var(--ae-purple-bright, #B85BE7);
  box-shadow: 0 0 0 3px rgba(184, 91, 231, .18);
}

.cot-calc-result {
  margin-top: .9rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ae-purple, #7B2A80);
  min-height: 1.4em;
  line-height: 1.35;
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 500px) {
  .cot-root {
    padding: 1.2rem 1rem;
    margin: 1.2rem 0;
  }
  .cot-option > span {
    padding: .75rem 1.1rem;
    font-size: .9rem;
  }
  .cot-total {
    font-size: 1.25rem;
  }
  .cot-acciones {
    flex-direction: column;
    align-items: stretch;
  }
  .cot-acciones .cot-whatsapp {
    width: 100%;
    padding-left: .9rem;
    padding-right: .9rem;
    font-size: .9rem;
  }
  .cot-acciones .cot-reset {
    text-align: center;
  }
  .cot-resultado {
    padding: 1.1rem .9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cot-option > span {
    transition: none;
  }
}

/* ===========================================================================
 * Cupones (entrega 5) — cuando vino descuento del server o cuando ofrecemos
 * captura inline bajo el resultado. Hereda --ae-* (con fallback). Prefijo
 * cot-precio-* y cot-cupon-*. Sin position fixed/sticky.
 * ========================================================================= */

/* Filas Precio / Descuento / Total — label izquierda + monto derecha (sin
 * leader dots). Total en negrita (label + monto), monto de Descuento en verde. */
.cot-precio-linea {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .4rem 0;
  text-align: left;
}
.cot-precio-label {
  color: var(--ae-ink-soft, #2B2B2B);
  font-weight: 600;
  white-space: nowrap;
}
.cot-precio-monto {
  text-align: right;
  font-weight: 700;
  color: var(--ae-ink, #171717);
  white-space: nowrap;
}
/* "+ IVA" chico pegado al monto, no negrita. Vive dentro del span del monto
 * (en .cot-total y .cot-precio-linea--total) para que el alineado a la
 * derecha lo arrastre con el número. */
.cot-iva {
  font-size: .65em;
  font-weight: 600;
  color: var(--ae-gray-dark, #6D6D72);
  margin-left: .15rem;
  white-space: nowrap;
}
/* Descuento: monto en verde (label queda en el color base). */
.cot-precio-linea--descuento .cot-precio-monto {
  color: #15803d;
}
/* Total: separador superior + label + monto en negrita y tipografía mayor. */
.cot-precio-linea--total {
  margin-top: .35rem;
  padding-top: .8rem;
  border-top: 2px solid rgba(23, 23, 23, .12);
}
.cot-precio-linea--total .cot-precio-label,
.cot-precio-linea--total .cot-precio-monto {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ae-ink, #171717);
}

/* Nota chica bajo el desglose (matriz / vencido). */
.cot-cupon-nota {
  margin: .6rem auto 1.2rem;
  max-width: 460px;
  color: var(--ae-gray-dark, #6D6D72);
  font-size: .88rem;
  line-height: 1.5;
  text-align: center;
  font-style: italic;
}
.cot-cupon-nota--alerta {
  color: var(--ae-error, #B3261E);
  font-style: normal;
  font-weight: 600;
}

/* Caja de captura inline (no-suscriptor). Vive DENTRO de .cot-resultado, al
 * final, separada con borde superior — no es un card aparte. */
.cot-cupon-captura {
  margin: 1.4rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px dashed rgba(23, 23, 23, .18);
  max-width: 460px;
  text-align: center;
}
.cot-cupon-titulo {
  margin: 0 0 .4rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ae-ink, #171717);
}
.cot-cupon-sub {
  margin: 0 0 1rem;
  font-size: .88rem;
  line-height: 1.45;
  color: var(--ae-ink-soft, #2B2B2B);
}
.cot-cupon-form {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  position: relative;
}
.cot-cupon-input {
  font-family: inherit;
  font-size: 1rem;
  padding: .75rem 1rem;
  min-height: 46px;
  border: 1.5px solid var(--ae-gray, #DDE2E4);
  border-radius: 999px;
  background: var(--ae-white, #FFFFFF);
  color: var(--ae-ink, #171717);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.cot-cupon-input::placeholder { color: var(--ae-gray-dark, #6D6D72); }
.cot-cupon-input:focus {
  outline: none;
  border-color: var(--ae-purple, #7B2A80);
  box-shadow: 0 0 0 3px rgba(123, 42, 128, .15);
}
.cot-cupon-input:disabled {
  background: var(--ae-textile, #F4F6F5);
  cursor: not-allowed;
}
.cot-cupon-submit {
  align-self: stretch;
}
.cot-cupon-submit:disabled {
  cursor: not-allowed;
  opacity: .65;
  transform: none;
}
/* Honeypot — invisible al usuario pero accesible al DOM. */
.cot-cupon-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.cot-cupon-status {
  margin: .55rem 0 0;
  min-height: 1.1em;
  font-size: .85rem;
  color: var(--ae-gray-dark, #6D6D72);
}
.cot-cupon-status--err {
  color: var(--ae-error, #B3261E);
  font-weight: 600;
}

/* Panel de éxito tras submit (reemplaza al form). */
.cot-cupon-exito { text-align: center; }
.cot-cupon-exito-eyebrow {
  margin: 0 0 .5rem;
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ae-purple, #7B2A80);
}
.cot-cupon-exito-codigo {
  margin: 0 0 .7rem;
  padding: .65rem 1rem;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: .22em;
  color: var(--ae-purple-dark, #37283F);
  background: var(--ae-white, #FFFFFF);
  border-radius: 10px;
}
.cot-cupon-exito-msg {
  margin: 0;
  font-size: .92rem;
  color: var(--ae-ink-soft, #2B2B2B);
  line-height: 1.5;
}

/* En mobile el bloque sigue centrado y compacto. */
@media (max-width: 480px) {
  .cot-precio-linea--total .cot-precio-label,
  .cot-precio-linea--total .cot-precio-monto {
    font-size: 1.15rem;
  }
}
