/*** ---------- Landing page blocks ---------- ***/
/* Blocks rendered in a landing page, shown on top of the product category archive. */
:is(.wpb-block-landingpages, body.tax-product_cat .wpb-block, body.tax-product_cat .wpb-main-category-header) .wpb-text p { color: var(--clr-text-grey); }

.wpb-block-landingpages {
    &:has(.blaze-slider) { overflow: hidden; }

    .block-header { display: flex; align-items: center; justify-content: space-between;
        .wpb-text { max-width: 90rem; }
    }
    .block-footer { justify-content: center; display: none;
        .btn { width: 100%; justify-content: center; }
    }
    .block-header + .block-body { margin-top: 2.4rem; }
    .block-body + .block-footer { margin-top: 2.4rem; }

    &.wpb-block--lp-category-tags .tags { overflow: visible; }
    :is(ul, ol) { list-style: inside; }

    .blaze-slider { width: 100%;
        .blaze-track-container { overflow: visible; }
        .blaze-track .blaze-track__pair { display: flex; flex-direction: column; gap: var(--slide-gap); }
        .blaze-nav-btn { --br: .6rem; --icon-size: 1.8rem; --bg-color: var(--clr-dark); --inner-color: #FFFF; }
    }

    .wpb-text li { font: inherit;
        + li { margin: 4px 0; }
    }

    @media (max-width: 992px) {
        .block-header + .block-body { margin-top: 1.8rem; }
        .block-body + .block-footer { margin-top: 1.8rem; }
    }
    @media (max-width: 768px) {
        .block-header .btn { display: none; }
        .block-footer { display: flex; }
        .block-header + .block-body { margin-top: 1.4rem; }
    }
    @media (min-width: 1200px) {
        .blaze-slider .blaze-nav-btn { display: none; }
    }
}

section.wpb-block-landingpages { padding: 6.4rem 0;
    &:not(.wpb-block--product-overview) + .wpb-block-landingpages { padding-top: 0; }

    @media (max-width: 992px) {
        padding: 4.8rem 0;
    }
    @media (max-width: 768px) {
        padding: 3.2rem 0;
    }
}


/*** ---------- Block: LP product list ---------- ***/
section.wpb-block__product-list {
    @media (max-width: 575.98px) {
        .wpb-card--product-small { border-radius: .6rem!important; padding: 1rem!important; border-left: none!important; }
        .blaze-track-container { margin: 0 -16px; padding: 0 16px; }
    }
}


/*** ---------- Block: LP text ---------- ***/
section.wpb-block__lp-text {
    .inner { --gap: 2.4rem; --gc: 1; display: grid; grid-template-columns: repeat(var(--gc), minmax(0, 1fr)); gap: var(--gap); }
    .block-header + .block-body { margin-top: 1em; }
    iframe { height: 550px; }

    @media (max-width: 1200px) {
        iframe { height: 500px; }
    }
    @media (max-width: 768px) {
        iframe { height: 320px; }
    }
    @media (max-width: 575.98px) {
        iframe { height: 220px; }
    }
    @media (min-width: 992px) {
        .inner:not(.inner--2col) .wpb-text { max-width: 98rem; }
        .inner.inner--2col { --gap: 4.8rem; --gc: 2; }
    }
    @media (min-width: 1200px) {
        .inner.inner--2col { --gap: 8rem; }
    }
}


/*** ---------- Block: LP text & media ---------- ***/
section.wpb-block--lp-text-media .inner { display: grid; grid-template-columns: 1fr 1fr; gap: 8rem;
    > div { order: 5; }
    .block-content { border-radius: 1.2rem; display: flex; flex-direction: column; justify-content: center; }
    .block-image { border-radius: 1.2rem; overflow: hidden;
        img { height: 100%; object-fit: cover; }
    }

    @media (max-width: 1200px) {
        grid-template-columns: 1fr; gap: 4.8rem;
        .block-image { order: 0; }
    }
    @media (max-width: 992px) {
        gap: 2.4rem;
    }
    @media (max-width: 575.98px) {
        .block-image img { max-height: 250px; }
    }
}


/*** ---------- Block: LP reviews ---------- ***/
section.wpb-block--lp-reviews {
    :is(h2,h3,h4) + .blaze-slider { margin-top: 1.6rem; }

    .blaze-slider { overflow: hidden; padding-bottom: 1px;
        .blaze-track-container { overflow: visible; }
        .blaze-nav-container { position: absolute; bottom: calc(100% + 1.2rem); right: 0;
            button { width: 2.8rem; height: 2.5rem;
                .icon { font-size: 1rem; }
                &.blaze-prev { border-top-right-radius: 0; border-bottom-right-radius: 0; }
                &.blaze-next { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
            }
        }
    }
}


/*** ---------- Block: LP category links ---------- ***/
.wpb-block--lp-category-links {
    .wpb-block__header { padding-bottom: 1.6rem; }

    @media (min-width: 768px) {
        .wpb-block__header { padding-bottom: 3.2rem; }
    }
    @media (min-width: 992px) {
        .wpb-block__header { padding-bottom: 4.4rem; }
    }
}

.wpb-category-links { --gap: 2.4rem; --gc: 2; display: grid; grid-template-columns: repeat(var(--gc), minmax(0, 1fr)); gap: var(--gap);
    a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: transparent; transition: opacity var(--ts-25) ease, text-decoration-color var(--ts-25) ease; }
    .wpb-category-links__item > a { display: block; font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem;
        &:hover { opacity: .7; }
    }
    .wpb-category-links__children { display: flex; flex-direction: column; gap: 0;
        > a { display: flex; align-items: center; min-height: 2.4rem; color: var(--clr-contrast-blue); font-size: 1.3rem;
            &:hover { opacity: .7; text-decoration-color: inherit; }
        }
    }

    @media (min-width: 768px) {
        --gap: 4.8rem; --gc: 3;
        .wpb-category-links__item > a { font-size: 1.6rem; }
        .wpb-category-links__children > a { font-size: 1.4rem; }
    }
    @media (min-width: 1200px) {
        --gap: 8rem; --gc: 4;
    }
}


/*** ---------- Block: Product overview ---------- ***/
.wpb-block--product-overview {
    &:has(+ .wpb-block.wpb-bg-color--transparent) { border-bottom: 1px solid var(--clr-border); }

    .block-header { flex-direction: column; align-items: start; gap: 1.2rem; }

    /* Filters */
    #wux-filters { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

    .wf-multiselect { --br: .4rem; --p: 1.2rem; --border: 1px solid var(--clr-border); position: relative; min-width: clamp(15rem, 10vw, 22rem);
        > label { position: relative; border: var(--border); border-radius: var(--br); margin: 0; cursor: pointer; min-height: 3.8rem; padding: 0 var(--p); display: flex; align-items: center; justify-content: space-between; gap: 2.4rem; transition: border var(--ts-25) ease, box-shadow var(--ts-50) ease, color var(--ts-25) ease; 
            .icon--theme { color: var(--clr-blue); transform-origin: center; transition: transform var(--ts-25) ease; }
        }

        .wf-multiselect-dropdown { position: absolute; border: var(--border); background-color: #FFFF; border-radius: var(--br); top: calc(100% + 1.2rem); left: 0; min-width: 36rem; opacity: 0; transform: translateY(-1.2rem); pointer-events: none; z-index: 555; transition: opacity var(--ts-25) ease, transform var(--ts-25) ease; 
            .wf-multiselect-dropdown-content > * { padding: 0 var(--p); display: flex; align-items: center; gap: .8rem; cursor: pointer; width: 100%; position: relative;
                &:first-child { padding-top: 1.2rem; }
                &:last-child { padding-bottom: 1.2rem; }
                label { width: 100%; transition: color var(--ts-25) ease;
                    &::before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; cursor: pointer; }
                }
                &:hover label { color: var(--clr-blue); }
            }

            .wf-multiselect-dropdown-header { padding: 1rem var(--p); border-bottom: var(--border); display: flex; align-items: center; justify-content: space-between; column-gap: 1rem; 
                span { font-size: 1.6rem; font-weight: bold; }
                .btn { --padding: 0; --size: 3.8rem; width: var(--size); height: var(--size); min-width: var(--size); min-height: auto; justify-content: center; }
            }
            .wf-multiselect-dropdown-footer { padding: var(--p); padding-top: 0;
                .btn { display: flex; width: 100%; justify-content: center; }
            }
        }

        &:is(.open, .is-active) > label { --border: 1px solid var(--clr-blue); color: var(--clr-blue); box-shadow: inset 0 0 0 1px var(--clr-blue); }
        &.is-active > label::after { content: ''; position: absolute; right: calc(var(--p) - .6rem); top: -.6rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; background-color: var(--clr-blue); border: 2px solid #fff; opacity: 0; transform: scale(0); transition: opacity var(--ts-25) ease, transform var(--ts-25) ease; }
        &.is-active:not(.open) > label::after { opacity: 1; transform: scale(1); }
        &.open > label .icon--theme { transform: rotate(180deg); }
        &.open .wf-multiselect-dropdown { opacity: 1; transform: translateY(0); pointer-events: all; }
    }

    @media (max-width: 576px) {
        .wf-multiselect { min-width: fit-content;
            > label { gap: 0.8rem; }
        }
    }
    @media (max-width: 768px) {
        #wux-filters { scroll-snap-type: x mandatory; white-space: nowrap; overflow-x: auto !important; scrollbar-width: none; flex-wrap: nowrap; padding-left: 1.8rem; margin-left: -1.8rem; width: calc(100% + 3.6rem); }
        &:has(.wf-multiselect.open) { overflow: hidden; }

        .wf-multiselect { position: static;
            .wf-multiselect-dropdown { position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column;
                .wf-multiselect-dropdown-header { padding: var(--p);
                    .btn { display: flex; }
                    span { font-size: clamp(1.8rem, 3vw, 2.4rem); }
                }
                .wf-multiselect-dropdown-content { height: 100%; }
            }
        }
    }
    @media (min-width: 768px) {
        .wf-multiselect { --br: .6rem; --p: 1.6rem;
            > label { min-height: 4.6rem; }
        }
    }
}
