/* Bouton Filtrer dans la barre de tri */
.df-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #e2e5e9;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    margin-right: 10px;
    white-space: nowrap;
}
.df-filter-btn:hover {
    border-color: #FF6B35;
    color: #FF6B35;
}
.df-filter-btn.active,
.df-filter-btn.has-filters {
    border-color: #FF6B35;
    color: #FF6B35;
    background: #FFF3ED;
}

/* Badge compteur de filtres actifs */
.df-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #FF6B35;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: 4px;
}

/* Panneau de filtres déroulant */
#dfFilterPanel {
    background: #fff;
    border: 1px solid #e2e5e9;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.df-filter-panel-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.df-filter-facets-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* Groupe de filtre (1 facette) */
.df-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: calc((100% - 64px) / 5);
    min-width: 140px;
    flex: 0 0 auto;
}
.df-filter-group-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ==============================
   Multi-select custom-dropdown (left column + top bar)
   ============================== */
#Doofinderfacets .facets {
    margin-bottom: 8px;
}
#Doofinderfacets .custom-dropdown.multi-select {
    position: relative;
}
#Doofinderfacets .custom-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border: 1px solid #e2e5e9;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
}
#Doofinderfacets .custom-dropdown-toggle:hover {
    border-color: #ccc;
}
#Doofinderfacets .custom-dropdown.open .custom-dropdown-toggle {
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}
#Doofinderfacets .custom-dropdown-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
#Doofinderfacets .custom-dropdown-arrow {
    flex-shrink: 0;
    color: #999;
    transition: transform 0.2s;
}
#Doofinderfacets .custom-dropdown.open .custom-dropdown-arrow {
    transform: rotate(180deg);
    color: #FF6B35;
}

/* Count badge in toggle */
.custom-dropdown-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #FF6B35;
    border-radius: 9px;
    padding: 0 5px;
}

/* Dropdown menu */
#Doofinderfacets .custom-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 10;
    background: #fff;
    border: 1px solid #e2e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-height: 220px;
    overflow-y: auto;
    list-style: none;
    padding: 4px;
    margin: 0;
}
#Doofinderfacets .custom-dropdown.open .custom-dropdown-menu {
    display: block;
}

/* Dropdown items with checkbox */
#Doofinderfacets .custom-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    border-radius: 6px;
    transition: background 0.15s;
}
#Doofinderfacets .custom-dropdown-item:hover {
    background: #f8f9fa;
}
#Doofinderfacets .custom-dropdown-item.active {
    background: #FFF3ED;
}
#Doofinderfacets .custom-dropdown-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 8px 10px;
    margin: 0;
    cursor: pointer;
    font-size: 13px;
    color: #555;
}
#Doofinderfacets .custom-dropdown-item.active label {
    color: #FF6B35;
    font-weight: 600;
}
#Doofinderfacets .custom-dropdown-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #FF6B35;
    cursor: pointer;
    flex-shrink: 0;
}
#Doofinderfacets .custom-dropdown-item small {
    font-size: 11px;
    color: #aaa;
    padding-right: 10px;
    flex-shrink: 0;
}
#Doofinderfacets .custom-dropdown-item.active small {
    color: #FF6B35;
    opacity: 0.7;
}

/* Has active filters styling on toggle */
#Doofinderfacets .custom-dropdown.has-checked .custom-dropdown-toggle {
    border-color: #FF6B35;
    background: #FFF3ED;
}

/* ==============================
   Top bar panel dropdowns
   ============================== */
#dfFilterPanel .df-filter-group .custom-dropdown {
    position: relative;
}
#dfFilterPanel .custom-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border: 1px solid #e2e5e9;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
}
#dfFilterPanel .custom-dropdown-toggle:hover {
    border-color: #ccc;
}
#dfFilterPanel .custom-dropdown.open .custom-dropdown-toggle {
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}
#dfFilterPanel .custom-dropdown-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}
#dfFilterPanel .custom-dropdown-arrow {
    flex-shrink: 0;
    color: #999;
    transition: transform 0.2s;
}
#dfFilterPanel .custom-dropdown.open .custom-dropdown-arrow {
    transform: rotate(180deg);
    color: #FF6B35;
}
#dfFilterPanel .custom-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 180px;
    z-index: 20;
    background: #fff;
    border: 1px solid #e2e5e9;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-height: 200px;
    overflow-y: auto;
    list-style: none;
    padding: 4px;
    margin: 0;
}
#dfFilterPanel .custom-dropdown.open .custom-dropdown-menu {
    display: block;
}
#dfFilterPanel .custom-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    border-radius: 6px;
    transition: background 0.15s;
}
#dfFilterPanel .custom-dropdown-item:hover {
    background: #f8f9fa;
}
#dfFilterPanel .custom-dropdown-item.active {
    background: #FFF3ED;
}
#dfFilterPanel .custom-dropdown-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding: 6px 8px;
    margin: 0;
    cursor: pointer;
    font-size: 12px;
    color: #555;
}
#dfFilterPanel .custom-dropdown-item.active label {
    color: #FF6B35;
    font-weight: 600;
}
#dfFilterPanel .custom-dropdown-item input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #FF6B35;
    cursor: pointer;
    flex-shrink: 0;
}
#dfFilterPanel .custom-dropdown-item small {
    font-size: 11px;
    color: #aaa;
    padding-right: 8px;
    flex-shrink: 0;
}
#dfFilterPanel .custom-dropdown-item.active small {
    color: #FF6B35;
    opacity: 0.7;
}
#dfFilterPanel .custom-dropdown.has-checked .custom-dropdown-toggle {
    border-color: #FF6B35;
    background: #FFF3ED;
}

/* Reset button in the sort bar (next to Filtrer) */
.df-reset-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #dc3545;
    background: #fff;
    color: #dc3545;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.df-reset-bar-btn:hover {
    background: #dc3545;
    color: #fff;
}

/* Reset filters button inside panel */
.df-filter-reset-group {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}
.df-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid #e2e5e9;
    background: #fff;
    color: #777;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.df-reset-btn:hover {
    border-color: #dc3545;
    color: #dc3545;
    background: #fff5f5;
}

/* Responsive */
@media (max-width: 767px) {
    .df-filter-btn {
        padding: 5px 10px;
        font-size: 13px;
    }
    .df-filter-btn span {
        display: none;
    }
    #dfFilterPanel {
        padding: 12px;
    }
    .df-filter-facets-row {
        flex-direction: column;
        gap: 12px;
    }
}