/**
 * Queeny – Filtres Produits v1.0.0
 * Palette : #55162F · #9A7078 · #C8AB9F · #B1C3CA
 */

/* ── Conteneur principal ─────────────────────────────────────── */
.queeny-filters {
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    position: relative;
}

/* ── Titre ───────────────────────────────────────────────────── */
.queeny-filters__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 20px;
    color: #55162F;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding-bottom: 12px;
    border-bottom: 2px solid #C8AB9F;
}

/* ── Section accordéon ───────────────────────────────────────── */
.queeny-filters__section {
    border-bottom: 1px solid #e8ddd9;
    padding: 14px 0;
}
.queeny-filters__section:first-child { padding-top: 0; }
.queeny-filters__section:last-of-type { border-bottom: none; }

.queeny-filters__section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    min-height: 36px;
}

.queeny-filters__section-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #55162F;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 10px;
}

button.queeny-filters__section-toggle .queeny-filters__section-title {
    margin-bottom: 0;
}

.queeny-filters__section-chevron {
    font-size: 1.1rem;
    color: #C8AB9F;
    transition: transform 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}
.queeny-filters__section-toggle[aria-expanded="true"] .queeny-filters__section-chevron {
    transform: rotate(90deg);
}

.queeny-filters__section-body {
    margin-top: 10px;
}
.queeny-filters__section-body[hidden] { display: none; }

/* ── Liste de cases à cocher ─────────────────────────────────── */
.queeny-filters__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.queeny-filters__item {
    display: flex;
    align-items: center;
}

/* Cacher la checkbox native */
.queeny-filters__checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Label stylisé */
.queeny-filters__label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #3a3a3a;
    padding: 8px 10px;
    border-radius: 6px;
    width: 100%;
    min-height: 44px;
    transition: background-color 0.15s ease, color 0.15s ease;
    line-height: 1.3;
    box-sizing: border-box;
}

/* Carré custom avant le label */
.queeny-filters__label::before {
    content: '';
    display: inline-flex;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid #C8AB9F;
    border-radius: 4px;
    background-color: #fff;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.queeny-filters__label:hover {
    background-color: #faf5f3;
}

/* État coché */
.queeny-filters__checkbox:checked + .queeny-filters__label {
    color: #55162F;
    font-weight: 600;
}
.queeny-filters__checkbox:checked + .queeny-filters__label::before {
    background-color: #55162F;
    border-color: #55162F;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}

/* Focus accessibilité */
.queeny-filters__checkbox:focus-visible + .queeny-filters__label {
    outline: 2px solid #55162F;
    outline-offset: 2px;
}

/* Compteur de termes */
.queeny-filters__term-count {
    font-size: 0.78rem;
    color: #9A7078;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Tri (select) ────────────────────────────────────────────── */
.queeny-filters__section--tri { border-bottom: 1px solid #e8ddd9; padding-bottom: 14px; }
.queeny-filters__select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #C8AB9F;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #3a3a3a;
    background-color: #faf7f5;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239A7078' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    cursor: pointer;
    min-height: 44px;
    transition: border-color 0.15s ease;
}
.queeny-filters__select:focus {
    outline: none;
    border-color: #55162F;
}

/* ── Slider prix ─────────────────────────────────────────────── */
.queeny-filters__price-wrap { width: 100%; }

.queeny-filters__price-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.queeny-filters__range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #C8AB9F, #9A7078);
    outline: none;
    cursor: pointer;
}
.queeny-filters__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #55162F;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(85,22,47,0.3);
    transition: transform 0.15s ease;
}
.queeny-filters__range::-webkit-slider-thumb:hover { transform: scale(1.15); }
.queeny-filters__range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #55162F;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(85,22,47,0.3);
}

.queeny-filters__price-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.85rem;
    color: #55162F;
    font-weight: 600;
}
.queeny-filters__price-value { min-width: 50px; }

/* ── Bouton reset ────────────────────────────────────────────── */
.queeny-filters__reset {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 11px 16px;
    background: none;
    border: 1px solid #C8AB9F;
    border-radius: 8px;
    color: #9A7078;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    text-align: center;
}
.queeny-filters__reset:hover {
    background-color: #55162F;
    border-color: #55162F;
    color: #fff;
}

/* ── Loader Ajax ─────────────────────────────────────────────── */
.queeny-filters__loader {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    color: #9A7078;
    font-size: 0.85rem;
}
.queeny-filters__loader.is-loading { display: flex; }

.queeny-filters__spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #C8AB9F;
    border-top-color: #55162F;
    border-radius: 50%;
    animation: queeny-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes queeny-spin { to { transform: rotate(360deg); } }

/* ── Message vide ────────────────────────────────────────────── */
.queeny-filters__empty {
    font-size: 0.82rem;
    color: #9A7078;
    font-style: italic;
    margin: 4px 0 0;
}

/* ── No results ──────────────────────────────────────────────── */
.queeny-no-results {
    text-align: center;
    color: #9A7078;
    font-size: 1rem;
    padding: 40px 20px;
}

/* ── Bouton mobile ───────────────────────────────────────────── */
.queeny-filters__mobile-toggle {
    display: none;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* Bouton Filtrer visible */
    .queeny-filters__mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 18px;
        background-color: #55162F;
        color: #fff;
        border: none;
        border-radius: 10px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        min-height: 48px;
        box-sizing: border-box;
        transition: background-color 0.2s ease;
    }
    .queeny-filters__mobile-toggle:hover { background-color: #3d0f22; }
    .queeny-filters__mobile-toggle[aria-expanded="true"] { border-radius: 10px 10px 0 0; }

    .queeny-filters__mobile-icon { font-size: 1.2rem; }

    /* Corps du filtre caché par défaut */
    .queeny-filters__body[hidden] { display: none; }
    .queeny-filters__body {
        background: #faf7f5;
        border: 1px solid #e8ddd9;
        border-top: none;
        border-radius: 0 0 10px 10px;
        padding: 16px;
    }

    /* Touch targets plus généreux */
    .queeny-filters__label { min-height: 48px; padding: 10px 12px; }
    .queeny-filters__select { min-height: 48px; }
    .queeny-filters__reset { min-height: 48px; }

    /* Grille 2 colonnes pour checkboxes nombreuses */
    .queeny-filters__list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .queeny-filters__list { grid-template-columns: 1fr; }
}
