/* mapa.css — Observatorio de Lucha Social
 * Estilos específicos del mapa interactivo
 * Ruta: mapa/assets/css/mapa.css
 * Consume tokens de main.css via var() — sin valores hardcodeados
 */

/* ─── Scrollbars personalizados ─────────────────────────────────────────── */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(205, 121, 11, 0.4) transparent;
}

/* Chrome / Edge / Safari */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(205, 121, 11, 0.4);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(205, 121, 11, 0.75);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ─── Header (§44) ───────────────────────────────────────────────────────── */

#header {
  display: flex;
  align-items: center;
  height: 52px;
  background-color: var(--dark-surface);
  border-bottom: 2px solid var(--rojo);
  padding: 0 var(--space-4);
  position: sticky;
  top: 0;
  z-index: var(--z-modal);
  flex-shrink: 0;
  overflow: visible;
}

.header-logo {
  display: flex;
  align-items: center;
}

.header-logo-img {
  height: 108px;
  width: auto;
  mix-blend-mode: screen;
}

.header-sep {
  width: 1px;
  height: 28px;
  background-color: rgba(242, 240, 236, 0.15);
  margin: 0 var(--space-4);
  flex-shrink: 0;
}

/* Toggle vista (Pines / Calor / Cronología) */
.header-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
}

/* Toggle Mapa / Grafo */
.header-toggle-map {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.toggle-tab {
  font-family: 'Aileron', 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius);
  background: transparent;
  color: rgba(242, 240, 236, 0.55);
  transition: color 0.15s, background-color 0.15s;
  height: 32px;
}

.toggle-tab:hover {
  color: rgba(242, 240, 236, 1);
}

.toggle-tab:focus {
  outline: 2px solid var(--amarillo);
  outline-offset: 2px;
}

.toggle-tab.active {
  background-color: var(--rojo);
  color: var(--crema);
}

.toggle-tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Buscador */
.header-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: var(--space-4);
  position: relative;
  z-index: var(--z-modal);
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrapper .search-icon {
  position: absolute;
  left: var(--space-2);
  color: var(--gris-sutil);
  pointer-events: none;
  font-size: var(--text-sm);
  transition: color 0.15s;
}

#search-input {
  background: var(--dark-bg);
  border: 1px solid var(--gris-sutil);
  border-radius: var(--radius);
  width: 220px;
  height: 32px;
  padding: 0 var(--space-3) 0 var(--space-7);
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-sm);
  color: var(--dark-text);
}

#search-input::placeholder {
  color: rgba(242, 240, 236, 0.35);
}

#search-input:focus {
  outline: none;
  border-color: var(--amarillo);
}

#search-input:focus + .search-icon,
.search-wrapper:focus-within .search-icon {
  color: var(--amarillo);
}

#search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--dark-surface);
  border: 1px solid var(--gris-sutil);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: var(--z-modal);
  max-height: 240px;
  overflow-y: auto;
}

/* ─── Sidebar de filtros ─────────────────────────────────────────────────── */

#sidebar {
  width: var(--sidebar-w);
  background-color: var(--dark-surface);
  border-right: 1px solid rgba(242, 240, 236, 0.1);
  overflow-y: auto;
  flex-shrink: 0;
  padding: var(--space-4);
  z-index: var(--z-base);
  transition: width 0.25s ease, padding 0.25s ease;
}

#sidebar.collapsed {
  width: 0;
  padding: 0;
  overflow: hidden;
  border-right: none;
}

#sidebar-toggle {
  flex-shrink: 0;
  align-self: center;
  width: 20px;
  height: 48px;
  background: var(--dark-surface);
  border: 1px solid rgba(242, 240, 236, 0.1);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--gris-sutil);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 450;
}

#sidebar-toggle:hover {
  color: var(--crema);
  background: var(--dark-bg);
}

.filter-section {
  margin-bottom: var(--space-6);
}

.filter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amarillo);
  margin-bottom: var(--space-2);
  display: block;
}

.filter-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--gris-sutil);
  color: var(--gris-sutil);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  cursor: default;
  vertical-align: middle;
  margin-left: var(--space-1);
}

#filter-tooltip {
  position: fixed;
  width: 220px;
  background: #1a1a1a;
  border: 1px solid var(--rojo);
  color: var(--crema);
  font-family: 'Aileron', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.6;
  white-space: pre-line;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  pointer-events: none;
  z-index: var(--z-tooltip);
  display: none;
}

/* ─── Panel lateral del evento ───────────────────────────────────────────── */

#event-panel {
  width: 320px;
  background-color: var(--dark-surface);
  border-left: 1px solid rgba(242, 240, 236, 0.1);
  overflow-y: auto;
  flex-shrink: 0;
  padding: var(--space-6);
  display: none;
  z-index: var(--z-base);
}

#event-panel.open {
  display: block;
}

.panel-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  color: var(--gris-sutil);
  font-size: var(--text-md);
  background: none;
  border: none;
}

.panel-close:hover {
  color: var(--crema);
}

/* ─── Pines del mapa (DivIcon) ───────────────────────────────────────────── */

.map-pin {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(242, 240, 236, 0.6);
  cursor: pointer;
  transition: transform 0.15s;
}

.map-pin:hover {
  transform: scale(1.33);
}

.map-pin.selected {
  transform: scale(1.5);
  border-color: var(--amarillo);
  border-width: 3px;
  box-shadow: 0 0 0 3px rgba(205, 121, 11, 0.35), 0 0 12px rgba(205, 121, 11, 0.4);
}

.map-pin.dimmed {
  opacity: 0.3;
}

/* Tooltip del pin */
.leaflet-tooltip.pin-tooltip {
  background: #1f1f1f;
  border: 1px solid var(--rojo);
  border-radius: 0;
  color: var(--crema);
  font-family: 'Aileron', sans-serif;
  font-weight: 700;
  font-size: 12px;
  padding: var(--space-1) var(--space-2);
  white-space: nowrap;
}

.leaflet-tooltip.pin-tooltip::before {
  border-top-color: var(--rojo);
}

/* ─── GeoJSON — polígonos de estados ─────────────────────────────────────── */

.estado-layer {
  cursor: pointer;
  transition: fill 0.15s;
}

/* ─── Controles del sidebar ──────────────────────────────────────────────── */

.filter-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--gris-sutil);
  margin-bottom: var(--space-4);
}

.btn-limpiar {
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amarillo);
  background: transparent;
  border: 1px solid var(--amarillo);
  border-radius: var(--radius);
  padding: var(--space-1) var(--space-3);
  width: 100%;
  margin-bottom: var(--space-6);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-limpiar:hover {
  background: var(--amarillo);
  color: var(--dark-bg);
}

.filter-check-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 160px;
  overflow-y: auto;
}

.filter-check-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-sm);
  color: var(--dark-text);
  cursor: pointer;
}

.filter-check-label input[type="checkbox"] {
  accent-color: var(--amarillo);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.filter-count {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  color: var(--gris-sutil);
}

/* Input de entidad */
.filter-input {
  width: 100%;
  background: var(--dark-bg);
  border: 1px solid rgba(242,240,236,0.2);
  border-radius: var(--radius);
  color: var(--dark-text);
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  box-sizing: border-box;
}

.filter-input:focus {
  outline: none;
  border-color: var(--amarillo);
}

/* Sugerencias de entidad */
.filter-suggestions {
  background: var(--dark-surface);
  border: 1px solid rgba(242,240,236,0.15);
  border-radius: var(--radius);
  max-height: 160px;
  overflow-y: auto;
  margin-top: 2px;
}

.suggestion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-sm);
  color: var(--dark-text);
  cursor: pointer;
  border-bottom: 1px solid rgba(242,240,236,0.06);
}

.suggestion-item:hover {
  background: rgba(205,121,11,0.12);
}

.suggestion-tipo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--gris-sutil);
  text-transform: uppercase;
}

/* Chips de entidad */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: rgba(205,121,11,0.18);
  border: 1px solid var(--amarillo);
  border-radius: var(--radius);
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-xs);
  color: var(--amarillo);
  padding: 2px var(--space-2);
}

.chip-remove {
  background: none;
  border: none;
  color: var(--amarillo);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
}

.chip-remove:hover { opacity: 1; }

/* Select de proceso */
.filter-select {
  width: 100%;
  background: var(--dark-bg);
  border: 1px solid rgba(242,240,236,0.2);
  border-radius: var(--radius);
  color: var(--dark-text);
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  box-sizing: border-box;
  cursor: pointer;
}

.filter-select:focus { outline: none; border-color: var(--amarillo); }

/* Radios de estado */
.filter-radio-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.filter-radio-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-sm);
  color: var(--dark-text);
  cursor: pointer;
}

.filter-radio-label input[type="radio"] {
  accent-color: var(--amarillo);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ─── Slider temporal ────────────────────────────────────────────────────── */

#map-slider {
  position: absolute;
  bottom: 36px;
  left: var(--space-4);
  width: 260px;
  background: rgba(8, 39, 59, 0.92);
  border: 1px solid rgba(242, 240, 236, 0.15);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 450;
  pointer-events: all;
}

.map-slider-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--amarillo);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--gris-sutil);
}

.slider-track-wrap {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
}

.slider-thumb {
  position: absolute;
  width: 100%;
  height: 4px;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.slider-thumb::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--amarillo);
  border: 2px solid var(--dark-bg);
  cursor: pointer;
  pointer-events: all;
}

.slider-thumb::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--amarillo);
  border: 2px solid var(--dark-bg);
  cursor: pointer;
  pointer-events: all;
}

.slider-range-fill {
  position: absolute;
  height: 4px;
  background: var(--amarillo);
  border-radius: 2px;
  pointer-events: none;
}

/* Track base */
.slider-track-wrap::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 4px;
  background: rgba(242,240,236,0.15);
  border-radius: 2px;
}

/* ─── Dropdown del buscador ──────────────────────────────────────────────── */

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  border-bottom: 1px solid rgba(242, 240, 236, 0.08);
}

.search-result-item:hover {
  background: rgba(242, 240, 236, 0.06);
}

.search-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.search-nombre {
  font-family: 'Aileron', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--dark-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-match {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--amarillo);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Panel lateral — estilos completos ──────────────────────────────────── */

#event-panel {
  position: relative;
}

.panel-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-3) var(--space-3) var(--space-3) 0;
  margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-6)) var(--space-4);
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.panel-header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  flex: 1;
}

.panel-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px var(--space-2);
  border-radius: var(--radius);
  color: var(--dark-bg);
  display: inline-block;
}

.panel-badge-estado {
  background: rgba(242, 240, 236, 0.2);
  color: var(--dark-text);
}

.panel-title {
  font-family: 'Aileron', sans-serif;
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--dark-text);
  margin-bottom: var(--space-4);
  line-height: 1.3;
}

.panel-section {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid rgba(242, 240, 236, 0.08);
}

.panel-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.panel-section-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amarillo);
  margin-bottom: var(--space-3);
}

.panel-meta {
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-sm);
  color: var(--gris-sutil);
  margin-bottom: var(--space-2);
}

.panel-desc {
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-sm);
  color: var(--dark-text);
  line-height: 1.5;
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.panel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.panel-chip {
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-xs);
  padding: 2px var(--space-2);
  border-radius: var(--radius);
  background: rgba(205, 121, 11, 0.15);
  border: 1px solid rgba(205, 121, 11, 0.4);
  color: var(--dark-text);
}

.panel-chip-entidad {
  background: rgba(242, 240, 236, 0.07);
  border-color: rgba(242, 240, 236, 0.2);
}

.panel-proceso-nombre {
  font-family: 'Aileron', sans-serif;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--dark-text);
  margin-bottom: var(--space-2);
}

.panel-fuentes-scroll {
  max-height: 220px;
  overflow-y: auto;
}

.panel-fuente-grupo {
  margin-bottom: var(--space-4);
}

.panel-fuente-tipo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gris-sutil);
  margin-bottom: var(--space-2);
}

.panel-fuente-link {
  display: block;
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-sm);
  color: var(--dark-text);
  text-decoration: none;
  padding: var(--space-1) 0;
  border-bottom: 1px solid rgba(242, 240, 236, 0.05);
  line-height: 1.4;
}

.panel-fuente-link:hover {
  color: var(--amarillo);
}

.panel-fuente-fecha {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--gris-sutil);
  margin-right: var(--space-2);
}

.panel-related-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid rgba(242, 240, 236, 0.08);
  margin-bottom: var(--space-2);
  transition: background 0.15s;
}

.panel-related-card:hover {
  background: rgba(242, 240, 236, 0.05);
}

.panel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.panel-related-nombre {
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-sm);
  color: var(--dark-text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-related-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--gris-sutil);
  flex-shrink: 0;
}

.panel-proceso-badge {
  font-size: 12px;
  color: var(--amarillo);
  flex-shrink: 0;
}

/* Skeleton de carga */
.skeleton {
  background: rgba(242, 240, 236, 0.07);
  border-radius: var(--radius);
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
  0%   { opacity: 0.5; }
  50%  { opacity: 1; }
  100% { opacity: 0.5; }
}

.skeleton-title {
  height: 20px;
  width: 80%;
  margin-bottom: var(--space-4);
}

.skeleton-line {
  height: 14px;
  width: 100%;
  margin-bottom: var(--space-3);
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-block {
  height: 60px;
  width: 100%;
  margin-bottom: var(--space-3);
}

/* ─── Loading overlay y toast ────────────────────────────────────────────── */

#map-loading {
  position: absolute;
  inset: 0;
  background: rgba(13,13,13,0.45);
  z-index: 800;
  display: none;
  align-items: center;
  justify-content: center;
}

#map-loading.visible {
  display: flex;
}

#map-loading::after {
  content: '';
  width: 32px;
  height: 32px;
  border: 3px solid rgba(205,121,11,0.3);
  border-top-color: var(--amarillo);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

#map-toast {
  position: absolute;
  bottom: var(--space-6);
  left: var(--space-6);
  background: var(--dark-surface);
  border: 1px solid var(--rojo);
  color: var(--dark-text);
  font-family: 'Aileron', sans-serif;
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  z-index: 900;
}


/* Tooltip de polígono de estado */
.leaflet-tooltip.estado-tooltip {
  background: rgba(8, 39, 59, 0.9);
  border: 1px solid rgba(242, 240, 236, 0.2);
  border-radius: 0;
  color: var(--crema);
  font-family: 'Aileron', sans-serif;
  font-weight: 600;
  font-size: 12px;
  padding: var(--space-1) var(--space-2);
  white-space: nowrap;
  box-shadow: none;
}


/* ─── Barra de búsqueda mobile (oculta en desktop) ──────────────────────── */

#mobile-search-bar {
  display: none;
}

/* ─── Bottom sheet mobile ────────────────────────────────────────────────── */

#filter-fab {
  display: none;
}

#filter-sheet-overlay {
  display: none;
}

#filter-sheet {
  display: none;
}

/* ─── Mobile ≤768px ──────────────────────────────────────────────────────── */

@media (max-width: 768px) {

  /* ── Header compacto: logo | sep | Pines/Calor | sep | Mapa/Grafo ── */
  #header {
    padding: 0 var(--space-3);
    gap: 0;
    height: 44px;
  }

  .header-logo-img {
    height: 56px;
  }

  .header-sep {
    margin: 0 var(--space-2);
  }

  /* Ocultar buscador del header en mobile */
  .header-search {
    display: none;
  }

  /* Comprimir los toggles */
  .toggle-tab {
    font-size: 11px;
    padding: var(--space-1) var(--space-2);
    height: 28px;
  }

  /* ── Barra de búsqueda: segunda fila bajo el header ── */
  #mobile-search-bar {
    display: block;
    background: var(--dark-bg);
    border-bottom: 1px solid rgba(242,240,236,0.1);
    padding: var(--space-2) var(--space-3);
    position: sticky;
    top: 44px;
    z-index: calc(var(--z-modal) - 1);
    flex-shrink: 0;
  }

  #mobile-search-bar .search-wrapper {
    width: 100%;
  }

  #mobile-search-bar #search-input-mobile {
    width: 100%;
    background: var(--dark-surface);
    border: 1px solid rgba(242,240,236,0.2);
    border-radius: var(--radius);
    height: 36px;
    padding: 0 var(--space-3) 0 var(--space-7);
    font-family: 'Aileron', sans-serif;
    font-size: var(--text-sm);
    color: var(--dark-text);
  }

  #mobile-search-bar #search-input-mobile::placeholder {
    color: rgba(242,240,236,0.35);
  }

  #mobile-search-bar #search-input-mobile:focus {
    outline: none;
    border-color: var(--amarillo);
  }

  #mobile-search-bar #search-input-mobile:focus + .search-icon {
    color: var(--amarillo);
  }

  #mobile-search-bar #search-results-mobile {
    position: absolute;
    top: 100%;
    left: var(--space-3);
    right: var(--space-3);
    background: var(--dark-surface);
    border: 1px solid var(--gris-sutil);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: var(--z-modal);
    max-height: 240px;
    overflow-y: auto;
  }

  /* Ocultar sidebar y toggle de escritorio */
  #sidebar-toggle {
    display: none;
  }

  /* El sidebar se oculta en su posición original pero es visible dentro del sheet */
  #sidebar:not(.in-sheet) {
    display: none;
  }

  /* El mapa ocupa todo el espacio disponible */
  #map-container {
    position: relative;
  }

  /* Slider temporal: ancho completo menos margen, siempre sobre el FAB */
  #map-slider {
    left: var(--space-3);
    right: var(--space-3);
    width: auto;
    bottom: calc(64px + var(--space-4) + env(safe-area-inset-bottom, 0px));
  }

  /* Panel de evento: full-screen sheet desde abajo */
  #event-panel {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-height: 75vh;
    border-left: none;
    border-top: 2px solid var(--rojo);
    border-radius: 0;
    z-index: var(--z-modal);
    padding: var(--space-5) var(--space-4) var(--space-6);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
    overflow-y: auto;
    display: none;
  }

  #event-panel.open {
    display: block;
  }

  /* ── FAB de filtros ───────────────────────────────────────────────── */

  #filter-fab {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    position: fixed;
    bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
    right: var(--space-4);
    z-index: calc(var(--z-modal) - 1);
    background: var(--rojo);
    color: var(--crema);
    font-family: 'Aileron', sans-serif;
    font-weight: 700;
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: var(--space-2) var(--space-4);
    border-radius: 24px;
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.45);
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    pointer-events: all;
  }

  #filter-fab:hover {
    background: #8B0E0E;
  }

  #filter-fab:active {
    transform: scale(0.96);
  }

  #filter-fab-icon {
    font-size: 16px;
    line-height: 1;
  }

  #filter-fab-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 var(--space-1);
    border-radius: 9px;
    background: var(--amarillo);
    color: var(--dark-bg);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
  }

  #filter-fab-badge.visible {
    display: flex;
  }

  /* ── Overlay ──────────────────────────────────────────────────────── */

  #filter-sheet-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(13,13,13,0.6);
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  #filter-sheet-overlay.visible {
    opacity: 1;
    pointer-events: all;
  }

  /* ── Bottom sheet ─────────────────────────────────────────────────── */

  #filter-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: auto 0 0 0;
    max-height: 82vh;
    background: var(--dark-surface);
    border-top: 2px solid var(--rojo);
    z-index: var(--z-modal);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
  }

  #filter-sheet.open {
    transform: translateY(0);
  }

  /* Handle visual de arrastre */
  #filter-sheet-handle {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-2) 0 0;
  }

  #filter-sheet-handle::before {
    content: '';
    width: 40px;
    height: 4px;
    background: rgba(242,240,236,0.25);
    border-radius: 2px;
  }

  /* Header del sheet */
  #filter-sheet-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4) var(--space-3);
    border-bottom: 1px solid rgba(242,240,236,0.1);
  }

  #filter-sheet-title {
    font-family: 'Aileron', sans-serif;
    font-weight: 700;
    font-size: var(--text-sm);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--crema);
  }

  #filter-sheet-close {
    background: none;
    border: none;
    color: var(--gris-sutil);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: var(--space-1);
  }

  #filter-sheet-close:hover {
    color: var(--crema);
  }

  /* Cuerpo scrollable del sheet — muestra el contenido del sidebar */
  #filter-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    /* El sidebar se clona aquí via JS */
  }

  /* Botones de acción del sheet */
  #filter-sheet-footer {
    flex-shrink: 0;
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4) var(--space-5);
    border-top: 1px solid rgba(242,240,236,0.1);
  }

  .sheet-btn-apply {
    flex: 1;
    font-family: 'Aileron', sans-serif;
    font-weight: 700;
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--rojo);
    color: var(--crema);
    border: none;
    border-radius: var(--radius);
    padding: var(--space-3) 0;
    cursor: pointer;
    transition: background 0.15s;
  }

  .sheet-btn-apply:hover {
    background: #8B0E0E;
  }

  .sheet-btn-clear {
    font-family: 'Aileron', sans-serif;
    font-weight: 600;
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: transparent;
    color: var(--amarillo);
    border: 1px solid var(--amarillo);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
  }

  .sheet-btn-clear:hover {
    background: var(--amarillo);
    color: var(--dark-bg);
  }

  /* Ajustes cosméticos del sidebar dentro del sheet */
  #filter-sheet-body #sidebar {
    width: 100%;
    border-right: none;
    padding: 0;
    overflow-y: visible;
  }

  #filter-sheet-body .btn-limpiar {
    display: none; /* reemplazado por sheet-btn-clear en el footer */
  }

  #filter-sheet-body .filter-check-list {
    max-height: none; /* sin altura máxima dentro del sheet scrollable */
  }

  #filter-sheet-body .filter-suggestions {
    max-height: 120px;
  }

}