/*  FANPASS — Base Styles (Responsive)  */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0B0B0C;
  --surface:   #121214;
  --primary:   #1A1B1E;
  --primary-d: #0F1012;
  --text:      #F5F5F7;
  --muted:     #8A8F98;

  --shadow:    0 6px 24px rgba(0,0,0,0.35);
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.25);
  --radius:    18px;
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Responsive spacing */
  --page-px:   16px;
  --gap:       10px;

  /* Ancho uniforme para TODOS los grupos de cards */
  --card-w:    min(92vw, 420px);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  justify-content: center;
}

a    { text-decoration: none; color: inherit; }
img  { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ─── App Shell ─────────────────────────────────────────────────────────────── */
.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: max(90px, env(safe-area-inset-bottom, 90px));
}

/* Desktop: flota como teléfono */
@media (min-width: 500px) {
  body {
    min-height: 100vh;
    align-items: flex-start;
    padding: 32px 0;
    background: #131313;
  }
  .app-shell {
    border-radius: 32px;
    overflow: hidden;
    min-height: auto;
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
  }
}

/* ─── Page Content ───────────────────────────────────────────────────────────── */
.page-content {
  padding: 10px var(--page-px) var(--gap);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  align-items: center;  /* centra cada grupo */
}

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ─── Safety Card (Medical ID + SOS) ────────────────────────────────────────── */
.safety-card {
  width: var(--card-w);
  height: auto;
  min-height: clamp(76px, 20vw, 92px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 0 auto;
}

.medical-id-btn {
  flex: 1;
  min-height: 52px;
  background: #1A1B1E;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  cursor: pointer;
  border: none;
  transition: filter 0.15s;
  overflow: hidden;
}
.medical-id-btn:active { filter: brightness(0.95); }

.qr-icon { width: clamp(28px, 8vw, 36px); height: clamp(28px, 8vw, 36px); flex-shrink: 0; }
.medical-id-text { text-align: left; overflow: hidden; }
.medical-id-text strong { color: #F5F5F7; font-size: clamp(12px, 3.5vw, 14px); white-space: nowrap; }
.medical-id-text span  { color: #8A8F98; font-size: clamp(10px, 2.8vw, 12px); white-space: nowrap; }

.sos-btn {
  width: clamp(52px, 14vw, 64px);
  height: clamp(52px, 14vw, 64px);
  background: #1F2937;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; border: none;
  transition: transform 0.1s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.sos-btn:active { transform: scale(0.95); }
.sos-btn span { font-size: clamp(13px, 4vw, 16px); font-weight: 900; color: #fff; letter-spacing: 0.5px; }

/* ─── Category Grid ──────────────────────────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: var(--card-w);
}

/* Experience Card — escala con la grid, ratio 3:2 */
.exp-card {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--surface);
  border-radius: 15px 4px 15px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s;
  text-decoration: none;
}
.exp-card:active { transform: scale(0.96); }

.cat-logo {
  width: clamp(22px, 6vw, 32px);
  height: clamp(22px, 6vw, 32px);
  object-fit: contain;
  border-radius: 4px;
}

.cat-empty-logo {
  width: clamp(20px, 5.5vw, 28px);
  height: clamp(20px, 5.5vw, 28px);
  border-radius: 50%;
  background: #2A2D31;
}

.cat-svg {
  width: clamp(22px, 6vw, 30px);
  height: clamp(22px, 6vw, 30px);
  display: block;
}

.exp-card span {
  font-size: clamp(7px, 2vw, 9px);
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text);
  text-transform: uppercase;
  text-align: center;
  line-height: 1.1;
}

/* ─── Banner Rectangular ─────────────────────────────────────────────────────── */
.banner-rectangular {
  width: var(--card-w);
  height: clamp(90px, 26vw, 130px);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  background: var(--surface);
  flex-shrink: 0;
  margin: 0 auto;
}
.banner-default {
  background: linear-gradient(135deg, #0F172A, #1E293B);
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
}
.banner-eyebrow  { font-size: clamp(9px, 2.5vw, 12px); color: rgba(255,255,255,0.65); letter-spacing: 2px; text-align: center; }
.banner-headline { font-size: clamp(14px, 4.5vw, 20px); font-weight: 900; color: #fff; letter-spacing: 1px; text-align: center; }

/* ─── Banner Square ──────────────────────────────────────────────────────────── */
.banner-square {
  width: clamp(140px, 46vw, 210px);
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  background: var(--surface);
  flex-shrink: 0;
}
.banner-default-sq {
  background: linear-gradient(160deg, #1E293B, #0F172A);
  display: flex; align-items: center; justify-content: center;
}
.banner-eyebrow-sm { font-size: clamp(9px, 2.5vw, 11px); color: rgba(255,255,255,0.65); letter-spacing: 2px; text-align: center; }
.banner-year       { font-size: clamp(22px, 7vw, 32px); font-weight: 900; color: #fff; text-align: center; }
.banner-sub-sm     { font-size: clamp(9px, 2.5vw, 11px); color: rgba(255,255,255,0.55); text-align: center; margin-top: 4px; }

/* Shared slider */
.slider-track  { display: flex; height: 100%; transition: transform 0.4s cubic-bezier(0.4,0,0.2,1); }
.slider-slide  { flex-shrink: 0; width: 100%; height: 100%; overflow: hidden; }
.slider-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1A1B1E, #2A2D31);
  color: var(--muted);
}

/* ─── Mixed row (FAN ZONES/HOW TO + banner cuadrado) ────────────────────────── */
.mixed-row {
  display: flex;
  align-items: stretch;   /* ambas columnas estiran al mismo alto */
  gap: 10px;
  width: var(--card-w);
}
.mixed-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
/* Fan Zones / How To: se reparten el alto del banner de al lado */
.mixed-col .exp-card {
  flex: 1;
  width: 100%;
  aspect-ratio: unset;   /* anula el 3/2 global — el alto lo controla flex */
}

/* ─── AI Bar ─────────────────────────────────────────────────────────────────── */
.ai-powered-card {
  width: var(--card-w);
  height: clamp(52px, 14vw, 66px);
  background: var(--surface);
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-shadow: var(--shadow);
  gap: 6px;
  margin: 0 auto;
}
.ai-concierge-btn {
  height: clamp(28px, 8vw, 34px);
  flex: 1;
  background: var(--surface);
  border-radius: 30px;
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px;
  cursor: pointer; border: none;
  overflow: hidden;
}
.ai-star { width: clamp(12px, 3.5vw, 16px); height: clamp(12px, 3.5vw, 16px); flex-shrink: 0; }
.ai-concierge-btn span { font-size: clamp(11px, 3vw, 13px); font-weight: 600; color: var(--text); white-space: nowrap; }
.ai-icon-btn {
  width: clamp(28px, 8vw, 34px);
  height: clamp(28px, 8vw, 34px);
  background: var(--bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; flex-shrink: 0;
}
.ai-icon-btn svg { width: clamp(16px, 5vw, 22px); height: clamp(16px, 5vw, 22px); }

/* ─── Brand footer ───────────────────────────────────────────────────────────── */
.brand-footer { text-align: center; padding: 8px 0; display: flex; flex-direction: column; align-items: center; width: 100%; }
.brand-name   { font-size: clamp(15px, 4.5vw, 18px); font-weight: 900; letter-spacing: 3px; color: var(--text); }
.brand-sub    { font-size: clamp(8px, 2.2vw, 9px); color: var(--muted); letter-spacing: 1px; }

/* ─── Modal overlay ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-sheet {
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 430px;
  padding: 16px 20px max(36px, env(safe-area-inset-bottom, 36px));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-drag-handle {
  width: 36px; height: 4px;
  background: #E2E8F0; border-radius: 2px;
  margin: 0 auto 16px;
}

/* ─── Medical ID Modal ───────────────────────────────────────────────────────── */
.med-header {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px;
}
.med-header-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.med-header-icon svg { width: 24px; height: 24px; }
.med-title { font-size: clamp(14px, 4vw, 16px); font-weight: 700; color: var(--text); line-height: 1.3; margin-top: 2px; }
.med-close {
  margin-left: auto; padding: 4px; border-radius: 50%;
  background: #1A1B1E; flex-shrink: 0;
}
.med-close svg { width: 18px; height: 18px; }

.med-section-label {
  font-size: 11px; font-weight: 800; color: var(--primary);
  letter-spacing: 1.5px; margin: 14px 0 8px;
}

.med-data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.med-data-card {
  background: #1A1B1E; border-radius: 12px; padding: 10px 12px;
  display: flex; align-items: center; gap: 10px;
}
.med-data-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: #1A1B1E;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.med-data-icon svg { width: 20px; height: 20px; }
.med-data-label { font-size: 9px; font-weight: 700; color: var(--primary); letter-spacing: 0.5px; text-transform: uppercase; }
.med-data-value { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 1px; }

.med-contact-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.med-contact-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: #FFF5F3;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.med-contact-icon svg { width: 18px; height: 18px; }
.med-contact-label { font-size: 14px; font-weight: 700; }

.med-unlock-row {
  display: flex; align-items: center; gap: 8px;
  background: #1A1B1E; border-radius: 12px; padding: 10px 12px;
  margin-top: 6px; position: relative;
}
.med-passcode-input {
  flex: 1; border: none; background: transparent;
  font-size: 14px; outline: none; color: #94A3B8;
}
.med-lock-icon { width: 18px; height: 18px; flex-shrink: 0; }
.med-unlock-btn {
  background: var(--primary); color: #fff;
  border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  white-space: nowrap;
}

.med-contact-revealed {
  background: #0F1F17; border-radius: 12px; padding: 12px 14px; margin-top: 6px;
}
.med-contact-revealed .rev-name  { font-size: 14px; font-weight: 700; color: #34D399; }
.med-contact-revealed .rev-phone {
  font-size: 15px; font-weight: 800; color: #10B981; margin-top: 2px; display: block;
}

.med-call-btn {
  width: 100%; margin-top: 16px;
  background: #1F2937; color: #fff;
  border: none; border-radius: 14px; padding: 16px;
  font-size: 15px; font-weight: 900; letter-spacing: 1px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.med-call-btn svg { width: 22px; height: 22px; }
.med-disclaimer { font-size: 10px; color: #94A3B8; text-align: center; margin-top: 8px; letter-spacing: 0.5px; }

/* ─── AI Search ──────────────────────────────────────────────────────────────── */
.search-input-wrap {
  display: flex; align-items: center; gap: 8px;
  background: #121214; border-radius: 30px; padding: 10px 14px; margin-bottom: 12px;
}
.search-input-wrap input { flex: 1; border: none; background: transparent; font-size: 14px; outline: none; }
.search-input-wrap button {
  background: #1F2937; color: #fff; border-radius: 20px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; border: none; cursor: pointer;
}
.search-results { display: flex; flex-direction: column; gap: 8px; }
.search-result-item {
  display: flex; gap: 10px; align-items: center;
  padding: 10px; background: var(--bg); border-radius: 12px; cursor: pointer;
  text-decoration: none; color: inherit;
}
.search-result-item img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #ddd; flex-shrink: 0; }
.search-result-item .sri-info strong { font-size: 13px; font-weight: 600; display: block; }
.search-result-item .sri-info span  { font-size: 11px; color: var(--muted); display: block; }

/* ─── Flash messages ─────────────────────────────────────────────────────────── */
.flash-container {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 1000;
  width: calc(100% - 32px);
  max-width: 400px;
}
.flash {
  padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; margin-bottom: 6px;
  animation: slideDown 0.3s ease; box-shadow: var(--shadow);
}
.flash.success { background: #0F1F17; color: #34D399; }
.flash.error   { background: #2A0F0F; color: #F87171; }
@keyframes slideDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

/* ─── Leaflet overrides ──────────────────────────────────────────────────────── */
.leaflet-container { font-family: var(--font); }
.fanpass-popup .leaflet-popup-content-wrapper {
  border-radius: 12px; box-shadow: var(--shadow); border: none;
}
.fanpass-popup .leaflet-popup-content { margin: 10px 14px; font-size: 13px; }

/* ─── Utilities ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.w-full { width: 100%; }
