/* Portal de demostración «Telón». Papel cálido, tinta oscura y un bermellón como único acento. */
:root {
  --bg: #f4efe5;
  --paper: #fffdf8;
  --ink: #1d1913;
  --muted: #655d50;
  --line: #e3d9c6;
  --accent: #c43d1c;
  --on-accent: #ffffff;
  --accent-soft: #fbe6dd;
  --ok: #1f7a4d;
  --warn-bg: #fff1dc;
  --warn-ink: #7a3b00;
  --shadow: 0 1px 2px rgba(60, 40, 10, .06), 0 12px 32px -12px rgba(60, 40, 10, .22);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110e;
    --paper: #1d1a16;
    --ink: #f4eee3;
    --muted: #b6ac98;
    --line: #38322a;
    --accent: #e2603a;
    --on-accent: #1a0e08;
    --accent-soft: #3a1e14;
    --ok: #5fd39a;
    --warn-bg: #3a2a10;
    --warn-ink: #ffd49a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -12px rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before { /* luz de escenario muy sutil en la parte superior */
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 380px;
  background: radial-gradient(60% 100% at 50% 0%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--ink); color: var(--bg); border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* Cabecera */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1200px; margin: 0 auto; padding: 18px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-name { font: 700 26px/1 var(--serif); letter-spacing: -.02em; }
.tags { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 8px; }
.demo-tag {
  font-size: 12.5px; color: var(--muted); padding: 5px 12px; border: 1px dashed var(--line); border-radius: 999px; text-align: center;
}
.mode-tag { border-style: solid; font-variant-numeric: tabular-nums; }

main { max-width: 1200px; margin: 0 auto; padding: 0 24px 40px; }

/* Ficha del evento */
.event { padding: 14px 0 26px; }
.kicker { font-size: 13px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.event h1 {
  margin-top: 8px; max-width: 18ch; font: 700 clamp(34px, 6vw, 62px)/1.02 var(--serif); letter-spacing: -.025em; text-wrap: balance;
}
.event h1 .sk { display: inline-block; width: min(18ch, 90%); height: .9em; border-radius: 10px; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 18px 0 0; padding: 0; list-style: none; color: var(--muted); }
.facts li { display: flex; align-items: center; gap: 8px; }
.facts svg { flex: none; color: var(--accent); }
.facts b { color: var(--ink); font-weight: 600; }

/* Estructura */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.sec-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font: 650 19px/1.2 var(--serif); letter-spacing: -.01em; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 700 13px/1 var(--sans); }

.seats-host {
  /* El portal sobrescribe las variables públicas del widget para integrarlo con su paleta (y su modo oscuro). */
  --seats-accent: var(--accent);
  --seats-on-accent: var(--on-accent);
  --seats-bg: var(--paper);
  --seats-map: color-mix(in srgb, var(--ink) 4%, var(--paper));
  --seats-border: var(--line);
  --seats-ink: var(--ink);
  --seats-muted: var(--muted);
  font-family: var(--sans);
}

/* Pedido */
.order { position: sticky; top: 16px; }
.order-card { padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.empty { display: grid; justify-items: center; gap: 10px; padding: 18px 8px; text-align: center; color: var(--muted); }
.empty svg { color: var(--line); stroke: currentColor; }
.lines { margin: 0 0 6px; padding: 0; list-style: none; }
.lines li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.lines li:last-child { border-bottom: 0; }
.lines .dot { width: 11px; height: 11px; margin-top: .42em; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 50%, transparent); align-self: start; }
.lines .what { font-weight: 600; }
.lines .what small { display: block; margin-top: 1px; font-weight: 400; color: var(--muted); }
.lines .price { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.total { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 16px; padding-top: 14px; border-top: 2px solid var(--ink); }
.total dt { font-weight: 600; }
.total dd { margin: 0; font: 700 28px/1 var(--serif); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hold { margin-bottom: 16px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); }
.hold-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.hold-row strong { font: 700 20px/1 var(--sans); font-variant-numeric: tabular-nums; }
.hold.low { background: var(--warn-bg); color: var(--warn-ink); }
.hold .bar { height: 5px; margin-top: 9px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 12%, transparent); overflow: hidden; }
.hold .bar i { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; transition: width 1s linear; }
.fine { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.alert { margin-top: 14px; padding: 11px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; }
.alert.err { background: color-mix(in srgb, var(--accent) 14%, var(--paper)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.alert.ok { background: color-mix(in srgb, var(--ok) 14%, var(--paper)); color: var(--ink); }
.order-card > .alert:first-child { margin-top: 0; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 20px;
  border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-weight: 650;
  transition: transform .12s, background-color .15s, opacity .15s;
}
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); }
.btn-block { width: 100%; min-height: 50px; font-size: 17px; }
.link { padding: 2px 0; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
.link:hover { color: var(--ink); }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Herramientas de demostración */
.tools { margin-top: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
.tools summary { padding: 12px 16px; cursor: pointer; font-size: 14px; font-weight: 600; }
.tools-body { display: grid; gap: 4px; padding: 0 16px 16px; }
.tool { padding: 14px 0; border-top: 1px dashed var(--line); }
.tool h3 { font-size: 14.5px; color: var(--ink); }
.tool p { margin: 2px 0 10px; font-size: 13.5px; }
.tool .row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.tool label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; }
.tool select { min-height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; }
.tool .row .link { align-self: center; }
.tools-status { min-height: 1.4em; font-size: 14px; color: var(--ink); }

/* Pantalla de éxito: un billete con talón */
.done { max-width: 820px; margin: 10px auto 0; }
.ticket {
  --notch: 14px;
  display: grid; grid-template-columns: minmax(0, 1fr) 230px; background: var(--paper); border-radius: 20px; box-shadow: var(--shadow);
  -webkit-mask: radial-gradient(circle var(--notch) at calc(100% - 230px) 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--notch) at calc(100% - 230px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
  mask: radial-gradient(circle var(--notch) at calc(100% - 230px) 0, transparent 98%, #000) top / 100% 51% no-repeat, radial-gradient(circle var(--notch) at calc(100% - 230px) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.ticket-main { padding: 30px 32px; }
.ticket-main .ok { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 14px; border-radius: 50%; background: var(--ok); color: var(--paper); }
.ticket-main h2 { font: 700 34px/1.05 var(--serif); letter-spacing: -.02em; outline: none; }
.done-event { margin: 6px 0 14px; color: var(--muted); }
.ticket-stub { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 24px; text-align: center; border-left: 2px dashed var(--line); background: var(--accent-soft); border-radius: 0 20px 20px 0; }
.stub-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.ref { font: 700 26px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }
.stub-note { font-size: 12.5px; color: var(--muted); }
.done-actions { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 24px; }

.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; max-width: 1200px; margin: 0 auto; padding: 18px 24px 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* Barra de pago fija en móvil */
.mbar { display: none; }

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .order { position: static; }
  .mbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, .3);
  }
  .mbar[hidden] { display: none !important; }
  .mbar-info { display: grid; line-height: 1.25; min-width: 0; }
  .mbar-info strong { font-size: 15px; }
  .mbar-info span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
  body.has-sel { padding-bottom: 76px; }
}
@media (max-width: 600px) {
  .top { padding: 14px 16px; }
  .demo-tag:not(.mode-tag) { display: none; }
  .mode-tag { font-size: 12px; padding: 4px 10px; }
  main { padding: 0 16px 32px; }
  .event { padding-bottom: 18px; }
  .facts { gap: 6px 18px; font-size: 14.5px; }
  .order-card { padding: 16px; }
  .ticket { grid-template-columns: 1fr; -webkit-mask: none; mask: none; }
  .ticket-stub { border-left: 0; border-top: 2px dashed var(--line); border-radius: 0 0 20px 20px; }
  .ticket-main { padding: 24px 20px; }
  .done-actions { flex-direction: column; gap: 12px; }
  .foot { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
