:root {
  --navy: #242468;
  --navy-soft: #494970;
  --yellow: #fdc616;
  --cyan: #00a3cf;
  --red: #e0464b;
  --green: #1f9e63;
  --gray: #9a9ab3;
  --text: #6b6b8a;
  --surface: #f5f6fa;
  --white: #ffffff;
  --line: #e3e4ee;
  --r: 10px;
  --r-sm: 8px;
  --r-pill: 999px;
  --shadow: 0 4px 18px rgba(36, 36, 104, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Rubik", system-ui, sans-serif;
  color: var(--navy);
  background: var(--surface);
  font-size: 14px;
}
button, input { font: inherit; }

.layout { display: flex; height: 100vh; height: 100dvh; }
.lateral {
  width: 360px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--white); border-right: 1px solid var(--line); z-index: 2;
}
.mapa { flex: 1; min-width: 0; }

.cabecera { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); }
.cabecera h1 { margin: 0 0 2px; font-size: 18px; font-weight: 800; }
.cabecera p { margin: 0; color: var(--text); font-size: 13px; }

.buscador {
  width: 100%; margin-top: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  color: var(--navy); outline: none;
}
.buscador:focus { border-color: var(--cyan); background: var(--white); }

/* Filtro por zona */
.zonas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.zona-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 2px solid var(--line); background: var(--white); color: var(--navy);
  border-radius: var(--r-pill); padding: 4px 10px; font-size: 12.5px; font-weight: 600;
  transition: border-color .15s, background .15s;
}
.zona-chip span { font-size: 11px; font-weight: 700; color: var(--text); }
.zona-chip:hover { border-color: var(--navy); }
.zona-chip.on { background: var(--navy); border-color: var(--navy); color: var(--white); }
.zona-chip.on span { color: var(--yellow); }
.zona-titulo {
  padding: 14px 18px 4px; font-size: 11px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--cyan);
}

.lista { flex: 1; overflow-y: auto; margin: 0; padding: 6px 0; list-style: none; }
.item {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 18px;
  cursor: pointer; border-left: 3px solid transparent;
}
.item:hover, .item.sel { background: var(--surface); border-left-color: var(--yellow); }
.item .txt { flex: 1; min-width: 0; }
.item .nom { font-weight: 600; overflow-wrap: anywhere; }
.item .dir { color: var(--text); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.vacio { padding: 24px 18px; color: var(--text); text-align: center; }

/* Pin */
.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--navy); border: 3px solid var(--white); box-shadow: 0 2px 6px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
}
.pin::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); }
.pin.prendido { background: var(--green); }
.pin.apagado { background: var(--gray); }
.pin.fuera { background: var(--red); }
.pin.nuevo { outline: 3px solid var(--yellow); outline-offset: 1px; }

/* Burbuja de agrupación: roja con el número en blanco y el borde con volumen, como el pin */
.burbuja {
  width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #e2463c 0%, #e2463c 58%, #d63b32 74%, #b92d26 100%);
  box-shadow:
    inset 3px 4px 5px rgba(255, 170, 160, .55),   /* luz arriba a la izquierda, como el pin */
    inset -3px -4px 6px rgba(110, 18, 14, .45);   /* sombra abajo a la derecha */
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 700; font-size: 15px; line-height: 1;
  transition: transform .12s;
}
.burbuja:hover { transform: scale(1.08); }

.logo-pin { height: 28px; vertical-align: -6px; margin-right: 6px; }

/* Página pública: encabezado navy a lo ancho + mapa y lista debajo */
.pagina { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.pagina .layout { flex: 1; min-height: 0; height: auto; }
.encabezado {
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
  padding: 14px 24px;
}
.enc__marca { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.enc__logo { height: 30px; width: auto; display: block; }
.eyebrow {
  display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800;
  letter-spacing: .17em; text-transform: uppercase; line-height: 1; color: var(--yellow);
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; flex: none; }
/* Recordatorio: es una aclaración, va más chico que la marca para no competir */
.enc__aviso { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.enc__titulo { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--white); }
.enc__aviso li { display: flex; align-items: center; gap: 7px; font-size: 12px; color: #d6d6ea; }
.enc__aviso li b { color: var(--white); font-weight: 600; }
.enc__aviso .num {
  flex-shrink: 0; width: 17px; height: 17px; border-radius: 50%; background: var(--yellow);
  color: var(--navy); font-weight: 800; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}

@media (max-width: 760px) {
  .encabezado { padding: 10px 16px; gap: 8px 14px; }
  .enc__logo { height: 24px; }
  .enc__titulo { font-size: 11.5px; width: 100%; }
  .enc__aviso { gap: 5px 14px; }
  .enc__aviso li { font-size: 11.5px; }
  .enc__aviso .num { width: 16px; height: 16px; font-size: 9.5px; }
}

/* Popup */
.leaflet-popup-content-wrapper { border-radius: var(--r); box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 14px 16px; font-family: "Rubik", system-ui, sans-serif; }
.pop-nom { font-weight: 700; font-size: 15px; color: var(--navy); }
.pop-dir { color: var(--text); margin: 4px 0 10px; line-height: 1.35; }
.pop-indic {
  margin: -2px 0 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface);
  color: var(--navy-soft); font-size: 12.5px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere;
}
.btn-llegar {
  display: inline-block; padding: 7px 12px; border-radius: var(--r-pill);
  background: var(--yellow); color: var(--navy) !important; font-weight: 600;
  text-decoration: none; font-size: 13px;
}
.btn-llegar:hover { filter: brightness(.95); }

/* Botón para abrir la lista en el celular */
.btn-lista { display: none; }

@media (max-width: 760px) {
  .layout { flex-direction: column-reverse; }
  .lateral { width: 100%; height: 45%; border-right: 0; border-top: 1px solid var(--line); }
  .lateral.cerrada { height: auto; }
  .lateral.cerrada .lista, .lateral.cerrada .cabecera p { display: none; }
  .btn-lista {
    display: inline-block; float: right; border: 0; background: var(--surface);
    color: var(--navy); border-radius: var(--r-pill); padding: 4px 10px; cursor: pointer;
  }
}
