/**
 * Filter Sidebar Component
 * Barre latérale de filtrage pour la boutique
 */

.filter-sidebar {
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    padding: 0;
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.filter-sidebar__header {
    padding: 24px;
    border-bottom: 1px solid #E5E5E5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #000000;
    border-radius: 8px 8px 0 0;
}

.filter-sidebar__title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: #D4AF37;
    margin: 0;
}

.filter-sidebar__reset {
    background: transparent;
    border: 1px solid #D4AF37;
    color: #D4AF37;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-sidebar__reset:hover {
    background: #D4AF37;
    color: #000000;
}

.filter-sidebar__section {
    padding: 24px;
    border-bottom: 1px solid #E5E5E5;
}

.filter-sidebar__section:last-child {
    border-bottom: none;
}

.filter-sidebar__section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 16px;
}

.filter-sidebar__section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.filter-sidebar__section-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666666;
    transition: transform 0.3s ease;
}

.filter-sidebar__section--collapsed .filter-sidebar__section-toggle {
    transform: rotate(-90deg);
}

.filter-sidebar__section-content {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-sidebar__section--collapsed .filter-sidebar__section-content {
    max-height: 0;
}

/* Search input */
.filter-sidebar__search {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-sidebar__search:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* Checkbox list */
.filter-sidebar__checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-sidebar__checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.filter-sidebar__checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #D4AF37;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.filter-sidebar__checkbox input {
    display: none;
}

.filter-sidebar__checkbox input:checked + .filter-sidebar__checkbox {
    background: #D4AF37;
}

.filter-sidebar__checkbox input:checked + .filter-sidebar__checkbox::after {
    content: '✓';
    color: #000000;
    font-size: 12px;
    font-weight: bold;
}

.filter-sidebar__checkbox-label {
    font-size: 14px;
    color: #333333;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-sidebar__checkbox-count {
    font-size: 12px;
    color: #999999;
}

/* Price range */
.filter-sidebar__price-range {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-sidebar__price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.filter-sidebar__price-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0; /* Permet au contenu de se réduire */
}

.filter-sidebar__price-label {
    font-size: 12px;
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-sidebar__price-input {
    width: 100%;
    max-width: 100%;
    padding: 10px 8px; /* Padding réduit pour plus d'espace */
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    font-size: 13px; /* Taille réduite */
    box-sizing: border-box; /* Important pour inclure padding dans width */
}

.filter-sidebar__price-input:focus {
    outline: none;
    border-color: #D4AF37;
}

.filter-sidebar__price-slider {
    width: 100%;
    height: 4px;
    background: #E5E5E5;
    border-radius: 2px;
    position: relative;
    margin: 20px 0;
}

.filter-sidebar__price-slider-track {
    height: 100%;
    background: #D4AF37;
    border-radius: 2px;
    position: absolute;
}

/* Color swatches */
.filter-sidebar__color-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 10px;
}

.filter-sidebar__color-item {
    position: relative;
    cursor: pointer;
}

.filter-sidebar__color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #E5E5E5;
    transition: all 0.3s ease;
    position: relative;
}

.filter-sidebar__color-item input {
    display: none;
}

.filter-sidebar__color-item input:checked + .filter-sidebar__color-swatch {
    border-color: #D4AF37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.filter-sidebar__color-item input:checked + .filter-sidebar__color-swatch::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FFFFFF;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    font-weight: bold;
    font-size: 16px;
}

/* Size buttons */
.filter-sidebar__size-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}

.filter-sidebar__size-item {
    position: relative;
}

.filter-sidebar__size-button {
    width: 100%;
    padding: 10px;
    border: 1px solid #E5E5E5;
    background: #FFFFFF;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.filter-sidebar__size-item input {
    display: none;
}

.filter-sidebar__size-item input:checked + .filter-sidebar__size-button {
    background: #000000;
    color: #D4AF37;
    border-color: #000000;
}

.filter-sidebar__size-button:hover {
    border-color: #D4AF37;
}

/* Stock filter */
.filter-sidebar__stock-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #F9F9F9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-sidebar__stock-toggle:hover {
    background: #F0F0F0;
}

.filter-sidebar__stock-toggle input {
    display: none;
}

.filter-sidebar__stock-switch {
    width: 44px;
    height: 24px;
    background: #E5E5E5;
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.filter-sidebar__stock-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #FFFFFF;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.filter-sidebar__stock-toggle input:checked + .filter-sidebar__stock-switch {
    background: #D4AF37;
}

.filter-sidebar__stock-toggle input:checked + .filter-sidebar__stock-switch::after {
    left: 22px;
}

.filter-sidebar__stock-label {
    font-size: 14px;
    color: #333333;
    flex: 1;
}

/* Apply button */
.filter-sidebar__apply {
    padding: 24px;
}

.filter-sidebar__apply-button {
    width: 100%;
    padding: 14px;
    background: #000000;
    color: #D4AF37;
    border: none;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-sidebar__apply-button:hover {
    background: #D4AF37;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* Scrollbar styling */
.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filter-sidebar::-webkit-scrollbar-track {
    background: #F5F5F5;
}

.filter-sidebar::-webkit-scrollbar-thumb {
    background: #D4AF37;
    border-radius: 3px;
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #B8941F;
}

/* Responsive */
@media (max-width: 992px) {
    .filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 90%;
        max-width: 400px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        border-radius: 0;
    }
    
    .filter-sidebar--open {
        left: 0;
    }
}

@media (max-width: 576px) {
    .filter-sidebar {
        width: 100%;
        max-width: 100%;
    }
    
    .filter-sidebar__section {
        padding: 20px 16px;
    }
}
