/* ==========================================================
   PETSCOMPARE - FILTRES EN PILLS
   ==========================================================
   Pastilles cliquables avec compteurs sur la page catégorie.
   Multi-sélection, désactivation auto si 0 résultat.
   ========================================================== */

/* === Filtres avancés repliables (Boutique / Économie / Tri) === */
.filter-advanced {
    margin: .75rem 0 1.25rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
}
.filter-advanced[open] {
    border-color: #d1d5db;
    background: #fafafa;
}
.filter-advanced-toggle {
    list-style: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 600;
    color: #4b5563;
    user-select: none;
}
.filter-advanced-toggle::-webkit-details-marker { display: none; }
.filter-advanced-toggle:hover { color: #047857; }
.filter-advanced-icon { font-size: 1rem; }
.filter-advanced-chevron {
    margin-left: auto;
    transition: transform .2s;
    font-size: .9rem;
    color: #9ca3af;
}
.filter-advanced[open] .filter-advanced-chevron { transform: rotate(180deg); }
.filter-bar-advanced {
    border-top: 1px solid #e5e7eb;
    margin: 0 !important;
    padding-top: 1rem !important;
}

.pills-filter-bar {
    margin: 1.25rem 0 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fefaf2 0%, #fff7ed 100%);
    border-radius: 14px;
    border: 1px solid #f3e8d0;
}

.pills-filter-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

.pills-filter-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #6b7280;
    font-weight: 600;
}

.pills-filter-reset {
    background: transparent;
    border: 1px solid #d1d5db;
    color: #6b7280;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .8rem;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.pills-filter-reset:hover {
    background: #fff;
    color: #1f2937;
    border-color: #1f2937;
}

.pills-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    color: #374151;
    padding: .5rem .9rem;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .18s cubic-bezier(.4, 0, .2, 1);
    font-family: inherit;
    white-space: nowrap;
}

.filter-pill:hover {
    transform: translateY(-2px);
    border-color: #047857;
    box-shadow: 0 4px 10px rgba(4, 120, 87, .12);
}

.filter-pill-emoji {
    font-size: 1rem;
    line-height: 1;
}

.filter-pill-label {
    font-weight: 600;
}

.filter-pill-count {
    background: #f3f4f6;
    color: #6b7280;
    font-size: .75rem;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    min-width: 24px;
    text-align: center;
}

/* État actif */
.filter-pill.is-active {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    color: #fff;
    border-color: #047857;
    box-shadow: 0 4px 12px rgba(4, 120, 87, .25);
}
.filter-pill.is-active .filter-pill-count {
    background: rgba(255, 255, 255, .25);
    color: #fff;
}
.filter-pill.is-active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(4, 120, 87, .35);
}

/* Pill verrouillée Plus */
.filter-pill-plus {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fbbf24;
}
.filter-pill-plus:hover {
    border-color: #d97706;
}
.filter-pill-plus .filter-pill-count {
    background: rgba(245, 158, 11, .15);
    color: #92400e;
}
.filter-pill-lock {
    font-size: .85rem;
    margin-left: 2px;
}

/* Mobile */
@media (max-width: 640px) {
    .pills-filter-bar {
        padding: .85rem 1rem;
        margin: 1rem 0 .75rem;
    }
    .pills-filter-list {
        gap: .4rem;
    }
    .filter-pill {
        padding: .42rem .75rem;
        font-size: .82rem;
    }
    .filter-pill-count {
        font-size: .7rem;
        padding: 1px 6px;
    }
    /* Permet le scroll horizontal sur très petit écran */
    .pills-filter-list {
        overflow-x: auto;
        flex-wrap: nowrap;
        margin: 0 -1rem;
        padding: 0 1rem;
        scrollbar-width: none;
    }
    .pills-filter-list::-webkit-scrollbar { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .filter-pill:hover,
    .filter-pill.is-active:hover {
        transform: none;
    }
}
