/* =========================================================
   RED VIAL - Módulo Sandbox Independiente
   ========================================================= */

/* Contenedor del mapa aislado */
.rv-map-container {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw;
    height: 100vh;
    z-index: 50; /* Sobre el mapa/base amarilla, debajo de chips y paneles globales */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    background: #e9e5dc; /* Gris plano por si fallan las texturas de internet */
}

/* Panel lateral de información aislado */
.rv-info-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1500; /* Sobre ResultsDock (1400), debajo de Legend (2000) y Filters (9000) */
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
}

.rv-info-panel.is-active {
    transform: translateX(0);
}

/* =========================================================
   Filtros Flotantes del mapa Red Vial
   ========================================================= */
.rv-filters {
    position: absolute;
    top: 80px; /* Debajo de los chips principales */
    left: 50%;
    transform: translateX(-50%);
    z-index: 100; /* Sobre el mapa (2) pero bajo modales y muelles */
    display: flex;
    gap: 8px;
    transition: opacity 0.5s ease;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 6px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.rv-filter-btn {
    background: transparent;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font: 900 11px/1.2 'Arial Black', Arial, sans-serif;
    color: #801039;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
}
.rv-filter-btn.is-active, .rv-filter-btn:hover {
    background: #801039;
    color: #ffc300;
}

.rv-filter-btn.rv-filter-toggle {
    border-left: 1px solid rgba(128, 16, 57, 0.18);
    color: #5b6678;
}

.rv-filter-btn.rv-filter-toggle.is-muted {
    background: rgba(15, 23, 42, 0.08);
    color: #64748b;
}

@media (max-width: 1024px) {
    body.segmento-alcalde_provincial .rv-filters {
        position: fixed !important;
        top: calc(env(safe-area-inset-top, 0px) + 106px) !important;
        left: 50vw !important;
        left: 50dvw !important;
        width: calc(100vw - 28px) !important;
        width: calc(100dvw - 28px) !important;
        max-width: 520px !important;
        transform: translateX(-50%) !important;
        z-index: 2147482400 !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 7px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        border-radius: 999px !important;
        background: rgba(255,255,255,0.86) !important;
        border: 1px solid rgba(255,255,255,0.88) !important;
        box-shadow: 0 12px 24px rgba(15,23,42,0.18) !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    body.segmento-alcalde_provincial .rv-filters::-webkit-scrollbar {
        display: none;
    }

    body.segmento-alcalde_provincial .rv-filter-btn {
        flex: 0 0 auto !important;
        min-height: 38px !important;
        padding: 0 14px !important;
        border-radius: 999px !important;
        background: rgba(255,255,255,0.72) !important;
        color: #801039 !important;
        box-shadow: inset 0 0 0 1px rgba(128,16,57,0.06);
        white-space: nowrap !important;
        font-size: 10.5px !important;
        letter-spacing: 0 !important;
    }

    body.segmento-alcalde_provincial .rv-filter-btn.is-active {
        background: #801039 !important;
        color: #ffc300 !important;
        box-shadow: 0 8px 16px rgba(128,16,57,0.23) !important;
    }

    body.segmento-alcalde_provincial .rv-filter-btn.rv-filter-toggle {
        margin-left: auto !important;
        max-width: 116px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        color: #5b6678 !important;
    }

    body.segmento-alcalde_provincial .rv-filter-btn.rv-filter-toggle.is-muted {
        background: rgba(15,23,42,0.08) !important;
        color: #64748b !important;
    }
}
