/* Identidad: índigo #2B2E8F y limón #C4D92C, tipografía pesada redondeada.
   Mobile primero: la mayoría va a comprar desde el celular. */
:root {
  --papel: #F5F6FB;
  --tarjeta: #FFFFFF;
  --tinta: #15162B;
  --gris: #5E6179;
  --linea: #D9DBEA;
  --indigo: #2B2E8F;
  --indigo-claro: #4A4DC4;
  --enlace: #2B2E8F;
  --limon: #C4D92C;
  --ok: #1C7A54;
  --alerta: #A85A14;
  --error: #A81F18;
  --sombra: 0 1px 2px rgba(21, 22, 43, .06), 0 8px 24px rgba(21, 22, 43, .06);
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --cuerpo: "Nunito Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --radio: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--papel); color: var(--tinta);
  font-family: var(--cuerpo); font-size: 16px; line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
.wrap { width: 100%; max-width: 920px; margin-inline: auto; padding-inline: 16px; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.12; letter-spacing: -.01em; }
h1 { font-weight: 800; font-size: clamp(1.7rem, 5.5vw, 2.6rem); }
h2 { font-weight: 700; font-size: clamp(1.25rem, 3.6vw, 1.7rem); }
h3 { font-weight: 700; font-size: 1.1rem; }
p { margin: 0; }
a { color: var(--enlace); }
img { max-width: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; }

/* Barra */
.barra { background: var(--indigo); color: #fff; }
.barra .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; }
.logo { font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: #fff; text-decoration: none; }
.logo span { color: var(--limon); margin-left: .22em; }
.barra .vinculo { color: #D6D7F2; text-decoration: none; font-size: .9rem; }

/* Bloques */
main { padding-block: 24px 64px; display: block; }
.pila { display: flex; flex-direction: column; gap: 18px; }
.tarjeta { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); }
.tarjeta.p { padding: 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; font-weight: 700; color: var(--indigo-claro); }
.gris { color: var(--gris); }
.chico { font-size: .9rem; }

/* Cartelera */
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.evento-card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); transition: transform .15s ease, box-shadow .15s ease; }
.evento-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(21,22,43,.12); }
.evento-card .foto { aspect-ratio: 16/9; background: linear-gradient(135deg, var(--indigo), var(--indigo-claro)); display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 800; font-size: 1.1rem; text-align: center; padding: 12px; }
.evento-card .foto img { width: 100%; height: 100%; object-fit: cover; }
.evento-card .cuerpo { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.fecha-pill { align-self: flex-start; background: color-mix(in srgb, var(--limon) 35%, #fff); color: #3C4206; border-radius: 999px; padding: 3px 10px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* Portada de evento */
.hero { border-radius: var(--radio); overflow: hidden; border: 1px solid var(--linea); background: var(--tarjeta); box-shadow: var(--sombra); }
.hero .foto { aspect-ratio: 16/7; background: linear-gradient(135deg, var(--indigo), var(--indigo-claro)); }
.hero .foto img { width: 100%; height: 100%; object-fit: cover; }
.hero .cuerpo { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.datos { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--gris); font-size: .95rem; }

/* Zonas */
.zona { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--linea); }
.zona:last-child { border-bottom: 0; }
.zona .izq { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.zona .precio { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.agotada { color: var(--error); font-weight: 700; font-size: .85rem; }
.pocos { color: var(--alerta); font-weight: 700; font-size: .85rem; }
.contador { display: flex; align-items: center; gap: 4px; }
.contador button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--linea); background: var(--papel); font-size: 1.3rem; font-weight: 700; color: var(--enlace); cursor: pointer; line-height: 1; }
.contador button:disabled { opacity: .4; cursor: not-allowed; }
.contador .n { min-width: 34px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Totales y botones */
.resumen { display: flex; flex-direction: column; gap: 8px; }
.renglon { display: flex; justify-content: space-between; gap: 12px; }
.renglon.total { border-top: 1px solid var(--linea); padding-top: 10px; font-family: var(--display); font-weight: 700; font-size: 1.25rem; }
button.boton, a.boton, .boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 1.05rem; padding: 14px 22px; border-radius: 12px; border: 0; cursor: pointer; text-decoration: none; background: var(--indigo); color: #fff; width: 100%; }
.boton.limon { background: var(--limon); color: #22240A; }
.boton.hueco { background: transparent; color: var(--enlace); border: 1px solid var(--linea); }
.boton:disabled { opacity: .5; cursor: not-allowed; }
.boton.auto { width: auto; }

/* Formas */
label { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; font-weight: 600; color: var(--gris); }
input, select, textarea { font-family: var(--cuerpo); font-size: 1rem; padding: 12px 14px; border: 1px solid var(--linea); border-radius: 10px; background: var(--tarjeta); color: var(--tinta); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--indigo-claro); outline-offset: 1px; }
input[type=color] { height: 48px; padding: 4px; cursor: pointer; }
input[type=file] { padding: 10px; }
.campos { display: grid; gap: 14px; }
@media (min-width: 620px) { .campos.dos { grid-template-columns: 1fr 1fr; } }

/* Avisos */
.aviso { border-radius: 12px; padding: 12px 14px; font-size: .95rem; border: 1px solid; }
.aviso.error { background: color-mix(in srgb, var(--error) 8%, #fff); border-color: color-mix(in srgb, var(--error) 30%, #fff); color: var(--error); }
.aviso.ok { background: color-mix(in srgb, var(--ok) 8%, #fff); border-color: color-mix(in srgb, var(--ok) 30%, #fff); color: var(--ok); }
.aviso.simulado { background: #FFF8E1; border-color: #E9C46A; color: #6B4E00; }

/* Boletos */
.boleto { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); padding: 18px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.boleto img { width: 220px; height: 220px; }
.boleto .codigo { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: .08em; color: var(--enlace); }
.boleto.usado { opacity: .55; }
.sello-usado { background: var(--error); color: #fff; border-radius: 999px; padding: 3px 12px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

.cargando { text-align: center; color: var(--gris); padding: 40px 0; }
.reloj { font-variant-numeric: tabular-nums; font-weight: 700; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papel: #101120; --tarjeta: #1A1C2E; --tinta: #EAEBF4; --gris: #9A9DB5;
    --linea: #2E3147; --indigo: #22246F; --indigo-claro: #9497F5; --enlace: #9497F5; --limon: #CFE33C;
    --ok: #55C894; --alerta: #E79A4E; --error: #F0756C;
    color-scheme: dark;
  }
}
