/*
 * AYUDA Y GANA: base del sistema visual de las páginas públicas.
 * Mundo: un salón de concesionaria de noche visto desde la ruta. Fondo noche verdosa, carteles verdes con filete
 * blanco, letra condensada de cartel y el amarillo boleto como único color de acción. Fuente única: DESIGN.md.
 * Mobile first (390 px), sin frameworks ni dependencias. La fuente (Archivo, OFL) está autoalojada en /fonts.
 */

/* 0. Fuentes ----------------------------------------------------------------------------------------------- */
/* Archivo variable, subset latin (ejes: peso 400-800, ancho 75-100 %). Licencia: public/fonts/OFL.txt */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url("../fonts/archivo-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Respaldos con métricas ajustadas a Archivo (medidas en Chrome): mientras carga o si no carga, el texto ocupa
   casi lo mismo y no salta. Cuerpo: Arial al 98 %. Display y CVU: Arial Narrow Bold al 98,7 %. */
@font-face {
  font-family: "Archivo respaldo";
  font-weight: 400 500;
  src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Roboto");
  size-adjust: 98%; ascent-override: 89.6%; descent-override: 21.4%; line-gap-override: 0%;
}
@font-face {
  font-family: "Archivo respaldo";
  font-weight: 600 800;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Roboto Bold");
  size-adjust: 98%; ascent-override: 89.6%; descent-override: 21.4%; line-gap-override: 0%;
}
@font-face {
  font-family: "Archivo condensada respaldo";
  font-weight: 400 800;
  src: local("Arial Narrow Bold"), local("ArialNarrow-Bold"), local("Roboto Condensed Bold"), local("Arial Narrow");
  size-adjust: 98.7%; ascent-override: 89%; descent-override: 21.3%; line-gap-override: 0%;
}

/* 1. Tokens ------------------------------------------------------------------------------------------------ */
:root {
  color-scheme: dark;

  /* Color. Contraste sobre noche entre paréntesis (DESIGN.md §2). */
  --noche: #07110D;           /* fondo: el salón de noche, verde casi negro (nunca #000) */
  --noche-2: #0C1A15;         /* superficie: filas, inputs, bloques */
  --noche-3: #132620;         /* superficie al pasar el mouse */
  --linea: #1E3129;           /* divisores */
  --linea-2: #2B443A;         /* bordes de bloque */
  --borde-control: #5C7A6D;   /* contorno de inputs, radios y checks (3,8:1 sobre noche-2) */
  --texto: #F2F6F3;           /* texto principal (17,6:1) */
  --texto-2: #B5C6BE;         /* bajadas y secundario (10,8:1) */
  --texto-3: #8FA59B;         /* ayudas y metadatos (7,3:1; 6,8:1 sobre noche-2) */
  --placeholder: #7E968B;
  --cartel: #0A5E3F;          /* verde cartel: el verde campo llevado a cartel de ruta (blanco encima 7,8:1) */
  --cartel-2: #0D6B48;        /* fila del cartel al pasar el mouse */
  --sobre-cartel: #FFFFFF;
  --sobre-cartel-2: #CFE3D8;  /* secundario sobre el cartel (6,0:1) */
  --filete: #F2F6F3;          /* el filete blanco del cartel: el único marco del sitio */
  --boleto: #F6CB46;          /* amarillo boleto: único color de acción, lo elegido y la banda de la patente */
  --boleto-hover: #FFD966;
  --sobre-boleto: #07110D;    /* tinta sobre amarillo (12,4:1) */
  --enlace: #7FD9AE;          /* enlaces en texto (11,4:1) */
  --enlace-hover: #A6E8C7;
  --ok: #6ED3A4;              /* pagado, éxito */
  --ok-suave: rgb(110 211 164 / 0.12);
  --alerta: #F6CB46;          /* pendiente (es tuyo, todavía sin pagar) */
  --alerta-suave: rgb(246 203 70 / 0.12);
  --error: #FF8A80;           /* errores de formulario, anulado (8,4:1) */
  --error-suave: rgb(255 138 128 / 0.12);
  --neutro-suave: #22342C;    /* vencido, banda de la patente reservada */
  --placa: #FFFFFF;           /* la patente */
  --tinta: #07110D;           /* tinta sobre la placa y el amarillo */
  --hueco-foto: #132620;

  /* Tipografía */
  --fuente: "Archivo", "Archivo respaldo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fuente-display: "Archivo", "Archivo condensada respaldo", "Arial Narrow", system-ui, sans-serif;
  --ancho-display: 75%;       /* eje wdth de Archivo: condensada de cartel para titulares y cifras */
  --ancho-medio: 87.5%;

  --t-heroe: clamp(2.75rem, 1.6rem + 5vw, 6rem);          /* 44 a 96 px */
  --t-display: clamp(2.375rem, 1.55rem + 3.6vw, 4.25rem);  /* 38 a 68 px */
  --t-h2: clamp(2rem, 1.5rem + 2vw, 3.25rem);              /* 32 a 52 px */
  --t-h3: 1.3125rem;                                       /* 21 px */
  --t-cuerpo: 1.0625rem;                                   /* 17 px */
  --t-chico: 0.9375rem;                                    /* 15 px */
  --t-mini: 0.8125rem;                                     /* 13 px */

  /* Espaciado (base 4) */
  --e-1: 4px;  --e-2: 8px;  --e-3: 12px; --e-4: 16px; --e-5: 24px;
  --e-6: 32px; --e-7: 48px; --e-8: 64px; --e-9: 96px;
  --gutter: 20px;
  --ancho-max: 1240px;
  --seccion: clamp(3.5rem, 8vw, 7rem);

  /* Radios: los del cartel de ruta. Chico para piezas, medio para controles, cartel para los paneles. */
  --r-1: 6px;
  --r-2: 10px;
  --r-3: 14px;
  --r-pill: 999px;

  /* El filete: borde verde y raya blanca adentro, como un cartel vial. Una sola receta en todo el sitio. */
  --filete-sombra: inset 0 0 0 5px var(--cartel), inset 0 0 0 7px var(--filete);

  --sombra-2: 0 2px 4px rgb(0 0 0 / 0.3), 0 18px 40px -16px rgb(0 0 0 / 0.7);
  --foco: 3px solid var(--boleto);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 2. Reset ------------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--noche); }
body {
  min-height: 100dvh;
  background: var(--noche);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: var(--t-cuerpo);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, picture, svg.bloque { display: block; max-width: 100%; height: auto; }
input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--enlace); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--enlace-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: var(--foco); outline-offset: 2px; }
::selection { background: var(--boleto); color: var(--sobre-boleto); }
html { scrollbar-color: var(--linea-2) var(--noche); accent-color: var(--boleto); caret-color: var(--boleto); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 3. Tipografía -------------------------------------------------------------------------------------------- */
h1, h2, h3, .display {
  font-family: var(--fuente-display);
  text-wrap: balance;
  color: var(--texto);
}
h1, .display {
  font-size: var(--t-display);
  font-stretch: var(--ancho-display);
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.012em;
}
h2 {
  font-size: var(--t-h2);
  font-stretch: var(--ancho-display);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.008em;
}
h3 {
  font-size: var(--t-h3);
  font-stretch: var(--ancho-medio);
  font-weight: 700;
  line-height: 1.2;
}
p, li, dd { text-wrap: pretty; }
strong { font-weight: 700; color: var(--texto); }
.medida { max-width: 62ch; }
.bajada { max-width: 60ch; font-size: 1.1875rem; line-height: 1.5; color: var(--texto-2); }
.chico { font-size: var(--t-chico); line-height: 1.45; }
.mini { font-size: var(--t-mini); line-height: 1.4; color: var(--texto-3); }
.secundario { color: var(--texto-2); }
.cifra { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.dinero { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 4. Layout ------------------------------------------------------------------------------------------------ */
.contenedor {
  width: 100%;
  max-width: calc(var(--ancho-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.seccion { padding-block: var(--seccion); }
.pila > * + * { margin-top: var(--e-4); }
.pila-chica > * + * { margin-top: var(--e-2); }
.pila-grande > * + * { margin-top: var(--e-6); }
.fila { display: flex; flex-wrap: wrap; gap: var(--e-3); align-items: center; }
.grilla { display: grid; gap: var(--e-4); grid-template-columns: 1fr; }
@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .grilla--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grilla--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  :root { --gutter: 48px; }
  .grilla--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Cartel de ruta: panel verde con el filete blanco adentro. Es el marco de lo que hay que leer de un vistazo
   (el cierre, los packs). Pocos por página. */
.cartel {
  background: var(--cartel);
  color: var(--sobre-cartel);
  border-radius: var(--r-3);
  box-shadow: var(--filete-sombra);
  padding: var(--e-5);
}
.cartel h2, .cartel h3 { color: var(--sobre-cartel); }
.cartel .secundario, .cartel .mini { color: var(--sobre-cartel-2); }
.cartel a { color: var(--sobre-cartel); }

/* Banda (compatibilidad con /vivo y bloques oscuros): ya es el fondo del sitio. */
.banda-tinta { background: var(--noche-2); color: var(--texto); }

/* Encabezado del sitio */
.cabecera {
  display: flex; align-items: center; justify-content: space-between; gap: var(--e-4);
  min-height: 64px;
  border-bottom: 1px solid var(--linea);
}
.cabecera__logo { display: inline-flex; align-items: center; min-height: 44px; }
.cabecera__logo img { height: 22px; width: auto; }
.cabecera__nav { display: none; gap: var(--e-5); }
.cabecera__nav a {
  color: var(--texto); text-decoration: none; font-weight: 600; font-size: var(--t-chico);
  min-height: 44px; display: inline-flex; align-items: center;
}
.cabecera__nav a:hover { color: var(--texto); text-decoration: underline; text-decoration-color: var(--boleto); }
/* El enlace de la página actual queda subrayado en amarillo */
.cabecera__nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--boleto); text-decoration-thickness: 2px; text-underline-offset: 0.35em; }
/* El botón del encabezado y el logo entran juntos: el logo (8:1) usa lo que deja el botón (~165 px + gutter y
   gap), de 17 px de alto a 360 px hasta 22 px a 390 px. */
@media (max-width: 419px) {
  .cabecera__logo img { height: clamp(17px, calc((100vw - 214px) / 8), 24px); }
  .cabecera .btn--chico { padding-inline: var(--e-3); }
}
@media (min-width: 720px) {
  .cabecera { min-height: 72px; }
  .cabecera__logo img { height: 26px; }
}
@media (min-width: 1024px) { .cabecera__nav { display: flex; } }
/* Sobre la foto (tienda): sin raya, flota sobre el techo del salón */
.cabecera--sobre-foto { position: absolute; inset: 0 0 auto 0; z-index: 3; border-bottom: 0; }

/* Pie del sitio (views/comun.js: layout) */
.pie { border-top: 1px solid var(--linea); padding-block: var(--e-7) calc(var(--e-7) + env(safe-area-inset-bottom, 0px)); background: var(--noche); }
/* Con el botón flotante de ayuda, el pie deja abajo su alto (48 px) + margen + safe-area: ningún texto queda debajo. */
body:has(.ayuda-flotante) .pie { padding-bottom: calc(var(--e-7) + 48px + var(--e-4) + env(safe-area-inset-bottom, 0px)); }
.pie__grilla { display: grid; gap: var(--e-5); }
.pie__marca { display: grid; gap: var(--e-3); max-width: 26rem; }
.pie__marca img { height: 22px; width: auto; }
.pie__marca p { color: var(--texto-3); }
.pie__enlaces { display: flex; flex-wrap: wrap; gap: 0 var(--e-5); }
.pie__enlaces a { color: var(--texto); font-size: var(--t-chico); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.pie__enlaces a:hover { color: var(--texto); text-decoration: underline; text-decoration-color: var(--boleto); }
.pie__contacto { color: var(--texto-2); }
.pie__contacto a { display: inline-flex; align-items: center; min-height: 44px; }
@media (min-width: 900px) {
  .pie__grilla { grid-template-columns: 1fr 1.4fr; column-gap: var(--e-8); }
  .pie__contacto { grid-column: 2; }
}

/* 5. Botones ----------------------------------------------------------------------------------------------- */
.btn {
  --alto: 54px;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--e-2);
  min-height: var(--alto);
  padding: 0 var(--e-5);
  border: 2px solid transparent;
  border-radius: var(--r-2);
  font-weight: 750;
  font-size: 1.0625rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.1s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
/* Primario: el boleto amarillo. Uno por pantalla. */
.btn--primario { background: var(--boleto); color: var(--sobre-boleto); }
.btn--primario:hover { background: var(--boleto-hover); color: var(--sobre-boleto); }
.btn--primario[disabled]:hover { background: var(--boleto); }
.btn--secundario { background: transparent; color: var(--texto); border-color: var(--texto-2); }
.btn--secundario:hover { background: var(--noche-3); color: var(--texto); border-color: var(--texto); }
.btn--fantasma { background: transparent; color: var(--enlace); padding-inline: var(--e-2); text-decoration: underline; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
.btn--fantasma:hover { color: var(--enlace-hover); text-decoration-thickness: 2px; }
.btn--ancho { width: 100%; }
.btn--chico { --alto: 44px; padding-inline: var(--e-4); font-size: var(--t-chico); }
.btn .cargando {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: girar 0.8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
@media (min-width: 720px) { .btn--ancho-movil { width: auto; } }

/* 6. Chip (información breve; pocos por pantalla) ---------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: var(--e-2);
  min-height: 32px; padding: 0 var(--e-3);
  border: 1px solid var(--linea-2); border-radius: var(--r-pill);
  background: var(--noche-2); color: var(--texto);
  font-size: var(--t-mini); font-weight: 600; line-height: 1;
}
.chip svg { width: 16px; height: 16px; flex: none; }

/* 7. Patente: el número del participante. Es la firma visual de la marca. ---------------------------------- */
.patente {
  display: inline-grid;
  min-width: 8.5rem;
  padding: 3px;
  border-radius: var(--r-1);
  background: var(--placa);
  text-align: center;
  color: var(--tinta);
}
.patente__banda, .patente__num { border: 2px solid var(--tinta); }
.patente__banda {
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: var(--boleto);
  font-size: 0.6875rem; font-weight: 750; letter-spacing: 0.1em; line-height: 1;
  padding: 5px var(--e-2) 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.patente__num {
  border-top: 0;
  border-radius: 0 0 4px 4px;
  font-family: var(--fuente-display);
  font-stretch: var(--ancho-display);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.08em;
  padding: 7px var(--e-3) 8px calc(var(--e-3) + 0.08em);
  font-variant-numeric: tabular-nums;
}
.patente--grande { min-width: 13rem; }
.patente--grande .patente__num { font-size: 3.25rem; }
.patente--reservado { background: var(--noche-2); color: var(--texto-2); }
.patente--reservado .patente__banda, .patente--reservado .patente__num { border-color: var(--borde-control); border-style: dashed; }
.patente--reservado .patente__banda { background: var(--neutro-suave); color: var(--texto-2); }
.patente--reservado .patente__num { color: var(--texto); }
.patentes { display: flex; flex-wrap: wrap; gap: var(--e-3); }
/* Vacía: la patente antes del sorteo, con una raya por cifra (como en el vivo) */
.patente--vacia .patente__num { display: flex; justify-content: center; gap: 0.08em; }
.patente--vacia .patente__banda { background: var(--neutro-suave); color: var(--texto); }
.casilla { position: relative; display: inline-block; height: 1em; }
.casilla::before { content: "0"; visibility: hidden; }
.casilla::after { content: ""; position: absolute; left: 0.06em; right: 0.06em; bottom: 0.08em; height: 0.07em; background: currentColor; opacity: 0.35; }

/* 8. Packs: filas grandes y tocables (un radio por fila; la fila es la etiqueta) ---------------------------- */
.packs { display: grid; gap: var(--e-2); }
.pack {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "radio chances precio"
    "radio detalle unitario";
  column-gap: var(--e-3);
  row-gap: 0;
  align-items: baseline;
  min-height: 56px;
  padding: 7px var(--e-4);
  border: 2px solid var(--linea-2);
  border-radius: var(--r-2);
  background: var(--noche-2);
  color: var(--texto);
  cursor: pointer;
  isolation: isolate;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.pack:hover { border-color: var(--texto-3); }
.pack--con-sello { margin-top: 10px; padding-top: 12px; }
.pack__radio {
  grid-area: radio; align-self: center;
  appearance: none; -webkit-appearance: none;
  width: 26px; height: 26px; margin: 0;
  border: 2px solid var(--borde-control); border-radius: 50%;
  background: transparent;
  display: grid; place-content: center;
}
.pack__radio::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--sobre-boleto); transform: scale(0); transition: transform 0.14s var(--ease);
}
.pack__radio:checked::before { transform: scale(1); }
.pack__radio:focus-visible { outline: 3px solid var(--boleto); outline-offset: 3px; }
.pack__chances {
  grid-area: chances;
  font-family: var(--fuente-display); font-stretch: var(--ancho-display);
  font-weight: 800; font-size: 2rem; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pack__chances small { font-size: 1.0625rem; font-weight: 750; margin-left: 3px; }
.pack__detalle { grid-area: detalle; font-size: var(--t-mini); color: var(--texto-3); line-height: 1.2; }
.pack__precio {
  grid-area: precio; justify-self: end;
  font-family: var(--fuente-display); font-stretch: var(--ancho-display);
  font-weight: 800; font-size: 1.875rem; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap;
  color: var(--boleto);
}
.pack__unitario { grid-area: unitario; justify-self: end; font-size: var(--t-mini); line-height: 1.2; color: var(--texto-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Elegida: borde y fondo amarillo boleto. Sin :has() lo pinta una capa desde el hermano del radio. */
.pack__radio:checked ~ .pack__chances::before {
  content: "";
  position: absolute; inset: -2px; z-index: -1;
  border-radius: var(--r-2);
  background: var(--boleto);
  pointer-events: none;
}
.pack:has(.pack__radio:checked), .pack:has(.pack__radio:checked):hover { background: var(--boleto); border-color: var(--boleto); }
.pack__radio:checked { border-color: var(--sobre-boleto); background: var(--placa); }
.pack__radio:checked ~ * { color: var(--sobre-boleto); }
.pack__radio:checked ~ .pack__detalle, .pack__radio:checked ~ .pack__unitario { color: #2E3A2C; }
.pack__sellos { position: absolute; top: 0; left: var(--e-4); transform: translateY(-55%); display: flex; gap: var(--e-1); z-index: 1; }
.pack--agotado { cursor: not-allowed; opacity: 0.5; }
.pack--agotado:hover { border-color: var(--linea-2); }
/* Más opciones: se despliega debajo, mismas filas */
.packs-mas { margin-top: var(--e-2); }
.packs-mas > summary {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 var(--e-2);
  min-height: 48px; padding: var(--e-1) 34px var(--e-1) var(--e-3); position: relative; cursor: pointer; list-style: none;
  border: 1px dashed var(--borde-control); border-radius: var(--r-2);
  font-weight: 700; color: var(--texto);
}
.packs-mas > summary::-webkit-details-marker { display: none; }
.packs-mas > summary::after {
  content: ""; position: absolute; right: 16px; top: 50%; margin-top: -4px; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform 0.15s var(--ease);
}
.packs-mas[open] > summary { margin-bottom: var(--e-3); }
.packs-mas[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.packs-mas .packs { gap: var(--e-2); }
.packs-mas__mejor { color: var(--boleto); font-size: 0.875rem; }

/* Sello: etiqueta corta en mayúsculas (más elegido, mejor precio, en vivo). Pocos por pantalla. */
.sello {
  display: inline-flex; align-items: center;
  min-height: 22px; padding: 2px 8px;
  border-radius: var(--r-1);
  font-size: 0.6875rem; font-weight: 800; line-height: 1.1; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}
.sello--elegido { background: var(--placa); color: var(--tinta); }
.sello--precio { background: var(--cartel); color: var(--sobre-cartel); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.5); }
.sello--vivo { background: var(--boleto); color: var(--sobre-boleto); }

/* 9. Contador regresivo: un cartel con el cierre ----------------------------------------------------------- */
.contador {
  background: var(--cartel);
  color: var(--sobre-cartel);
  border-radius: var(--r-3);
  box-shadow: var(--filete-sombra);
  padding: var(--e-4) var(--e-5) var(--e-4);
}
.contador__titulo { font-size: var(--t-chico); font-weight: 700; margin-bottom: var(--e-1); }
.contador__grilla { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--e-2); }
.contador__u { display: grid; justify-items: start; gap: 0; }
.contador__u + .contador__u { padding-left: var(--e-3); border-left: 1px solid rgb(255 255 255 / 0.28); }
.contador__n {
  font-family: var(--fuente-display); font-stretch: var(--ancho-display);
  font-weight: 800; font-size: 2.5rem; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.contador__l { font-size: var(--t-mini); color: var(--sobre-cartel-2); }
.contador__pie { margin-top: var(--e-3); padding-top: var(--e-2); border-top: 1px solid rgb(255 255 255 / 0.28); font-size: var(--t-chico); color: var(--sobre-cartel); font-weight: 600; }
@media (min-width: 720px) { .contador__n { font-size: 3rem; } }

/* 10. Premios con foto ------------------------------------------------------------------------------------- */
.premio { display: grid; align-content: start; gap: var(--e-3); }
.premio__foto { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--hueco-foto); border-radius: var(--r-2); }
.premio__cuerpo { display: grid; gap: 2px; }
.premio__orden { font-size: var(--t-mini); font-weight: 750; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.premio__nombre { font-size: var(--t-h3); font-stretch: var(--ancho-medio); font-weight: 750; line-height: 1.15; }
.premio__detalle { font-size: var(--t-chico); color: var(--texto-2); }

/* Hueco rotulado para fotos que todavía no existen */
.foto-pendiente {
  display: grid; place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--hueco-foto);
  color: var(--texto-2);
  font-size: var(--t-mini); font-weight: 600; text-align: center;
  padding: var(--e-4);
}

/* 11. Formularios ------------------------------------------------------------------------------------------ */
.campo { display: grid; gap: 6px; align-content: start; }
.campo__label { font-weight: 650; font-size: var(--t-chico); color: var(--texto); }
.campo__ayuda { font-size: var(--t-mini); color: var(--texto-3); }
.campo__error {
  display: none;
  font-size: var(--t-mini); font-weight: 650; color: var(--error);
}
.input, .select {
  width: 100%;
  min-height: 54px;
  padding: 0 var(--e-4);
  border: 1.5px solid var(--borde-control);
  border-radius: var(--r-2);
  background: var(--noche-2);
  color: var(--texto);
  font-size: 1.0625rem; /* 17 px: evita el zoom de iOS */
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input::placeholder { color: var(--placeholder); }
.input:hover, .select:hover { border-color: var(--texto-2); }
.input:focus-visible, .select:focus-visible {
  outline: none;
  border-color: var(--boleto);
  box-shadow: 0 0 0 3px rgb(246 203 70 / 0.28);
}
.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%23F2F6F3' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.select option { background: var(--noche-2); color: var(--texto); }
.campo--error .input, .campo--error .select, .input[aria-invalid="true"] { border-color: var(--error); }
.campo--error .campo__error { display: block; }
.campo--error .input:focus-visible { box-shadow: 0 0 0 3px rgb(255 138 128 / 0.25); }
.input--cifra { font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.input[readonly] { background: var(--noche); border-color: var(--linea-2); color: var(--texto-2); }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.9); }

.check {
  display: grid; grid-template-columns: auto 1fr; gap: var(--e-3); align-items: start;
  font-size: var(--t-chico); line-height: 1.45; cursor: pointer;
  min-height: 44px; padding-top: 10px;
}
.check input {
  appearance: none; -webkit-appearance: none;
  width: 24px; height: 24px; margin: 0;
  border: 2px solid var(--borde-control); border-radius: var(--r-1);
  background: var(--noche-2);
  display: grid; place-content: center;
}
.check input::before {
  content: ""; width: 12px; height: 7px;
  border-left: 2.5px solid var(--sobre-boleto); border-bottom: 2.5px solid var(--sobre-boleto);
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform 0.12s var(--ease);
}
.check input:checked { background: var(--boleto); border-color: var(--boleto); }
.check input:checked::before { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input:focus-visible { outline: var(--foco); outline-offset: 2px; }
.check--error input { border-color: var(--error); }

.formulario { display: grid; gap: var(--e-5); }
.formulario__fila { display: grid; gap: var(--e-5); }
@media (min-width: 720px) { .formulario__fila { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e-4); } }

/* Aviso en línea (no es un toast: queda en la página) */
.aviso {
  padding: var(--e-3) var(--e-4);
  border-radius: var(--r-2);
  border: 1px solid rgb(246 203 70 / 0.45);
  background: var(--alerta-suave);
  color: var(--texto);
  font-size: var(--t-chico);
}
.aviso--error { border-color: rgb(255 138 128 / 0.5); background: var(--error-suave); }
.aviso--ok { border-color: rgb(110 211 164 / 0.45); background: var(--ok-suave); }

/* 12. Copiar dato (CVU, alias, monto) ---------------------------------------------------------------------- */
.copiar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--e-3);
  padding: var(--e-3) var(--e-3) var(--e-3) var(--e-4);
  border-radius: var(--r-2);
  background: var(--noche-2);
  border: 1px solid var(--linea-2);
}
.copiar + .copiar { margin-top: var(--e-2); }
.copiar__label { display: block; font-size: var(--t-mini); color: var(--texto-3); font-weight: 650; }
.copiar__valor {
  display: block;
  font-weight: 700; font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
/* CVU de 22 cifras: un poco más angosta para que entre en una línea a 390 px */
.copiar__valor--cvu { font-family: var(--fuente-display); font-stretch: var(--ancho-medio); letter-spacing: 0.01em; }
/* El monto: lo más importante de la pantalla de pago, en un cartel */
.copiar--monto { background: var(--cartel); border: 0; box-shadow: var(--filete-sombra); padding: var(--e-4) var(--e-4) var(--e-4) var(--e-5); }
.copiar--monto .copiar__label { color: var(--sobre-cartel-2); }
.copiar--monto .copiar__valor {
  font-family: var(--fuente-display); font-stretch: var(--ancho-display);
  font-weight: 800; font-size: 2.5rem; line-height: 1.02; letter-spacing: 0;
  color: var(--sobre-cartel);
}
.copiar--monto .copiar__btn { border-color: var(--sobre-cartel); color: var(--sobre-cartel); }
.copiar--monto .copiar__btn:hover { background: var(--cartel-2); }
.copiar__btn[data-copiado="true"], .copiar--monto .copiar__btn[data-copiado="true"] { background: var(--boleto); border-color: var(--boleto); color: var(--sobre-boleto); }

/* 13. Estados de pedido ------------------------------------------------------------------------------------ */
.estado {
  display: inline-flex; align-items: center;
  min-height: 28px; padding: 0 10px;
  border-radius: var(--r-1);
  font-size: var(--t-mini); font-weight: 750; line-height: 1; white-space: nowrap;
  border: 1px solid currentColor;
}
.estado--pagado { background: var(--ok-suave); color: var(--ok); }
.estado--pendiente { background: var(--alerta-suave); color: var(--alerta); }
.estado--vencido { background: var(--neutro-suave); color: var(--texto-2); }
.estado--anulado { background: var(--error-suave); color: var(--error); }

/* 14. Tabla simple ----------------------------------------------------------------------------------------- */
.tabla-marco { overflow-x: auto; border: 1px solid var(--linea-2); border-radius: var(--r-2); background: var(--noche-2); }
.tabla { width: 100%; border-collapse: collapse; font-size: var(--t-chico); }
.tabla th, .tabla td { padding: 10px var(--e-4); text-align: left; vertical-align: middle; height: 44px; white-space: nowrap; }
.tabla th { font-size: var(--t-mini); font-weight: 650; color: var(--texto-3); background: var(--noche); border-bottom: 1px solid var(--linea-2); }
.tabla tbody tr + tr td { border-top: 1px solid var(--linea); }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla .id { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }

/* 15. Toast ------------------------------------------------------------------------------------------------ */
.toasts {
  position: fixed; z-index: 50;
  left: var(--e-4); right: var(--e-4);
  bottom: calc(var(--e-4) + env(safe-area-inset-bottom, 0px));
  display: grid; justify-items: center; gap: var(--e-2);
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: var(--e-3);
  max-width: 28rem; width: 100%;
  padding: var(--e-3) var(--e-4);
  border-radius: var(--r-2);
  background: var(--placa); color: var(--tinta);
  box-shadow: var(--sombra-2);
  font-size: var(--t-chico); font-weight: 650;
  pointer-events: auto;
  animation: toast-entra 0.24s var(--ease);
}
.toast svg { width: 20px; height: 20px; flex: none; color: var(--cartel); }
.toast--error { background: #4A1512; color: #FFFFFF; border: 1px solid var(--error); }
.toast--error svg { color: var(--error); }
.toast--estatico { position: static; animation: none; }
@keyframes toast-entra { from { opacity: 0; transform: translateY(8px); } }
@media (min-width: 720px) { .toasts { left: auto; right: var(--e-6); bottom: var(--e-6); justify-items: end; } }

/* 16. Movimiento reducido ---------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* 17. Piezas compartidas de la v2 -------------------------------------------------------------------------- */
.btn--grande { --alto: 60px; font-size: 1.1875rem; font-weight: 800; }

/* Ayuda flotante (WhatsApp): abajo a la derecha; sube cuando aparece la barra fija de la tienda */
.ayuda-flotante {
  position: fixed; z-index: 40;
  right: var(--e-4); bottom: calc(var(--e-4) + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: var(--e-2);
  min-height: 48px; padding: 0 var(--e-4) 0 var(--e-3);
  border-radius: var(--r-pill);
  background: var(--placa); color: var(--tinta);
  box-shadow: var(--sombra-2);
  font-weight: 750; font-size: var(--t-chico); text-decoration: none;
  transition: bottom 0.22s var(--ease);
}
.ayuda-flotante:hover { color: var(--tinta); background: #E6F2EC; }
@media (max-width: 1023px) { .boton-a-la-vista .ayuda-flotante { opacity: 0; visibility: hidden; } }
.ayuda-flotante { transition: bottom 0.22s var(--ease), opacity 0.2s var(--ease), visibility 0.2s; }
.cabecera__ayuda { color: var(--texto); font-weight: 650; font-size: var(--t-chico); min-height: 44px; display: inline-flex; align-items: center; margin-left: auto; }
@media (min-width: 1024px) { .cabecera__ayuda:not(.cabecera__ayuda--siempre) { display: none; } }
.cabecera__pedido + .cabecera__ayuda { margin-left: var(--e-4); }
/* En el celular, solo el ícono: no tapa los precios */
@media (max-width: 719px) {
  .ayuda-flotante { width: 48px; padding: 0; justify-content: center; }
  .ayuda-flotante > span:not(.sr) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.con-barra .ayuda-flotante, body:has(.barra-compra:not([hidden])) .ayuda-flotante { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1024px) { .con-barra .ayuda-flotante, body:has(.barra-compra:not([hidden])) .ayuda-flotante { bottom: calc(var(--e-5) + env(safe-area-inset-bottom, 0px)); } .ayuda-flotante { right: var(--e-5); bottom: var(--e-5); } }

.pie__legal { grid-column: 1 / -1; color: var(--texto-3); }

/* Preguntas frecuentes (tienda y /ayuda) */
.faq { border-top: 1px solid var(--linea); max-width: 46rem; }
.faq__item { border-bottom: 1px solid var(--linea); }
.faq__pregunta {
  display: flex; justify-content: space-between; align-items: center; gap: var(--e-4);
  min-height: 56px; padding-block: var(--e-3);
  font-weight: 700; cursor: pointer; list-style: none;
}
.faq__pregunta::-webkit-details-marker { display: none; }
.faq__pregunta::after {
  content: ""; flex: none; width: 10px; height: 10px;
  border-right: 2px solid var(--texto); border-bottom: 2px solid var(--texto);
  transform: translateY(-3px) rotate(45deg); transition: transform 0.15s var(--ease);
}
.faq__item[open] .faq__pregunta::after { transform: translateY(2px) rotate(225deg); }
.faq__respuesta { padding-bottom: var(--e-4); color: var(--texto-2); }
.faq__respuesta > * + * { margin-top: var(--e-2); }
.faq__respuesta p { max-width: 62ch; }

/* 18. Portada de curso: un libro de verdad (3:4), tipográfica si no hay portada subida ----------------------- */
.libro {
  overflow: hidden;
  container-type: inline-size;
  width: 100%; aspect-ratio: 3 / 4;
  border-radius: 3px 8px 8px 3px;
  background: var(--libro-fondo, var(--cartel)); color: var(--libro-tinta, var(--placa));
  box-shadow: 0 1px 2px rgb(7 17 13 / 0.4), 0 14px 28px -14px rgb(7 17 13 / 0.9);
}
/* La tapa se mide contra el libro (cqw): el título y el lomo escalan con el tamaño de la portada */
.libro__tapa {
  position: relative; isolation: isolate; height: 100%;
  display: grid; grid-template-rows: auto 1fr auto; gap: 6cqw;
  padding: 10cqw 9cqw 8cqw 14cqw;
}
/* El lomo: una franja más oscura a la izquierda con su pliegue */
.libro__tapa::before {
  content: ""; position: absolute; inset: 0 auto 0 0; z-index: -1; width: 7cqw;
  background: linear-gradient(to right, rgb(7 17 13 / 0.3), rgb(7 17 13 / 0.08) 70%, rgb(255 255 255 / 0.2) 72%, rgb(7 17 13 / 0) 80%);
}
.libro__cat { display: flex; align-items: center; gap: 3cqw; padding-bottom: 5cqw; border-bottom: max(1.5cqw, 2px) solid var(--libro-acento, var(--boleto)); font-size: max(7cqw, 11px); font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.1; }
.libro__icono { width: max(11cqw, 14px); height: max(11cqw, 14px); flex: none; }
.libro__titulo {
  align-self: center; padding-top: 4cqw;
  font-family: var(--fuente-display); font-stretch: var(--ancho-display); font-weight: 800;
  font-size: max(12.5cqw, 9px); line-height: 0.98; letter-spacing: -0.01em;
  text-wrap: balance; hyphens: manual; overflow-wrap: break-word;
}
.libro__pie { font-size: max(6.2cqw, 11px); font-weight: 650; line-height: 1.25; }
.libro--foto { display: block; padding: 0; object-fit: cover; background: var(--hueco-foto); }
/* Color por categoría, dentro de la paleta (texto sobre cada fondo con contraste de 7:1 o más) */
.libro--auto { --libro-fondo: var(--cartel); --libro-tinta: var(--placa); --libro-acento: var(--boleto); }
.libro--oficios { --libro-fondo: var(--boleto); --libro-tinta: var(--tinta); --libro-acento: var(--tinta); }
.libro--cocina { --libro-fondo: var(--placa); --libro-tinta: var(--tinta); --libro-acento: var(--cartel); }
.libro--belleza { --libro-fondo: var(--enlace); --libro-tinta: var(--tinta); --libro-acento: var(--placa); }
.libro--emprendimiento { --libro-fondo: var(--noche-3); --libro-tinta: var(--texto); --libro-acento: var(--boleto); }
.libro--docentes { --libro-fondo: var(--cartel); --libro-tinta: var(--placa); --libro-acento: var(--placa); }
.libro--otros { --libro-fondo: var(--linea-2); --libro-tinta: var(--texto); --libro-acento: var(--enlace); }
.libro--emprendimiento, .libro--otros { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14), 0 14px 28px -14px rgb(7 17 13 / 0.9); }

/* Pila de libros (resumen del checkout) */
.pila-libros { display: flex; flex: none; padding-left: 14px; }
.pila-libros .libro { width: 46px; margin-left: -14px; border-radius: 2px 4px 4px 2px; }
.pila-libros .libro__tapa { padding: 6px 4px 4px 7px; gap: 2px; grid-template-rows: 1fr; }
.pila-libros .libro__cat, .pila-libros .libro__pie { display: none; }
.pila-libros .libro__titulo { font-size: 8px; padding-top: 4px; align-self: start; }
.pila-libros .libro__titulo { display: none; }
.pila-libros .libro__tapa::after { content: ""; position: absolute; top: 8px; height: 2px; left: 7px; right: 4px; background: var(--libro-acento, var(--boleto)); }
.pila-libros > :nth-child(1) { transform: rotate(-6deg); }
.pila-libros > :nth-child(2) { transform: rotate(-2deg); }
.pila-libros > :nth-child(3) { transform: rotate(2deg); }
.pila-libros > :nth-child(4) { transform: rotate(6deg); }

.sello--cursos { background: var(--placa); color: var(--tinta); }

/* 19. Así vamos a entregar (tienda y /ganadores, mientras no hay ganadores publicados) ------------------------ */
.entregar { display: grid; gap: var(--e-5); padding-top: var(--e-6); border-top: 1px solid var(--linea-2); }
.entregar__cabeza { display: grid; gap: var(--e-3); }
.entregar__pasos { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--e-5); counter-reset: entrega; }
.entregar__pasos li { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); column-gap: var(--e-4); row-gap: var(--e-1); }
.entregar__pasos li::before {
  counter-increment: entrega; content: counter(entrega);
  grid-row: span 2; align-self: start;
  font-family: var(--fuente-display); font-stretch: var(--ancho-display); font-weight: 800;
  font-size: 2.5rem; line-height: 0.9; color: var(--boleto); font-variant-numeric: tabular-nums;
}
.entregar__pasos h3 { font-size: var(--t-h3); line-height: 1.2; }
.entregar__pasos p { color: var(--texto-2); font-size: var(--t-chico); max-width: 46ch; }
.entregar__acciones { gap: var(--e-2) var(--e-5); }
.entregar__enlace { color: var(--texto); font-weight: 650; min-height: 44px; display: inline-flex; align-items: center; text-decoration-color: var(--boleto); }
.entregar__enlace:hover { color: var(--texto); }
@media (min-width: 900px) {
  .entregar__pasos { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--e-6); }
}

/* 20. Mirá un curso por dentro (tienda y /cursos-incluidos): páginas reales, deslizables, con zoom ------------ */
.por-dentro { display: grid; gap: var(--e-5); margin-block: var(--e-6); padding: var(--e-5) 0 0; border-top: 1px solid var(--linea); }
.por-dentro__texto { display: grid; gap: var(--e-2); align-content: start; }
.por-dentro__titulo { font-family: var(--fuente-display); font-stretch: var(--ancho-display); font-weight: 800; font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem); line-height: 1; }
.por-dentro__curso { font-weight: 750; font-size: var(--t-h3); line-height: 1.2; }
.por-dentro__linea { color: var(--boleto); font-weight: 700; }
.por-dentro__paginas {
  list-style: none; margin: 0; padding: var(--e-1) 0 var(--e-4);
  display: grid; grid-auto-flow: column; grid-auto-columns: min(64vw, 17rem); gap: var(--e-4);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.por-dentro__paginas li { scroll-snap-align: start; }
.por-dentro__pagina { display: block; border-radius: var(--r-1); outline-offset: 4px; }
.por-dentro__pagina img {
  display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover;
  border-radius: var(--r-1); background: var(--hueco-foto);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.35), 0 22px 40px -18px rgb(0 0 0 / 0.8);
  transition: transform 0.25s var(--ease);
}
.por-dentro__pagina:hover img { transform: translateY(-3px); }
@media (min-width: 900px) {
  .por-dentro { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); column-gap: var(--e-8); align-items: center; }
  .por-dentro__paginas { grid-auto-columns: 15rem; overflow: visible; }
}
/* El zoom: la página sola, grande, sobre el salón oscurecido */
.zoom {
  width: min(100vw - 2 * var(--e-3), 40rem); max-width: none; max-height: calc(100dvh - 2 * var(--e-3));
  padding: var(--e-3); border: 1px solid var(--linea-2); border-radius: var(--r-3);
  background: var(--noche-2); color: var(--texto);
}
.zoom::backdrop { background: rgb(7 17 13 / 0.88); }
.zoom[open] { display: grid; gap: var(--e-3); justify-items: center; }
.zoom__cerrar { justify-self: end; min-height: 44px; }
.zoom__img { width: auto; max-width: 100%; height: auto; max-height: calc(100dvh - 2 * var(--e-3) - 5.5rem); border-radius: var(--r-1); }
@media (prefers-reduced-motion: reduce) { .por-dentro__pagina img { transition: none; } .por-dentro__pagina:hover img { transform: none; } }
