/* ============================================================
   RIFAS APP — Public Stylesheet (Mobile-first)
   Breakpoints:
     Base   → 0px+   (todos los móviles)
     sm     → 480px+ (teléfonos grandes)
     md     → 768px+ (tablets)
     lg     → 1025px+(desktop)
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary:       #6d28d9;
  --primary-dark:  #4c1d95;
  --primary-light: #ede9fe;
  --primary-mid:   #7c3aed;
  --gold:          #f59e0b;
  --gold-light:    #fffbeb;
  --success:       #10b981;
  --success-light: #ecfdf5;
  --danger:        #ef4444;
  --danger-light:  #fef2f2;
  --warning-light: #fffbeb;
  --text-main:     #111827;
  --text-body:     #374151;
  --text-muted:    #6b7280;
  --border:        #e5e7eb;
  --bg:            #f9f7ff;
  --card:          #ffffff;
  --card-bg:       #ffffff;
  --radius:        14px;
  --radius-sm:     8px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.06);
  --shadow:        0 4px 16px rgba(0,0,0,.09);
  --shadow-lg:     0 10px 40px rgba(0,0,0,.12);
  --touch:         44px;   /* mínimo táctil iOS/Android */
  --font: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
  /* Evitar zoom horizontal accidental */
  overflow-x: hidden;
}
body {
  font-family: var(--font);
  color: var(--text-body);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;     /* previene scroll horizontal */
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; height: auto; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

/* ─────────────────────────────────────────────────────────────
   NAVBAR PÚBLICA
───────────────────────────────────────────────────────────── */
.public-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
}
.nav-brand-icon {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .85rem;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* En móvil sólo mostramos el botón Admin */
.nav-link { display: none; }
.nav-admin-btn {
  padding: 8px 14px;
  min-height: var(--touch);
  display: flex; align-items: center;
  background: var(--primary);
  color: #fff !important;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none !important;
  transition: background .15s;
}
.nav-admin-btn:hover { background: var(--primary-dark); }

@media (min-width: 768px) {
  .public-nav { height: 62px; padding: 0 5%; }
  .nav-link {
    display: block;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-muted);
  }
  .nav-link:hover { color: var(--primary); text-decoration: none; }
}

/* ─────────────────────────────────────────────────────────────
   BARRA DE CONFIANZA
───────────────────────────────────────────────────────────── */
.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 4%;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.trust-item svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }

@media (min-width: 768px) {
  .trust-bar { gap: 24px; padding: 16px 5%; }
  .trust-item { font-size: .8rem; }
  .trust-item svg { width: 18px; height: 18px; }
}

/* ─────────────────────────────────────────────────────────────
   HERO BANNER
───────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 45%, #6d28d9 100%);
  color: #fff;
  padding: 40px 5% 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.8rem);
  font-weight: 900;
  margin-bottom: 12px;
  line-height: 1.15;
  letter-spacing: -.02em;
}
.hero p {
  font-size: .95rem;
  opacity: .85;
  margin-bottom: 24px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.hero-stat { text-align: center; min-width: 70px; }
.hero-stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  display: block;
  line-height: 1;
}
.hero-stat-lbl { font-size: .7rem; opacity: .7; margin-top: 3px; }

@media (min-width: 768px) {
  .hero { padding: 52px 5% 64px; }
  .hero p { font-size: 1.05rem; }
  .hero-stats { gap: 24px; margin-top: 32px; padding-top: 28px; }
  .hero-stat-num { font-size: 1.6rem; }
}

/* ─────────────────────────────────────────────────────────────
   CONTENEDOR / LAYOUT
───────────────────────────────────────────────────────────── */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 4%;
}
.section { padding: 32px 0; }
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}
.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -.01em;
}
.section-subtitle { font-size: .85rem; color: var(--text-muted); margin-top: 3px; }

@media (min-width: 768px) {
  .container { padding: 0 5%; }
  .section { padding: 48px 0; }
  .section-title { font-size: 1.4rem; }
  .section-header { margin-bottom: 28px; }
}

/* ─────────────────────────────────────────────────────────────
   BARRA DE PROGRESO
───────────────────────────────────────────────────────────── */
.progress-bar-bg {
  height: 8px;
  background: #e9d5ff;
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-mid));
  border-radius: 99px;
  transition: width .4s ease;
}
.progress-bar-fill.sold { background: linear-gradient(90deg, #10b981, #34d399); }
.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─────────────────────────────────────────────────────────────
   TARJETAS DE RIFA (homepage)
───────────────────────────────────────────────────────────── */
/* Base: una columna en móvil */
.rifas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 580px) {
  .rifas-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
}
@media (min-width: 1025px) {
  .rifas-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
}

.rifa-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  /* sin hover lift en móvil — táctil no tiene hover real */
}
@media (min-width: 768px) {
  .rifa-card { transition: transform .2s ease, box-shadow .2s ease; }
  .rifa-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
}

.rifa-card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f8fafc;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rifa-card-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}
.rifa-card-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  color: rgba(255,255,255,.4);
}
.rifa-card-badge {
  position: absolute;
  top: 10px; right: 10px;
  padding: 3px 9px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border-radius: 6px;
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}
.rifa-card-badge.urgente { background: rgba(239,68,68,.85); }
.rifa-card-badge.vencido { background: rgba(239,68,68,.7); }
.rifa-card-badge.hoy     { background: rgba(234,88,12,.8); }

.rifa-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
@media (min-width: 768px) { .rifa-card-body { padding: 18px; } }

.rifa-card-title {
  font-size: .95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.3;
}
.rifa-card-premio {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rifa-card-progress { margin-bottom: 12px; }
.rifa-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 6px;
}
.rifa-card-price {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -.02em;
}
.rifa-card-price span { font-size: .7rem; font-weight: 500; color: var(--text-muted); }
.rifa-card-days {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--gold-light);
  color: #92400e;
  border: 1px solid #fde68a;
}
.rifa-card-days.vencido { background: var(--danger-light); color: #7f1d1d; border-color: #fecaca; }
.rifa-card-days.hoy     { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }

/* CTA: tamaño mínimo táctil 44px */
.rifa-card-cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  height: 48px;           /* > 44px táctil */
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.rifa-card-cta:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.rifa-card-cta svg  { width: 18px; height: 18px; }

/* ─────────────────────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────────────────────── */
.no-rifas {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
}
.no-rifas-icon { font-size: 2.5rem; margin-bottom: 12px; }
.no-rifas h3 { font-size: 1rem; font-weight: 700; color: var(--text-main); margin-bottom: 6px; }
.no-rifas p  { font-size: .85rem; }

/* ─────────────────────────────────────────────────────────────
   FOOTER PÚBLICO
───────────────────────────────────────────────────────────── */
.public-footer {
  background: #0f0a1e;
  color: #9ca3af;
  padding: 32px 5%;
  margin-top: 48px;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}
.footer-brand {
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  display: flex; align-items: center; gap: 8px;
}
.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-links a { font-size: .78rem; color: #9ca3af; }
.footer-links a:hover { color: #fff; }
.footer-copy {
  width: 100%;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .72rem;
  text-align: center;
}
.wompi-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  font-size: .72rem; font-weight: 600; color: #9ca3af;
}

/* ═════════════════════════════════════════════════════════════
   PÁGINA DE DETALLE DE RIFA
   Layout: hero (full-width) + grid 2-col en desktop
   Orden en móvil: info-top → booking → info-bottom
═════════════════════════════════════════════════════════════ */

.rf-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 0 72px;   /* padding-bottom para la barra sticky */
}
@media (min-width: 768px) {
  .rf-wrap { padding: 0 16px 60px; }
}

/* Hero / Galería: ancho completo, fuera del grid */
.rf-hero {
  width: 100%;
  background: #f8fafc;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
@media (min-width: 768px) {
  .rf-hero {
    border-radius: var(--radius);
    margin: 16px 0 0;
  }
}
/* Imagen única (sin slider): tamaño natural, máx altura */
.rf-hero > img {
  display: block;
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
}
@media (min-width: 768px) {
  .rf-hero > img { max-height: 560px; }
}
.rf-hero-placeholder {
  aspect-ratio: 16/7;
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; background: linear-gradient(135deg, #1e1b4b, #6d28d9);
  color: rgba(255,255,255,.3);
}

/* Slider de galería */
.rf-slider { overflow: hidden; }
.rf-slides { display: flex; transition: transform .35s ease; }
.rf-slide {
  flex: 0 0 100%;
  height: 280px;
  background: #f8fafc;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
@media (min-width: 768px) { .rf-slide { height: 440px; } }
.rf-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.rf-slider-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45); border: none; border-radius: 50%;
  width: 38px; height: 38px; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; z-index: 2; transition: background .15s;
}
.rf-slider-btn:hover { background: rgba(0,0,0,.7); }
.rf-slider-prev { left: 10px; }
.rf-slider-next { right: 10px; }
.rf-slider-dots {
  display: flex; justify-content: center; gap: 6px; padding: 10px 0 6px;
  background: #fff;
}
.rf-slider-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #cbd5e1; border: none; cursor: pointer; padding: 0;
  transition: background .15s;
}
.rf-slider-dot.active { background: var(--primary); }

/* Grid de 2 columnas */
.rf-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 4%;
}
@media (min-width: 768px) {
  .rf-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    grid-template-rows: auto auto;
    gap: 20px;
    align-items: start;
    margin-top: 20px;
    padding: 0;
  }
}
@media (min-width: 1025px) {
  .rf-layout { grid-template-columns: 1fr 390px; gap: 24px; }
}

/* Columna info superior (título, hechos, progreso) */
.rf-info-top {
  order: 1;
  padding-top: 16px;
}
@media (min-width: 768px) {
  .rf-info-top {
    grid-column: 1;
    grid-row: 1;
    padding-top: 0;
  }
}

/* Panel de compra — en móvil va entre info-top e info-bottom */
.rf-booking {
  order: 2;
  padding-top: 8px;
}
@media (min-width: 768px) {
  .rf-booking {
    grid-column: 2;
    grid-row: 1 / 3;   /* abarca ambas filas */
    position: sticky;
    top: 72px;
    padding-top: 0;
  }
}

/* Columna info inferior (cómo funciona) */
.rf-info-bottom {
  order: 3;
  padding-top: 4px;
}
@media (min-width: 768px) {
  .rf-info-bottom {
    grid-column: 1;
    grid-row: 2;
    padding-top: 0;
  }
}

/* Tarjetas genéricas dentro del detalle */
.rf-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.rf-card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.rf-card-title { font-size: .85rem; font-weight: 700; color: var(--text-main); }
.rf-card-body { padding: 14px 16px; }

@media (min-width: 768px) {
  .rf-card { margin-bottom: 16px; }
  .rf-card-header { padding: 14px 20px; }
  .rf-card-body { padding: 18px 20px; }
}

.rf-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 5px;
  letter-spacing: -.02em;
}
@media (min-width: 768px) { .rf-title { font-size: 1.5rem; } }

.rf-desc { font-size: .875rem; color: var(--text-muted); line-height: 1.6; }

.rf-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}
@media (min-width: 480px) {
  .rf-facts { grid-template-columns: repeat(4, 1fr); }
}
.rf-fact {
  padding: 10px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}
.rf-fact-icon { font-size: 1rem; margin-bottom: 3px; }
.rf-fact-val  { font-size: .95rem; font-weight: 800; color: var(--text-main); line-height: 1.2; }
.rf-fact-lbl  { font-size: .65rem; color: var(--text-muted); margin-top: 2px; }

.rf-how-item {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: .85rem;
  color: var(--text-muted);
  align-items: flex-start;
}
.rf-how-item:last-child { border-bottom: none; }
.rf-how-num {
  width: 26px; height: 26px;
  min-width: 26px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800;
}

/* ─────────────────────────────────────────────────────────────
   PANEL DE RESERVA
───────────────────────────────────────────────────────────── */
.rf-booking-card {
  background: #fff;
  border: 2px solid var(--primary-light);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(109,40,217,.12);
}
.rf-booking-header {
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  padding: 14px 16px;
  color: #fff;
  display: flex; align-items: center; gap: 8px;
  border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
}
.rf-booking-title { font-size: .9rem; font-weight: 700; }
.rf-booking-price-badge {
  margin-left: auto;
  background: rgba(255,255,255,.2);
  padding: 3px 9px;
  border-radius: 7px;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}
.rf-booking-body { padding: 14px; }
@media (min-width: 768px) {
  .rf-booking-body { padding: 18px; }
}

/* Pasos dentro del panel */
.rf-step { margin-bottom: 16px; }
.rf-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.rf-step-num {
  width: 22px; height: 22px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: .7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rf-step-title { font-size: .82rem; font-weight: 700; color: var(--text-main); }

/* Tabs de modo de selección */
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mode-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 60px;       /* fácil de tocar */
  padding: 10px 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #fff;
  transition: all .15s;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.mode-tab .mode-icon { font-size: 1.4rem; line-height: 1; }
.mode-tab.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* Selector de cantidad — botones táctiles */
.quantity-selector { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: var(--touch);
  height: var(--touch);
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-main);
  transition: background .1s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.qty-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.qty-input {
  flex: 1;
  text-align: center;
  font-size: 1.3rem;        /* > 16px → sin zoom en iOS */
  font-weight: 800;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  color: var(--text-main);
  outline: none;
  min-width: 0;
}
.qty-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(109,40,217,.15); }

/* ─────────────────────────────────────────────────────────────
   GRILLA DE NÚMEROS
───────────────────────────────────────────────────────────── */
.nums-search-bar { display: flex; gap: 6px; margin-bottom: 8px; }
.nums-search-input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;            /* 16px — sin zoom iOS */
  outline: none;
  min-width: 0;
}
.nums-search-input:focus { border-color: var(--primary); }
.nums-range-select {
  padding: 8px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .82rem;
  outline: none;
  background: #fff;
  max-width: 110px;
}

/* Contenedor del grid de tiles */
.nums-grid-wrap {
  height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  background: #fafafa;
  position: relative;
  -webkit-overflow-scrolling: touch;   /* scroll suave en iOS */
}
@media (min-width: 768px) { .nums-grid-wrap { height: 280px; } }

.nums-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-content: flex-start;
}
.nums-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250,250,250,.9);
  font-size: .82rem;
  color: var(--text-muted);
  gap: 8px;
}
.nums-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Navegación de páginas del grid */
.nums-page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: .72rem;
  color: var(--text-muted);
  gap: 6px;
  flex-wrap: wrap;
}
.nums-page-btn {
  padding: 0 12px;
  height: var(--touch);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: .78rem;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.nums-page-btn:hover:not(:disabled) { background: var(--primary-light); border-color: var(--primary); }
.nums-page-btn:disabled { opacity: .4; cursor: default; }

/* Leyenda de colores */
.grid-legend {
  display: flex;
  gap: 8px;
  font-size: .67rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.grid-legend-item { display: flex; align-items: center; gap: 4px; }
.grid-legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────────
   RESUMEN DE SELECCIÓN
───────────────────────────────────────────────────────────── */
.selection-summary {
  background: var(--primary-light);
  border: 1px solid #c4b5fd;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  display: none;
}
.selection-summary.visible { display: block; }
.sel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 72px;
  overflow-y: auto;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.sel-chip {
  padding: 3px 9px;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  font-size: .72rem;
  font-weight: 700;
}
.sel-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
}
.sel-total-val { font-weight: 800; color: var(--primary); font-size: .95rem; }

/* ─────────────────────────────────────────────────────────────
   COUNTDOWN
───────────────────────────────────────────────────────────── */
.countdown-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 11px 14px;
  margin: 10px 0;
  display: none;
  align-items: center;
  gap: 10px;
}
.countdown-banner.visible { display: flex; }
.countdown-banner.urgent {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-color: #fca5a5;
}
.countdown-icon { font-size: 1.1rem; flex-shrink: 0; }
.countdown-text { flex: 1; min-width: 0; }
.countdown-label { font-size: .68rem; color: #92400e; font-weight: 600; }
.countdown-time  { font-size: 1.2rem; font-weight: 900; color: #92400e; letter-spacing: .02em; }
.countdown-banner.urgent .countdown-label,
.countdown-banner.urgent .countdown-time { color: #7f1d1d; }

/* ─────────────────────────────────────────────────────────────
   FORMULARIO DEL COMPRADOR
───────────────────────────────────────────────────────────── */
.buyer-form { display: none; }
.buyer-form.visible { display: block; }

/* 16px mínimo en inputs — previene auto-zoom de iOS */
.bf-input {
  display: block;
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;       /* 16px exactos */
  color: var(--text-main);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--font);
  -webkit-appearance: none;
  background: #fff;
}
.bf-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(109,40,217,.15);
}
.bf-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 5px;
}
.bf-group { margin-bottom: 12px; }

/* ─────────────────────────────────────────────────────────────
   BOTONES DE ACCIÓN
───────────────────────────────────────────────────────────── */
.pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;       /* > 44px táctil */
  padding: 0 16px;
  background: linear-gradient(135deg, #6d28d9, #4c1d95);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 800;
  transition: opacity .15s;
  letter-spacing: .01em;
  -webkit-tap-highlight-color: transparent;
}
.pay-btn:hover:not(:disabled) { opacity: .9; }
.pay-btn:active { opacity: .8; }
.pay-btn:disabled { opacity: .5; cursor: default; }

.assign-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 700;
  margin-top: 10px;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.assign-btn:hover:not(:disabled) { background: var(--primary-dark); }
.assign-btn:disabled { opacity: .55; cursor: default; }

.reservar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 700;
  margin-top: 10px;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.reservar-btn:hover:not(:disabled) { background: #059669; }
.reservar-btn:disabled { opacity: .5; cursor: default; }

/* ─────────────────────────────────────────────────────────────
   ALERTAS INLINE
───────────────────────────────────────────────────────────── */
.rf-alert {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 500;
  margin-bottom: 10px;
  align-items: flex-start;
  word-break: break-word;
}
.rf-alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.rf-alert-error   { background: var(--danger-light);  color: #b91c1c; border: 1px solid #fecaca; }
.rf-alert-info    { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #c4b5fd; }
.rf-alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }

/* ─────────────────────────────────────────────────────────────
   BARRA STICKY INFERIOR (solo móvil — CTA de compra)
───────────────────────────────────────────────────────────── */
.mobile-buy-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 150;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  box-shadow: 0 -4px 16px rgba(0,0,0,.1);
}
.mobile-buy-bar.hidden { display: none; }
.mobile-buy-bar-price {
  flex: 1;
  min-width: 0;
}
.mobile-buy-bar-price .price-val {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--primary);
  display: block;
}
.mobile-buy-bar-price .price-lbl {
  font-size: .68rem;
  color: var(--text-muted);
}
.mobile-buy-bar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  padding: 0 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Ocultar la barra en tablet/desktop */
@media (min-width: 768px) {
  .mobile-buy-bar { display: none !important; }
  .rf-wrap { padding-bottom: 60px; }
}

/* ─────────────────────────────────────────────────────────────
   CHECKOUT LAYOUT (.co-*) — mejoras responsive
───────────────────────────────────────────────────────────── */
/* Inputs del checkout a 16px */
.co-input {
  font-size: 1rem !important;   /* override layout inline — previene zoom iOS */
  -webkit-appearance: none;
}

/* Botones del checkout con mínimo táctil */
.co-btn {
  min-height: var(--touch);
}

/* Pago: resumen de boletos con scroll */
.num-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 100px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.num-chip {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .78rem; font-weight: 700;
  background: var(--primary-light); color: var(--primary-dark);
  border: 1px solid #c4b5fd;
  white-space: nowrap;
}
.num-chip.vendido { background: var(--success-light); color: #065f46; border-color: #a7f3d0; }

/* Referencia monospace no desborda */
.ref-code {
  font-family: monospace;
  font-size: .82rem;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* Container de Wompi no desborda */
.wompi-container {
  overflow: hidden;
  max-width: 100%;
}
.wompi-container iframe,
.wompi-container button {
  max-width: 100% !important;
}

/* ─────────────────────────────────────────────────────────────
   ACCESIBILIDAD Y PREFERENCIAS
───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible para teclado */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
