html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

#map {
    width: 100vw !important;
    height: 100vh !important;
    display: block;
}

  /* === Brujula === */
.compass-needle {
    font-size: 22px;
    color: red;
    text-align: center;
}

/* Contenido colapsable en popups */
.colapsable {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    margin-top: 4px;
    padding-left: 10px;
    color: #333;
}

.colapsable.open {
max-height: 500px; /* altura máxima expandida */
}

.leaflet-popup-content {
font-size: 13px;
line-height: 1.4;
}

.leaflet-popup-content a {
word-break: break-word;
color: #0078A8;
text-decoration: underline;
}

/* Transición suave para polígonos y líneas */
.leaflet-interactive {
    transition: fill 0.25s ease, stroke 0.25s ease, fill-opacity 0.25s ease, stroke-opacity 0.25s ease;
}

/* Para las leyendas mostradas*/
.info.legend {
box-shadow: 0 1px 4px rgba(0,0,0,0.3);
font-family: Arial, Helvetica, sans-serif;
}

.info.legend i {
vertical-align: middle;
border-radius: 2px;
}

/* === Control de descarga elegante === */
.leaflet-control-descarga {
position: relative;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 40px;
list-style: none !important;
}

.leaflet-control-descarga::marker,
.leaflet-control-descarga::before {
content: none !important;
}

.leaflet-control-descarga button {
background: linear-gradient(135deg, #0078A8, #009fda);
border: none;
border-radius: 50%;
width: 42px;
height: 42px;
cursor: pointer;
box-shadow: 0 2px 6px rgba(0,0,0,0.25);
transition: all 0.25s ease;
display: flex;
align-items: center;
justify-content: center;
outline: none;
}

.leaflet-control-descarga button:hover {
background: linear-gradient(135deg, #009fda, #00b0ff);
transform: scale(1.07);
box-shadow: 0 3px 10px rgba(0,0,0,0.35);
}

.leaflet-control-descarga svg {
display: block;
}

.leaflet-control-descarga .tooltip {
position: absolute;
bottom: 52px;
background: rgba(0,0,0,0.8);
color: white;
padding: 5px 8px;
border-radius: 5px;
font-size: 11px;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transform: translateY(6px);
transition: opacity 0.2s ease, transform 0.2s ease;
}

.leaflet-control-descarga:hover .tooltip {
opacity: 1;
transform: translateY(0);
}

  /* === Botones === */
.gis-btn {
background: #f4f4f4;
border: 1px solid #d0d0d0;
padding: 6px 10px;
font-size: 12px;
font-weight: 500;
color: #333;
border-radius: 4px;
cursor: pointer;
display: flex;
align-items: center;
gap: 4px;
transition: 0.2s ease;
box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.gis-btn:hover {
background: #e6e6e6;
border-color: #bcbcbc;
}

.gis-btn:active {
background: #dcdcdc;
}

.gis-icon {
font-size: 14px;
opacity: 0.8;
}

.welcome-tooltip--map {
position: absolute;
top: 12px;
left: 50%;
transform: translateX(-50%) translateY(-8px);
z-index: 9999;
opacity: 0;
transition: opacity 0.28s ease, transform 0.28s ease;
pointer-events: auto;
max-width: 360px;
}

/* caja interior */
.welcome-box {
background: rgba(255,255,255,0.96);
color: #222;
padding: 10px 14px;
border-radius: 8px;
box-shadow: 0 6px 18px rgba(0,0,0,0.18);
border: 1px solid rgba(0,0,0,0.06);
display: flex;
gap: 10px;
align-items: center;
}

/* contenido textual */
.welcome-title {
display: block;
font-size: 15px;
margin-bottom: 2px;
}
.welcome-text {
font-size: 13px;
color: #444;
}

/* boton cerrar */
.welcome-close {
margin-left: 8px;
background: transparent;
border: none;
font-size: 13px;
color: #666;
cursor: pointer;
border-radius: 4px;
padding: 4px;
}

/* tooltip pequeño al hover municipio */
.municipio-tooltip .leaflet-tooltip-inner {
background: rgba(34,34,34,0.95);
color: white;
padding: 4px 8px;
border-radius: 4px;
font-size: 13px;
box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.municipio-tooltip.leaflet-tooltip-top .leaflet-tooltip-tip {
background: rgba(34,34,34,0.95);
}

/* =============================
   Tooltips nativos de HTML con estilo GIS
   ============================= */
   .btn-gis {
    position: relative;
}

/* Ocultar tooltip nativo del navegador */
.btn-gis[title] {
    position: relative;
}

.btn-gis[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.9);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.btn-gis[title]:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(30, 30, 30, 0.9);
    z-index: 9998;
    opacity: 1;
    pointer-events: none;
}

.btn-gis[title]::after,
.btn-gis[title]::before {
    opacity: 0;
}
.btn-gis:hover::after,
.btn-gis:hover::before {
    opacity: 1;
}

.leaflet-top.leaflet-right {
    max-height: 60vh !important;
    overflow-y: auto !important;
    padding-right: 6px;
}

.leaflet-control-filtros {
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.filtro-panel {
    margin-bottom: 8px;
}

.filtro-header {
    font-weight: 700;
    padding: 6px 4px;
    cursor: pointer;
    border-bottom: 1px solid #e2e2e2;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filtro-content {
    display: none;
    padding: 4px 2px;
    max-height: 180px; 
    overflow-y: auto;
}

.leaflet-bottom .leaflet-control {
    max-height: 22vh !important;  
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.leaflet-bottom {
    pointer-events: auto;
}
