/* ==========================================================================
   PATINA KINESIS — Eventos (portada /eventos/ y páginas de cada evento)
   Navidad: noche de invierno con nieve, luces y bolas con forma de rueda,
   sobre la paleta de marca (turquesa y magenta) con detalles dorados.
   ========================================================================== */

.event-page, .events-hub {
  --night: #0e1a36;
  --night-2: #1a2b55;
  --gold: #f2c14e;
  --gold-soft: #fff3d1;
  --fir: #0e5c4b;
  --on-night-muted: rgba(255, 255, 255, 0.76);
}

/* Los paneles usan display:grid/flex: que el atributo hidden siga ocultándolos. */
.event-page [hidden], .events-hub [hidden] { display: none !important; }

/* ---------- Estados (los pone eventos.js según la API) ---------- */
.event-page[data-state="open"] .xm-when-closed,
.event-page[data-state="closed"] .xm-when-open { display: none !important; }

/* ---------- Nieve, luces y bolas-rueda ---------- */
.xm-snow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

.xm-garland { position: absolute; left: 0; right: 0; top: clamp(78px, 9vw, 96px); height: 70px; z-index: 0; pointer-events: none; }
.xm-garland svg { width: 100%; height: 100%; }
.xm-bulb { animation: xm-twinkle 2.4s ease-in-out infinite; }
@keyframes xm-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.xm-baubles { position: absolute; top: clamp(110px, 12vw, 128px); right: 3%; display: flex; gap: clamp(10px, 2vw, 28px); z-index: 0; pointer-events: none; }
.xm-bauble { display: flex; flex-direction: column; align-items: center; transform-origin: top center; animation: xm-swing 5s ease-in-out infinite; }
.xm-bauble:nth-child(2) { animation-delay: -1.6s; }
.xm-bauble:nth-child(3) { animation-delay: -3.1s; }
.xm-bauble > span { display: block; width: 1.5px; background: rgba(255, 255, 255, 0.45); }
.xm-bauble svg { width: clamp(42px, 6vw, 78px); height: auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35)); }
@keyframes xm-swing { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

/* ---------- Portada del evento ---------- */
.xm-hero {
  position: relative; overflow: hidden; isolation: isolate;
  margin: clamp(8px, 1.2vw, 16px);
  border-radius: var(--radius-xl);
  color: var(--white);
  background:
    radial-gradient(60% 50% at 85% 15%, rgba(1, 206, 208, 0.22), transparent 70%),
    radial-gradient(50% 45% at 10% 90%, rgba(251, 11, 182, 0.24), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
}
.xm-hero__inner { position: relative; z-index: 1; display: grid; gap: 24px; justify-items: start; padding-block: clamp(190px, 20vw, 240px) clamp(96px, 12vw, 150px); }
.xm-hero .breadcrumb { color: var(--on-night-muted); }
.xm-hero h1 { font-size: var(--fs-hero); max-width: 11ch; }
.xm-lead { font-size: var(--fs-lead); color: var(--on-night-muted); max-width: 52ch; }

.xm-countdown {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--gold); color: var(--night); font-weight: 800; font-size: 0.9rem;
  border-radius: var(--radius-pill); padding: 6px 14px 6px 8px;
}
.xm-countdown b { background: var(--night); color: var(--gold); border-radius: var(--radius-pill); padding: 2px 10px; font-variant-numeric: tabular-nums; }

.xm-ticket {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%; max-width: 820px;
  border: 1.5px dashed rgba(255, 255, 255, 0.3); border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.xm-ticket li { display: flex; gap: 14px; align-items: center; padding: 16px 20px; min-width: 0; }
.xm-ticket li + li { border-left: 1.5px dashed rgba(255, 255, 255, 0.22); }
.xm-ticket svg { width: 28px; height: 28px; flex: none; color: var(--gold); }
.xm-ticket small { display: block; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-night-muted); font-weight: 600; }
.xm-ticket b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.15; }

.xm-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.xm-snowline { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 2; height: clamp(36px, 6vw, 80px); }
.xm-snowline svg { width: 100%; height: 100%; }

/* ---------- Secciones ---------- */
.xm-h2 { font-size: var(--fs-h2); margin-top: 14px; max-width: 18ch; }
.xm-sub { color: var(--muted); font-size: var(--fs-lead); max-width: 56ch; margin-top: 14px; }

/* Quién viene */
.xm-who__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.xm-groups { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.xm-groups li { display: flex; gap: 16px; align-items: flex-start; background: var(--white); border-radius: var(--radius-md); padding: 18px 20px; box-shadow: 0 1px 0 var(--line); }
.xm-groups h3 { font-size: 1.2rem; letter-spacing: -0.02em; }
.xm-groups p { color: var(--muted); font-size: 0.95rem; margin-top: 2px; }
.xm-groups__icon { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.xm-groups__icon svg { width: 22px; height: 22px; }
.xm-groups__icon--magenta { background: var(--magenta-soft); color: var(--magenta-strong); }
.xm-groups__icon--turq { background: var(--turq-soft); color: #04494a; }
.xm-groups__icon--gold { background: var(--gold-soft); color: #7a5a00; }
.xm-note { margin-top: 18px; display: flex; gap: 12px; align-items: center; background: var(--turq-soft); border-radius: var(--radius-md); padding: 14px 18px; font-weight: 600; color: #04494a; }
.xm-note svg { width: 24px; height: 24px; flex: none; }

.xm-photos { position: relative; min-height: 480px; }
.xm-polaroid { position: absolute; width: 66%; margin: 0; background: var(--white); padding: 10px 10px 42px; border-radius: 6px; box-shadow: 0 24px 50px -20px rgba(14, 26, 54, 0.45); }
.xm-polaroid img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; border-radius: 3px; }
.xm-polaroid figcaption { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-family: var(--font-display); font-weight: 600; color: var(--muted); }
.xm-polaroid--a { left: 0; top: 0; transform: rotate(-4deg); }
.xm-polaroid--b { right: 0; top: 80px; transform: rotate(5deg); }
.xm-tape { position: absolute; top: -12px; left: 50%; width: 90px; height: 24px; transform: translateX(-50%) rotate(-3deg); background: repeating-linear-gradient(45deg, var(--magenta) 0 10px, #fff 10px 20px); opacity: 0.85; border-radius: 3px; z-index: 1; }
.xm-polaroid--b .xm-tape { background: repeating-linear-gradient(45deg, var(--fir) 0 10px, #fff 10px 20px); }

/* Programa */
.xm-program { background: var(--white); }
.xm-timeline { list-style: none; padding: 0; margin: 36px 0 0; display: grid; position: relative; max-width: 820px; }
.xm-timeline::before { content: ""; position: absolute; left: 64px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: repeating-linear-gradient(180deg, var(--magenta) 0 14px, var(--turq) 14px 28px, var(--gold) 28px 42px); opacity: 0.6; }
.xm-timeline li { display: grid; grid-template-columns: 52px 1fr; gap: 28px; padding-block: 14px; position: relative; }
.xm-timeline li::before { content: ""; position: absolute; left: 58px; top: 22px; width: 15px; height: 15px; border-radius: 50%; background: var(--white); border: 3px solid var(--magenta-strong); }
.xm-timeline time { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; text-align: right; padding-top: 2px; font-variant-numeric: tabular-nums; }
.xm-timeline h3 { font-size: 1.3rem; letter-spacing: -0.02em; }
.xm-timeline p { color: var(--muted); margin-top: 4px; }
.xm-games { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.xm-games span { font-size: 0.86rem; font-weight: 600; color: var(--ink); padding: 6px 12px; border-radius: var(--radius-pill); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }

/* Precio */
.xm-prices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.xm-price { position: relative; overflow: hidden; display: grid; gap: 8px; padding: 28px; border-radius: var(--radius-lg); }
.xm-price b { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 2rem + 3vw, 4rem); line-height: 1; letter-spacing: -0.04em; }
.xm-price h3 { font-size: 1.3rem; }
.xm-price--free { background: var(--night); color: var(--white); }
.xm-price--free b { color: var(--gold); }
.xm-price--free p { color: var(--on-night-muted); }
.xm-price--guest { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line); }
.xm-price--guest b { color: var(--magenta-strong); }
.xm-price--guest p { color: var(--muted); }
.xm-price::before, .xm-price::after { content: ""; position: absolute; top: 50%; width: 36px; height: 36px; border-radius: 50%; background: var(--paper); transform: translateY(-50%); }
.xm-price::before { left: -18px; }
.xm-price::after { right: -18px; }

/* Inscripción */
.xm-signup {
  position: relative; overflow: hidden;
  margin: clamp(8px, 1.2vw, 16px); border-radius: var(--radius-xl);
  background: linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%); color: var(--white);
}
.xm-signup .xm-sub { color: var(--on-night-muted); }
.xm-signup .eyebrow { color: var(--gold); }
.xm-signup__grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(28px, 4vw, 56px); align-items: start; }
.xm-why { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 16px; }
.xm-why li { display: flex; gap: 14px; align-items: flex-start; }
.xm-why svg { width: 24px; height: 24px; flex: none; color: var(--gold); margin-top: 2px; }
.xm-why p { color: var(--on-night-muted); }
.xm-why b { display: block; color: var(--white); }
.xm-counter { margin-top: 28px; display: inline-flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, 0.08); border-radius: var(--radius-pill); padding: 8px 18px 8px 8px; font-weight: 600; }
.xm-counter b { font-family: var(--font-display); font-size: 1.4rem; background: var(--turq); color: var(--night); border-radius: var(--radius-pill); padding: 0 12px; font-variant-numeric: tabular-nums; }

.xm-form-card { background: var(--white); color: var(--ink); border-radius: var(--radius-xl); padding: clamp(20px, 3.5vw, 40px); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.55); min-width: 0; }
.xm-step { border: 0; padding: 0; margin: 0; min-width: 0; }
.xm-step + .xm-step { margin-top: 26px; padding-top: 26px; border-top: 1.5px dashed var(--line); }
.xm-step legend { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; padding: 0; display: flex; align-items: center; gap: 10px; }
.xm-step__n { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--night); display: inline-grid; place-items: center; font-size: 0.9rem; }
.xm-step .form { margin-top: 18px; }
.xm-step .consent { margin-top: 14px; }
.xm-step .consent span span { color: var(--magenta-strong); }

.xm-kids { display: grid; gap: 14px; margin-top: 18px; }
.xm-kid { position: relative; border: 0; margin: 0; min-width: 0; display: grid; grid-template-columns: 1fr 1fr 110px; gap: 14px; padding: 18px; border-radius: var(--radius-md); background: var(--paper); }
.xm-kid .field input, .xm-kid .field select { background: var(--white); }
.xm-kid__head { grid-column: 1 / -1; float: left; width: 100%; padding: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.xm-kid__title { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; }
.xm-kid__title svg { width: 26px; height: 26px; }
.xm-kid__price { font-size: 0.78rem; font-weight: 800; border-radius: var(--radius-pill); padding: 3px 10px; background: var(--turq-soft); color: #04494a; }
.xm-kid__price.is-paid { background: var(--magenta-soft); color: var(--magenta-strong); }
.xm-kid__remove { grid-column: 1 / -1; justify-self: start; font-size: 0.85rem; color: var(--muted); text-decoration: underline; padding: 4px 0; }
.xm-label { font-size: 0.88rem; font-weight: 600; }
.xm-label span { color: var(--magenta-strong); }
.xm-origin { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.xm-origin label { display: flex; gap: 10px; align-items: center; cursor: pointer; background: var(--white); border-radius: 12px; padding: 12px; font-size: 0.88rem; font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow 0.2s, background-color 0.2s; }
.xm-origin input { width: 18px; height: 18px; flex: none; accent-color: var(--magenta-strong); }
.xm-origin label:has(input:checked) { box-shadow: inset 0 0 0 2px var(--magenta-strong); background: var(--magenta-soft); }
.xm-origin small { font-weight: 500; color: var(--muted); }
.xm-add { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 18px; border-radius: var(--radius-pill); border: 1.5px dashed var(--magenta-strong); color: var(--magenta-strong); font-weight: 700; }
.xm-add svg { width: 18px; height: 18px; }

.xm-summary { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; background: var(--gold-soft); border-radius: var(--radius-md); padding: 14px 18px; font-weight: 600; }
.xm-summary b { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.xm-summary small { flex-basis: 100%; color: var(--muted); font-weight: 500; }
.xm-submit { margin-top: 18px; min-height: 58px; }
.xm-submit:disabled { opacity: 0.6; cursor: wait; }
.xm-form .form__hint--error { margin-top: 14px; }

.xm-success { display: grid; gap: 16px; justify-items: center; text-align: center; padding-block: 12px; }
.xm-success__wheel { width: 100px; height: auto; }
.xm-success h3 { font-size: clamp(1.7rem, 1.3rem + 2vw, 2.4rem); }
.xm-success p { color: var(--muted); max-width: 46ch; }
.xm-success__cash { background: var(--gold-soft); color: var(--ink) !important; border-radius: var(--radius-md); padding: 12px 16px; font-weight: 600; }
.xm-success__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.xm-link { color: var(--muted); text-decoration: underline; font-size: 0.9rem; }

.xm-closed { display: grid; gap: 14px; justify-items: start; }
.xm-signup .xm-closed .eyebrow { color: var(--magenta-strong); }
.xm-closed h3 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.1rem); }
.xm-closed p { color: var(--muted); }

/* Qué traer */
.xm-bring__grid { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.xm-bring__grid li { background: var(--white); border-radius: var(--radius-md); padding: 22px; display: grid; gap: 10px; align-content: start; box-shadow: 0 1px 0 var(--line); }
.xm-bring__grid svg { width: 34px; height: 34px; color: var(--fir); }
.xm-bring__grid h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
.xm-bring__grid p { color: var(--muted); font-size: 0.94rem; }

/* FAQ */
.xm-faq-section { padding-top: 0; }
.xm-faq { display: grid; gap: 10px; margin-top: 28px; }
.xm-faq details { background: var(--white); border-radius: var(--radius-md); padding: 4px 22px; box-shadow: 0 1px 0 var(--line); }
.xm-faq summary { cursor: pointer; list-style: none; padding-block: 18px; font-weight: 700; display: flex; justify-content: space-between; gap: 16px; }
.xm-faq summary::-webkit-details-marker { display: none; }
.xm-faq summary::after { content: "+"; font-family: var(--font-display); font-size: 1.4rem; line-height: 1; color: var(--magenta-strong); }
.xm-faq details[open] summary::after { content: "–"; }
.xm-faq details p { padding-bottom: 18px; color: var(--muted); }

/* ---------- Portada /eventos/ ---------- */
.events-hub__loading { color: var(--muted); text-align: center; padding-block: 40px; }
.hub-event {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--radius-xl); color: var(--white);
  padding: clamp(28px, 5vw, 64px);
  background:
    radial-gradient(60% 60% at 90% 10%, rgba(1, 206, 208, 0.25), transparent 70%),
    radial-gradient(50% 50% at 0% 100%, rgba(251, 11, 182, 0.28), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
}
.hub-event__body { display: grid; gap: 20px; justify-items: start; }
.hub-event h2 { font-size: var(--fs-h2); max-width: 16ch; }
.hub-event__facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--on-night-muted); font-weight: 600; }
.hub-event__facts li { display: flex; align-items: center; gap: 8px; }
.hub-event__facts svg { width: 20px; height: 20px; color: var(--gold); }
.hub-event__facts li:has(span:empty) { display: none; }
.hub-empty { text-align: center; display: grid; justify-items: center; gap: 16px; padding: clamp(32px, 6vw, 72px) var(--gutter); background: var(--white); border-radius: var(--radius-xl); box-shadow: var(--shadow-soft); }
.hub-empty__icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--magenta-soft); color: var(--magenta-strong); }
.hub-empty__icon svg { width: 34px; height: 34px; }
.hub-empty h2 { font-size: clamp(1.9rem, 1.4rem + 2vw, 3rem); max-width: 18ch; }
.hub-empty p { color: var(--muted); font-size: var(--fs-lead); max-width: 48ch; }
.hub-empty__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .xm-who__grid, .xm-signup__grid { grid-template-columns: 1fr; }
  .xm-photos { min-height: 0; aspect-ratio: 1.3 / 1; max-width: 620px; width: 100%; }
  .xm-bring__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .xm-ticket { grid-template-columns: 1fr; }
  .xm-ticket li + li { border-left: 0; border-top: 1.5px dashed rgba(255, 255, 255, 0.22); }
  .xm-baubles { right: 2%; top: 96px; transform: scale(0.7); transform-origin: top right; }
  .xm-hero__inner { padding-top: clamp(170px, 46vw, 200px); }
  .xm-prices { grid-template-columns: 1fr; }
  .xm-kid { grid-template-columns: 1fr 1fr; padding: 14px; }
  .xm-kid__age { grid-column: 1 / -1; }
  .xm-origin { grid-template-columns: 1fr; }
  .xm-step .form { grid-template-columns: 1fr; }
  .xm-photos { aspect-ratio: 1.15 / 1; }
}

@media (max-width: 480px) {
  .xm-bring__grid { grid-template-columns: 1fr; }
  .xm-kid { grid-template-columns: 1fr; }
  .xm-timeline::before { left: 50px; }
  .xm-timeline li { grid-template-columns: 42px 1fr; gap: 22px; }
  .xm-timeline li::before { left: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .xm-bulb, .xm-bauble { animation: none; }
}
