/* Boletera Digital P-Metro — estilo deportivo azul/rojo, mobile-first */
:root {
  --pm-navy: #0b2a5b;
  --pm-blue: #1452b8;
  --pm-red: #c8102e;
  --pm-red-dark: #9e0c24;
  --pm-bg: #f2f5fa;
  --pm-ink: #17213a;
  --pm-muted: #5b6577;
  --pm-line: #d9e0ec;
  --pm-amber: #f2a900;
  --pm-sold: #aab3c2;
}
body { background: var(--pm-bg); color: var(--pm-ink); font-family: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3, .display-font { font-family: "Barlow Condensed", "Barlow", system-ui, sans-serif; letter-spacing: .01em; }
a { color: var(--pm-blue); }

/* ---------- Barra superior ---------- */
.pm-topbar { background: var(--pm-navy); color: #fff; border-bottom: 4px solid var(--pm-red); }
.pm-topbar .brand { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.25rem; color: #fff; text-decoration: none; letter-spacing: .03em; }
.pm-topbar .brand .ball { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--pm-red); margin-right: .4rem; font-size: 1rem; }

/* ---------- Hero ---------- */
.pm-hero { position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.10) 0 120px, transparent 121px),
    linear-gradient(135deg, var(--pm-navy) 0%, #12408f 60%, var(--pm-navy) 100%); }
.pm-hero::after { /* costura de pelota */
  content: ""; position: absolute; right: -90px; top: -90px; width: 300px; height: 300px; border-radius: 50%;
  border: 3px dashed rgba(200,16,46,.55); pointer-events: none; }
.pm-hero .kicker { display: inline-block; background: var(--pm-red); padding: .2rem .6rem; border-radius: 4px; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.pm-hero h1 { font-weight: 800; font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1; text-transform: uppercase; }
.pm-hero .lead { color: rgba(255,255,255,.88); font-size: 1.05rem; }
.pm-fact { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: .75rem .9rem; height: 100%; }
.pm-fact .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.7); }
.pm-fact .val { font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.35rem; line-height: 1.1; }

/* ---------- Tarjetas ---------- */
.pm-card { background: #fff; border: 1px solid var(--pm-line); border-radius: 14px; box-shadow: 0 1px 2px rgba(11,42,91,.04); }
.pm-section-title { font-weight: 800; text-transform: uppercase; color: var(--pm-navy); font-size: 1.5rem; }

/* ---------- Leyenda y cuadrícula ---------- */
.pm-legend { display: flex; flex-wrap: wrap; gap: .75rem 1rem; font-size: .85rem; color: var(--pm-muted); }
.pm-legend .sw { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: .3rem; border: 2px solid var(--pm-blue); background: #fff; }
.pm-legend .sw.sel { background: var(--pm-red); border-color: var(--pm-red); }
.pm-legend .sw.res { background: repeating-linear-gradient(45deg, #fff4d1 0 4px, #ffe39a 4px 8px); border-color: var(--pm-amber); }
.pm-legend .sw.sold { background: var(--pm-sold); border-color: var(--pm-sold); }

.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.pm-num { appearance: none; border: 2px solid var(--pm-blue); background: #fff; color: var(--pm-navy); border-radius: 8px;
  font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1.05rem; padding: .45rem 0; line-height: 1;
  transition: transform .08s, background .12s; touch-action: manipulation; }
.pm-num:hover:not(:disabled) { background: #e8f0ff; }
.pm-num:active:not(:disabled) { transform: scale(.94); }
.pm-num.is-selected { background: var(--pm-red); border-color: var(--pm-red); color: #fff; box-shadow: 0 2px 6px rgba(200,16,46,.35); }
.pm-num.is-reserved { background: repeating-linear-gradient(45deg, #fff4d1 0 5px, #ffe39a 5px 10px); border-color: var(--pm-amber); color: #8a6000; cursor: not-allowed; }
.pm-num.is-sold { background: var(--pm-sold); border-color: var(--pm-sold); color: #fff; text-decoration: line-through; cursor: not-allowed; }
.pm-num.is-hidden { display: none; }
.pm-num.is-flash { animation: pmflash 1s ease 2; }
.pm-num.is-winner { outline: 3px solid #ffd400; outline-offset: 1px; }
@keyframes pmflash { 50% { box-shadow: 0 0 0 4px rgba(242,169,0,.8); } }

.pm-counter { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.9rem; color: var(--pm-blue); line-height: 1; }

/* ---------- Resumen / carrito ---------- */
.pm-summary { position: sticky; top: 1rem; }
.pm-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; }
.pm-chip { display: inline-flex; align-items: center; gap: .25rem; background: var(--pm-red); color: #fff; border-radius: 999px; padding: .15rem .3rem .15rem .65rem;
  font-family: "Barlow Condensed", sans-serif; font-weight: 700; font-size: 1rem; }
.pm-chip button { border: 0; background: rgba(255,255,255,.2); color: #fff; width: 22px; height: 22px; border-radius: 50%; line-height: 1; font-size: .9rem; }
.pm-total { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 2.2rem; color: var(--pm-navy); line-height: 1; }

/* Barra fija inferior (móvil) */
.pm-bottombar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: var(--pm-navy); color: #fff;
  border-top: 3px solid var(--pm-red); padding: .6rem 16px calc(.6rem + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform .2s; }
.pm-bottombar.show { transform: none; }
.pm-bottombar .t { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.5rem; line-height: 1; }
body.has-bottombar { padding-bottom: 84px; }
@media (min-width: 992px) { .pm-bottombar { display: none; } body.has-bottombar { padding-bottom: 0; } }

.btn-pm { background: var(--pm-red); border-color: var(--pm-red); color: #fff; font-weight: 700; }
.btn-pm:hover, .btn-pm:focus { background: var(--pm-red-dark); border-color: var(--pm-red-dark); color: #fff; }
.btn-navy { background: var(--pm-navy); border-color: var(--pm-navy); color: #fff; font-weight: 600; }
.btn-navy:hover { background: #071d40; color: #fff; }
.btn-wa { background: #25d366; border-color: #25d366; color: #fff; font-weight: 700; }
.btn-wa:hover { background: #1da851; border-color: #1da851; color: #fff; }

/* ---------- Confirmación ---------- */
.pm-countdown { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 3.2rem; color: var(--pm-red); line-height: 1; font-variant-numeric: tabular-nums; }
.pm-yappy { border: 2px dashed var(--pm-blue); border-radius: 12px; background: #f5f8ff; }
.pm-yappy .num { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 2rem; color: var(--pm-navy); letter-spacing: .04em; }
.pm-notice { background: #fff7e0; border-left: 5px solid var(--pm-amber); border-radius: 8px; }

/* ---------- Ejemplo "¿Cómo se gana?" ---------- */
.pm-example { border: 1px solid var(--pm-line); border-radius: 12px; overflow: hidden; background: #fff; }
.pm-example-head { display: flex; justify-content: space-between; align-items: center; background: var(--pm-navy); color: #fff; padding: .6rem .9rem; border-bottom: 3px solid var(--pm-red); }
.pm-example-num { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.8rem; letter-spacing: .12em; line-height: 1; }
.pm-example-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .6rem; padding: .55rem .9rem; }
.pm-example-row + .pm-example-row { border-top: 1px solid var(--pm-line); }
.pm-example-der { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 1.5rem; color: var(--pm-navy); line-height: 1; }

footer.pm-footer { color: var(--pm-muted); font-size: .85rem; }

/* ---------- Admin ---------- */
.adm-nav .nav-link { color: rgba(255,255,255,.8); font-weight: 600; }
.adm-nav .nav-link.active, .adm-nav .nav-link:hover { color: #fff; }
.adm-nav .nav-link.active { box-shadow: inset 0 -3px 0 var(--pm-red); }
.stat-card { background: #fff; border: 1px solid var(--pm-line); border-radius: 14px; padding: 1rem 1.1rem; height: 100%; }
.stat-card .lbl { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pm-muted); font-weight: 600; }
.stat-card .val { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 2.1rem; line-height: 1.05; color: var(--pm-navy); }
.stat-card .sub { font-size: .8rem; color: var(--pm-muted); }
.badge-estado { font-weight: 600; }
.table-orders td, .table-orders th { white-space: nowrap; vertical-align: middle; font-size: .9rem; }
.table-orders td.nums { white-space: normal; min-width: 140px; }
.res-ganador { background: #e7f7ec !important; }
.res-descartado_rango { color: var(--pm-muted); }
.res-repetido { color: var(--pm-muted); font-style: italic; }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
