/* ============================================
   NAYMALL — app.css
   Hecho para Panama 🇵🇦
   ============================================ */

:root {
  --dark:    #0A1628;
  --blue:    #1E40AF;
  --accent:  #3B82F6;
  --light:   #DBEAFE;
  --green:   #10B981;
  --gold:    #F59E0B;
  --red:     #EF4444;
  --pink:    #FCE7F3;
  --pink-b:  #9D174D;
  --yellow:  #FEF3C7;
  --yellow-b:#92400E;
  --gray:    #F8F7F5;
  --gray2:   #E2E8F0;
  --text:    #1E293B;
  --muted:   #64748B;
  --white:   #FFFFFF;
  --radius:  12px;
  --radius-sm: 8px;
  --shadow:  0 2px 12px rgba(0,0,0,0.08);
  --nav-h:   64px;
  --top-h:   52px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray);
  color: var(--text);
  overflow: hidden;
}

/* ---- SPLASH ---- */
#splash {
  position: fixed; inset: 0;
  background: var(--dark);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; z-index: 9999;
  transition: opacity 0.5s;
}
#splash.fade-out { opacity: 0; pointer-events: none; }

.splash-logo {
  display: flex; align-items: center; gap: 10px;
}
.splash-icon { font-size: 40px; }
.splash-text {
  font-size: 36px; font-weight: 800; color: #fff;
  letter-spacing: -1px;
}
.splash-text span { color: #60A5FA; }
#splash p { font-size: 14px; color: rgba(255,255,255,0.5); }

/* ---- APP WRAPPER ---- */
#app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
}
#app.hidden { display: none; }

/* ---- TOPBAR ---- */
.topbar {
  height: var(--top-h);
  background: var(--dark);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 100;
}
.app-brand { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.topbar-right { display: flex; gap: 8px; }
.icon-btn {
  background: rgba(255,255,255,0.1);
  border: none; border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ---- SCREENS ---- */
.screen {
  display: none;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-h) + 8px);
}
.screen.active { display: block; }

/* ---- BOTTOM NAV ---- */
.bottom-nav {
  height: var(--nav-h);
  background: var(--white);
  border-top: 1px solid var(--gray2);
  display: flex;
  flex-shrink: 0;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  background: none; border: none;
  cursor: pointer; padding: 8px 0;
  transition: all 0.15s;
}
.nav-icon { font-size: 20px; }
.nav-label { font-size: 10px; font-weight: 600; color: var(--muted); }
.nav-item.active .nav-label { color: var(--accent); }
.nav-item.active .nav-icon { filter: saturate(2); }

/* ---- HERO ---- */
.hero {
  background: linear-gradient(160deg, var(--dark) 0%, #1E3A5F 100%);
  padding: 24px 20px 28px;
  text-align: center;
}
.hero-title { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.hero-sub { font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 18px; }

.btn-detect {
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-detect:active { transform: scale(0.97); }

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%; background: var(--green);
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); box-shadow:0 0 0 0 rgba(16,185,129,0.5); }
  50% { opacity:0.7; transform:scale(1.2); box-shadow:0 0 0 6px rgba(16,185,129,0); }
}

/* ---- SECTIONS ---- */
.section { padding: 14px 16px; }
.section-title {
  font-size: 11px; font-weight: 700;
  color: var(--muted); letter-spacing: 0.6px;
  text-transform: uppercase; margin-bottom: 10px;
}

/* ---- SEARCH ---- */
.search-bar {
  background: var(--white);
  border: 1px solid var(--gray2);
  border-radius: var(--radius);
  padding: 13px 16px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; box-shadow: var(--shadow);
}
.search-icon { font-size: 18px; }
.search-placeholder { font-size: 15px; color: var(--muted); }

.search-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--gray2);
  position: sticky; top: 0; z-index: 10;
}
.search-input {
  flex: 1; border: none; outline: none;
  font-size: 16px; color: var(--text);
  background: transparent;
}

/* ---- BACK BUTTON ---- */
.back-btn {
  width: 36px; height: 36px;
  background: var(--gray2);
  border: none; border-radius: 50%;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ---- MALL CARDS ---- */
.card-list { display: flex; flex-direction: column; gap: 10px; }

.mall-card {
  background: var(--white);
  border: 1px solid var(--gray2);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.mall-card:active { transform: scale(0.99); }
.mall-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.mall-card-info { flex: 1; min-width: 0; }
.mall-card-name { font-size: 15px; font-weight: 700; }
.mall-card-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mall-card-dist { font-size: 12px; font-weight: 700; color: var(--accent); }

/* ---- PROMO SCROLL ---- */
.promo-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.promo-scroll::-webkit-scrollbar { display: none; }
.promo-card-h {
  min-width: 220px;
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  border-radius: var(--radius);
  padding: 14px;
  color: #fff; flex-shrink: 0;
}
.promo-card-h.gold { background: linear-gradient(135deg, #B45309, #D97706); }
.promo-card-h.green { background: linear-gradient(135deg, #065F46, #059669); }
.promo-store { font-size: 11px; opacity: 0.8; margin-bottom: 3px; }
.promo-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.promo-val { font-size: 20px; font-weight: 800; color: #FCD34D; }
.promo-exp { font-size: 11px; opacity: 0.7; margin-top: 4px; }

/* ---- CATEGORY PILLS ---- */
.cat-pills {
  display: flex; gap: 8px; padding: 10px 16px;
  overflow-x: auto; flex-shrink: 0;
}
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  padding: 7px 14px;
  border-radius: 50px;
  font-size: 13px; font-weight: 600;
  white-space: nowrap; cursor: pointer;
  border: 1.5px solid var(--gray2);
  background: var(--white); color: var(--text);
  transition: all 0.15s;
}
.cat-pill.active {
  background: var(--dark); color: #fff; border-color: var(--dark);
}

/* ---- STORE RESULTS ---- */
.store-item {
  background: var(--white);
  border: 1px solid var(--gray2);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: transform 0.15s;
  margin-bottom: 8px;
}
.store-item:active { transform: scale(0.99); }
.store-logo {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  border: 1px solid var(--gray2);
  flex-shrink: 0; text-align: center;
}
.store-info { flex: 1; min-width: 0; }
.store-name { font-size: 15px; font-weight: 700; }
.store-loc { font-size: 12px; color: var(--muted); margin-top: 2px; }
.store-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.store-tag {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
}
.tag-promo { background: #FEF3C7; color: #92400E; }
.tag-premium { background: #DBEAFE; color: #1E40AF; }
.tag-kiosko { background: #EDE9FE; color: #5B21B6; }
.btn-nav-sm {
  background: #EFF6FF; color: var(--accent);
  border: none; border-radius: 8px;
  padding: 7px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}

/* ---- SPONSORED BANNER ---- */
.sponsored-banner {
  margin: 0 16px 10px;
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
}
.spon-thumb {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.spon-info { flex: 1; }
.spon-label { font-size: 10px; color: rgba(255,255,255,0.7); font-weight: 700; }
.spon-title { font-size: 14px; font-weight: 700; color: #fff; }
.spon-tag { font-size: 16px; font-weight: 800; color: #FCD34D; }

/* ---- MAP ---- */
.map-header {
  background: var(--dark);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.map-header .back-btn { background: rgba(255,255,255,0.15); color: #fff; }
.map-mall-name { font-size: 16px; font-weight: 800; color: #fff; }
.map-mall-sub { font-size: 12px; color: #93C5FD; display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 1.5s infinite; flex-shrink: 0; }

.floor-tabs {
  background: var(--dark);
  padding: 0 14px 10px;
  display: flex; gap: 6px;
  flex-shrink: 0;
}
.floor-tab {
  padding: 6px 14px; border-radius: 50px;
  font-size: 12px; font-weight: 700;
  border: none; cursor: pointer;
  transition: all 0.15s;
}
.floor-tab.active { background: var(--accent); color: #fff; }
.floor-tab.inactive { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.6); }
.floor-tab.luxury { background: rgba(244,114,182,0.2); color: #F9A8D4; }
.floor-tab.luxury.active { background: #BE185D; color: #fff; }

.map-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #F0EEE9;
}
#map-container {
  width: 100%;
  height: 100%;
  overflow: auto;
}
#map-container svg { display: block; }

.map-legend {
  position: absolute;
  bottom: 120px; right: 12px;
  background: rgba(255,255,255,0.95);
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid var(--gray2);
  z-index: 20;
  box-shadow: var(--shadow);
}
.legend-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.legend-row:last-child { margin-bottom: 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.legend-row span { font-size: 11px; color: var(--text); }

.nav-card {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray2);
  padding: 12px 16px;
  z-index: 20;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
}
.nav-card.hidden { display: none; }
.nav-card-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.nav-dest-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.nav-dest-info { flex: 1; }
.nav-dest-name { font-size: 15px; font-weight: 700; }
.nav-dest-floor { font-size: 12px; color: var(--muted); }
.nav-eta { font-size: 13px; font-weight: 700; color: var(--accent); }

/* ---- BUTTONS ---- */
.btn-primary {
  background: var(--dark);
  color: #60A5FA;
  border: none; border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:active { transform: scale(0.98); opacity: 0.9; }
.btn-secondary {
  background: var(--gray2);
  color: var(--text);
  border: none; border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-full { width: 100%; }

/* ---- PARKING ---- */
.parking-header {
  background: linear-gradient(135deg, var(--dark), #1E3A5F);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.parking-header .back-btn { background: rgba(255,255,255,0.15); color: #fff; }
.parking-title { font-size: 16px; font-weight: 800; color: #fff; }
.parking-sub { font-size: 12px; color: #93C5FD; margin-top: 2px; }

.pills-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.level-pill {
  padding: 9px 16px; border-radius: 50px;
  font-size: 13px; font-weight: 700;
  border: 1.5px solid var(--gray2);
  background: var(--white); color: var(--text);
  cursor: pointer; transition: all 0.15s;
}
.level-pill.selected { background: var(--blue); color: #fff; border-color: var(--blue); }

.zone-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.zone-card {
  background: var(--white);
  border: 1.5px solid var(--gray2);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center; cursor: pointer;
  transition: all 0.15s;
}
.zone-card.selected { background: #EFF6FF; border-color: var(--accent); }
.zone-icon { font-size: 20px; margin-bottom: 4px; }
.zone-label { font-size: 12px; font-weight: 700; }
.zone-code { font-size: 10px; color: var(--muted); margin-top: 1px; }

.spot-input {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--gray2);
  border-radius: var(--radius);
  font-size: 18px; font-weight: 700;
  text-align: center; letter-spacing: 3px;
  color: var(--text); background: var(--white);
}
.spot-input:focus { outline: none; border-color: var(--accent); }

.tip-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: #92400E;
}

.saved-card {
  background: #F0FDF4;
  border: 1.5px solid #BBF7D0;
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px;
  display: flex; align-items: center; gap: 14px;
}
.saved-card-icon { font-size: 36px; }
.saved-level { font-size: 16px; font-weight: 800; color: #065F46; }
.saved-zone { font-size: 14px; color: var(--green); margin-top: 2px; }
.saved-time { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---- MODAL ---- */
.modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: flex-end;
}
.modal.hidden { display: none; }
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
}
.modal-card {
  position: relative; z-index: 1;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-close {
  position: absolute; top: 14px; right: 16px;
  background: var(--gray2); border: none;
  border-radius: 50%; width: 30px; height: 30px;
  font-size: 14px; cursor: pointer;
}
.modal-store-hero {
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}
.modal-store-name { font-size: 22px; font-weight: 800; color: #fff; }
.modal-store-loc { font-size: 13px; color: rgba(255,255,255,0.8); margin-top: 3px; }
.modal-tags { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.modal-tag { font-size: 11px; padding: 3px 9px; border-radius: 20px; background: rgba(255,255,255,0.2); color: #fff; font-weight: 600; }

.modal-promo {
  background: var(--gray);
  border: 1px solid var(--gray2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.modal-promo-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.modal-promo-desc { font-size: 12px; color: var(--muted); }
.modal-promo-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.modal-promo-val { font-size: 16px; font-weight: 800; color: #7C3AED; }
.modal-promo-exp { font-size: 11px; color: var(--muted); }

.modal-action {
  margin-top: 14px;
  display: flex; gap: 10px;
}
.modal-action .btn-primary { flex: 1; }

/* ---- PARKING ROUTE VISUAL ---- */
.park-route-box {
  background: #1E293B;
  border-radius: var(--radius);
  padding: 16px;
  color: #fff;
}
.park-route-step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.park-route-step:last-child { border-bottom: none; }
.step-num {
  width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.step-text { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.9); padding-top: 3px; }

/* ---- UTILS ---- */
.hidden { display: none !important; }
.badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }

/* ---- RESPONSIVE ---- */
@media (min-width: 480px) {
  #app { max-width: 430px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,0.2); }
  body { background: #1a1a2e; }
}
