/* =============================================================
   Visor territorial — centros de donación de sangre.
   Se carga solo en la plantilla del visor (enqueue condicional).
   ========================================================== */

.visor { max-width: var(--container); margin: 0 auto; padding: 0 40px 90px; }
.visor__panel { display: flex; flex-direction: column; }

.visor__controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.visor__search, .visor__select {
  width: 100%; padding: 11px 14px;
  border: 1px solid rgba(26,10,7,0.14); border-radius: 12px;
  font-family: var(--sans); font-size: 15px; color: var(--ink); background: #fff;
}
.visor__search:focus, .visor__select:focus { outline: none; border-color: var(--fuech-red); }
.visor__near { width: 100%; text-align: center; }
.visor__near.is-active { background: var(--ink); box-shadow: none; }
.visor__notice {
  margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; line-height: 1.4;
  background: #FCEBEB; color: var(--fuech-red-deep); border: 1px solid #F09595;
}
.visor__notice.is-info { background: var(--warm-paper); color: var(--ink-soft); border-color: rgba(26,10,7,0.10); }

.visor__count { font-size: 14px; color: var(--ink-soft); margin: 0 0 8px; }
.visor__count strong { color: var(--ink); }

.visor__list { list-style: none; margin: 0; padding: 0; }
.visor__item { padding: 14px 0; border-bottom: 1px solid rgba(26,10,7,0.08); }
.visor__item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.visor__item-name { font-family: var(--sans); font-weight: 600; font-size: 15px; line-height: 1.25; margin: 0; }
.visor__item-addr { font-size: 13px; color: var(--ink-soft); margin: 3px 0 0; line-height: 1.35; }
.visor__item-tel { display: inline-block; font-size: 13px; color: var(--fuech-red); text-decoration: none; margin-top: 3px; }
.visor__item-tel + .visor__item-wa { margin-left: 12px; }
.visor__item-wa { display: inline-block; font-size: 13px; color: #128C7E; text-decoration: none; margin-top: 3px; }
.visor__item-horario { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 4px; line-height: 1.35; }
.visor__item-region { display: inline-block; font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--fuech-red); font-weight: 600; margin-top: 6px; }
.visor__dist { flex-shrink: 0; font-size: 12px; font-weight: 600; color: #fff; background: #1E6FE0; border-radius: 20px; padding: 2px 10px; white-space: nowrap; }
.visor__empty { padding: 30px 0; text-align: center; color: var(--ink-soft); font-size: 14px; }

.visor__source { font-size: 12px; color: var(--ink-soft); line-height: 1.5; margin: 18px 0 0; }
.visor__source a { color: var(--fuech-red); }
/* z-index:0 + position aísla los panes de Leaflet (z-index ~400-700) en su
   propio contexto de apilamiento, para que el header sticky (z-index 50) quede
   siempre por encima del mapa al hacer scroll. */
.visor__map { width: 100%; position: relative; z-index: 0; }

/* ── Vista mejorada (con JS): panel + mapa lado a lado ──────── */
.visor--map {
  display: grid; grid-template-columns: 360px minmax(0, 1fr); grid-template-rows: 640px;
  gap: 0; height: 640px;
  border: 1px solid rgba(26,10,7,0.12); border-radius: 18px; overflow: hidden; background: #fff;
}
.visor--map .visor__panel {
  height: 100%; min-width: 0; min-height: 0; overflow: hidden;
  padding: 0; border-right: 1px solid rgba(26,10,7,0.10);
}
.visor--map .visor__controls { padding: 20px 20px 0; margin-bottom: 14px; }
.visor--map .visor__count { padding: 0 20px; }
.visor--map .visor__list { flex: 1; min-height: 0; overflow-y: auto; }
.visor--map .visor__item { padding: 12px 20px; cursor: pointer; border-bottom: 1px solid rgba(26,10,7,0.07); transition: background .12s; }
.visor--map .visor__item:hover { background: var(--warm-paper); }
.visor--map .visor__item.is-active { background: #fff; border-left: 3px solid var(--fuech-red); padding-left: 17px; }
.visor--map .visor__source { padding: 12px 20px 16px; margin: 0; border-top: 1px solid rgba(26,10,7,0.10); }
.visor--map .visor__map { height: 100%; min-width: 0; min-height: 0; }

/* ── InfoWindow (Google Maps) ──────────────────────────────── */
.visor-pop { font-family: var(--sans); min-width: 200px; }
.visor-pop__name { font-family: var(--serif); font-weight: 500; font-size: 16px; line-height: 1.15; margin-bottom: 6px; color: var(--ink); }
.visor-pop__row { font-size: 13px; color: var(--ink-soft); margin-top: 4px; line-height: 1.3; }
.visor-pop__row a { color: var(--fuech-red); text-decoration: none; }
.visor-pop__row a:hover { text-decoration: underline; }
.visor-pop__horario { color: var(--ink); }
.visor-pop__region { font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; color: var(--fuech-red); font-weight: 600; margin-top: 7px; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 860px) {
  .visor { padding: 0 20px 70px; }
  .visor--map { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; height: auto; }
  .visor--map .visor__map { height: 58vh; min-height: 360px; order: -1; }
  .visor--map .visor__panel { height: auto; border-right: 0; }
  .visor--map .visor__list { max-height: 420px; }
}
