/*
 * Exclusive Shop / Category archive polish v1.4.0
 * Keeps the Bemins AJAX/filter engine, but removes two artificial UI limits:
 * 1) top-level product categories no longer sit inside a one-row Slick carousel;
 * 2) the category filter no longer has a 245px internal scrollbar.
 */

/* Top category navigation ---------------------------------------- */
body.tax-product_cat .woocommerce-product-subcategorie-content,
body.post-type-archive-product .woocommerce-product-subcategorie-content {
    overflow: visible !important;
}

body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded,
body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded {
    display: flex !important;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 22px 26px;
    width: min(100%, 1120px) !important;
    margin: 0 auto 26px !important;
    padding: 0 !important;
    transform: none !important;
    list-style: none;
}

body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded > li,
body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded > li {
    float: none !important;
    width: 118px !important;
    min-width: 0 !important;
    max-width: 118px;
    flex: 0 0 118px;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center;
}

body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded .woocommerce-loop-category__link,
body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded .woocommerce-loop-category__link {
    display: block;
    width: 100%;
    text-decoration: none;
}

body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded img,
body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded img {
    display: block;
    width: 96px !important;
    height: 96px !important;
    max-width: 96px !important;
    margin: 0 auto 12px !important;
    border-radius: 50%;
    object-fit: cover;
}

body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded .woocommerce-loop-category__title,
body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded .woocommerce-loop-category__title {
    margin: 0 !important;
    color: #323232 !important;
    font-family: var(--exclusive-font) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
}

body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded .woocommerce-loop-category__title a,
body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded .woocommerce-loop-category__title a {
    color: inherit !important;
}

body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded > li.active .woocommerce-loop-category__title,
body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded > li.current-product_cat .woocommerce-loop-category__title,
body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded > li.active .woocommerce-loop-category__title {
    color: var(--exclusive-accent, #00866f) !important;
}

/* Once JS unslicks the list, Slick arrows/dots must not leave visual debris. */
body.tax-product_cat .woocommerce-product-subcategorie-content > .slick-arrow,
body.tax-product_cat .woocommerce-product-subcategorie-content > .slick-dots,
body.post-type-archive-product .woocommerce-product-subcategorie-content > .slick-arrow,
body.post-type-archive-product .woocommerce-product-subcategorie-content > .slick-dots {
    display: none !important;
}

/* Sidebar category filter ---------------------------------------- */
body.tax-product_cat .bwp_ajax_filte .filter_category_product,
body.post-type-archive-product .bwp_ajax_filte .filter_category_product,
body.tax-product_cat .filter_category_product,
body.post-type-archive-product .filter_category_product {
    width: 100% !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    overflow-y: visible !important;
    padding-right: 0 !important;
    scrollbar-width: none;
}

body.tax-product_cat .bwp_ajax_filte .filter_category_product::-webkit-scrollbar,
body.post-type-archive-product .bwp_ajax_filte .filter_category_product::-webkit-scrollbar,
body.tax-product_cat .filter_category_product::-webkit-scrollbar,
body.post-type-archive-product .filter_category_product::-webkit-scrollbar {
    display: none !important;
}

/* Keep nested category labels readable when the tree gets taller. */
body.tax-product_cat .filter_category_product .item-category,
body.post-type-archive-product .filter_category_product .item-category {
    line-height: 1.45;
}

body.tax-product_cat .filter_category_product .children,
body.post-type-archive-product .filter_category_product .children {
    padding-bottom: 2px;
}

/* The page itself should scroll naturally instead of creating a scroll-inside-scroll UI. */
body.tax-product_cat .bwp-sidebar,
body.post-type-archive-product .bwp-sidebar {
    overflow: visible;
}

@media (max-width: 1199px) {
    body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded,
    body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded {
        gap: 18px 18px;
    }

    body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded > li,
    body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded > li {
        width: 104px !important;
        max-width: 104px;
        flex-basis: 104px;
    }

    body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded img,
    body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded img {
        width: 86px !important;
        height: 86px !important;
        max-width: 86px !important;
    }
}

@media (max-width: 767px) {
    body.tax-product_cat .woocommerce-product-subcategorie-content,
    body.post-type-archive-product .woocommerce-product-subcategorie-content {
        padding-right: 14px;
        padding-left: 14px;
    }

    body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded,
    body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded {
        justify-content: flex-start;
        gap: 18px 12px;
        width: 100% !important;
    }

    body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded > li,
    body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded > li {
        width: calc(25% - 9px) !important;
        max-width: none;
        flex: 0 0 calc(25% - 9px);
    }

    body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded img,
    body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded img {
        width: min(78px, 19vw) !important;
        height: min(78px, 19vw) !important;
        max-width: none !important;
    }

    body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded .woocommerce-loop-category__title,
    body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded .woocommerce-loop-category__title {
        font-size: 11px !important;
    }
}

/* v1.5.0: deterministic category thumbnail rings -----------------
 * Bemins draws the active ring with a percentage-based ::before pseudo element.
 * Its size changes with responsive link dimensions, which caused the uneven rings
 * seen at some breakpoints. Use the actual circle as the ring instead.
 */
body.tax-product_cat ul.woocommerce-product-subcategories.exclusive-categories-expanded > li > a:first-child::before,
body.post-type-archive-product ul.woocommerce-product-subcategories.exclusive-categories-expanded > li > a:first-child::before {
    display: none !important;
    content: none !important;
}

body.tax-product_cat ul.woocommerce-product-subcategories.exclusive-categories-expanded > li > a:first-child,
body.post-type-archive-product ul.woocommerce-product-subcategories.exclusive-categories-expanded > li > a:first-child {
    display: block !important;
    width: 96px !important;
    height: 96px !important;
    margin: 0 auto 12px !important;
    border-radius: 50% !important;
    box-sizing: border-box !important;
    box-shadow: 0 0 0 1.5px transparent;
    transition: box-shadow .2s ease, transform .2s ease;
}

body.tax-product_cat ul.woocommerce-product-subcategories.exclusive-categories-expanded > li > a:first-child img,
body.post-type-archive-product ul.woocommerce-product-subcategories.exclusive-categories-expanded > li > a:first-child img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}

body.tax-product_cat ul.woocommerce-product-subcategories.exclusive-categories-expanded > li.active > a:first-child,
body.tax-product_cat ul.woocommerce-product-subcategories.exclusive-categories-expanded > li.current-product_cat > a:first-child,
body.post-type-archive-product ul.woocommerce-product-subcategories.exclusive-categories-expanded > li.active > a:first-child {
    box-shadow: 0 0 0 1.5px var(--exclusive-accent, #00866f) !important;
}

@media (hover: hover) {
    body.tax-product_cat ul.woocommerce-product-subcategories.exclusive-categories-expanded > li > a:first-child:hover,
    body.post-type-archive-product ul.woocommerce-product-subcategories.exclusive-categories-expanded > li > a:first-child:hover {
        box-shadow: 0 0 0 1.5px var(--exclusive-accent, #00866f);
    }
}

@media (max-width: 1199px) {
    body.tax-product_cat ul.woocommerce-product-subcategories.exclusive-categories-expanded > li > a:first-child,
    body.post-type-archive-product ul.woocommerce-product-subcategories.exclusive-categories-expanded > li > a:first-child {
        width: 86px !important;
        height: 86px !important;
    }
}

/* Exactly two category tiles per row on phones, with comfortable breathing room. */
@media (max-width: 767px) {
    body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded,
    body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded {
        justify-content: center !important;
        column-gap: 20px !important;
        row-gap: 24px !important;
    }

    body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded > li,
    body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded > li {
        width: calc(50% - 10px) !important;
        max-width: calc(50% - 10px) !important;
        flex: 0 0 calc(50% - 10px) !important;
    }

    body.tax-product_cat ul.woocommerce-product-subcategories.exclusive-categories-expanded > li > a:first-child,
    body.post-type-archive-product ul.woocommerce-product-subcategories.exclusive-categories-expanded > li > a:first-child {
        width: clamp(88px, 27vw, 112px) !important;
        height: clamp(88px, 27vw, 112px) !important;
    }

    body.tax-product_cat .woocommerce-product-subcategories.exclusive-categories-expanded .woocommerce-loop-category__title,
    body.post-type-archive-product .woocommerce-product-subcategories.exclusive-categories-expanded .woocommerce-loop-category__title {
        max-width: 150px;
        margin-right: auto !important;
        margin-left: auto !important;
        font-size: 13px !important;
        line-height: 1.35 !important;
    }
}


/* v1.5.2: category description + compact mobile archive ------------------ */
.exclusive-category-description-anchor {
    display: none !important;
}

body.tax-product_cat .exclusive-category-description {
    width: min(100%, 900px);
    margin: 4px auto 34px;
    color: #454545;
    text-align: left;
}

body.tax-product_cat .exclusive-category-description__content {
    position: relative;
    max-height: 7em;
    overflow: hidden;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.75;
}

body.tax-product_cat .exclusive-category-description__content > :first-child {
    margin-top: 0 !important;
}

body.tax-product_cat .exclusive-category-description__content > :last-child {
    margin-bottom: 0 !important;
}

body.tax-product_cat .exclusive-category-description.is-collapsible:not(.is-expanded) .exclusive-category-description__content::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2.5em;
    content: '';
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 85%);
}

body.tax-product_cat .exclusive-category-description.is-expanded .exclusive-category-description__content {
    max-height: none;
    overflow: visible;
}

body.tax-product_cat .exclusive-category-description__toggle {
    display: none;
    margin: 9px 0 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    border-radius: 0;
    background: transparent !important;
    color: var(--exclusive-accent, #00866f);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
}

body.tax-product_cat .exclusive-category-description.is-collapsible .exclusive-category-description__toggle {
    display: inline-block;
}

body.tax-product_cat .exclusive-category-description__toggle:hover,
body.tax-product_cat .exclusive-category-description__toggle:focus {
    color: #111;
}

@media (max-width: 767px) {
    /* The category-circle navigation is useful on desktop, but on phones it
       pushes the actual products too far down the page. Keep the sidebar/filter
       category tree as the mobile navigation instead. */
    body.tax-product_cat .woocommerce-product-subcategorie-content,
    body.post-type-archive-product .woocommerce-product-subcategorie-content {
        display: none !important;
    }

    body.tax-product_cat .exclusive-category-description {
        width: 100%;
        margin: 18px auto 0;
        padding: 0;
        text-align: left;
    }

    body.tax-product_cat .exclusive-category-description__content {
        max-height: 6.6em;
        font-size: 13px;
        line-height: 1.65;
    }

    body.tax-product_cat .exclusive-category-description__toggle {
        margin-top: 8px;
        font-size: 12px;
    }
}
