/* =========================================================
   GUÍA BURGERLAND · estilos
   Paleta: rojo profundo + mostaza + crema + carbón
   ========================================================= */

:root {
  --bg:            #0c0a09;
  --bg-2:          #161311;
  --ink:           #f5efe4;
  --ink-dim:       #cbb89a;
  --ink-mute:      #8b7f6c;

  --red:           #c01a1a;
  --red-deep:      #7a0d0d;
  --mustard:       #f2b431;
  --mustard-soft:  #e0a426;
  --cream:         #f3e9d2;
  --char:          #1a1715;

  --line:          rgba(245,239,228,0.10);

  --shadow-hard:   6px 6px 0 var(--char);
  --shadow-soft:   0 10px 30px rgba(0,0,0,0.45);

  --display: "Archivo Black", "Bebas Neue", system-ui, sans-serif;
  --display-2: "Bebas Neue", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --header-h: 72px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: var(--mustard); text-decoration: none; }
a:hover { color: var(--mustard-soft); text-decoration: underline; }

/* Grano sutil para evitar plano */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.9'/></svg>");
}

/* ====== TOPBAR ====== */
.topbar {
  position: sticky; top: 0; z-index: 600;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  padding: 0 20px;
  background: linear-gradient(180deg, #100d0b 0%, #0c0a09 100%);
  border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar__mark {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--red);
  display: grid; place-items: center;
  font-size: 22px;
  box-shadow: 0 0 0 3px var(--mustard), 0 0 0 5px var(--char);
}
.topbar__titles { min-width: 0; }
.topbar__title {
  margin: 0; line-height: .9;
  font-family: var(--display);
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: .5px;
  color: var(--cream);
  text-transform: uppercase;
}
.topbar__title::after {
  content: ""; display: inline-block; width: 10px; height: 10px;
  margin-left: 8px; background: var(--mustard); vertical-align: middle;
  transform: rotate(45deg);
}
.topbar__sub {
  margin: 4px 0 0; color: var(--ink-dim);
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
}

.topbar__nav { display: flex; gap: 8px; overflow-x: auto; }
.topbar__nav::-webkit-scrollbar { display: none; }

.chip {
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink-dim);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .3px;
  white-space: nowrap;
  transition: all .15s ease;
}
.chip:hover { color: var(--ink); border-color: var(--ink-mute); }
.chip--active {
  background: var(--mustard);
  color: var(--char);
  border-color: var(--mustard);
  box-shadow: 3px 3px 0 var(--red-deep);
}

/* ====== LAYOUT ====== */
.layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: calc(100vh - var(--header-h));
  min-height: 480px;
}

/* ====== MAPA ====== */
.map-wrap { position: relative; }
.map {
  width: 100%; height: 100%;
  background: #161311;
}
/* Filtro de mate sobre las tiles para acompasar la estética */
.map .leaflet-tile-pane {
  filter: saturate(.6) brightness(.55) contrast(1.05) hue-rotate(-8deg);
}
.leaflet-container { background: #161311; font-family: var(--body); }
.leaflet-control-attribution {
  background: rgba(12,10,9,0.7) !important;
  color: var(--ink-mute) !important;
}
.leaflet-control-attribution a { color: var(--ink-dim) !important; }
.leaflet-control-zoom a {
  background: var(--char) !important;
  color: var(--cream) !important;
  border-color: var(--line) !important;
}
.leaflet-control-zoom a:hover { background: var(--red-deep) !important; }

/* ====== MARCADORES ====== */
.bl-marker {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cream);
  border: 2.5px solid var(--char);
  box-shadow: 0 4px 10px rgba(0,0,0,0.45);
  overflow: visible;
  transition: transform .18s ease;
  cursor: pointer;
}
.bl-marker:hover { transform: scale(1.08); z-index: 500 !important; }
.bl-marker__img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}
.bl-marker__emoji {
  font-size: 60%; line-height: 1;
}
.bl-marker__pin {
  position: absolute; bottom: -6px; left: 50%;
  width: 10px; height: 10px;
  background: var(--char);
  transform: translateX(-50%) rotate(45deg);
}

/* Por rango */
.bl-marker--1 { width: 68px; height: 68px; border-color: var(--mustard); }
.bl-marker--1::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(242,180,49,.35), 0 0 28px 8px rgba(242,180,49,.55);
  animation: glowPulse 2.2s ease-in-out infinite;
  z-index: -1;
}
.bl-marker--2 { width: 58px; height: 58px; border-color: var(--mustard-soft); }
.bl-marker--2::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(242,180,49,.25), 0 0 16px 4px rgba(242,180,49,.35);
  animation: glowPulse 2.8s ease-in-out infinite;
  z-index: -1;
}
.bl-marker--3 { width: 48px; height: 48px; }
.bl-marker--4 { width: 40px; height: 40px; background: var(--red); border-color: var(--char); }
.bl-marker--4 .bl-marker__emoji { font-size: 22px; }
.bl-marker--5 { width: 32px; height: 32px; background: var(--red-deep); border-color: var(--char); }
.bl-marker--5 .bl-marker__emoji { font-size: 18px; }

@keyframes glowPulse {
  0%, 100% { opacity: .85; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.06); }
}

/* ====== LEYENDA ====== */
.legend {
  position: absolute; right: 14px; bottom: 14px;
  background: rgba(12,10,9,.86);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  z-index: 500;
  max-width: 220px;
}
.legend__title {
  margin: 0 0 6px;
  font-family: var(--display-2);
  letter-spacing: 2px;
  font-size: 13px;
  color: var(--mustard);
}
.legend__list { list-style: none; margin: 0; padding: 0; font-size: 12px; color: var(--ink-dim); }
.legend__list li { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.legend__dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--cream); border: 2px solid var(--char);
  display: grid; place-items: center; font-size: 9px;
  flex-shrink: 0;
}
.legend__dot--1 { box-shadow: 0 0 8px 2px rgba(242,180,49,.7); border-color: var(--mustard); }
.legend__dot--2 { box-shadow: 0 0 5px 1px rgba(242,180,49,.45); }
.legend__dot--3 { }
.legend__dot--4 { background: var(--red); }

/* ====== LOADER ====== */
.loader {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(12,10,9,.9);
  z-index: 700;
  transition: opacity .35s ease;
}
.loader.is-hidden { opacity: 0; pointer-events: none; }
.loader__inner { text-align: center; }
.loader__burger {
  font-size: 56px;
  display: inline-block;
  animation: bounce 1s ease-in-out infinite;
}
.loader__text {
  margin: 14px 0 0;
  font-family: var(--display-2); letter-spacing: 4px; font-size: 14px;
  color: var(--mustard); text-transform: uppercase;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px) rotate(-6deg); }
}

/* ====== SIDEBAR ====== */
.sidebar {
  background: var(--bg-2);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar__search {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.sidebar__search input {
  flex: 1;
  background: var(--char);
  border: 1.5px solid var(--line);
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.sidebar__search input:focus { border-color: var(--mustard); }
.sidebar__search input::placeholder { color: var(--ink-mute); }
.sidebar__count {
  font-family: var(--display-2); letter-spacing: 1.5px; font-size: 12px;
  color: var(--mustard); white-space: nowrap;
}

.list {
  list-style: none; margin: 0; padding: 8px;
  overflow-y: auto; flex: 1;
}
.list__item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center; gap: 12px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .14s;
  border: 1px solid transparent;
}
.list__item:hover { background: #1f1b18; border-color: var(--line); }
.list__item.is-active { background: #1f1b18; border-color: var(--mustard); }

.list__logo {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--char);
  object-fit: cover;
  flex-shrink: 0;
}
.list__body { min-width: 0; }
.list__name {
  margin: 0; font-family: var(--display);
  font-size: 15px; letter-spacing: .3px;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list__addr {
  margin: 2px 0 0; font-size: 12px; color: var(--ink-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.list__rango {
  font-family: var(--display-2); letter-spacing: 1px;
  font-size: 11px;
  background: var(--char); color: var(--mustard);
  padding: 4px 8px; border-radius: 4px;
}
.list__rango[data-r="1"] { background: var(--mustard); color: var(--char); }
.list__rango[data-r="2"] { background: var(--mustard-soft); color: var(--char); }

.list__empty {
  padding: 30px 20px; text-align: center; color: var(--ink-mute);
  font-size: 14px;
}

/* ====== DETALLE ====== */
.detail {
  position: fixed;
  right: 20px; bottom: 20px;
  width: 380px; max-width: calc(100vw - 40px);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
  z-index: 800;
  transform: translateY(20px); opacity: 0; pointer-events: none;
  transition: transform .25s ease, opacity .25s ease;
}
.detail.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.detail__close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px;
  background: transparent; border: 0;
  color: var(--ink-dim);
  font-size: 26px; line-height: 1;
}
.detail__close:hover { color: var(--mustard); }

.detail__head {
  display: flex; gap: 14px; align-items: center;
  margin-bottom: 12px;
}
.detail__logo-wrap {
  width: 70px; height: 70px;
  background: var(--cream);
  border: 3px solid var(--char);
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--mustard);
}
.detail__logo { width: 100%; height: 100%; object-fit: cover; }
.detail__name {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: .3px;
  color: var(--cream);
  text-transform: uppercase;
}
.detail__rango {
  margin: 4px 0 0;
  font-family: var(--display-2); letter-spacing: 2px;
  font-size: 11px; color: var(--mustard);
}

.detail__desc {
  margin: 0 0 14px;
  font-size: 14px; line-height: 1.5;
  color: var(--ink-dim);
}

.detail__data { margin: 0; }
.detail__row {
  display: grid; grid-template-columns: 100px 1fr;
  padding: 8px 0; gap: 10px;
  border-top: 1px dashed var(--line);
  font-size: 13.5px;
}
.detail__row dt {
  font-family: var(--display-2); letter-spacing: 1.5px;
  font-size: 11px; color: var(--ink-mute); text-transform: uppercase;
  padding-top: 2px;
}
.detail__row dd {
  margin: 0; color: var(--ink); word-break: break-word;
}

.detail__actions {
  margin-top: 14px;
  display: flex; gap: 8px;
}
.btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  border: 0;
}
.btn--primary {
  background: var(--mustard); color: var(--char);
  box-shadow: 3px 3px 0 var(--red-deep);
  transition: transform .12s ease;
}
.btn--primary:hover { transform: translate(-1px, -1px); text-decoration: none; box-shadow: 4px 4px 0 var(--red-deep); }

/* ====== FOOTER ====== */
.footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: #0a0807;
  text-align: center;
  font-size: 12px;
  color: var(--ink-mute);
}
.footer p { margin: 2px 0; }
.footer__small { font-size: 11px; }

/* ====== RESPONSIVE ====== */
@media (max-width: 880px) {
  :root { --header-h: 60px; }
  .topbar { padding: 0 12px; }
  .topbar__mark { width: 36px; height: 36px; font-size: 18px; }
  .topbar__title { font-size: 18px; }
  .topbar__sub { display: none; }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 60vh 1fr;
    height: auto;
    min-height: calc(100vh - var(--header-h));
  }
  .map-wrap { height: 60vh; }
  .sidebar { border-left: 0; border-top: 1px solid var(--line); }

  .detail {
    right: 10px; left: 10px; bottom: 10px;
    width: auto;
  }
  .legend { font-size: 11px; padding: 8px; }
}

@media (max-width: 480px) {
  .detail__row { grid-template-columns: 90px 1fr; }
  .detail__name { font-size: 18px; }
}
