/* DetailingClub archive and category interaction fixes. */

/* Covers supplier templates that print the label outside wc_get_stock_html().
   Never hide .onbackorder: that class belongs to the entire product card. */
html body .stock.available-on-supplier-order,
html body .stock.available-on-backorder,
html body .backorder_notification {
    display: none !important;
}

body.dc-storefront-polish.woocommerce-shop,
body.dc-storefront-polish.post-type-archive-product,
body.dc-storefront-polish.tax-product_cat {
    background: var(--dc-shop-bg-catalog, #0b0b0b) !important;
}

body.dc-storefront-polish.woocommerce-shop .site-content,
body.dc-storefront-polish.post-type-archive-product .site-content,
body.dc-storefront-polish.tax-product_cat .site-content {
    background: var(--dc-shop-bg-catalog, #0b0b0b) !important;
}

body.dc-storefront-polish.woocommerce-shop .elementor-element-c3ea3ca > .e-con-inner,
body.dc-storefront-polish.post-type-archive-product .elementor-element-c3ea3ca > .e-con-inner,
body.dc-storefront-polish.tax-product_cat .elementor-element-c3ea3ca > .e-con-inner {
    width: min(100% - 32px, var(--dc-shop-content-width, 1240px)) !important;
    max-width: var(--dc-shop-content-width, 1240px) !important;
    margin-inline: auto !important;
}

/* Keep the desktop filter in its own stable column. */
@media (min-width: 922px) {
    body.dc-storefront-polish.woocommerce-shop .elementor-element-c3ea3ca > .e-con-inner,
    body.dc-storefront-polish.post-type-archive-product .elementor-element-c3ea3ca > .e-con-inner,
    body.dc-storefront-polish.tax-product_cat .elementor-element-c3ea3ca > .e-con-inner {
        display: grid !important;
        grid-template-columns: var(--dc-shop-sidebar-width, 290px) minmax(0, 1fr) !important;
        gap: var(--dc-shop-layout-gap, 24px) !important;
        align-items: start !important;
    }

    body.dc-storefront-polish.woocommerce-shop .elementor-widget-sidebar,
    body.dc-storefront-polish.post-type-archive-product .elementor-widget-sidebar,
    body.dc-storefront-polish.tax-product_cat .elementor-widget-sidebar,
    body.dc-storefront-polish.woocommerce-shop .elementor-widget-sidebar .elementor-widget-container,
    body.dc-storefront-polish.post-type-archive-product .elementor-widget-sidebar .elementor-widget-container,
    body.dc-storefront-polish.tax-product_cat .elementor-widget-sidebar .elementor-widget-container,
    body.dc-storefront-polish.woocommerce-shop .elementor-widget-sidebar .ast-filter-wrap,
    body.dc-storefront-polish.post-type-archive-product .elementor-widget-sidebar .ast-filter-wrap,
    body.dc-storefront-polish.tax-product_cat .elementor-widget-sidebar .ast-filter-wrap,
    body.dc-storefront-polish.woocommerce-shop .wc-block-product-filters,
    body.dc-storefront-polish.post-type-archive-product .wc-block-product-filters,
    body.dc-storefront-polish.tax-product_cat .wc-block-product-filters {
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
        transform: none !important;
    }
}

body.dc-storefront-polish.woocommerce-shop .elementor-widget-sidebar .wc-block-product-filters,
body.dc-storefront-polish.post-type-archive-product .elementor-widget-sidebar .wc-block-product-filters,
body.dc-storefront-polish.tax-product_cat .elementor-widget-sidebar .wc-block-product-filters {
    box-sizing: border-box !important;
    padding: 18px !important;
    background: var(--dc-shop-surface, #fff) !important;
    border: 1px solid #d8dde2 !important;
    border-radius: var(--dc-shop-radius, 8px) !important;
    box-shadow: 0 10px 28px rgb(0 0 0 / 10%) !important;
    color: var(--dc-shop-ink, #071831) !important;
    overflow: visible !important;
}

/* Restore a slim, usable price range. */
body.dc-storefront-polish .wc-block-components-price-slider__range-input-wrapper,
body.dc-storefront-polish .price_slider_wrapper .ui-widget-content,
body.dc-storefront-polish .price_slider {
    height: 4px !important;
    min-height: 4px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #cfd5da !important;
    box-shadow: none !important;
}

body.dc-storefront-polish .price_slider_wrapper .ui-slider-range,
body.dc-storefront-polish .price_slider .ui-slider-range {
    height: 4px !important;
    background: var(--dc-shop-lime, #a1d40f) !important;
}

body.dc-storefront-polish .price_slider_wrapper .ui-slider-handle,
body.dc-storefront-polish .price_slider .ui-slider-handle {
    top: 50% !important;
    width: 18px !important;
    height: 18px !important;
    margin-top: 0 !important;
    border: 1px solid var(--dc-shop-lime, #a1d40f) !important;
    border-radius: 50% !important;
    background: var(--dc-shop-surface, #fff) !important;
    box-shadow: 0 2px 6px rgb(0 0 0 / 16%) !important;
    transform: translateY(-50%) !important;
}

/* A category tile must behave as one large link, not as text with dead space. */
body.dc-storefront-polish li.product-category,
body.dc-storefront-polish .woocommerce-loop-category,
body.dc-storefront-polish .wc-block-product-category,
body.dc-storefront-polish .dc-whole-category-card {
    position: relative !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    cursor: pointer !important;
    background: var(--dc-shop-surface, #fff) !important;
    border: 1px solid #d8dde2 !important;
    border-radius: var(--dc-shop-radius, 8px) !important;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease !important;
}

body.dc-storefront-polish li.product-category > a,
body.dc-storefront-polish .woocommerce-loop-category > a,
body.dc-storefront-polish .wc-block-product-category > a,
body.dc-storefront-polish .dc-whole-category-card > a {
    display: flex !important;
    width: 100% !important;
    min-height: 100% !important;
    box-sizing: border-box !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 18px !important;
    color: var(--dc-shop-ink, #071831) !important;
    text-align: center !important;
    text-decoration: none !important;
}

body.dc-storefront-polish li.product-category:hover,
body.dc-storefront-polish .woocommerce-loop-category:hover,
body.dc-storefront-polish .wc-block-product-category:hover,
body.dc-storefront-polish .dc-whole-category-card:hover,
body.dc-storefront-polish .dc-whole-category-card:focus-visible {
    border-color: var(--dc-shop-lime, #a1d40f) !important;
    box-shadow: 0 12px 28px rgb(0 0 0 / 14%) !important;
    transform: translateY(-2px) !important;
    outline: none !important;
}

@media (max-width: 921px) {
    body.dc-storefront-polish.woocommerce-shop .elementor-element-c3ea3ca > .e-con-inner,
    body.dc-storefront-polish.post-type-archive-product .elementor-element-c3ea3ca > .e-con-inner,
    body.dc-storefront-polish.tax-product_cat .elementor-element-c3ea3ca > .e-con-inner {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        padding: 18px 14px 28px !important;
    }

    body.dc-storefront-polish.woocommerce-shop .wc-block-product-filters__open-overlay,
    body.dc-storefront-polish.post-type-archive-product .wc-block-product-filters__open-overlay,
    body.dc-storefront-polish.tax-product_cat .wc-block-product-filters__open-overlay,
    body.dc-storefront-polish.woocommerce-shop .woocommerce-ordering,
    body.dc-storefront-polish.post-type-archive-product .woocommerce-ordering,
    body.dc-storefront-polish.tax-product_cat .woocommerce-ordering,
    body.dc-storefront-polish.woocommerce-shop .woocommerce-ordering select,
    body.dc-storefront-polish.post-type-archive-product .woocommerce-ordering select,
    body.dc-storefront-polish.tax-product_cat .woocommerce-ordering select {
        display: flex !important;
        width: 100% !important;
        max-width: none !important;
        margin-inline: 0 !important;
        box-sizing: border-box !important;
    }

    body.dc-storefront-polish.woocommerce-shop .wc-block-product-filters__open-overlay,
    body.dc-storefront-polish.post-type-archive-product .wc-block-product-filters__open-overlay,
    body.dc-storefront-polish.tax-product_cat .wc-block-product-filters__open-overlay {
        min-height: 50px !important;
        margin-bottom: 12px !important;
    }
}
