/* Reducir espacio hasta el footer en página mapa */
body:has(#pagina-mapa) footer { margin-top: 1rem !important; }
/* Mapa base en escala de grises, fondo más claro (igual que vista impresión) */
#pagina-mapa .leaflet-tile-pane { filter: grayscale(100%); opacity: 0.75; }
/* Listas tri-estado: incluir / excluir (NOT) / quitar */
.comb-list {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.25rem;
    overflow-y: auto;
    max-height: 10em;
    background: var(--bs-body-bg, #fff);
}
.comb-list-item {
    padding: 0.05rem 0.4rem;
    line-height: 1.3;
    cursor: pointer;
    font-size: 0.875rem;
    border-radius: 2px;
    user-select: none;
    background: #fff;
}
.comb-list-item:hover { background: rgba(0,0,0,0.05); }
.comb-list-item.comb-item-selected {
    background: rgba(13, 110, 253, 0.15);
    font-weight: 500;
}
.comb-list-item.comb-item-excluded {
    text-decoration: line-through;
    color: #6c757d;
    background: rgba(220, 53, 69, 0.08);
}
.btn-reset-list {
    opacity: 0.5;
    width: 1.15rem;
    height: 1.15rem;
    min-width: 1.15rem;
    min-height: 1.15rem;
    padding: 0;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.btn-reset-list:hover { opacity: 1; }
.btn-reset-list.comb-reset-con-seleccion { background-color: rgba(13, 110, 253, 0.12); opacity: 1; }
.btn-reset-list.comb-reset-con-seleccion:hover { background-color: rgba(13, 110, 253, 0.2); }
.btn-paleta { font-size: 10px; line-height: 1; min-width: 22px; }
.btn-paleta.usado { opacity: 0.6; cursor: not-allowed; }
.btn-paleta.usado .tachado { position: absolute; left: 2px; right: 2px; top: 50%; height: 2px; background: #333; transform: rotate(-45deg); pointer-events: none; }
.combinacion-btn-color {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 1px rgba(0,0,0,0.8), 0 1px 2px rgba(0,0,0,0.5);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.combinacion-btn-color:hover { opacity: 0.9; }
.combinacion-btn-color.combinacion-oculta { opacity: 0.4; }
.combinacion-drag-handle { cursor: grab; padding: 0.15rem 0.25rem; user-select: none; }
.combinacion-drag-handle:active { cursor: grabbing; }
.combinacion-drag-handle:hover { color: var(--bs-primary) !important; }
.combinacion-card.combinacion-dragging { transition: opacity 0.15s; }
.combinacion-card.combinacion-drop-before { box-shadow: 0 -3px 0 0 var(--bs-primary); }
.combinacion-card.combinacion-drop-after { box-shadow: 0 3px 0 0 var(--bs-primary); }
.combinacion-header-row { gap: 0.5rem; min-width: 0; overflow: hidden; }
.combinacion-header { cursor: pointer; user-select: none; overflow: hidden; min-width: 0; }
.combinacion-header:hover { background: rgba(0,0,0,0.02); border-radius: 4px; }
.combinacion-resumen { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.combinacion-header-row .btnEliminarCombinacion { flex-shrink: 0; }
.combinacion-header-row .btnEliminarCombinacion .bi-trash { font-size: 1rem; }
.combinacion-chevron { transition: transform 0.2s; }
.combinacion-chevron.collapsed { transform: rotate(-90deg); }
/* Contador móvil: debajo de botones, una línea, alineado a la derecha */
.barra-mapa-contador-movil { display: none; text-align: right; font-size: 0.9rem; padding-top: 0.25rem; white-space: nowrap; }
/* Botones Exportar e Imprimir: layout y tamaños */
.barra-btn-accion { display: inline-flex; align-items: center; }
.barra-btn-icon { margin-right: 0.25rem; }
.barra-btn-accion .barra-btn-text { white-space: nowrap; }
/* En móviles: agrupar botones (sin espacio entre Combinaciones y Exportar/Imprimir) */
@media (max-width: 767.98px) {
    .barra-btn-accion { flex-direction: column; min-width: 4.5rem; }
    .barra-btn-accion .barra-btn-icon { margin-right: 0; margin-bottom: 0.15rem; }
    .barra-mapa-botones { flex-direction: column; align-items: stretch; }
    .barra-mapa-botones-row1 { flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 0.5rem; }
    .barra-mapa-botones .contador-desktop { display: none !important; }
    .barra-mapa-contador-movil { display: block !important; }
    .barra-mapa-botones .btn-combinaciones-abrir { flex: 0 0 auto; font-size: 0.875rem; padding: 0.25rem 0.5rem; }
    .barra-mapa-botones .btn-combinaciones-abrir .barra-btn-text { white-space: nowrap; }
    .combinacion-header { flex-wrap: nowrap; }
    .combinacion-header-row .btnEliminarCombinacion {
        flex-shrink: 0;
        min-width: 2rem;
        width: 2rem;
        height: 2rem;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .combinacion-header-row .btnEliminarCombinacion .bi-trash { font-size: 1rem !important; }
    .combinacion-filtros .d-flex.justify-content-between.align-items-center.mb-0 { flex-wrap: nowrap; }
    .combinacion-filtros .btn-reset-list {
        flex-shrink: 0;
        min-width: 1.15rem;
        width: 1.15rem;
        height: 1.15rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .combinacion-filtros .btn-reset-list .bi-x-circle { font-size: 0.9rem !important; }
}
/* <480px: botones igual que a 480px; solo reducir espacio entre Combinaciones y Exp/Impr */
@media (max-width: 479.98px) {
    .barra-mapa-botones-row1 { gap: 0.25rem; }
    .barra-mapa-botones-acciones { gap: 0.35rem; }
}
.mapa-leyenda {
    position: absolute; top: 8px; right: 8px; z-index: 1000;
    background: rgba(255,255,255,0.95); border-radius: 6px; padding: 6px 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2); font-size: 0.75rem; max-width: 220px;
}
.mapa-leyenda-item { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 4px; line-height: 1.3; }
.mapa-leyenda-item:last-child { margin-bottom: 0; }
.mapa-leyenda-num { min-width: 1.8em; text-align: right; font-weight: 600; color: #333; flex-shrink: 0; margin-top: 2px; }
.mapa-leyenda-color { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.2); flex-shrink: 0; margin-top: 3px; }
.mapa-leyenda-texto { word-break: break-word; color: #333; }
.mapa-leyenda-tachado { text-decoration: line-through; color: #6c757d; }
/* Badges en tooltips del mapa: menos padding, separación entre badges */
.mapa-popup .badge { padding: 0.15em 0.35em; margin: 1px 0; }
.mapa-popup .badge-subvencionada,
.mapa-popup .badge-tea { font-size: 0.7em; padding: 0.15em 0.35em; }
/* Tooltip de clusters: color + número por línea */
.mapa-cluster-tooltip { font-size: 0.8rem; white-space: nowrap; }
.mapa-cluster-tooltip-inner { padding: 2px 0; }
.mapa-cluster-tooltip-line { display: flex; align-items: center; gap: 5px; margin: 2px 0; line-height: 1.2; }
.mapa-cluster-tooltip-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.25); flex-shrink: 0; }
/* Clusters con desglose por color (MarkerCluster) */
.mapa-cluster-div { background: transparent !important; border: none !important; }
.mapa-cluster-icon { position: relative; width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.35); border: none; }
.leaflet-marker-icon.marker-cluster { background: transparent !important; border: none !important; }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background: transparent !important; border: none !important; }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background: transparent !important; border: none !important; }
.mapa-cluster-pie { overflow: visible; }
.mapa-cluster-pie svg { display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
.mapa-cluster-tt-popup {
    display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px;
    background: rgba(255,255,255,0.97); border-radius: 6px; padding: 6px 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    font-size: 0.75rem; white-space: nowrap; z-index: 1000; pointer-events: none;
}
.mapa-cluster-icon:hover .mapa-cluster-tt-popup { display: block; }
