/* ══════════════════════════════════════════════════════
   GelatoMaps — Premium Polish Layer v1.0
   Loaded LAST — overrides base styles for premium feel.
   Principle: less noise, more air, clearer hierarchy.
   ══════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS (refined) ── */
:root {
  --sh-subtle: 0 1px 3px rgba(11,31,56,.04), 0 1px 2px rgba(0,0,0,.03);
  --sh-card: 0 2px 8px rgba(11,31,56,.07), 0 1px 3px rgba(0,0,0,.04);
  --sh-elevated: 0 8px 24px rgba(11,31,56,.10), 0 2px 6px rgba(0,0,0,.04);
  --ease-out: cubic-bezier(.2, 0, .0, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ══════════════════════════════════
   A. HEADER — más aire, más premium
   ══════════════════════════════════ */

#hdr {
  height: 54px;
  padding: 0 18px;
  gap: 12px;
  background: linear-gradient(180deg, #0E1E33 0%, #0B1A2E 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.03), 0 2px 12px rgba(0,0,0,.3);
  border-bottom: 1px solid rgba(255,255,255,.04);
}

/* Logo más grande y legible */
.hdr-logo {
  height: 46px;
  width: 46px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

/* Brand: un toque más compacto */
.hdr-brand {
  font-size: 18px;
  letter-spacing: -.3px;
}

/* Info btn: más discreto */
.hdr-info-btn {
  padding: 4px 11px;
  font-size: 11px;
  border-radius: 16px;
  border-color: rgba(255,255,255,.08);
  color: rgba(255,255,255,.4);
  background: transparent;
}
.hdr-info-btn:hover {
  border-color: rgba(255,255,255,.18);
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.05);
}

/* Divider: más sutil */
.hdr-div {
  height: 20px;
  background: rgba(255,255,255,.08);
}

/* Search: más protagonismo, más ancho */
.hdr-srch {
  max-width: 320px;
}
.hdr-srch input {
  padding: 7px 12px 7px 36px;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.06);
  letter-spacing: .01em;
}
.hdr-srch input::placeholder {
  color: rgba(255,255,255,.25);
  font-weight: 400;
}
.hdr-srch input:focus {
  background: var(--color-border-md);
  border-color: var(--color-accent-a40);
  box-shadow: 0 0 0 3px var(--color-accent-a08);
}

/* Geo button: refinado */
.geo-btn {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  gap: 6px;
  border-width: 1.5px;
  transition: all .2s var(--ease-out);
}
.geo-btn:not(.active) {
  border-color: var(--color-accent-a30);
  background: var(--color-accent-a08);
  color: var(--color-accent-a85);
}
.geo-btn:not(.active):hover {
  background: var(--color-accent-a15);
  border-color: var(--color-accent-a50);
  color: var(--teal);
}

/* Sabores button: más integrado con el resto */
.sabor-map-btn {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.55);
  transition: all .2s var(--ease-out);
}
.sabor-map-btn:hover {
  border-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.08);
}

/* Pills: menos peso, más coherentes */
.hdr-pills {
  gap: 3px;
}
.hdr-pill {
  padding: 5px 12px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 500;
  border-color: rgba(255,255,255,.08);
  color: rgba(255,255,255,.45);
  background: transparent;
  gap: 5px;
  letter-spacing: .01em;
}
.hdr-pill img {
  height: 24px;
  opacity: .7;
  transition: transform .25s var(--ease-spring), opacity .2s, filter .2s;
}
.hdr-pill:hover {
  border-color: rgba(255,255,255,.15);
  color: rgba(255,255,255,.75);
  background: rgba(255,255,255,.05);
  transform: none; /* remove bouncy hover — more mature */
}
.hdr-pill:hover img {
  transform: scale(1.3);
  opacity: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}
.hdr-pill.on {
  background: var(--color-accent-a20);
  border-color: var(--color-accent-a40);
  color: var(--color-white);
  box-shadow: none;
  font-weight: 600;
}
.hdr-pill.on img {
  opacity: 1;
}

/* Count: más sutil */
.hdr-count {
  font-size: 11px;
  color: rgba(255,255,255,.28);
  letter-spacing: .03em;
}
.hdr-count strong {
  color: rgba(13,148,136,.7);
  font-weight: 600;
}

/* Login btn: más sofisticado */
.hdr-login-btn {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 1px 4px var(--color-accent-a20);
  letter-spacing: .02em;
}

/* Admin btn removed from header */


/* ══════════════════════════════════════
   B. DISCOVERY BANNER — más editorial
   ══════════════════════════════════════ */

#discoveryBanner {
  background: linear-gradient(180deg,
    rgba(255,255,255,.88) 0%,
    rgba(255,255,255,.4) 70%,
    transparent 100%);
  transition: all .45s var(--ease-out);
}

.disco-scroll {
  gap: 8px;
  padding: 14px 12px 28px 12px;
}

/* Tarjetas: más limpias */
.disco-card {
  flex: 0 0 172px;
  border-radius: 10px;
  box-shadow: var(--sh-card);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}

/* Hover MUCHO menos agresivo */
.disco-card:hover {
  transform: scale(1.06) translateY(-3px);
  box-shadow: var(--sh-elevated);
  z-index: 10;
}
.disco-card:active {
  transform: scale(.98);
}

/* Imagen con un poquito más de aire */
.disco-img-wrap {
  height: 78px;
  background: #f0ede8;
}

/* Category label: más sutil */
.disco-category-label {
  padding: 2.5px 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .6px;
  opacity: .85;
}

/* Badge: más refinado */
.disco-badge {
  top: 5px;
  left: 5px;
  padding: 1.5px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  border-radius: 12px;
}

/* Body de la tarjeta */
.disco-body {
  padding: 5px 9px 7px;
}
.disco-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -.01em;
}
.disco-meta {
  font-size: 10px;
  gap: 3px;
}
.disco-meta .rating {
  font-weight: 600;
}
.disco-loc {
  font-size: 11px;
  color: var(--mid);
  margin-top: 1px;
}

/* Hover overlay: más sutil */
.disco-hover-overlay {
  background: linear-gradient(180deg, rgba(11,31,56,.82) 0%, rgba(11,31,56,.92) 100%);
  padding: 8px 10px;
  gap: 3px;
  transition: opacity .2s var(--ease-out);
}

/* Transiciones internas para compactación suave */
.disco-img-wrap {
  transition: height .4s var(--ease-out);
}
.disco-body {
  transition: padding .3s var(--ease-out);
}
.disco-name, .disco-meta, .disco-loc {
  transition: font-size .3s var(--ease-out), opacity .3s;
}
.disco-category-label, .disco-badge, .disco-bolas {
  transition: opacity .25s var(--ease-out), max-height .3s;
}

/* ── MODO COMPACTO: "Cerca de ti" activo ── */
#discoveryBanner.compact .disco-scroll {
  padding: 6px 12px 10px 12px;
  gap: 6px;
  transition: padding .4s var(--ease-out);
}
#discoveryBanner.compact .disco-card {
  flex: 0 0 140px;
  border-radius: 8px;
  transition: flex-basis .4s var(--ease-out), border-radius .3s;
}
#discoveryBanner.compact .disco-img-wrap {
  height: 50px;
  transition: height .4s var(--ease-out);
}
#discoveryBanner.compact .disco-category-label {
  display: none;
}
#discoveryBanner.compact .disco-badge {
  display: none;
}
#discoveryBanner.compact .disco-bolas {
  display: none;
}
#discoveryBanner.compact .disco-body {
  padding: 3px 7px 5px;
}
#discoveryBanner.compact .disco-name {
  font-size: 11px;
}
#discoveryBanner.compact .disco-meta {
  font-size: 11px;
}
#discoveryBanner.compact .disco-loc {
  display: none;
}
#discoveryBanner.compact .disco-hover-overlay {
  display: none;
}
/* Fondo más transparente en modo compacto */
#discoveryBanner.compact {
  background: linear-gradient(180deg,
    rgba(255,255,255,.7) 0%,
    rgba(255,255,255,.15) 60%,
    transparent 100%);
}


/* ══════════════════════════════════════════
   C. SIDEBAR — más respirable, más premium
   ══════════════════════════════════════════ */

#sidebar {
  width: 264px;
  border-right: 1px solid rgba(0,0,0,.04);
}

/* Secciones: más padding */
.sb-sec {
  padding: 15px 16px;
  border-bottom: 1px solid rgba(0,0,0,.05);
}

/* Labels: ligeramente menos gritones */
.sb-lbl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  color: rgba(156,163,175,.8);
  margin-bottom: 10px;
}

/* ── Bolas Hero: menos pesado, más elegante ── */
.bolas-hero {
  background: linear-gradient(145deg, #0C1F37 0%, #132B4A 60%, #15304F 100%);
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--color-accent-a30);
}
.bolas-hero-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(255,255,255,.9);
}
.bolas-hero-title::before {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 8px var(--color-accent-a40);
}
.bolas-hero-sub {
  font-size: 11px;
  color: var(--color-text-on-dark-low);
  margin-top: 2px;
  letter-spacing: .02em;
}

/* Bolas buttons: más refinados */
.bolas-list .tbtn {
  padding: 9px 11px;
  border-radius: 9px;
  gap: 10px;
  border-color: var(--color-border);
  background: rgba(255,255,255,.04);
}
.bolas-list .tbtn:hover {
  background: var(--color-border);
  border-color: var(--color-border-md);
  transform: translateX(2px);
}
.bolas-list .tbtn:hover img {
  transform: scale(1.25) !important;
  filter: drop-shadow(0 2px 5px rgba(255,255,255,.2));
}
.bolas-list .tbtn.on {
  background: var(--color-accent-a18);
  border-color: var(--color-accent-a40);
  box-shadow: 0 1px 6px var(--color-accent-a20);
}
.bolas-list .tcnt {
  font-size: 11px;
  font-weight: 500;
}

/* ── Stats: más respiración ── */
.stats {
  gap: 6px;
}
.stat {
  border-radius: 10px;
  padding: 10px 6px;
  background: var(--smoke);
}
.stat-v {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.stat-v[style*="color:#0D9488"],
.stat-v[style*="teal"] {
  color: var(--teal) !important;
}
.stat-l {
  font-size: 10px;
  color: var(--mid);
  margin-top: 4px;
  letter-spacing: .02em;
}

/* ── Rankings: más limpio ── */
.rank-sec {
  padding: 15px 16px;
  background: linear-gradient(180deg, #FFFCF0 0%, #FFF9E6 100%);
  border-bottom: 1px solid rgba(0,0,0,.05);
}
.rank-title {
  font-size: 11px;
  letter-spacing: .16em;
  margin-bottom: 10px;
}
.rank-tabs {
  margin-bottom: 10px;
  border-color: rgba(253,230,138,.6);
  border-radius: 10px;
}
.rank-tab {
  padding: 5px;
  font-size: 10px;
  border-radius: 9px;
}
.rank-tab.active {
  background: #7C3A0E;
}
.rank-item {
  padding: 5px 0;
  font-size: 12px;
  gap: 6px;
}
.rank-pos {
  font-weight: 800;
  font-size: 11px;
  min-width: 16px;
}
.rank-name {
  font-weight: 500;
  font-size: 12px;
}
.rank-val {
  font-size: 11px;
}

/* Tag buttons: mejor proporcionados */
.tbtn {
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 12px;
  border-width: 1px;
  border-color: rgba(0,0,0,.07);
}
.tbtn:hover {
  background: rgba(0,0,0,.02);
  transform: translateX(1px);
}
.tbtn.on {
  background: var(--color-accent-a08);
  border-color: var(--color-accent-a20);
  color: var(--teal);
}

/* Select */
.sel {
  padding: 8px 11px;
  border-radius: 10px;
  border-width: 1px;
  border-color: rgba(0,0,0,.08);
  font-size: 13px;
}

/* Sliders */
.sl-lbl { font-size: 12px; }
.sl-val { font-size: 13px; }

/* Toggle rows */
.tog-lbl { font-size: 12px; }

/* Reset button */
.btn-rst {
  padding: 8px;
  border-radius: 10px;
  font-size: 12px;
  border-width: 1px;
  border-color: rgba(0,0,0,.06);
  color: var(--mid);
}
.btn-rst:hover {
  border-color: rgba(0,0,0,.12);
  color: var(--navy);
  background: var(--smoke);
}


/* ══════════════════════════════════════════
   D. MAPA & OVERLAYS — más respiro
   ══════════════════════════════════════════ */

/* Clusters: más refinados */
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  font-weight: 700;
  font-size: 12px;
}

/* Leaflet popups: más limpios */
.leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: var(--sh-elevated) !important;
}



/* ══════════════════════════════════════════
   F. BARRA INFERIOR SABORES — más integrada
   ══════════════════════════════════════════ */

.sabores-ticker {
  background: linear-gradient(0deg,
    rgba(255,255,255,.85) 0%,
    rgba(255,255,255,.6) 60%,
    transparent 100%) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-top: none !important;
  padding: 4px 0 6px !important;
}

.sabor-chip {
  background: rgba(255,255,255,.75) !important;
  border: 1px solid rgba(0,0,0,.06) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.04) !important;
  padding: 4px 12px !important;
  border-radius: 16px !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  gap: 5px !important;
  color: var(--navy) !important;
  transition: all .15s var(--ease-out) !important;
}
.sabor-chip:hover {
  background: rgba(255,255,255,.95) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.08) !important;
  border-color: var(--color-accent-a20) !important;
}

.sabor-chip-dot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}

.sabor-chip-votes {
  font-size: 11px !important;
  color: var(--mid) !important;
  font-weight: 500 !important;
}

.sabor-chip-icon {
  font-size: 12px !important;
}


/* ══════════════════════════════════════════════════
   G. CURIOSITY TABS — más discretos
   ══════════════════════════════════════════════════ */

.curiosity-handle {
  background: linear-gradient(180deg, rgba(30,41,59,.85) 0%, rgba(51,65,85,.85) 100%);
  padding: 10px 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
  border-radius: 0 8px 8px 0;
  opacity: .6;
  transition: opacity .2s, padding .2s;
}
.curiosity-tab.right .curiosity-handle {
  border-radius: 8px 0 0 8px;
}
.curiosity-handle:hover {
  opacity: 1;
  padding: 10px 7px;
}

.curiosity-panel {
  border-radius: 12px;
  box-shadow: var(--sh-elevated);
}


/* ══════════════════════════════════════════════════
   H. CTA BOTTOM BANNER — más limpio
   ══════════════════════════════════════════════════ */

.cta-card {
  border-radius: 16px 16px 0 0;
}

.cta-peek {
  height: 40px;
}
.cta-peek-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  opacity: .7;
}

/* Glow line: más sutil */
.cta-card::before,
.cta-peek::before {
  height: 2px !important;
  opacity: .5 !important;
}


/* ══════════════════════════════════════════════
   I. CONSISTENCIA GLOBAL
   ══════════════════════════════════════════════ */

/* Scrollbar unificada */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,.18);
}

/* Tipografía global: ligeramente más relajada */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Transiciones consistentes */
a, button, input, select {
  transition: all .15s var(--ease-out);
}

/* Focus states consistentes */
*:focus-visible {
  outline: 2px solid var(--color-accent-a40);
  outline-offset: 2px;
}


/* ══════════════════════════════════════════════
   J. NEARBY PANEL refinado
   ══════════════════════════════════════════════ */

.nearby-panel {
  border-radius: 14px;
  box-shadow: var(--sh-elevated);
  border: 1px solid rgba(0,0,0,.04);
}
.nearby-hdr {
  border-radius: 14px 14px 0 0;
  padding: 14px 18px;
}
.nearby-hdr h3 {
  font-size: 15px;
  font-weight: 700;
}
.nearby-item {
  padding: 12px 18px;
  border-bottom-color: rgba(0,0,0,.04);
}
.nearby-item:hover {
  background: rgba(0,0,0,.02);
}


/* ══════════════════════════════════════════════════
   K. RESPONSIVE REFINEMENTS
   ══════════════════════════════════════════════════ */

@media (max-width: 900px) {
  #hdr {
    height: 50px;
    padding: 0 12px;
    gap: 8px;
  }
  .hdr-brand {
    font-size: 16px;
  }
  .hdr-info-btn {
    display: none;
  }
  .hdr-div {
    display: none;
  }
}

@media (max-width: 640px) {
  .disco-card {
    flex: 0 0 150px;
  }
  .disco-img-wrap {
    height: 65px;
  }
  #discoveryBanner.compact .disco-card {
    flex: 0 0 120px;
  }
  #discoveryBanner.compact .disco-img-wrap {
    height: 40px;
  }
}
