/* Woo archives only. WoodMart and shop-filters.js retain all commerce behavior. */
body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) {
    --uh-catalog-top: 16px;
}

body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar .widget {
    margin-bottom: 18px;
    padding-bottom: 18px;
    min-width: 0;
}

body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar .widget-title {
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

/* Never target the main product loop, mini-cart, or other product widgets. */
body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar .widget_recently_viewed_products .product_list_widget > li {
    margin: 0 0 10px;
    padding: 0 0 10px;
    font-size: 13px;
    line-height: 1.4;
}

body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar .widget_recently_viewed_products .widget-product-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar .widget_recently_viewed_products .widget-product-img {
    flex: 0 0 52px;
    width: 52px;
    margin: 0;
}

body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar .widget_recently_viewed_products .product_list_widget img {
    display: block;
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    height: 52px;
    object-fit: contain;
    margin: 0;
    border-radius: 4px;
}

body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar .widget_recently_viewed_products .widget-product-info {
    flex: 1 1 0;
    min-width: 0;
}

body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar .widget_recently_viewed_products .wd-entities-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: 0;
}

/* Full title remains in the native link/title attribute and is revealed on focus. */
body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar .widget_recently_viewed_products .wd-entities-title:focus-visible {
    display: block;
    -webkit-line-clamp: unset;
}

body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar .widget_recently_viewed_products .price {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
    overflow-wrap: anywhere;
}

body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar :is(select,.uray-shop-filter-toggle,.uray-category-go,.wd-widget-stock-status li > a) {
    min-height: 44px;
    max-width: 100%;
}

body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar .wd-widget-stock-status li > a {
    display: flex;
    align-items: center;
}

body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) :is(.wd-sidebar,.wd-show-sidebar-btn) :is(a,button,input,select):focus-visible {
    outline: 2px solid var(--wd-primary-color, #6b2874);
    outline-offset: 2px;
}

/* Respect the theme's mobile visibility rules and its native drawer trigger. */
body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-show-sidebar-btn :is(a,button) {
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--brdcolor-gray-300, #d7d8dc);
    border-radius: 4px;
    white-space: normal;
    line-height: 1.4;
}

@media (min-width: 1025px) and (min-height: 600px) {
    body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-content-layout:not(.wd-sidebar-hidden-lg) > .wd-sidebar:not(.wd-side-hidden) {
        position: sticky;
        top: var(--uh-catalog-top);
        align-self: start;
        display: flex;
        flex-direction: column;
        min-height: 0;
        max-height: calc(100vh - var(--uh-catalog-top) - 16px);
        max-height: calc(100dvh - var(--uh-catalog-top) - 16px);
    }

    body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-content-layout:not(.wd-sidebar-hidden-lg) > .wd-sidebar:not(.wd-side-hidden) > .widget-area {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-gutter: stable;
        padding: 3px 6px 3px 3px;
    }

    body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar > .uray-shop-filter-actions {
        flex: 0 0 auto;
        margin: 0;
        padding-block: 12px 0;
    }
}

@media (max-width: 1024px) {
    body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar.wd-side-hidden .wd-widget {
        padding-inline: 20px;
    }

    body.uray-shell-active:is(.post-type-archive-product,.tax-product_cat):not(.uray-b2b-page) .wd-sidebar.wd-side-hidden > .widget-area {
        padding-block: 18px;
        scroll-padding-block: 12px;
    }
}
