/* ===================================
   ACCIONES CLIMÁTICAS - ESTILOS PRINCIPALES
   Usa variables de css/variables.css
   =================================== */

/* ===================================
   HEADER
   =================================== */
.acciones-header {
  background: var(--color-header-bg);
  color: white;
  padding: 0.5rem 0;
  box-shadow: 0 2px 8px var(--color-shadow-md);
  flex: 0 0 auto;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.header-left {
  flex: 1;
}

.header-title {
  font-family: "Montserrat", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: white;
}

.header-subtitle {
  font-family: "Open Sans", sans-serif;
  font-size: 1rem;
  margin: 0;
  opacity: 0.9;
  color: var(--color-bg-white);
}

.header-right {
  flex-shrink: 0;
}

.stats-container {
  display: flex;
  gap: 2rem;
  background: rgba(198, 168, 106, 0.2);
  padding: 0.2rem 0.2rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(198, 168, 106, 0.3);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-number {
  font-family: "Montserrat", sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
}

.stat-label {
  font-family: "Open Sans", sans-serif;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===================================
   MAIN CONTAINER
   =================================== */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  /* Altura = 100vh - header(~70px) - filtros(~58px) - timeline fijo(90px) */
  height: calc(100vh - 70px - 58px - 90px);
  overflow: hidden;
}

/* ===================================
   MAPA
   =================================== */
.map-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px var(--color-shadow-lg);
}

#map,
.map-container {
  width: 100%;
  height: 100%;
  background: var(--color-gray-300);
}

/* Forzar que Leaflet respete el contenedor */
.leaflet-container {
  width: 100% !important;
  height: 100% !important;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--color-gray-200);
  border-top: 4px solid var(--color-header-bg);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-family: "Open Sans", sans-serif;
  font-size: 1rem;
  color: var(--color-text-dark);
  margin: 0;
}

/* Botón de centrar mapa */
.map-control-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px var(--color-shadow-sm);
}

.map-control-btn:hover {
  background: var(--color-header-bg);
  border-color: var(--color-header-bg);
  color: white;
  transform: scale(1.05);
}

.map-control-btn svg {
  width: 20px;
  height: 20px;
}

/* ===================================
   TIMELINE - Gráfica Chart.js fija en la parte inferior
   =================================== */
.timeline-container {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: white !important;
  padding: 0 !important;
  box-shadow: 0 -2px 10px var(--color-shadow-lg) !important;
  height: 90px !important;
  z-index: 9999 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.timeline-container .timeline-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  position: relative;
}

.timeline-wrapper {
  width: 100%;
  height: 100%;
}

/* ===================================
   MODAL DE RANGO DE FECHAS
   =================================== */
.date-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(2px);
}

.date-modal {
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 450px;
  border: 2px solid var(--color-gold);
  overflow: hidden;
}

.date-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: rgba(198, 168, 106, 0.1);
  border-bottom: 2px solid var(--color-gold);
}

.date-modal-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-gray-900);
  margin: 0;
}

.date-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: white;
  border: 2px solid var(--color-gold);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.date-modal-close svg {
  stroke: var(--color-warning-orange);
}

.date-modal-close:hover {
  background: var(--color-warning-orange);
  border-color: var(--color-warning-orange);
  transform: scale(1.05);
}

.date-modal-close:hover svg {
  stroke: white;
}

.date-modal-body {
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.date-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.date-label {
  font-family: "Montserrat", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-gray-800);
}

.date-input {
  font-family: "Open Sans", sans-serif;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-gray-300);
  border-radius: 8px;
  transition: all 0.2s ease;
  background: white;
}

.date-input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(198, 168, 106, 0.2);
}

.date-input:hover {
  border-color: var(--color-gold);
}

.date-modal-footer {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(198, 168, 106, 0.05);
  border-top: 1px solid var(--color-gray-300);
}

.date-btn {
  flex: 1;
  font-family: "Montserrat", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: 2px solid;
  cursor: pointer;
  transition: all 0.2s ease;
}

.date-btn-secondary {
  background: white;
  border-color: var(--color-gold);
  color: var(--color-gold);
}

.date-btn-secondary:hover {
  background: rgba(198, 168, 106, 0.1);
  transform: translateY(-1px);
}

.date-btn-primary {
  background: var(--color-warning-orange);
  border-color: var(--color-warning-orange);
  color: white;
}

.date-btn-primary:hover {
  background: var(--color-warning-orange-dark);
  border-color: var(--color-warning-orange-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.date-btn:active {
  transform: translateY(0);
}

/* ===================================
   MODAL DE UBICACIONES
   =================================== */
.media-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(3px);
}

.media-modal {
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  border: 2px solid var(--color-gold);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.media-modal-large {
  max-width: 900px;
  max-height: 90vh;
}

.media-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: rgba(198, 168, 106, 0.1);
  border-bottom: 2px solid var(--color-gold);
  flex-shrink: 0;
}

.media-modal-title {
  font-family: "Montserrat", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-gray-900);
  margin: 0;
}

.media-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: white;
  border: 2px solid var(--color-gold);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.media-modal-close svg {
  stroke: var(--color-warning-orange);
}

.media-modal-close:hover {
  background: var(--color-warning-orange);
  border-color: var(--color-warning-orange);
  transform: scale(1.05);
}

.media-modal-close:hover svg {
  stroke: white;
}

.media-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Lista de ubicaciones */
.ubicaciones-list-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ubicacion-item {
  background: white;
  border: 2px solid var(--color-gray-300);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  transition: all 0.2s ease;
}

.ubicacion-item:hover {
  border-color: var(--color-gold);
  box-shadow: 0 2px 8px rgba(198, 168, 106, 0.2);
  transform: translateX(4px);
}

.ubicacion-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ubicacion-item-icon {
  font-size: 1.5rem;
}

.ubicacion-item-lugar {
  font-family: "Montserrat", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-gray-900);
  flex: 1;
}

.ubicacion-item-actividad {
  font-family: "Open Sans", sans-serif;
  font-size: 0.95rem;
  color: var(--color-text-gray);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.ubicacion-item-evidencias {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ubicacion-evidencia-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: white;
  color: var(--color-warning-orange);
  border: 2px solid var(--color-warning-orange);
  border-radius: 6px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ubicacion-evidencia-btn:hover {
  background: var(--color-warning-orange);
  color: white;
  transform: scale(1.05);
}

.ubicacion-evidencia-btn svg {
  width: 14px;
  height: 14px;
}

/* ===================================
   LEAFLET POPUP CUSTOMIZATION
   =================================== */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  font-family: "Open Sans", sans-serif;
  width: 300px !important;
}

/* ===================================
   POPUP
   =================================== */
.popup-container {
  width: 100%;
  font-family: "Open Sans", sans-serif;
}

/* Header mejorado - SIN DEGRADADOS */
.popup-header-old {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  background: var(--color-header-bg);
  color: white;
  border-radius: 12px 12px 0 0;
  position: relative;
  overflow: hidden;
}

.popup-header-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.popup-header-icon svg {
  width: 24px;
  height: 24px;
}

.popup-header-content {
  flex: 1;
  min-width: 0;
}

.popup-dependencia {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 0.35rem 0;
  opacity: 0.95;
  color: white;
}

.popup-title {
  font-family: "Montserrat", sans-serif;
  font-size: 0.938rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  color: white;
}

/* Body */
.popup-body {
  padding: 0.75rem;
  background: white;
}

/* Badges en la parte superior */
.popup-badges {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 0.625rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--color-gray-200);
}

.popup-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.625rem;
  border-radius: 20px;
  font-size: 0.688rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.2s ease;
}

.popup-badge svg {
  width: 10px;
  height: 10px;
}

.popup-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px var(--color-shadow-sm);
}

.popup-badge.tipo-proyecto {
  background: rgba(74, 144, 226, 0.12);
  color: var(--color-data-blue);
  border: 1px solid rgba(74, 144, 226, 0.2);
}

.popup-badge.tipo-programa {
  background: rgba(118, 188, 33, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(118, 188, 33, 0.2);
}

.popup-badge.estado-activo {
  background: rgba(118, 188, 33, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(118, 188, 33, 0.2);
}

.popup-badge.estado-concluido {
  background: rgba(139, 111, 71, 0.12);
  color: var(--color-sector-rural);
  border: 1px solid rgba(139, 111, 71, 0.2);
}

.popup-badge-multi {
  background: rgba(107, 18, 51, 0.12);
  color: var(--color-btn-primary);
  border: 1px solid rgba(107, 18, 51, 0.2);
}

/* Secciones con iconos */
.popup-section {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
  padding: 0.5rem;
  background: var(--color-bg-light);
  border-radius: 8px;
  border: 1px solid var(--color-gray-200);
  transition: all 0.2s ease;
}

.popup-section:hover {
  background: var(--color-bg-gray);
  border-color: var(--color-beige);
}

.popup-section-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 6px;
  color: var(--color-header-bg);
  box-shadow: 0 1px 2px var(--color-shadow-sm);
}

.popup-section-icon svg {
  width: 16px;
  height: 16px;
}

.popup-section-content {
  flex: 1;
  min-width: 0;
}

/* Ubicación */
.popup-location-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-dark);
  line-height: 1.5;
}

/* Meta */
.popup-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 0.5rem;
}

.popup-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.popup-meta-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-text-light);
  font-weight: 600;
}

.popup-meta-value {
  font-size: 0.813rem;
  font-weight: 700;
  color: var(--color-header-bg);
}

/* Descripción */
.popup-description-text {
  font-size: 0.813rem;
  line-height: 1.5;
  color: var(--color-text-dark);
  margin: 0;
}

/* Población objetivo */
.popup-population-label {
  font-size: 0.688rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-text-gray);
  margin-bottom: 0.3rem;
}

.popup-population-value {
  font-size: 0.813rem;
  color: var(--color-text-dark);
  margin: 0;
  line-height: 1.4;
}

/* Footer con botones */
.popup-footer {
  margin-top: 0rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--color-gray-200);
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.popup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1;
  padding: 0.5rem 0.4rem;
  background: var(--color-btn-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: "Montserrat", sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(107, 18, 51, 0.2);
}

.popup-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.popup-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(107, 18, 51, 0.3);
}

.popup-btn:active {
  transform: translateY(0);
}

.popup-btn:hover svg {
  transform: scale(1.1);
}

/* Estilos opcionales para cada tipo de botón */
.popup-btn-pdf:hover {
  background: var(--color-btn-primary-hover);
}

.popup-btn-fotos:hover {
  background: var(--color-btn-primary-hover);
}

.popup-btn-videos:hover {
  background: var(--color-btn-primary-hover);
}

/* ===================================
   CLUSTER STYLING
   =================================== */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(182, 181, 121, 0.6);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(182, 181, 121, 0.8);
  color: white;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
}

/* ===================================
   CLUSTERS POR DEPENDENCIA (Estatales)
   =================================== */
.marker-cluster-dependencia {
  background: transparent !important;
}

.cluster-dependencia {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-family: "Montserrat", sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 3px solid white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cluster-dependencia:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.cluster-small {
  width: 60px;
  height: 60px;
  padding: 5px;
}

.cluster-medium {
  width: 76px;
  height: 76px;
  padding: 8px;
}

.cluster-large {
  width: 90px;
  height: 90px;
  padding: 10px;
}

.cluster-count {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.cluster-small .cluster-count {
  font-size: 1.25rem;
}

.cluster-large .cluster-count {
  font-size: 1.75rem;
}

.cluster-nombre {
  font-size: 0.6rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.95;
}

.cluster-small .cluster-nombre {
  font-size: 0.55rem;
}

.cluster-large .cluster-nombre {
  font-size: 0.7rem;
}

/* Animación al aparecer */
.cluster-dependencia {
  animation: clusterAppear 0.4s ease-out;
}

@keyframes clusterAppear {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===================================
   MARKERS PERSONALIZADOS
   =================================== */

/* Contenedor del marker */
.custom-marker-icon {
  background: transparent;
  border: none;
}

.custom-marker-icon svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

/* Efecto hover en markers */
.leaflet-marker-icon:hover .custom-marker-icon svg {
  transform: scale(1.1);
}

/* Animación de entrada para markers */
.custom-marker-icon {
  animation: markerPop 0.3s ease-out;
}

@keyframes markerPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Resaltado de marcadores del mismo proyecto */
.marker-highlighted {
  z-index: 1000 !important;
}

.marker-highlighted .custom-marker-icon svg {
  transform: scale(1.25);
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.9))
          drop-shadow(0 0 6px rgba(255, 165, 0, 0.8))
          drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  animation: pulseHighlight 0.8s ease-in-out infinite;
}

@keyframes pulseHighlight {
  0%, 100% {
    transform: scale(1.2);
  }
  50% {
    transform: scale(1.3);
  }
}

/* Líneas de conexión entre marcadores del mismo proyecto */
.connection-line {
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes dashAnimation {
  to {
    stroke-dashoffset: -20;
  }
}

.leaflet-interactive.connection-line {
  animation: dashAnimation 0.5s linear infinite;
}

/* Labels de municipios */
.municipio-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.municipio-label-text {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-dark-ui);
  text-align: center;
  white-space: nowrap;
  text-shadow:
    -1px -1px 0 var(--color-bg-white),
    1px -1px 0 var(--color-bg-white),
    -1px 1px 0 var(--color-bg-white),
    1px 1px 0 var(--color-bg-white),
    0 0 4px rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

/* ============================================ */
/* MARCADORES ESTATALES */
/* ============================================ */

.marker-estatal svg {
  filter: drop-shadow(0 0 4px rgba(94, 59, 140, 0.5));
}

.marker-estatal:hover svg {
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px rgba(94, 59, 140, 0.7));
}

/* Tooltip (hover sobre marker) */
.leaflet-tooltip {
  background-color: rgba(0, 0, 0, 0.85);
  border: none;
  border-radius: 4px;
  color: white;
  font-family: "Open Sans", sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.leaflet-tooltip-top:before {
  border-top-color: rgba(0, 0, 0, 0.85);
}

.leaflet-tooltip-bottom:before {
  border-bottom-color: rgba(0, 0, 0, 0.85);
}

.leaflet-tooltip-left:before {
  border-left-color: rgba(0, 0, 0, 0.85);
}

.leaflet-tooltip-right:before {
  border-right-color: rgba(0, 0, 0, 0.85);
}

/* Body sin scroll para acciones climáticas */
html:has(.acciones-header),
body:has(.acciones-header) {
  overflow: hidden !important;
  height: 100vh !important;
  max-height: 100vh !important;
  margin: 0;
  padding: 0;
}

/* ===================================
   LEYENDA DE ACCIONES POR MUNICIPIO
   =================================== */
.acciones-legend {
  background: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 10px var(--color-shadow-lg);
  font-family: "Open Sans", sans-serif;
  min-width: 160px;
}

.acciones-legend h4 {
  margin: 0 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-header-bg);
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-header-bg);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.legend-color {
  width: 20px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.legend-label {
  font-size: 12px;
  color: var(--color-gray-900);
}

/* Tooltip de municipios */
.municipio-tooltip {
  background: white;
  border: none;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
  font-family: "Open Sans", sans-serif;
  font-size: 13px;
}

.municipio-tooltip strong {
  color: var(--color-header-bg);
}

/* ===================================
   LEYENDA DE DEPENDENCIAS
   =================================== */
.legend-dependencias {
  max-height: 400px;
  overflow-y: auto;
  min-width: 180px;
}

.legend-dependencias h4 {
  position: sticky;
  top: 0;
  background: white;
  padding-bottom: 8px;
  margin-bottom: 8px;
  z-index: 1;
}

.legend-group {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border-light);
}

.legend-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.legend-group-title {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-gray-600);
  margin-bottom: 6px;
}

.legend-dependencias .legend-item {
  padding: 2px 0;
}

.legend-dependencias .legend-label {
  font-size: 11px;
}

.legend-dependencias .legend-color {
  width: 16px;
  height: 12px;
}

/* Cuando hay dos leyendas, ajustar posición */
.legend-acciones {
  margin-bottom: 10px !important;
}

/* Scrollbar personalizado para la leyenda */
.legend-dependencias::-webkit-scrollbar {
  width: 6px;
}

.legend-dependencias::-webkit-scrollbar-track {
  background: var(--color-gray-100);
  border-radius: 3px;
}

.legend-dependencias::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: 3px;
}

.legend-dependencias::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}
