/* Shop listing filters: products first, filter sections as an accordion, slide-in panel below 992px */

/* Accordion sections (all screen sizes) */
.bb-shop-sidebar .bb-product-filter {
    margin-bottom: 14px;
    border-radius: 12px;
}

.bb-shop-sidebar .bb-product-filter .bb-product-filter-attribute-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
}

.bb-shop-sidebar .chozhan-acc-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.bb-shop-sidebar .chozhan-acc-title::after {
    content: '';
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-right: 4px;
    border-right: 2px solid #7e7e7e;
    border-bottom: 2px solid #7e7e7e;
    transform: rotate(-135deg) translate(-2px, -2px);
    transition: transform 0.2s ease;
}

.bb-shop-sidebar .chozhan-acc-title:hover,
.bb-shop-sidebar .chozhan-acc-title:focus-visible {
    color: var(--color-brand);
    outline: none;
}

.bb-shop-sidebar .chozhan-acc-title:hover::after,
.bb-shop-sidebar .chozhan-acc-title:focus-visible::after {
    border-color: var(--color-brand);
}

.bb-shop-sidebar .chozhan-acc.is-collapsed > .chozhan-acc-title {
    margin-bottom: 0 !important;
    padding-bottom: 0;
    border-bottom: 0;
}

.bb-shop-sidebar .chozhan-acc.is-collapsed > .chozhan-acc-title::after {
    transform: rotate(45deg) translate(-2px, -2px);
}

.bb-shop-sidebar .chozhan-acc.is-collapsed > .bb-product-filter-content {
    display: none;
}

/* Toolbar above the products: "Filters" button (phones / tablets) + count + sort */
.chozhan-shop-toolbar {
    flex-wrap: wrap;
    gap: 12px 16px;
}

.chozhan-filters-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1px solid #ececec;
    border-radius: 30px;
    background: #fff;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.05);
    color: #253d4e;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.chozhan-filters-btn i {
    color: var(--color-brand);
    line-height: 1;
}

.chozhan-filters-btn:hover,
.chozhan-filters-btn:focus-visible {
    border-color: var(--color-brand);
    color: var(--color-brand);
    outline: none;
}

.chozhan-filter-panel__head,
.chozhan-filter-panel__foot,
.chozhan-filter-overlay {
    display: none;
}

@media (min-width: 992px) {
    .chozhan-filter-col {
        margin-top: 1.5rem;
    }

    /* Long category list: shown in full, scrolls only when taller than the screen */
    .bb-shop-sidebar .bb-product-filter-content:has(.bb-product-filter-link) {
        max-height: calc(100vh - 140px);
    }
}

@media (max-width: 991.98px) {
    .chozhan-filter-col {
        margin: 0;
    }

    .chozhan-filters-btn {
        display: inline-flex;
    }

    .chozhan-filters-btn.d-none {
        display: none !important;
    }

    /* One bar: Filters (left) + show / sort (right), the result count underneath */
    .chozhan-shop-toolbar {
        display: flex;
        align-items: center;
    }

    .chozhan-shop-toolbar .chozhan-filters-btn {
        order: 1;
    }

    .chozhan-shop-toolbar .sort-by-product-area {
        order: 2;
        display: flex;
        gap: 8px;
        margin: 0 0 0 auto;
    }

    .chozhan-shop-toolbar .sort-by-product-area .sort-by-cover,
    .chozhan-shop-toolbar .sort-by-product-area .sort-by-cover:first-child {
        display: block;
        margin: 0;
    }

    .chozhan-shop-toolbar .total-product {
        order: 3;
        flex: 0 0 100%;
        margin: 0;
    }

    .chozhan-shop-toolbar .total-product p {
        margin: 0;
        font-size: 14px;
    }

    /* Panel scrolls as a whole: no second scrollbar inside the category list */
    .chozhan-filter-panel .bb-product-filter-content:has(.bb-product-filter-items) {
        max-height: none;
        overflow: visible;
    }

    .chozhan-filter-panel.bb-filter-offcanvas-area {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 100000;
        width: min(360px, 88vw);
        height: 100%;
        padding: 0;
        background: #fff;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.18);
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform 0.3s ease, visibility 0.3s;
    }

    .chozhan-filter-panel.bb-filter-offcanvas-area.offcanvas-opened {
        transform: none;
        visibility: visible;
    }

    .chozhan-filter-panel__head {
        position: sticky;
        top: 0;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 1px solid #ececec;
        background: #fff;
    }

    .chozhan-filter-panel__title {
        color: #253d4e;
        font-family: var(--font-heading);
        font-size: 20px;
        font-weight: 700;
    }

    .chozhan-filter-panel__close {
        width: 38px;
        height: 38px;
        padding: 0;
        border: 1px solid #ececec;
        border-radius: 50%;
        background: #fff;
        color: #253d4e;
        font-size: 26px;
        line-height: 34px;
    }

    .chozhan-filter-panel__close:hover {
        border-color: var(--color-brand);
        color: var(--color-brand);
    }

    .chozhan-filter-panel .widget-area {
        padding: 14px 14px 4px;
    }

    .chozhan-filter-panel__foot {
        position: sticky;
        bottom: 0;
        z-index: 2;
        display: block;
        padding: 12px 14px 16px;
        border-top: 1px solid #ececec;
        background: #fff;
    }

    .chozhan-filter-panel__done {
        width: 100%;
        border-radius: 30px;
    }

    .chozhan-filter-overlay {
        position: fixed;
        inset: 0;
        z-index: 99999;
        display: block;
        background: rgba(37, 61, 78, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s;
    }

    .chozhan-filter-overlay.opened {
        opacity: 1;
        visibility: visible;
    }

    body.chozhan-filters-open {
        overflow: hidden;
    }
}

/* Small phones: keep the bar on one line (icons + values, labels hidden) */
@media (max-width: 575.98px) {
    .chozhan-shop-toolbar .sort-by-product-area .sort-by .chozhan-gt-label {
        display: none;
    }

    .chozhan-shop-toolbar .chozhan-filters-btn {
        gap: 6px;
        padding: 9px 13px;
    }

    .chozhan-shop-toolbar .sort-by-product-area {
        gap: 6px;
    }

    .chozhan-shop-toolbar .sort-by-product-area .sort-by-product-wrap {
        padding: 9px 10px;
    }

    .chozhan-shop-toolbar .sort-by-product-area .sort-by-product-wrap .sort-by {
        margin-right: 0;
    }

    .chozhan-shop-toolbar .sort-by-product-area .sort-by-product-wrap .sort-by i {
        margin-right: 6px;
    }

    .chozhan-shop-toolbar .sort-by-product-area .sort-by-product-wrap .sort-by-dropdown-wrap {
        min-width: 0;
    }

    .chozhan-shop-toolbar .sort-by-product-area .sort-by-product-wrap .sort-by-dropdown-wrap span i {
        margin-left: 4px;
    }
}
