/* Ricas UI: make out-of-stock catalog buttons visually distinct. */
body.woocommerce-page .wc-block-product.outofstock .wp-block-woocommerce-product-button .wp-block-button__link,
body.woocommerce-page li.product.outofstock .button {
    background-color: #ffe36d !important;
    border-color: #ffe36d !important;
    color: #111 !important;
}

body.woocommerce-page .wc-block-product.outofstock .wp-block-woocommerce-product-button .wp-block-button__link:hover,
body.woocommerce-page .wc-block-product.outofstock .wp-block-woocommerce-product-button .wp-block-button__link:focus,
body.woocommerce-page li.product.outofstock .button:hover,
body.woocommerce-page li.product.outofstock .button:focus {
    background-color: #f4ce45 !important;
    border-color: #f4ce45 !important;
    color: #111 !important;
}



/* Ricas UI: compact WooCommerce shop/category archive spacing. */
body.tax-product_cat .wp-site-blocks > .wp-block-columns,
body.post-type-archive-product .wp-site-blocks > .wp-block-columns {
    margin-block-start: 24px !important;
}

body.tax-product_cat .wp-block-breadcrumbs,
body.post-type-archive-product .wp-block-breadcrumbs {
    margin-block-start: 0 !important;
    margin-bottom: 0 !important;
}

body.tax-product_cat .wp-block-column > .wp-block-breadcrumbs + .wp-block-query-title,
body.post-type-archive-product .wp-block-column > .wp-block-breadcrumbs + .wp-block-query-title,
body.post-type-archive-product .wp-block-column > .wp-block-breadcrumbs + .ricas-toolkit-shop-h1 {
    margin-block-start: 12px !important;
}

body.tax-product_cat h1.wp-block-query-title,
body.post-type-archive-product h1.wp-block-query-title,
body.post-type-archive-product h1.ricas-toolkit-shop-h1 {
    letter-spacing: 0 !important;
    line-height: 1.05 !important;
    margin-bottom: 0 !important;
}

body.tax-product_cat .wp-block-column > .wp-block-query-title + .wp-block-woocommerce-store-notices,
body.post-type-archive-product .wp-block-column > .wp-block-query-title + .wp-block-woocommerce-store-notices,
body.post-type-archive-product .wp-block-column > .ricas-toolkit-shop-h1 + .wp-block-woocommerce-store-notices {
    margin-block-start: 0 !important;
}

body.tax-product_cat .wp-block-woocommerce-store-notices .woocommerce-notices-wrapper:empty,
body.post-type-archive-product .wp-block-woocommerce-store-notices .woocommerce-notices-wrapper:empty {
    display: none;
}

body.tax-product_cat .wp-block-column > .wp-block-woocommerce-store-notices + .wp-block-group,
body.post-type-archive-product .wp-block-column > .wp-block-woocommerce-store-notices + .wp-block-group {
    margin-block-start: 14px !important;
}

body.tax-product_cat .wp-block-woocommerce-catalog-sorting .woocommerce-ordering,
body.post-type-archive-product .wp-block-woocommerce-catalog-sorting .woocommerce-ordering {
    margin: 0;
}

body.tax-product_cat .wp-block-woocommerce-catalog-sorting select.orderby,
body.post-type-archive-product .wp-block-woocommerce-catalog-sorting select.orderby {
    min-height: 36px;
    padding: 6px 36px 6px 12px;
}

body.tax-product_cat .wp-block-column > .wp-block-group + .wp-block-columns,
body.post-type-archive-product .wp-block-column > .wp-block-group + .wp-block-columns {
    align-items: flex-start;
    margin-block-start: 22px !important;
}

body.tax-product_cat .wp-block-columns .wp-block-column > .wp-block-woocommerce-filter-wrapper:first-child,
body.post-type-archive-product .wp-block-columns .wp-block-column > .wp-block-woocommerce-filter-wrapper:first-child {
    margin-block-start: 0 !important;
}

body.tax-product_cat .wp-block-woocommerce-filter-wrapper,
body.post-type-archive-product .wp-block-woocommerce-filter-wrapper {
    margin-block-start: 22px !important;
}

body.tax-product_cat .wp-block-woocommerce-filter-wrapper h3,
body.post-type-archive-product .wp-block-woocommerce-filter-wrapper h3 {
    font-size: 1.1rem !important;
    letter-spacing: 0 !important;
    line-height: 1.2 !important;
    margin: 0 0 10px !important;
}

body.tax-product_cat .wp-block-woocommerce-product-collection,
body.post-type-archive-product .wp-block-woocommerce-product-collection {
    margin-block-start: 0 !important;
}

body.tax-product_cat .term-description,
body.tax-product_cat .ricas-category-intro,
body.post-type-archive-product .term-description,
body.post-type-archive-product .ricas-category-intro {
    color: #333;
    font-size: 1rem;
    line-height: 1.5;
    margin-block-start: 10px !important;
    max-width: 760px;
}

body.tax-product_cat .term-description p,
body.tax-product_cat .ricas-category-intro p,
body.post-type-archive-product .term-description p,
body.post-type-archive-product .ricas-category-intro p {
    margin: 0;
}

@media (max-width: 768px) {
    body.tax-product_cat .wp-site-blocks > .wp-block-columns,
    body.post-type-archive-product .wp-site-blocks > .wp-block-columns {
        margin-block-start: 18px !important;
    }

    body.tax-product_cat .wp-block-breadcrumbs,
    body.post-type-archive-product .wp-block-breadcrumbs {
        font-size: 0.95rem !important;
    }

    body.tax-product_cat h1.wp-block-query-title,
    body.post-type-archive-product h1.wp-block-query-title {
        font-size: clamp(2.45rem, 11vw, 3.15rem) !important;
        line-height: 1 !important;
    }

    body.tax-product_cat .wp-block-column > .wp-block-breadcrumbs + .wp-block-query-title,
    body.post-type-archive-product .wp-block-column > .wp-block-breadcrumbs + .wp-block-query-title,
    body.post-type-archive-product .wp-block-column > .wp-block-breadcrumbs + .ricas-toolkit-shop-h1 {
        margin-block-start: 10px !important;
    }

    body.tax-product_cat .wp-block-column > .wp-block-woocommerce-store-notices + .wp-block-group,
    body.post-type-archive-product .wp-block-column > .wp-block-woocommerce-store-notices + .wp-block-group {
        margin-block-start: 16px !important;
    }

    body.tax-product_cat .wp-block-woocommerce-catalog-sorting,
    body.post-type-archive-product .wp-block-woocommerce-catalog-sorting {
        width: 100%;
    }

    body.tax-product_cat .wp-block-woocommerce-catalog-sorting select.orderby,
    body.post-type-archive-product .wp-block-woocommerce-catalog-sorting select.orderby {
        background-color: #eeeeee;
        border: 0;
        border-radius: 999px;
        min-height: 40px;
        padding-left: 18px;
        width: 100%;
    }

    body.tax-product_cat .wp-block-column > .wp-block-group + .wp-block-columns,
    body.post-type-archive-product .wp-block-column > .wp-block-group + .wp-block-columns {
        gap: 18px !important;
        margin-block-start: 24px !important;
    }

    body.tax-product_cat .wp-block-woocommerce-filter-wrapper,
    body.post-type-archive-product .wp-block-woocommerce-filter-wrapper {
        margin-block-start: 20px !important;
    }

    body.tax-product_cat .wp-block-woocommerce-filter-wrapper:first-child,
    body.post-type-archive-product .wp-block-woocommerce-filter-wrapper:first-child {
        margin-block-start: 0 !important;
    }

    body.tax-product_cat .wp-block-woocommerce-filter-wrapper h3,
    body.post-type-archive-product .wp-block-woocommerce-filter-wrapper h3 {
        font-size: 1.2rem !important;
        margin-bottom: 8px !important;
    }

    body.tax-product_cat .term-description,
    body.tax-product_cat .ricas-category-intro,
    body.post-type-archive-product .term-description,
    body.post-type-archive-product .ricas-category-intro {
        font-size: 0.98rem;
        line-height: 1.45;
        margin-block-start: 8px !important;
    }
}



/* Ricas UI: keep the single-product sale badge in the cart button green. */
body.single-product .onsale {
    background-color: #c4ff47 !important;
    border-color: #c4ff47 !important;
    color: #000 !important;
}

/* Ricas UI: make the mobile category menu bar self-explanatory. */
@media (max-width: 768px) {
    #mega-menu-wrap-max_mega_menu_1 .mega-menu-toggle {
        position: relative;
    }

    #mega-menu-wrap-max_mega_menu_1 .mega-menu-toggle::before {
        content: "Ava kataloog";
        position: absolute;
        left: 24px;
        top: 50%;
        transform: translateY(-50%);
        color: #fff;
        font-family: inherit;
        font-size: 18px;
        font-weight: 700;
        line-height: 1;
        pointer-events: none;
        z-index: 1;
    }
}



/* Ricas Toolkit: keep visible product EAN aligned with WooCommerce product meta. */
body.single-product .ricas-toolkit-product-identifier.product_meta {
    font-size: 16px;
    line-height: 1.6;
}
