/* ================================================================
   Global Filter — Panneau de filtrage global
   Variantes : wide (allongée), narrow (étroite / accordion), grid (3 sections par ligne)
   ================================================================ */

/* ── Conteneur principal ─────────────────────────────────────── */
.gf {
    background: var(--white);
    border: 1px solid rgba(55, 36, 28, 0.08);
    border-radius: 16px;
}

/* Version allongée : panneau sidebar large */
.gf--wide {
    padding: 20px 24px;
}

/* Version étroite : sidebar compacte */
.gf--narrow {
    padding: 16px 18px;
}

/* Version grille : panneau large, 3 sections par ligne */
.gf--grid {
    padding: 20px 28px;
}

/* ── En-tête ─────────────────────────────────────────────────── */
.gf__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(55, 36, 28, 0.07);
}

/* Bouton toggle (titre + chevron) */
.gf__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.gf__toggle-chevron {
    font-size: 11px;
    color: var(--neutral-500);
    transition: transform 0.25s ease;
}

.gf.is-collapsed .gf__toggle-chevron {
    transform: rotate(180deg);
}

.gf__title {
    font-family: var(--font-rubik);
    font-size: 15px;
    font-weight: 700;
    color: var(--dark1);
    letter-spacing: 0.01em;
}

.gf__header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gf__active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--main-color);
    color: var(--dark1);
    font-family: var(--font-rubik);
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
}

.gf__reset {
    background: none;
    border: none;
    font-family: var(--font-rubik);
    font-size: 12px;
    color: var(--neutral-500);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: color 0.15s ease;
}

.gf__reset:hover {
    color: var(--dark1);
}

/* ── Corps (sections) ────────────────────────────────────────── */
.gf__body {
    display: flex;
    flex-direction: column;
}

/* Corps masqué quand le panneau est replié */
.gf.is-collapsed .gf__body {
    display: none;
}

.gf.is-collapsed .gf__header {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

/* Grid : 4 sections côte à côte pour économiser la hauteur */
.gf--grid .gf__body {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 24px;
}

/* ── Section ─────────────────────────────────────────────────── */
.gf__section {
    border-bottom: 1px solid rgba(55, 36, 28, 0.07);
}

.gf__section--last {
    border-bottom: none;
}

/* En mode grid : séparateur horizontal remplacé par un trait en haut de chaque section */
.gf--grid .gf__section {
    border-bottom: none;
    border-top: 1px solid rgba(55, 36, 28, 0.07);
    padding-top: 2px;
}

/* ── Trigger (titre de section) ──────────────────────────────── */
.gf__section-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 14px 0;
    cursor: default;
    text-align: left;
    gap: 8px;
}

/* En mode narrow le trigger est cliquable */
.gf__section--collapsible .gf__section-trigger {
    cursor: pointer;
}

.gf__section--collapsible .gf__section-trigger:hover .gf__section-title {
    color: var(--main-color-orange);
}

.gf__section-title {
    font-family: var(--font-rubik);
    font-size: 15px;
    font-weight: 700;
    color: var(--neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    transition: color 0.15s ease;
}

.gf--wide .gf__section-title {
    font-size: 15px;
}

.gf--narrow .gf__section-title {
    font-size: 15px;
    color: var(--dark1);
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0;
}

.gf--grid .gf__section-title {
    font-size: 15px;
}

.gf__section-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Badge de compteur par section */
.gf__count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--main-color);
    color: var(--dark1);
    font-family: var(--font-rubik);
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
}

/* Chevron accordion */
.gf__chevron {
    font-size: 11px;
    color: var(--neutral-500);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.gf__section--collapsible.is-open .gf__chevron {
    transform: rotate(180deg);
}

/* ── Corps de section ────────────────────────────────────────── */
.gf__section-body {
    padding-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Narrow : masqué par défaut, révélé si is-open */
.gf__section--collapsible .gf__section-body {
    display: none;
}

.gf__section--collapsible.is-open .gf__section-body {
    display: flex;
    animation: gf-body-in 0.18s ease both;
}

@keyframes gf-body-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Option (ligne checkbox) ─────────────────────────────────── */
.gf__option {
    display: flex;
}

.gf__option-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s ease;
    user-select: none;
}

.gf__option-label:hover {
    background: var(--light-warm);
}

/* Input natif masqué */
.gf__option-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Checkbox custom */
.gf__option-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 4px;
    border: 1.5px solid rgba(55, 36, 28, 0.25);
    background: var(--white);
    flex-shrink: 0;
    transition: border-color 0.15s ease, background 0.15s ease;
    position: relative;
}

.gf__option-box::after {
    content: '';
    display: block;
    width: 4px;
    height: 7px;
    border: 2px solid var(--dark1);
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
    opacity: 0;
    transition: opacity 0.12s ease;
}

.gf__option-input:checked ~ .gf__option-box {
    background: var(--main-color);
    border-color: var(--main-color);
}

.gf__option-input:checked ~ .gf__option-box::after {
    opacity: 1;
}

.gf__option-label:hover .gf__option-box {
    border-color: var(--main-color);
}

/* Icône option — thin par défaut, solid quand coché */
.gf__option-icon {
    font-size: 13px;
    color: var(--main-color-orange);
    width: 14px;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

/* Thin visible par défaut, solid masqué */
.gf__option-icon--solid {
    display: none;
}

/* Quand coché : masquer thin, afficher solid */
.gf__option-input:checked ~ .gf__option-icon--thin {
    display: none;
}

.gf__option-input:checked ~ .gf__option-icon--solid {
    display: inline;
    color: var(--main-color-orange);
}

/* Texte option */
.gf__option-text {
    font-family: var(--font-rubik);
    font-size: 12px;
    color: var(--dark1);
    line-height: 1.3;
}

.gf--narrow .gf__option-text {
    font-size: 13px;
}

/* ── Étoiles classement — thin par défaut, solid quand coché ── */
.gf__stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.gf__star {
    font-size: 11px;
    color: var(--main-color);
}

/* Thin visible par défaut, solid masqué */
.gf__star--solid {
    display: none;
}

/* Quand coché : masquer thin, afficher solid */
.gf__option-input:checked ~ .gf__stars .gf__star--thin {
    display: none;
}

.gf__option-input:checked ~ .gf__stars .gf__star--solid {
    display: inline;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .gf--grid .gf__body {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .gf--wide {
        padding: 16px 18px;
    }

    .gf--grid .gf__body {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .gf--grid .gf__body {
        grid-template-columns: 1fr;
    }
}
