﻿#map-div {
    width: 100%;
    max-width: 1400px;
    height: 60vh;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
}

@media (max-width:768px) {

    #map-div {
        height: 410px !important;
        max-width: 95%;
    }

    .map-container,
    .old-landing-mode {
        min-height: auto !important;
        height: auto !important;
    }
}

.filter-group {
    margin-bottom: 8px !important; /* COMPRIMIDO: antes 12px */
}

.enlace_filtro_mapa {
    display: flex;
    align-items: center;
    min-height: 32px !important; /* COMPRIMIDO: antes 38px */
    background: #fff !important;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 4px 12px !important; /* COMPRIMIDO: menos espacio arriba y abajo */
    color: #555555 !important;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    box-shadow: none;
    position: relative;
}

    .enlace_filtro_mapa:after {
        content: '›';
        position: absolute;
        right: 15px;
        font-size: 22px;
        font-weight: 400;
        color: #888888 !important;
    }

    .enlace_filtro_mapa:before {
        content: '';
        width: 16px !important; /* COMPRIMIDO: ícono más chico para caja más chica */
        height: 16px !important; /* COMPRIMIDO */
        margin-right: 10px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
    }

/* Redujimos los íconos de 20px a 16px para que no queden apretados en la caja de 32px */
.filter-group[data-parameter="departamento"] .enlace_filtro_mapa:before {
    content: '';
    width: 16px;
    height: 16px;
    display: inline-block;
    background: url('/img/Municipio_Filtro.png') center center no-repeat;
    background-size: contain;
}

.filter-group[data-parameter="ReparticionPBI"] .enlace_filtro_mapa:before {
    content: '';
    width: 16px;
    height: 16px;
    display: inline-block;
    background: url('/img/Reparticion_Filtro.png') center center no-repeat;
    background-size: contain;
}

/* Filtro con selección activa: Texto más oscuro, fuerte y destacado */
.filter-group.selected .enlace_filtro_mapa {
    color: #666666 !important;
    font-weight: 400 !important;
    background-color: #fafafa !important;
    border-color: #dcdcdc !important;
}

/* Filtro sin selección (inactivo): Texto más gris y suave */
.filter-group:not(.selected) .enlace_filtro_mapa {
    color: #222222 !important;
    font-weight: 600 !important;
}

.filter-group[data-parameter="IdEje"] .enlace_filtro_mapa:before {
    content: '';
    width: 16px;
    height: 16px;
    display: inline-block;
    background: url('/img/Eje_Filtro.png') center center no-repeat;
    background-size: contain;
}

.filter-group[data-parameter="sector"] .enlace_filtro_mapa:before {
    content: '';
    width: 16px;
    height: 16px;
    display: inline-block;
    background: url('/img/Objeto_Filtro.png') center center no-repeat;
    background-size: contain;
}

.filter-group[data-parameter="estado"] .enlace_filtro_mapa:before {
    content: '';
    width: 16px;
    height: 16px;
    display: inline-block;
    background: url('/img/Estado_Filtro.png') center center no-repeat;
    background-size: contain;
}

.filter-group[data-parameter="orgfinanciador"] .enlace_filtro_mapa:before {
    content: '';
    width: 16px;
    height: 16px;
    display: inline-block;
    background: url('/img/Financiador_Filtro.png') center center no-repeat;
    background-size: contain;
}

.filter-group[data-parameter="IdOCAD"] .enlace_filtro_mapa:before {
    content: '';
    width: 16px;
    height: 16px;
    display: inline-block;
    background: url('/img/Reparticion_Filtro.png') center center no-repeat;
    background-size: contain;
}

.tabcontent {
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
}

#filter-results {
    border: none !important;
    padding: 0 !important;
    background-color: transparent !important;
}

    /* 1. Contenedor general de la caja de resultados */
    #filter-results .results {
        border: 2px solid #009eb5 !important;
        border-radius: 10px !important;
        background-color: #ffffff !important;
        overflow: hidden !important;
        padding: 8px 15px !important; /* COMPRIMIDO: menos espacio arriba y abajo */
        justify-content: center !important;
        gap: 15px !important;
    }

        /* 2. El contenedor que tiene el número y el texto juntos */
        #filter-results .results > div:last-child {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

    /* 3. El número grande */
    #filter-results .value {
        font-size: 26px !important; /* COMPRIMIDO: Acompaña la caja un poquito más chica (antes 28) */
        font-weight: 700 !important;
        color: #009eb5 !important;
        line-height: 1 !important;
        margin-bottom: 2px !important;
    }

    /* 4. El texto pequeño ("Resultados encontrados") */
    #filter-results .text {
        font-size: 13px !important; /* COMPRIMIDO: antes 14px */
        color: #009eb5 !important;
        font-weight: 500 !important;
    }

    /* Opcional: Asegurar que el ícono no tenga márgenes raros */
    #filter-results .results img {
        margin: 0 !important;
        max-width: 60px; /* COMPRIMIDO: antes 45px */
    }

/* 1. Contenedor principal de las pestañas */
.tab {
    display: flex;
    width: 100% !important;
    justify-content: center !important;
    margin-bottom: 10px !important; /* COMPRIMIDO: acerca los botones a los filtros (antes 15px) */
    border-bottom: none !important;
    box-sizing: border-box !important;
}

/* 2. Estilo base para TODOS los botones */
button.tablinks {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background-color: #ffffff !important;
    color: #666666 !important;
    border: 1px solid #d9d9d9 !important;
    padding: 6px 8px !important; /* COMPRIMIDO: botones menos altos (antes 10px 8px) */
    margin: 0 !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    font-weight: 500;
    cursor: pointer;
    position: relative;
}

    /* 3. Redondeo específico: Primer botón (Obras públicas) */
    button.tablinks:first-child {
        border-radius: 8px 0 0 8px !important;
    }

    /* 4. Redondeo específico: Segundo botón (Contrataciones) */
    button.tablinks:last-child {
        border-radius: 0 8px 8px 0 !important;
        margin-left: -1px !important;
    }

    /* 5. Pestaña ACTIVA (La seleccionada) */
    button.tablinks.active {
        background-color: #009eb5 !important;
        color: #ffffff !important;
        border: 1px solid #009eb5 !important;
        outline: none !important;
        z-index: 2 !important;
    }

/* 6. Estilos para los íconos PNG en las pestañas */
.tab-icon {
    width: 16px; /* COMPRIMIDO: íconos un poco más sutiles (antes 18) */
    height: 16px;
    margin-right: 6px; /* COMPRIMIDO */
    object-fit: contain;
}

/* Convierte el ícono a color blanco cuando la pestaña está activa */
button.tablinks.active .tab-icon {
    filter: brightness(0) invert(1) !important;
}

/* ==========================================
         ESTILOS DE ADAPTACIÓN PARA FILTROS MÓVILES
         ========================================== */
.btn-flotante-movil-unico {
    display: none !important;
}


@media (max-width: 768px) {
    /* 🚫 BLOQUEAR SCROLL DEL FONDO CUANDO CUALQUIER PANEL ESTÁ ABIERTO */
    body:has(#map-view.panel-visible),
    body:has(.panel-detalle-proyectos-mobile.detalle-visible) {
        overflow: hidden !important;
        height: 100vh !important;
    }

        body:has(#map-view.panel-visible) .btn-top.active {
            display: none !important;
        }

    .proyectos-mode, .home-mode, .map-container {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    #map-div {
        height: 52vh !important;
        width: 100% !important;
        max-width: 100% !important;
        position: relative !important;
        z-index: 1 !important;
    }
    /* 📱 PANEL MÓVIL EN FLUJO NORMAL PARA QUE LOS FILTROS ABRAN BIEN */
    #map-view.map-view-movil-adaptado {
        display: block !important;
        position: fixed !important;
        left: 3% !important;
        right: 3% !important;
        width: 94% !important;
        max-width: 94% !important;
        height: auto !important;
        max-height: 82vh !important;
        bottom: -100% !important;
        top: auto !important;
        background: rgba(255, 255, 255, 0.96) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border: 1px solid rgba(255, 255, 255, 0.5) !important;
        border-radius: 20px !important;
        box-shadow: 0px 15px 40px rgba(0, 0, 0, 0.2) !important;
        overflow: visible !important;
        padding: 10px 12px 65px 12px !important;
        transition: bottom 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
        z-index: 99999 !important;
    }

        #map-view.map-view-movil-adaptado.panel-visible {
            bottom: 15px !important;
        }

        #map-view.map-view-movil-adaptado .filter-group {
            position: relative !important;
            margin-bottom: 4px !important;
        }

            #map-view.map-view-movil-adaptado .filter-group .filter-list {
                max-height: 200px !important;
                overflow-y: auto !important;
                z-index: 100005 !important;
                position: absolute !important;
                left: 0 !important;
                right: 0 !important;
                background: #ffffff !important;
                border: 1px solid #dcdcdc !important;
                border-radius: 8px !important;
                box-shadow: 0px 8px 20px rgba(0,0,0,0.15) !important;
                margin-top: 2px !important;
                padding: 2px 0 !important;
            }
    /* 🌑 VELO OSCURO GLOBAL (Se activa para filtros o para el panel de detalles) */
    #map-backdrop-overlay {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 99998 !important;
    }

        #map-backdrop-overlay.active,
        body:has(.panel-detalle-proyectos-mobile.detalle-visible) #map-backdrop-overlay {
            display: block !important;
        }
    /* ✨ FILTROS CERRADOS COMPACTOS Y PROLIJOS */
    .filter-group .enlace_filtro_mapa {
        color: #222222 !important;
        font-weight: 500 !important;
        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        padding: 0 10px !important;
        font-size: 12.5px !important;
        border-radius: 6px !important;
        display: flex !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }

        .filter-group .enlace_filtro_mapa:before {
            filter: brightness(0.2) !important;
            width: 13px !important;
            height: 13px !important;
        }

    .filter-group.selected .enlace_filtro_mapa {
        color: #555555 !important;
        font-weight: 400 !important;
        background-color: #f7f7f7 !important;
        border-color: #dcdcdc !important;
    }

        .filter-group.selected .enlace_filtro_mapa:before {
            filter: brightness(0.6) !important;
        }
    /* ⚡ BOTÓN APLICAR FILTROS FIJO ABAJO */
    #map-view.map-view-movil-adaptado #btnAplicarFiltroMobile {
        display: block !important;
        position: absolute !important;
        bottom: 10px !important;
        left: 12px !important;
        right: 12px !important;
        width: calc(100% - 24px) !important;
        margin: 0 !important;
        z-index: 10;
        background-color: #009eb5 !important;
        color: #fff !important;
        padding: 9px !important;
        border-radius: 10px !important;
        font-size: 13px !important;
        font-weight: bold !important;
        box-shadow: 0px 4px 12px rgba(0, 158, 181, 0.3);
        border: none !important;
    }
    /* PESTAÑAS COMPACTAS */
    .map-view-movil-adaptado .tabs,
    .map-view-movil-adaptado .nav-tabs {
        display: flex !important;
        flex-direction: row !important;
        gap: 0 !important;
        border: none !important;
        margin-bottom: 4px !important;
    }

    .map-view-movil-adaptado button.tablinks,
    .map-view-movil-adaptado .nav-link {
        font-size: 12px !important;
        padding: 4px 4px !important;
        text-align: center !important;
        width: 100% !important;
    }
    /* 📊 CUADRO DE RESULTADOS PEGADO Y ARMONIOSO */
    .map-view-movil-adaptado .resultados-fijos-mobile,
    .map-view-movil-adaptado #filter-results {
        font-size: 12px !important;
        margin-bottom: 4px !important;
        margin-top: 4px !important;
    }

    #filter-results .results {
        padding: 2px 8px !important;
        gap: 6px !important;
        border-radius: 8px !important;
    }

    .map-view-movil-adaptado .value {
        font-size: 17px !important;
    }

    .map-view-movil-adaptado .text {
        font-size: 11px !important;
    }

    #filter-results .results img {
        max-width: 24px !important;
    }

    .btn-flotante-movil-unico {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: fixed !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 9998 !important;
        background-color: #009eb5 !important;
        color: #ffffff !important;
        border: none !important;
        padding: 10px 24px !important;
        border-radius: 25px !important;
        font-size: 13px !important;
        font-weight: bold !important;
        box-shadow: 0px 4px 15px rgba(0, 158, 181, 0.4) !important;
        cursor: pointer !important;
    }
    /* 📦 POPUP DE DETALLES DE PROYECTOS */
    .panel-detalle-proyectos-mobile {
        display: block !important;
        position: fixed !important;
        bottom: -100% !important;
        left: 3% !important;
        right: 3% !important;
        width: 94% !important;
        height: 58vh !important;
        max-height: 58vh !important;
        background-color: rgba(255, 255, 255, 0.92) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.4) !important;
        border-radius: 20px !important;
        box-shadow: 0px -10px 35px rgba(0, 0, 0, 0.15) !important;
        z-index: 100000 !important;
        transition: bottom 0.4s cubic-bezier(0.25, 1, 0.5, 1) !important;
        overflow: hidden;
    }

        .panel-detalle-proyectos-mobile.detalle-visible {
            bottom: 15px !important;
        }

    .header-detalle-mobile {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 12px 18px !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
        background: #fff;
    }

    .body-detalle-mobile {
        height: calc(100% - 50px) !important;
        overflow-y: auto !important;
        padding: 12px 18px 35px 18px !important;
    }

    .popup-close-mobile {
        font-size: 20px;
        color: #333;
        cursor: pointer;
        font-weight: bold;
        padding: 5px;
    }

    .panel-detalle-proyectos-mobile .header-detalle-mobile h3 {
        font-size: 13px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
    }

    .panel-detalle-proyectos-mobile .azure-popu-list-item-pba {
        padding: 8px 0 !important;
    }

    .panel-detalle-proyectos-mobile .azure-popu-link-pba {
        font-size: 13px !important;
        line-height: 1.4 !important;
        font-weight: 500 !important;
    }

    .panel-detalle-proyectos-mobile .pagination-buttons-pba {
        margin-top: 12px !important;
        font-size: 12px !important;
        gap: 10px !important;
    }

        .panel-detalle-proyectos-mobile .pagination-buttons-pba button {
            width: 32px !important;
            height: 32px !important;
            font-size: 15px !important;
            line-height: 1 !important;
        }
}


