/* =====================================================
   Shop sidebar — layout, filter sections, WC widgets
   ===================================================== */

/* -- Match the top spacing that page__container uses on regular pages -- */
.productgrid--outer {
    margin-top: 2rem;
}
@media (min-width: 768px) {
    .productgrid--outer {
        margin-top: 3.125rem; /* 50px */
    }
}
@media (min-width: 1024px) {
    .productgrid--outer {
        margin-top: 4.6875rem; /* 75px */
    }
}

/* -- Product content area gets the named grid slot -- */
.product-main-content {
    grid-area: productgrid--items;
    min-width: 0;
}

/* -- Force sidebar visible on desktop (theme.css has display:none) -- */
@media (min-width: 768px) {
    .productgrid--sidebar {
        display: block !important;
        position: static !important;
        transform: none !important;
        width: 185px;
        padding: 0;
        background: transparent;
    }
    .sidebar-mobile-header { display: none !important; }
    .sidebar-overlay       { display: none !important; }
}

/* -- Mobile sidebar drawer -- */
@media (max-width: 767px) {
    .productgrid--sidebar {
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-110%);
        width: 85vw;
        max-width: 320px;
        height: 100dvh;
        overflow-y: auto;
        background: #fff;
        z-index: 9000;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: block !important;
        padding: 0 0 80px;
    }
    .productgrid--sidebar.is-open {
        transform: translateX(0);
    }
}

/* -- Mobile overlay backdrop -- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 8999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
@media (max-width: 767px) {
    .sidebar-overlay {
        display: block;
    }
    .sidebar-overlay.is-active {
        opacity: 1;
        pointer-events: auto;
    }
}

/* -- Mobile sidebar header -- */
.sidebar-mobile-header {
    display: none;
}
@media (max-width: 767px) {
    .sidebar-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        border-bottom: 1px solid #e5e5e5;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1;
    }
    .sidebar-mobile-title {
        font-family: "Libre Franklin", sans-serif;
        font-weight: 700;
        font-size: 16px;
        color: #1d1d1d;
    }
    .sidebar-mobile-close {
        background: none;
        border: 0;
        cursor: pointer;
        padding: 4px;
        line-height: 0;
        color: #1d1d1d;
    }
    .sidebar-mobile-close:hover { color: #00e; }
    .filter-sections-wrap { padding: 0 16px; }
}

/* -- Mobile filter toggle button (inside mobile utils nav) -- */
.sidebar-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: "Libre Franklin", sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: #1d1d1d;
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    line-height: 1.4;
    margin-right: 8px;
}
.sidebar-filter-toggle:hover { border-color: #1d1d1d; }

/* =====================================================
   Filter sections (collapsible)
   ===================================================== */

.filter-section {
    border-bottom: 1px solid #e5e5e5;
    padding: 14px 0;
}
.filter-section:first-child { padding-top: 0; }
.filter-section:last-child  { border-bottom: 0; }

.filter-section__toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: 0;
    padding: 0;
    font-family: "Libre Franklin", sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: #1d1d1d;
    cursor: pointer;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.filter-section__toggle:hover { color: #00e; }

.filter-section__chevron {
    flex-shrink: 0;
    margin-left: 8px;
    transition: transform 0.2s ease;
}
.filter-section__toggle[aria-expanded="false"] .filter-section__chevron {
    transform: rotate(-90deg);
}

.filter-section__body { margin-top: 12px; }
.filter-section__toggle[aria-expanded="false"] + .filter-section__body {
    display: none;
}

/* =====================================================
   WooCommerce widget content styles
   ===================================================== */

/* -- Product categories -- */
.productgrid--sidebar .product-categories {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.5;
}
.productgrid--sidebar .product-categories li { padding: 3px 0; }
.productgrid--sidebar .product-categories .children {
    padding-left: 12px;
    margin-top: 2px;
}
.productgrid--sidebar .product-categories a {
    display: flex;
    justify-content: space-between;
    color: #4c5154;
    text-decoration: none;
}
.productgrid--sidebar .product-categories a:hover { color: #00e; }
.productgrid--sidebar .product-categories .current-cat > a { color: #00e; font-weight: 700; }
.productgrid--sidebar .product-categories .count {
    color: #aaa;
    font-weight: 400;
    margin-left: 4px;
}

/* -- Layered nav (attribute filters) -- */
.productgrid--sidebar .wc-layered-nav-terms {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
}
.productgrid--sidebar .wc-layered-nav-terms li { padding: 3px 0; }
.productgrid--sidebar .wc-layered-nav-terms a {
    display: flex;
    justify-content: space-between;
    color: #4c5154;
    text-decoration: none;
}
.productgrid--sidebar .wc-layered-nav-terms a:hover   { color: #00e; }
.productgrid--sidebar .wc-layered-nav-terms li.chosen > a { color: #00e; font-weight: 700; }
.productgrid--sidebar .wc-layered-nav-terms .count    { color: #aaa; margin-left: 4px; }

/* -- Active filters -- */
.productgrid--sidebar .widget_layered_nav_filters ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.productgrid--sidebar .widget_layered_nav_filters .wc-layered-nav-term {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 12px;
    color: #1d1d1d;
    text-decoration: none;
    background: #f5f5f5;
}
.productgrid--sidebar .widget_layered_nav_filters .wc-layered-nav-term:hover {
    border-color: #1d1d1d;
    background: #eee;
}

/* -- Price filter slider -- */
.productgrid--sidebar .price_slider_wrapper { padding-top: 6px; }
.productgrid--sidebar .ui-slider {
    position: relative;
    height: 4px;
    background: #e5e5e5;
    border-radius: 4px;
    margin: 20px 8px 8px;
}
.productgrid--sidebar .ui-slider-range {
    background: #1d1d1d;
    position: absolute;
    height: 100%;
    border-radius: 4px;
}
.productgrid--sidebar .ui-slider-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #fff;
    border: 2px solid #1d1d1d;
    border-radius: 50%;
    cursor: pointer;
    outline: none;
    z-index: 1;
}
.productgrid--sidebar .ui-slider-handle:hover,
.productgrid--sidebar .ui-slider-handle:focus { border-color: #00e; }
.productgrid--sidebar .price_slider_amount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 13px;
    gap: 8px;
}
.productgrid--sidebar .price_slider_amount .button {
    font-family: "Libre Franklin", sans-serif;
    font-weight: 700;
    font-size: 12px;
    padding: 5px 12px;
    border: 1px solid #1d1d1d;
    border-radius: 4px;
    background: #1d1d1d;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
}
.productgrid--sidebar .price_slider_amount .button:hover { background: #333; }
.productgrid--sidebar .price_label { color: #4c5154; }
.productgrid--sidebar .price_label .from,
.productgrid--sidebar .price_label .to { font-weight: 700; }
