/* AD Grid Filters : mise en page des filtres. Couleurs et typographie viennent du thème (UIkit / YOOtheme). */

.adgf { --adgf-accent: currentColor; --adgf-rail: rgba(128, 128, 128, .3); }
.adgf-title { display: block; margin-bottom: 8px; }

/* Pastilles */
.adgf-chips { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.adgf-chip { text-transform: none; }
.adgf-chip.uk-active { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }
.adgf-empty { opacity: .4; pointer-events: none; cursor: default; }

/* Barre horizontale */
.adgf-bar .adgf-groups { gap: 12px 40px; }
.adgf-all.uk-active { box-shadow: 0 2px 0 currentColor; padding-bottom: 6px; }
.adgf-dd-toggle { display: inline-flex; align-items: center; gap: 8px; }
.adgf-dd-panel { min-width: 240px; max-height: 60vh; overflow: auto; }
.adgf-dd-panel .uk-active > a { font-weight: 600; }
.adgf-dd-panel .uk-active > a::before { content: "\2713\00a0"; }
.adgf-badge {
    display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid currentColor; border-radius: 10px;
    font-size: 11px; line-height: 16px; text-align: center;
}

/* Panneau et colonne */
.adgf-sidebar .adgf-group + .adgf-group { margin-top: 24px; }
.adgf-group-search { max-width: 400px; }

/* Champs mini / maxi */
.adgf-group-range, .adgf-dd-panel .adgf-range, .adgf-dd-panel .adgf-slider { max-width: 340px; }
.adgf-range { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adgf-range-field { display: block; }
.adgf-range-label { display: block; font-size: .8em; opacity: .7; margin-bottom: 2px; }
.adgf-range-input { position: relative; display: block; }
.adgf-range-input .uk-input { padding-right: 28px; }
.adgf-unit { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); opacity: .6; pointer-events: none; }

/* Curseur à deux poignées (affiché quand JavaScript est actif, les champs servent de repli) */
.adgf-slider { display: none; position: relative; padding: 8px 0 4px; margin: 0 9px 10px; }
.adgf-js .adgf-slider { display: block; }
.adgf-js .adgf-range-mode-slider .adgf-range { display: none; }
.adgf-range-mode-both .adgf-slider-out { display: none; }
.adgf-slider-rail { position: relative; height: 4px; border-radius: 2px; background: var(--adgf-rail); }
.adgf-slider-fill { position: absolute; top: 0; bottom: 0; left: 0; right: 0; border-radius: 2px; background: var(--adgf-accent); }
.adgf-slider-input {
    position: absolute; left: -9px; right: -9px; top: 1px; width: calc(100% + 18px); height: 18px; margin: 0; padding: 0;
    background: none; pointer-events: none; -webkit-appearance: none; appearance: none; z-index: 3;
}
.adgf-slider-input::-webkit-slider-runnable-track { background: none; height: 18px; }
.adgf-slider-input::-moz-range-track { background: none; height: 18px; }
.adgf-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: grab;
    width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--adgf-accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.adgf-slider-input::-moz-range-thumb {
    pointer-events: auto; cursor: grab; box-sizing: border-box;
    width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--adgf-accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.adgf-slider-input:focus { outline: none; }
.adgf-slider-input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(128, 128, 128, .35); }
.adgf-slider-input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(128, 128, 128, .35); }
.adgf-slider-out { display: flex; justify-content: space-between; margin: 14px -9px 0; font-size: .9em; }

/* Filtres actifs */
.adgf-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 20px; }
.adgf-active-item { text-transform: none; text-decoration: none; }
.adgf-active-item:hover { text-decoration: none; opacity: .8; }

/* Actions */
.adgf-actions { margin-top: 20px; }
.adgf-bar .adgf-actions { margin-top: 12px; }
.adgf-js .adgf-hide-js { display: none; }

/* Mobile : les filtres se replient derrière un bouton */
.adgf-mobile-toggle { display: none; }
@media (max-width: 959px) {
    .adgf-collapsible .adgf-mobile-toggle { display: inline-flex; align-items: center; gap: 8px; }
    .adgf-collapsible.adgf-js .adgf-body { display: none; }
    .adgf-collapsible.adgf-js.adgf-open .adgf-body { display: block; margin-top: 20px; }
}

/* Chargement */
.adgf-loading { opacity: .5; transition: opacity .15s ease; }
.adgf-loading .adgf { pointer-events: none; }
