/* =========================================================
   BudApproach – Catalog Filter Tabs
   Multi-filter declarative contract v1.4.1
   ========================================================= */

body .ba-strain-tabs-component {
    width: 100%;
}

/*
 * Contract records are configuration only. The hidden attribute is
 * the primary mechanism; this rule protects against page-builder CSS.
 */
body .ba-filter-contract {
    display: none !important;
}

body .ba-strain-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;

    column-gap: 34px;
    row-gap: 14px;

    width: 100%;
    min-height: var(--ba-strain-tabs-height, 0px);

    margin: 8px 0 34px;
    padding: 0;
}

body .ba-strain-tabs > button.ba-strain-tab,
body .ba-strain-tabs > button.ba-strain-tab:hover,
body .ba-strain-tabs > button.ba-strain-tab:focus,
body .ba-strain-tabs > button.ba-strain-tab:active {
    appearance: none;
    -webkit-appearance: none;

    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: auto !important;
    min-width: 0 !important;
    min-height: 42px;
    overflow: visible;

    margin: 0 !important;
    padding: 7px 3px 11px !important;

    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none;

    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;

    color: #656565;
    text-decoration: none !important;
    text-align: center;

    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.65px;
    text-transform: uppercase;

    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

body .ba-strain-tabs > button.ba-strain-tab::before {
    display: none !important;
}

body .ba-strain-tabs > button.ba-strain-tab::after {
    content: "";

    position: absolute;
    bottom: 2px;
    left: 50%;

    display: block;

    width: 70%;
    height: 3px;

    border: 0 !important;
    border-radius: 999px;

    background: #183d32 !important;

    opacity: 0;

    transform:
        translateX(-50%)
        scaleX(0.45);

    transform-origin: center;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

body .ba-strain-tabs > button.ba-strain-tab:hover {
    color: #183d32;
    transform: translateY(-1px);
}

body .ba-strain-tabs > button.ba-strain-tab.is-active {
    color: #183d32;
    font-weight: 700;
}

body .ba-strain-tabs > button.ba-strain-tab:hover::after,
body .ba-strain-tabs > button.ba-strain-tab.is-active::after {
    opacity: 1;

    transform:
        translateX(-50%)
        scaleX(1);
}

body .ba-strain-tabs > button.ba-strain-tab:focus-visible {
    outline: 2px solid #183d32 !important;
    outline-offset: 5px;
}

/*
 * JavaScript resolves each Product Filters source widget, finds the
 * Elementor widget ancestor that owns its WoodMart form, and adds this
 * class. Hiding the ancestor removes the layout gap without requiring a
 * new CSS selector for every product filter added later.
 */
.ba-product-filter-source-host--hidden {
    display: none !important;
}

/*
 * No broad .elementor-element fallback is used here. A source class may
 * live on a shared container that also owns Catalog Tabs; hiding that
 * container would remove the complete tab interface. JavaScript resolves
 * and hides only a safe form-owning ancestor. If resolution is uncertain,
 * it deliberately leaves the source visible instead of hiding the tabs.
 */

/*
 * Featured star badge.
 * Server-side output is controlled by ba-featured-star.php and uses
 * the same Product Collection → Featured term as the FEATURED tab.
 */
body .product-grid-item,
body li.product {
    position: relative;
}

body .product-grid-item .ba-featured-star-badge,
body li.product .ba-featured-star-badge {
    position: absolute;
    z-index: 12;
    top: 12px;
    left: 12px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(24, 61, 50, 0.22);

    background: #183d32;
    color: #f4c542;

    font-size: 19px;
    line-height: 1;

    pointer-events: none;
}

body.single-product
    .summary
    > .ba-featured-star-badge {
    position: static;

    width: 36px;
    height: 36px;
    margin: 0 0 12px;
}

@media (max-width: 1024px) {
    body .ba-strain-tabs {
        column-gap: 28px;
    }

    body .ba-strain-tabs > button.ba-strain-tab {
        font-size: 15px;
    }
}

@media (max-width: 767px) {
    body .ba-strain-tabs {
        justify-content: flex-start;
        flex-wrap: nowrap;

        column-gap: 24px;

        margin-bottom: 26px;
        padding: 0 4px 5px;

        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    body .ba-strain-tabs::-webkit-scrollbar {
        display: none;
    }

    body .ba-strain-tabs > button.ba-strain-tab {
        flex: 0 0 auto;

        min-height: 38px;
        font-size: 14px;
        white-space: nowrap;
    }

    body .product-grid-item .ba-featured-star-badge,
    body li.product .ba-featured-star-badge {
        top: 8px;
        left: 8px;

        width: 30px;
        height: 30px;
        font-size: 17px;
    }
}
