/*
 * La taquilla, lo principal de la web: sacar la entrada en dos pasos.
 * Como antes: a la izquierda el formulario y a la derecha la entrada que se va rellenando,
 * saliendo de su ranura, sobre papel de noche.
 * El formulario va en una tarjeta marfil para diferenciarlo: las entradas como tarjetas
 * (ninguna marcada de antemano) y la dirección, que se abre al elegir.
 * Fondos de papel con gramaje; letras lisas. En Stripe solo se paga: la dirección ya va desde aquí.
 */
.esc--taquilla { padding-bottom: clamp(4rem, 9vh, 6rem); }
.taquilla { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.taquilla__intro { margin-top: 1rem; max-width: 46ch; opacity: .92; }

/* --- la tarjeta marfil con el formulario --- */
.taquilla__ventana {
  margin-top: 1.8rem; padding: clamp(1.15rem, 2.4vw, 1.8rem);
  border-radius: 16px; box-shadow: 0 24px 46px -30px rgba(0, 0, 0, .7);
}
.taquilla__form { display: grid; gap: 1.3rem; }
.paso-f { margin: 0; padding: 0; border: 0; min-width: 0; }
.paso-f + .paso-f { padding-top: 1.2rem; border-top: 1px dashed rgba(42, 11, 18, .22); }
.paso-f legend { display: flex; align-items: center; gap: .65rem; padding: 0; font-weight: 700; font-size: 1.1rem; color: var(--granate); }
.paso-f__num {
  display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; flex: none;
  font-size: .95rem; font-weight: 700; color: var(--cera); background: var(--granate); border-radius: 50%;
}

/* paso 1 · las entradas: la suscripción, entera; los regalos, a medias */
.opciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: .95rem; }
.opcion {
  position: relative; cursor: pointer;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .2rem .75rem;
  padding: .85rem .95rem .9rem; color: var(--tinta); background: rgba(255, 253, 248, .75);
  border: 2px solid rgba(91, 24, 38, .25); border-radius: 12px;
  transition: border-color .2s, background-color .2s, color .2s, transform .3s var(--e-muelle);
}
.opcion--principal { grid-column: 1 / -1; padding: 1rem 1.1rem 1.05rem; }
.opcion input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.opcion__marca { position: relative; grid-row: span 2; width: 1.3rem; height: 1.3rem; border: 2px solid rgba(91, 24, 38, .55); border-radius: 50%; }
.opcion__nombre { font-weight: 700; font-size: 1rem; line-height: 1.2; color: var(--granate); }
.opcion__precio { display: flex; align-items: baseline; gap: .3em; white-space: nowrap; color: var(--granate); }
.opcion__precio b { font-weight: 800; font-size: 1.25rem; line-height: 1; }
.opcion__precio small { font-size: .82rem; font-weight: 600; }
.opcion--principal .opcion__precio b { font-size: 1.5rem; }
.opcion__nota { grid-column: 2 / -1; font-size: .86rem; color: var(--tinta-2); }
.opcion:hover { border-color: rgba(91, 24, 38, .6); transform: translateY(-1px); }
.opcion:has(input:focus-visible) { outline: 2px dashed var(--granate); outline-offset: 4px; }
/* la elegida: granate entera, con su marca */
.opcion.is-elegida { background: var(--granate); border-color: var(--granate); color: var(--cera); }
.opcion.is-elegida .opcion__nombre, .opcion.is-elegida .opcion__precio, .opcion.is-elegida .opcion__nota { color: var(--cera); }
.opcion.is-elegida .opcion__marca { background: var(--cera); border-color: var(--cera); }
.opcion.is-elegida .opcion__marca::after {
  content: ""; position: absolute; left: 50%; top: 44%; width: .28rem; height: .56rem;
  border: solid var(--granate); border-width: 0 2.5px 2.5px 0; translate: -50% -50%; rotate: 42deg;
}
.opciones.is-error .opcion { border-color: #C2453F; }

/* paso 2 · la dirección: plegada hasta que eliges la entrada */
.paso-f__espera { margin-top: .5rem; font-size: .9rem; color: var(--tinta-2); }
.paso-f__cuerpo > div { min-height: 0; padding: .15rem .25rem .3rem; margin: 0 -.25rem; }
.js .paso-f--plegable .paso-f__cuerpo { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .75s var(--e-out), opacity .5s .1s; }
.js .paso-f--plegable .paso-f__cuerpo > div { overflow: hidden; }
.js .paso-f--plegable.is-abierto .paso-f__cuerpo { grid-template-rows: 1fr; opacity: 1; }
.js .paso-f--plegable:not(.is-abierto) legend { opacity: .78; }
.paso-f--plegable.is-abierto .paso-f__espera, html:not(.js) .paso-f__espera { display: none; }

.rejilla-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem .9rem; margin-top: .95rem; }
.regalo-campos { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px dashed rgba(42, 11, 18, .2); }
.regalo-campos__titulo { grid-column: 1 / -1; font-weight: 700; color: var(--granate); }
.regalo-campos__titulo small { font-weight: 400; color: var(--tinta-2); }
.campo-t { display: grid; gap: .3rem; font-size: .9rem; }
.campo-t--ancho { grid-column: 1 / -1; }
.campo-t > span { font-weight: 600; color: var(--tinta); }
.campo-t small { font-weight: 400; color: var(--tinta-2); }
.campo-t input, .campo-t select, .campo-t textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--tinta);
  padding: .72rem .85rem; background: #FFFDF8;
  border: 1.5px solid rgba(42, 11, 18, .24); border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.campo-t input::placeholder, .campo-t textarea::placeholder { color: rgba(42, 11, 18, .45); }
.campo-t textarea { resize: vertical; min-height: 4.5rem; }
.campo-t select {
  appearance: none; -webkit-appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--granate) 50%), linear-gradient(135deg, var(--granate) 50%, transparent 50%);
  background-position: calc(100% - 1.2rem) 52%, calc(100% - .85rem) 52%;
  background-size: .4rem .4rem, .4rem .4rem; background-repeat: no-repeat;
}
.campo-t input:focus-visible, .campo-t select:focus-visible, .campo-t textarea:focus-visible {
  outline: none; border-color: var(--granate); box-shadow: 0 0 0 3px rgba(91, 24, 38, .16);
}
.campo-t.is-error input, .campo-t.is-error select { border-color: #C2453F; box-shadow: 0 0 0 3px rgba(194, 69, 63, .14); }
.campo-t__ayuda { margin-top: .6rem; font-size: .86rem; color: var(--tinta-2); max-width: 54ch; }
.campo-t__ayuda:empty { display: none; }

/* pasar por caja: el botón grande, a todo el ancho */
.boton--caja { justify-self: stretch; min-height: 3.9rem; margin-top: .2rem; font-size: 1.08rem; }
.taquilla__legal { font-size: .84rem; color: var(--tinta-2); max-width: 54ch; margin-top: -.5rem; }
.taquilla__aviso { font-weight: 700; color: #A8322D; min-height: 1.2em; margin-top: -.5rem; }
.taquilla__aviso:empty { display: none; }
.taquilla__pie { max-width: var(--ancho); margin: clamp(2.5rem, 6vw, 4rem) auto 0; font-size: .9rem; opacity: .8; text-align: center; }

/* --- la ventanilla: la entrada sale por la ranura --- */
.taquilla__ventanilla { position: sticky; top: calc(var(--nav-alto) + 1.5rem); display: grid; justify-items: center; gap: 1.4rem; padding-top: 1rem; }
.ranura { width: min(100%, 22rem); height: 10px; border-radius: 6px; background: #12030a; box-shadow: inset 0 3px 6px rgba(0, 0, 0, .8), 0 1px 0 rgba(244, 237, 224, .12); }

/* --- la entrada que se va rellenando (papel con gramaje) --- */
.impresa {
  --muesca: 11px; --matriz: 5.4rem;
  position: relative; width: min(100%, 23rem); margin-top: -1.6rem; display: grid; grid-template-columns: 1fr var(--matriz);
  color: var(--tinta); rotate: -1.5deg;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .25)) drop-shadow(0 16px 20px rgba(0, 0, 0, .45));
}
.impresa::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-color: #F6F0E4; background-image: var(--papel-marfil); background-size: 260px; background-blend-mode: multiply;
  -webkit-mask:
    radial-gradient(circle var(--muesca) at calc(100% - var(--matriz)) 0, #0000 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--muesca) at calc(100% - var(--matriz)) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle var(--muesca) at calc(100% - var(--matriz)) 0, #0000 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--muesca) at calc(100% - var(--matriz)) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
}
.impresa__cuerpo { padding: 1.1rem 1.1rem 1rem 1.3rem; min-width: 0; }
.impresa__marca { display: flex; justify-content: space-between; gap: .6rem; font-weight: 700; font-size: .85rem; padding-bottom: .5rem; border-bottom: 1.5px solid var(--granate); color: var(--granate); }
.impresa__marca span { white-space: nowrap; }
.impresa__lineas { margin-top: .5rem; display: grid; gap: .15rem; }
.impresa__lineas div { display: flex; justify-content: space-between; gap: .8rem; font-size: .9rem; overflow: hidden; }
.impresa__lineas dt { font-size: .82rem; color: var(--tinta-2); padding-top: .05em; }
.impresa__lineas dd { font-weight: 700; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.impresa__matriz {
  position: relative; display: grid; place-content: center; justify-items: center; gap: .1rem; text-align: center;
  border-left: 2px dashed rgba(42, 11, 18, .35); padding: .8rem .3rem; font-size: .8rem; color: var(--granate);
}
.impresa__matriz b { font-size: 2.2rem; line-height: 1; }
.impresa.is-vacia .impresa__lineas dd { opacity: .65; font-weight: 400; }
.impresa.is-imprimiendo { animation: imprimir 1.1s steps(11) both; }
@keyframes imprimir { from { clip-path: inset(0 0 100% 0); transform: translateY(-14%); } to { clip-path: inset(0 0 -10% 0); transform: none; } }

@media (max-width: 899px) {
  .taquilla { grid-template-columns: 1fr; }
  .taquilla__ventanilla { display: none; }
  .opciones, .rejilla-campos { grid-template-columns: 1fr; }
  .opcion--principal .opcion__precio b { font-size: 1.35rem; }
}
