/* Panneau de gauche : filtres des lieux (communes, types, medias)
   ---------------------------------------------------------------
   Base (position fixed, width 0, transition) dans sidebar.css ;
   ici l'habillage et le contenu. Meme "panneau de verre" que le
   panneau d'inventaire de droite (#side-popup). */

#left-side-panel {
    display: flex;
    flex-direction: column;
    font-family: var(--police-ui);
    background: var(--verre-fond);
    backdrop-filter: var(--verre-flou);
    -webkit-backdrop-filter: var(--verre-flou);
    box-shadow: inset -1px 0 0 var(--verre-lisere);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    #left-side-panel { background: var(--verre-fond-opaque); }
}
@media (prefers-reduced-transparency: reduce) {
    #left-side-panel {
        background: var(--verre-fond-opaque);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* Croix de fermeture : annule le padding-left de 200px de .sidenav .closeModal */
#left-side-panel .closeModal {
    position: absolute;
    top: 10px;
    right: 12px;
    padding: 4px 8px;
    font-size: 22px;
    line-height: 1;
    opacity: .7;
}
#left-side-panel .closeModal:hover { opacity: 1; }

/* En-tete ---------------------------------------------------------- */
#filtres-entete { padding: 18px 18px 12px; flex: none; }
#filtres-entete h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    letter-spacing: .2px;
}
#filtres-compteur {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .65);
    font-variant-numeric: tabular-nums;
}
#filtres-compteur b { color: #fff; font-weight: 600; }

/* Corps defilant --------------------------------------------------- */
#side-panel-content {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 10px 10px;
    color: #fff;
}

/* Sections repliables ---------------------------------------------- */
.filtres-section {
    margin: 6px 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .08);
}
.filtres-section > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    user-select: none;
}
.filtres-section > summary::-webkit-details-marker { display: none; }
.filtres-chevron {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, .7);
    transition: transform .2s;
}
.filtres-section:not([open]) .filtres-chevron { transform: rotate(-90deg); }
.filtres-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: rgba(255, 255, 255, .6);
    font-variant-numeric: tabular-nums;
}
.filtres-tout {
    background: none;
    border: 0;
    padding: 0;
    margin-left: 6px;
    font: inherit;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #a8d4f2;
    cursor: pointer;
}
.filtres-tout:hover { color: #fff; text-decoration: underline; }
.filtres-note {
    margin: 0;
    padding: 0 14px 6px;
    font-size: 11px;
    line-height: 1.35;
    color: rgba(255, 255, 255, .5);
}

/* Lignes ----------------------------------------------------------- */
.filtres-liste { margin: 0; padding: 2px 6px 8px; }
.filtres-ligne {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    color: #fff;
    font-size: 13.5px;
    cursor: pointer;
    position: relative;
}
.filtres-ligne:hover { background: rgba(255, 255, 255, .07); }

/* La case reste dans le flux d'accessibilite (focus clavier) mais
   invisible : l'interrupteur la represente. */
.filtres-ligne input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}
.filtres-ligne input:focus-visible ~ .filtres-switch {
    outline: 2px solid #a8d4f2;
    outline-offset: 2px;
}

.filtres-switch {
    flex: none;
    width: 30px;
    height: 17px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .18);
    position: relative;
    transition: background .2s;
}
.filtres-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
}
.filtres-ligne input:checked ~ .filtres-switch { background: #157bbd; }
.filtres-ligne input:checked ~ .filtres-switch::after { transform: translateX(13px); }

.filtres-ico {
    flex: none;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #cfe6f8;
}
.filtres-ico img { width: 18px; height: 18px; display: block; }
.filtres-lib { font-weight: 500; }
.filtres-nb {
    margin-left: auto;
    font-size: 11.5px;
    color: rgba(255, 255, 255, .5);
    font-variant-numeric: tabular-nums;
}

/* Ligne decochee : grisee */
.filtres-ligne input:not(:checked) ~ .filtres-lib { color: rgba(255, 255, 255, .42); font-weight: 400; }
.filtres-ligne input:not(:checked) ~ .filtres-ico { opacity: .35; filter: grayscale(1); }

/* Pied ------------------------------------------------------------- */
#filtres-pied {
    flex: none;
    padding: 10px 18px 14px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}
#filtres-reinit {
    width: 100%;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff;
    font: inherit;
    font-size: 12.5px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
}
#filtres-reinit:hover { background: rgba(255, 255, 255, .14); }
#filtres-reinit i { margin-right: 6px; }

/* Petits ecrans : le panneau prend toute la largeur */
@media (max-width: 480px) {
    body.filtres-ouverts #left-side-panel { width: 100% !important; }
}
