/* ═══════════════════════════════════════════════
   WooCommerce Sidebar Filter - sidebar-filter.css
═══════════════════════════════════════════════ */

:root {
    --wsf-primary:       #1a1a2e;
    --wsf-accent:        #c8a96e;
    --wsf-accent-light:  #f5efe4;
    --wsf-border:        #e8e0d5;
    --wsf-text:          #333;
    --wsf-muted:         #888;
    --wsf-white:         #fff;
    --wsf-sidebar-w:     260px;
    --wsf-radius:        6px;
    --wsf-transition:    0.25s ease;
}

/* ── Layout ── */
.wsf-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    width: 100%;
}

.wsf-sidebar {
    width: var(--wsf-sidebar-w);
    min-width: var(--wsf-sidebar-w);
    background: var(--wsf-white);
    border: 1px solid var(--wsf-border);
    border-radius: var(--wsf-radius);
    padding: 0 0 16px;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--wsf-accent) var(--wsf-border);
}

.wsf-sidebar::-webkit-scrollbar { width: 4px; }
.wsf-sidebar::-webkit-scrollbar-track { background: var(--wsf-border); }
.wsf-sidebar::-webkit-scrollbar-thumb { background: var(--wsf-accent); border-radius: 2px; }

.wsf-products-wrap {
    flex: 1;
    min-width: 0;
}

.all-pro{
    color: #222222;
}

/* ── Sidebar Header ── */
.wsf-sidebar-header {
    background: #1b1b1b;
    color: var(--wsf-white);
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: var(--wsf-radius) var(--wsf-radius) 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wsf-sidebar-header::before {
    content: "⊟";
    font-size: 16px;
}

/* ── Filter Groups ── */
.wsf-filter-group {
    border-bottom: 1px solid var(--wsf-border);
}

.wsf-filter-group:last-of-type {
    border-bottom: none;
}

/* ── Collapsible Headings ── */
.wsf-filter-heading {
    width: 100%;
    background: none;
    border: none;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--wsf-primary);
    transition: background var(--wsf-transition);
    text-align: left;
}

.wsf-filter-heading:hover {
    background: var(--wsf-accent-light);
}

.wsf-filter-heading .wsf-arrow {
    font-size: 10px;
    color: var(--wsf-accent);
    transition: transform var(--wsf-transition);
}

.wsf-filter-heading.wsf-open .wsf-arrow {
    transform: rotate(180deg);
}

/* ── Filter List (collapsible) ── */
.wsf-filter-list {
    list-style: none;
    margin: 0;
    padding: 0 0 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.wsf-filter-list.wsf-open {
    max-height: 600px;
}

/* ── Category Filter Items ── */
.wsf-cat-item {
    margin: 0;
    padding: 0;
}

/* Row: link + toggle button side by side */
.wsf-cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wsf-cat-link {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 7px 6px 7px 22px;
    font-size: 13.5px;
    color: var(--wsf-text);
    text-decoration: none;
    transition: color var(--wsf-transition), background var(--wsf-transition);
}

.wsf-cat-link:hover {
    color: var(--wsf-accent);
    background: var(--wsf-accent-light);
}

.wsf-cat-link.wsf-active-link {
    color: #252525;
    font-weight: 600;
}

/* Leaf items (no children) — full-width link */
.wsf-cat-link.wsf-leaf {
    display: flex;
    align-items: center;
    padding: 7px 18px 7px 22px;
    font-size: 13.5px;
    color: var(--wsf-text);
    text-decoration: none;
    transition: color var(--wsf-transition), background var(--wsf-transition);
    width: 100%;
}

.wsf-cat-link.wsf-leaf:hover {
    color: var(--wsf-accent);
    background: var(--wsf-accent-light);
}

/* Toggle arrow button */
.wsf-cat-toggle {
    background: none;
    border: none;
    padding: 7px 14px 7px 4px;
    cursor: pointer;
    color: var(--wsf-muted);
    font-size: 10px;
    line-height: 1;
    transition: color var(--wsf-transition);
    flex-shrink: 0;
}

.wsf-cat-toggle:hover {
    color: var(--wsf-accent);
}

.wsf-sub-arrow {
    display: inline-block;
    transition: transform var(--wsf-transition);
}

/* ── Sub-category lists (any depth) ── */
.wsf-subcat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.wsf-subcat-list.wsf-open {
    max-height: 2000px; /* large enough for deep trees */
}

/* Indent per depth level — depth-1, depth-2, depth-3 … */
.wsf-subcat-list.wsf-depth-1 > .wsf-cat-item > .wsf-cat-link,
.wsf-subcat-list.wsf-depth-1 > .wsf-cat-item > .wsf-cat-row .wsf-cat-link {
    padding-left: 34px;
    font-size: 13px;
    color: #555;
}

.wsf-subcat-list.wsf-depth-2 > .wsf-cat-item > .wsf-cat-link,
.wsf-subcat-list.wsf-depth-2 > .wsf-cat-item > .wsf-cat-row .wsf-cat-link {
    padding-left: 48px;
    font-size: 12.5px;
    color: var(--wsf-muted);
}

.wsf-subcat-list.wsf-depth-3 > .wsf-cat-item > .wsf-cat-link,
.wsf-subcat-list.wsf-depth-3 > .wsf-cat-item > .wsf-cat-row .wsf-cat-link {
    padding-left: 62px;
    font-size: 12px;
    color: #aaa;
}

/* Depth indicator line on the left */
.wsf-subcat-list.wsf-depth-1 {
    border-left: 2px solid var(--wsf-border);
    margin-left: 22px;
}

.wsf-subcat-list.wsf-depth-2 {
    border-left: 2px solid #ede8e0;
    margin-left: 36px;
}

.wsf-subcat-list.wsf-depth-3 {
    border-left: 2px solid #f0ece6;
    margin-left: 50px;
}

/* Hover & active at any depth */
.wsf-subcat-list .wsf-cat-link:hover {
    color: var(--wsf-accent);
    background: var(--wsf-accent-light);
}

.wsf-subcat-list .wsf-cat-link.wsf-active-link {
    color: var(--wsf-accent);
    font-weight: 600;
}

/* Active item marker */
.wsf-cat-item.wsf-active > .wsf-cat-link::before,
.wsf-cat-item.wsf-active > .wsf-cat-row .wsf-cat-link::before {
    content: "›";
    margin-right: 5px;
    font-weight: bold;
    color: var(--wsf-accent);
}

.wsf-count {
    font-size: 11px;
    color: var(--wsf-muted);
    margin-left: 4px;
    font-weight: 400;
}

/* ── Attribute Filter Items (radio) ── */
.wsf-filter-item {
    margin: 0;
}

.wsf-filter-item label {
    display: flex;
    align-items: center;
    padding: 7px 18px 7px 22px;
    font-size: 13px;
    color: var(--wsf-text);
    cursor: pointer;
    gap: 10px;
    transition: background var(--wsf-transition), color var(--wsf-transition);
}

.wsf-filter-item label:hover {
    background: var(--wsf-accent-light);
    color: var(--wsf-accent);
}

.wsf-filter-item.wsf-selected label {
    color: var(--wsf-accent);
    font-weight: 600;
}

/* Custom radio */
.wsf-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.wsf-checkmark {
    width: 15px;
    height: 15px;
    min-width: 15px;
    border: 2px solid var(--wsf-border);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: border-color var(--wsf-transition);
}

.wsf-filter-item.wsf-selected .wsf-checkmark,
.wsf-radio:checked ~ .wsf-checkmark {
    border-color: var(--wsf-accent);
    background: var(--wsf-accent);
}

.wsf-radio:checked ~ .wsf-checkmark::after {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--wsf-white);
}

/* ── Active Filter Pills ── */
.wsf-active-filters {
    padding: 12px 16px;
    border-top: 1px solid var(--wsf-border);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.wsf-active-label {
    width: 100%;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--wsf-muted);
    margin-bottom: 4px;
}

.wsf-pill {
    background: var(--wsf-accent);
    color: var(--wsf-white);
    border-radius: 20px;
    padding: 3px 10px 3px 12px;
    font-size: 11.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wsf-pill-remove {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 12px;
    line-height: 1;
    transition: color var(--wsf-transition);
}

.wsf-pill-remove:hover {
    color: var(--wsf-white);
}

.wsf-clear-all {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 8px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--wsf-muted);
    text-decoration: none;
    padding: 6px;
    border: 1px dashed var(--wsf-border);
    border-radius: var(--wsf-radius);
    transition: all var(--wsf-transition);
}

.wsf-clear-all:hover {
    color: #c0392b;
    border-color: #c0392b;
    background: #fff5f5;
}

/* ── Mobile Toggle Button ── */
.wsf-mobile-toggle {
    display: none;
    background: var(--wsf-primary);
    color: var(--wsf-white);
    border: none;
    padding: 10px 18px;
    border-radius: var(--wsf-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.wsf-mobile-close {
    display: none;
    background: none;
    border: none;
    font-size: 13px;
    color: var(--wsf-muted);
    cursor: pointer;
    padding: 12px 18px;
    width: 100%;
    text-align: right;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .wsf-layout {
        flex-direction: column;
    }

    .wsf-mobile-toggle {
        display: block;
    }

    .wsf-mobile-close {
        display: block;
    }

    .wsf-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        max-height: 100vh;
        z-index: 9999;
        border-radius: 0;
        border: none;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .wsf-sidebar.wsf-sidebar-open {
        left: 0;
    }

    .wsf-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 9998;
    }

    .wsf-overlay.wsf-active {
        display: block;
    }

    .wsf-products-wrap {
        width: 100%;
    }
}
