/* ─── LAYOUT ─────────────────────────────────────────────────────────────── */

#wcf-layout {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    width: 100%;
}

#wcf-sidebar {
    flex: 0 0 260px;
    min-width: 220px;
    position: sticky;
    top: 24px;
}

#wcf-products-wrap {
    flex: 1 1 0;
    min-width: 0;
}

/* ─── SIDEBAR CARD ───────────────────────────────────────────────────────── */

#wcf-filters {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    font-family: inherit;
}

.wcf-filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.wcf-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -.2px;
}

/* ─── RESET BUTTON ───────────────────────────────────────────────────────── */

.wcf-btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #e03131;
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all .15s ease;
}
.wcf-btn-reset:hover {
    background: #ffe3e3;
    border-color: #e03131;
}

/* ─── GROUP ──────────────────────────────────────────────────────────────── */

.wcf-group {
    border-bottom: 1px solid #f0f0f0;
}
.wcf-group:last-child {
    border-bottom: none;
}

.wcf-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -.1px;
    transition: background .1s;
}
.wcf-group-toggle:hover {
    background: #fafafa;
}

.wcf-chevron {
    flex-shrink: 0;
    transition: transform .2s ease;
    color: #aaa;
}
.wcf-group-toggle[aria-expanded="false"] .wcf-chevron {
    transform: rotate(-90deg);
}

/* Active group indicator */
.wcf-group--active .wcf-group-toggle span:first-child::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #228be6;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
    margin-bottom: 1px;
}

.wcf-options {
    padding: 4px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

/* ─── OPTION ─────────────────────────────────────────────────────────────── */

.wcf-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 7px;
    cursor: pointer;
    transition: background .12s;
    user-select: none;
}
.wcf-option:hover {
    background: #f5f8ff;
}
.wcf-option--checked {
    background: #eff6ff;
}

.wcf-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom checkbox */
.wcf-checkbox {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 1.5px solid #ccc;
    border-radius: 4px;
    background: #fff;
    position: relative;
    transition: all .12s;
}
.wcf-option--checked .wcf-checkbox {
    background: #228be6;
    border-color: #228be6;
}
.wcf-option--checked .wcf-checkbox::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 4px;
    width: 5px;
    height: 8px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

/* Color swatch */
.wcf-swatch {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #e8e8e8;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
    transition: border-color .12s;
}
.wcf-option--checked .wcf-swatch {
    border-color: #228be6;
    box-shadow: 0 0 0 2px #228be6, inset 0 0 0 1px rgba(0,0,0,.06);
}

.wcf-label {
    font-size: 13px;
    color: #333;
    flex: 1;
}
.wcf-option--checked .wcf-label {
    color: #1a1a1a;
    font-weight: 600;
}

.wcf-count {
    font-size: 11px;
    color: #bbb;
}

/* ─── LOADER ─────────────────────────────────────────────────────────────── */

#wcf-products-wrap {
    position: relative;
    min-height: 200px;
}

.wcf-loader {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 8px;
    backdrop-filter: blur(2px);
}

.wcf-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e8e8e8;
    border-top-color: #228be6;
    border-radius: 50%;
    animation: wcf-spin .7s linear infinite;
}

@keyframes wcf-spin {
    to { transform: rotate(360deg); }
}

/* ─── RESULTS COUNT ──────────────────────────────────────────────────────── */

#wcf-results-count {
    font-size: 13px;
    color: #777;
    margin-bottom: 16px;
}
#wcf-results-count strong {
    color: #1a1a1a;
}

/* ─── MOBILE ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    #wcf-layout {
        flex-direction: column;
    }

    #wcf-sidebar {
        width: 100%;
        flex: none;
        position: static;
    }

    #wcf-filters {
        border-radius: 8px;
    }

    /* Collapse tous les groupes sur mobile par défaut */
    .wcf-options {
        max-height: 200px;
    }
}
