/* =========================================================
   WooCommerce Overrides (Token-Driven)
   Source of truth: assets/css/global-styles.css
   ========================================================= */

body.woocommerce,
body.woocommerce-page {
    color: var(--text-body);
    font-family: var(--font-family-body);
}

body.woocommerce .woocommerce,
body.woocommerce-page .woocommerce,
body.woocommerce .woocommerce-page,
body.woocommerce-page .woocommerce-page {
    color: inherit;
}

/* 1) Base reset + normalization */
body.woocommerce {
    background-color: var(--surface-page);
}

/* Strip default GeneratePress light containers on Woo pages. */
:is(body.woocommerce, body.woocommerce-page, body.search-results) :is(#primary,
    #main,
    .site-content,
    .content-area,
    .site-main,
    .inside-article,
    .inside-page-header,
    .inside-content-header,
    .entry-content,
    .entry-summary,
    .comments-area) {
    background: transparent !important;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

:is(body.woocommerce, body.woocommerce-page) :is(.wc-block-cart,
    .wc-block-checkout,
    .wc-block-components-sidebar-layout,
    .wc-block-components-main,
    .wc-block-components-sidebar,
    .wc-block-components-order-summary,
    .wc-block-components-totals-wrapper,
    .wc-block-components-panel,
    .wc-block-components-checkout-step) {
    background: var(--surface-section);
    border-color: var(--border-subtle);
}

/* Page rhythm (legacy layout logic, tokenized) */
body.woocommerce.archive .ast-woocommerce-container,
body.post-type-archive-product .ast-woocommerce-container,
body.tax-product_cat .ast-woocommerce-container,
body.tax-product_tag .ast-woocommerce-container,
body.single-product .ast-woocommerce-container,
body.woocommerce-cart .ast-woocommerce-container,
body.woocommerce-checkout .ast-woocommerce-container,
body.woocommerce-account .ast-woocommerce-container {
    padding: 0;
    margin: 0;
}

body.woocommerce :is(.woocommerce-notices-wrapper,
    .woocommerce-products-header,
    .woocommerce-result-count,
    .woocommerce-ordering) {
    margin-bottom: var(--layout-content-gap);
}

.woocommerce ul.products,
.woocommerce-page ul.products,
body.woocommerce ul.products,
body.woocommerce-page ul.products,
body.woocommerce ul.products li.product,
body.woocommerce-page ul.products li.product {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.woocommerce .woocommerce-ordering,
body.woocommerce .woocommerce-result-count,
body.woocommerce .woocommerce-breadcrumb,
body.woocommerce .woocommerce-breadcrumb a,
body.woocommerce .woocommerce-breadcrumb .separator,
body.woocommerce .woocommerce-order,
body.woocommerce .woocommerce-order-overview,
body.woocommerce .woocommerce-order-details,
body.woocommerce .woocommerce-customer-details,
body.woocommerce .woocommerce-no-products-found,
body.woocommerce .woocommerce-info,
body.woocommerce .woocommerce-message,
body.woocommerce .woocommerce-error,
body.woocommerce .woocommerce-store-notice,
body.woocommerce .wc-block-components-notices,
body.woocommerce .wc-block-components-notice-banner,
body.woocommerce .wc-block-components-notice-banner__content,
body.woocommerce .wc-block-components-validation-error,
body.woocommerce .woocommerce-form,
body.woocommerce .woocommerce-form-row,
body.woocommerce .woocommerce-form-row--wide,
body.woocommerce .woocommerce-form__label,
body.woocommerce .woocommerce-form__label-for-checkbox,
body.woocommerce .woocommerce-Input,
body.woocommerce .woocommerce-Input--text,
body.woocommerce .wp-block-woocommerce-checkout,
body.woocommerce .wp-block-woocommerce-checkout-fields-block,
body.woocommerce .wp-block-woocommerce-checkout-order-summary-block,
body.woocommerce .wp-block-woocommerce-checkout-totals-block,
body.woocommerce .wp-block-woocommerce-cart,
body.woocommerce .wp-block-woocommerce-cart-order-summary-block,
body.woocommerce .wp-block-woocommerce-empty-cart-block,
body.woocommerce .wc-block-cart,
body.woocommerce .wc-block-grid,
body.woocommerce .wc-block-grid__products,
body.woocommerce .wp-block-woocommerce-customer-account,
body.woocommerce .wc-block-customer-account__dropdown,
body.woocommerce .woocommerce-search-list__list,
body.woocommerce .woocommerce-search-list__search,
body.woocommerce .woocommerce-search-list__item-label,
body.woocommerce .woocommerce-search-list__item-prefix {
    color: var(--text-body);
    font-family: var(--font-family-body);
}

/* 2) Headings + text */
body.woocommerce h1,
body.woocommerce h2 {
    color: var(--text-primary);
    font-family: var(--font-family-display);
    font-weight: var(--font-weight-display);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

body.woocommerce h3,
body.woocommerce h4,
body.woocommerce div.product .product_title,
body.woocommerce .woocommerce-loop-product__title,
body.woocommerce .wc-block-cart__empty-cart__title,
body.woocommerce #order_review_heading,
body.woocommerce #ship-to-different-address,
body.woocommerce .woocommerce-Address-title,
body.woocommerce .woocommerce-column__title,
body.woocommerce .wc-block-order-confirmation-summary-list-item__key,
body.woocommerce .wc-block-components-product-details {
    color: var(--text-primary);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heading);
}

body.woocommerce .woocommerce-products-header__title {
    font-family: var(--font-family-display);
    font-size: var(--font-size-h1);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

body.woocommerce div.product .product_title {
    font-family: var(--font-family-heading);
    font-size: clamp(2rem, 1.6rem + 2.2vw, 2.8rem);
    font-weight: var(--font-weight-heading);
    letter-spacing: 0.01em;
    text-transform: none;
}

body.woocommerce-cart h1,
body.woocommerce-checkout h1,
body.woocommerce-account h1,
body.woocommerce-order-received h1,
body.woocommerce-cart h2,
body.woocommerce-checkout h2,
body.woocommerce-account h2,
body.woocommerce-order-received h2 {
    font-family: var(--font-family-display);
    font-weight: var(--font-weight-display);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

body.woocommerce .wc-block-cart__empty-cart__title::before,
body.woocommerce .cart-empty::before,
body.woocommerce .wp-block-woocommerce-empty-cart-block h2::before {
    display: none !important;
    content: none !important;
}

body.woocommerce .wc-block-cart__empty-cart__title svg {
    display: none !important;
}

body.woocommerce .wc-block-cart__empty-cart__title.with-empty-cart-icon {
    padding-left: 0 !important;
    display: block !important;
    text-align: center;
}

/* My Account: Scalable buttons for smaller screens */
body.woocommerce-account .woocommerce-MyAccount-content .button,
body.woocommerce-account .woocommerce-MyAccount-content .o2b-button {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.85rem;
    min-height: 2.5rem;
}

@media (max-width: 768px) {

    body.woocommerce-account .woocommerce-MyAccount-content .button,
    body.woocommerce-account .woocommerce-MyAccount-content .o2b-button {
        width: 100%;
        margin-bottom: var(--space-xs);
    }
}

/* Wishlist: Mobile table fix (prevent breakout) */
@media (max-width: 768px) {
    body.woocommerce table.wishlist_table {
        display: block !important;
        width: 100% !important;
        border: none !important;
    }

    body.woocommerce table.wishlist_table thead {
        display: none !important;
    }

    body.woocommerce table.wishlist_table tbody,
    body.woocommerce table.wishlist_table tr,
    body.woocommerce table.wishlist_table td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    body.woocommerce table.wishlist_table tr {
        margin-bottom: var(--space-lg) !important;
        padding: var(--layout-card-padding) !important;
        border: 1px solid var(--border-subtle) !important;
        background: var(--surface-panel) !important;
        border-radius: var(--radius-sm) !important;
    }

    body.woocommerce table.wishlist_table td {
        text-align: left !important;
        padding: var(--space-xs) 0 !important;
        border: none !important;
    }

    body.woocommerce table.wishlist_table td.product-thumbnail {
        text-align: center !important;
        padding-bottom: var(--space-md) !important;
    }

    body.woocommerce table.wishlist_table td.product-thumbnail img {
        max-width: 120px !important;
        margin: 0 auto !important;
    }

    body.woocommerce table.wishlist_table td.product-name::before {
        content: 'Product: ';
        font-weight: 600;
        color: var(--text-muted);
    }

    body.woocommerce table.wishlist_table td.product-price::before {
        content: 'Price: ';
        font-weight: 600;
        color: var(--text-muted);
    }

    body.woocommerce table.wishlist_table td.product-stock-status::before {
        content: 'Status: ';
        font-weight: 600;
        color: var(--text-muted);
    }
}

/* Notice Button Contrast (View Cart) */
body.woocommerce .woocommerce-notices-wrapper .button.wc-forward,
body.woocommerce .woocommerce-message .button.wc-forward {
    background-color: var(--btn-secondary-bg) !important;
    color: var(--btn-secondary-text) !important;
    border: 1px solid var(--btn-secondary-border) !important;
    font-weight: var(--font-weight-ui) !important;
    font-size: 0.82rem !important;
}

body.woocommerce .woocommerce-notices-wrapper .button.wc-forward:hover {
    background-color: var(--btn-secondary-hover-bg) !important;
    color: var(--btn-secondary-hover-text) !important;
}

body.woocommerce .wp-block-woocommerce-empty-cart-block {
    background: var(--surface-section);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: none;
    padding: var(--layout-card-padding);
    max-width: 48rem;
    margin: var(--space-2xl) auto;
}

body.woocommerce .wp-block-woocommerce-empty-cart-block :is(.wc-block-components-button, .o2b-button) {
    border-radius: var(--radius-sm) !important;
    min-height: 2.75rem;
    padding: 0 var(--space-lg);
    font-family: var(--font-family-ui);
    font-size: 0.9rem;
    font-weight: var(--font-weight-ui);
}

body.woocommerce-account .o2b-button.o2b-button--primary,
body.woocommerce-page .o2b-button.o2b-button--primary {
    color: var(--btn-primary-text) !important;
    background: var(--btn-primary-bg) !important;
    border-color: var(--btn-primary-border) !important;
}

body.woocommerce-account .o2b-button.o2b-button--primary:hover,
body.woocommerce-page .o2b-button.o2b-button--primary:hover {
    color: var(--btn-primary-hover-text) !important;
    -webkit-text-fill-color: var(--btn-primary-hover-text) !important;
    background: var(--btn-primary-hover-bg) !important;
    border-color: var(--btn-primary-hover-border) !important;
}

/* 3) Links */
body.woocommerce a,
body.woocommerce-page a,
body.woocommerce a:visited,
body.woocommerce-page a:visited,
body.woocommerce .woocommerce-info a,
body.woocommerce .woocommerce-message a,
body.woocommerce .woocommerce-error a,
body.woocommerce .woocommerce-breadcrumb a,
body.woocommerce .product_meta a,
body.woocommerce .woocommerce-widget-layered-nav-list__item a,
body.woocommerce .widget_product_categories a,
body.woocommerce .widget_layered_nav a,
body.woocommerce .widget_categories a,
body.woocommerce .widget_archive a,
body.woocommerce .widget_recent_entries a,
body.woocommerce .widget_pages a,
body.woocommerce .widget_nav_menu a,
body.woocommerce .tagcloud a,
body.woocommerce .woocommerce-table__product-name a,
body.woocommerce table.shop_table td.product-name a,
body.woocommerce .reset_variations {
    color: var(--link-content);
    background-image: none;
    text-decoration: none;
}

body.woocommerce a:hover,
body.woocommerce-page a:hover,
body.woocommerce .woocommerce-info a:hover,
body.woocommerce .woocommerce-message a:hover,
body.woocommerce .woocommerce-error a:hover,
body.woocommerce .product_meta a:hover,
body.woocommerce .woocommerce-widget-layered-nav-list__item a:hover,
body.woocommerce .current-menu-item>a,
body.woocommerce .cat-item.current-cat>a,
body.woocommerce .woocommerce-widget-layered-nav-list__item--chosen a,
body.woocommerce .reset_variations:hover {
    color: var(--link-content-hover);
    background-image: none;
}

body.woocommerce .woocommerce-breadcrumb a,
body.woocommerce .widget_product_categories a,
body.woocommerce .widget_layered_nav a,
body.woocommerce .widget_categories a,
body.woocommerce .widget_archive a,
body.woocommerce .widget_recent_entries a,
body.woocommerce .widget_pages a,
body.woocommerce .widget_nav_menu a,
body.woocommerce .tagcloud a {
    color: var(--link-utility);
    text-decoration: none;
}

body.woocommerce .woocommerce-breadcrumb a:hover,
body.woocommerce .widget_product_categories a:hover,
body.woocommerce .widget_layered_nav a:hover,
body.woocommerce .widget_categories a:hover,
body.woocommerce .widget_archive a:hover,
body.woocommerce .widget_recent_entries a:hover,
body.woocommerce .widget_pages a:hover,
body.woocommerce .widget_nav_menu a:hover,
body.woocommerce .tagcloud a:hover {
    color: var(--link-utility-hover);
}

body.woocommerce a.o2b-button.o2b-button--primary {
    color: var(--btn-primary-text) !important;
    background: var(--btn-primary-bg) !important;
    border-color: var(--btn-primary-border) !important;
}

body.woocommerce a.o2b-button.o2b-button--primary:hover {
    color: var(--btn-primary-hover-text) !important;
    background: var(--btn-primary-hover-bg) !important;
    border-color: var(--btn-primary-hover-border) !important;
}

body.woocommerce .woocommerce-breadcrumb,
body.woocommerce .woocommerce-breadcrumb * {
    background: transparent;
}

/* 4) Buttons (classic + blocks + account) */
body.woocommerce #respond input#submit,
body.woocommerce a.button,
body.woocommerce button.button,
body.woocommerce input.button,
body.woocommerce #respond input#submit.alt,
body.woocommerce a.button.alt,
body.woocommerce button.button.alt,
body.woocommerce input.button.alt,
body.woocommerce .single_add_to_cart_button,
body.woocommerce-checkout #place_order,
body.woocommerce-checkout button#place_order.alt,
body.woocommerce .wc-proceed-to-checkout a,
body.woocommerce .woocommerce-button,
body.woocommerce .woocommerce-Button,
body.woocommerce .coupon .button,
body.woocommerce .wc-block-components-button,
body.woocommerce .wc-block-components-product-button__button,
body.woocommerce .wc-block-mini-cart__button,
body.woocommerce .wc-block-next-previous-buttons__button,
body.woocommerce .wc-block-attribute-filter__button,
body.woocommerce .wc-block-components-filter-submit-button,
body.woocommerce .wc-block-components-panel__button,
body.woocommerce .wc-block-components-drawer__content .wc-block-components-button {
    appearance: none;
    border: 1px solid var(--btn-primary-border);
    border-radius: var(--radius-none);
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    font-family: var(--font-family-ui);
    font-size: 0.9rem;
    font-weight: var(--font-weight-ui);
    line-height: 1;
    text-align: center;
    min-height: 2.75rem;
    padding: var(--space-sm) var(--space-lg);
    text-decoration: none;
    transition:
        background-color var(--transition-base),
        color var(--transition-base),
        border-color var(--transition-base),
        box-shadow var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Cart/checkout CTA text must stay legible even if plugins override colors. */
body.woocommerce :is(.wc-block-mini-cart__button,
    .wc-proceed-to-checkout a,
    a.checkout-button,
    button.checkout-button,
    .checkout-button,
    .wc-block-cart__submit-button,
    .wc-block-components-checkout-place-order-button,
    .wc-block-components-order-summary__button) {
    color: var(--btn-primary-text) !important;
    -webkit-text-fill-color: var(--btn-primary-text) !important;
}

body.woocommerce .wc-block-mini-cart__button,
body.woocommerce .wc-block-mini-cart__footer-actions .wc-block-components-button {
    background: var(--btn-secondary-bg) !important;
    border-color: var(--btn-secondary-border) !important;
    color: var(--btn-secondary-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-text) !important;
}

body.woocommerce .wc-block-mini-cart__button:hover,
body.woocommerce .wc-block-mini-cart__footer-actions .wc-block-components-button:hover {
    background: var(--btn-secondary-hover-bg) !important;
    border-color: var(--btn-secondary-hover-border) !important;
    color: var(--btn-secondary-hover-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-hover-text) !important;
}

body.woocommerce .wc-block-mini-cart__button:active,
body.woocommerce .wc-block-mini-cart__footer-actions .wc-block-components-button:active {
    background: var(--btn-secondary-active-bg) !important;
    border-color: var(--btn-secondary-active-border) !important;
    color: var(--btn-secondary-active-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-active-text) !important;
}

body.woocommerce :is(.wc-block-mini-cart__button,
    .wc-proceed-to-checkout a,
    a.checkout-button,
    button.checkout-button,
    .checkout-button,
    .wc-block-cart__submit-button,
    .wc-block-components-checkout-place-order-button,
    .wc-block-components-order-summary__button):hover {
    color: var(--btn-primary-hover-text) !important;
    -webkit-text-fill-color: var(--btn-primary-hover-text) !important;
}

body.woocommerce :is(.wc-block-mini-cart__button,
    .wc-proceed-to-checkout a,
    a.checkout-button,
    button.checkout-button,
    .checkout-button,
    .wc-block-cart__submit-button,
    .wc-block-components-checkout-place-order-button,
    .wc-block-components-order-summary__button):active {
    color: var(--btn-primary-active-text) !important;
    -webkit-text-fill-color: var(--btn-primary-active-text) !important;
}

/* Keep link underline effects off button-like anchors. */
body.woocommerce :is(a.button,
    .wc-proceed-to-checkout a,
    .woocommerce-button,
    .woocommerce-Button,
    .added_to_cart,
    .wp-element-button,
    .wc-block-components-button,
    .wc-block-components-product-button__button,
    .wc-block-mini-cart__button) {
    background-image: none !important;
    text-decoration: none !important;
}

body.woocommerce :is(a.button:hover,
    .wc-proceed-to-checkout a:hover,
    .woocommerce-button:hover,
    .woocommerce-Button:hover,
    .added_to_cart:hover,
    .wp-element-button:hover,
    .wc-block-components-button:hover,
    .wc-block-components-product-button__button:hover,
    .wc-block-mini-cart__button:hover) {
    background-image: none !important;
    text-decoration: none !important;
}

body.woocommerce :is(a.button,
    .wc-proceed-to-checkout a,
    .woocommerce-button,
    .woocommerce-Button,
    .added_to_cart,
    .wp-element-button,
    .wc-block-components-button,
    .wc-block-components-product-button__button,
    .wc-block-mini-cart__button) svg {
    fill: currentColor;
    stroke: currentColor;
}

body.woocommerce ul.products li.product.first,
body.woocommerce-page ul.products li.product.first,
body.woocommerce ul.products li.product.last,
body.woocommerce-page ul.products li.product.last {
    margin-right: 0 !important;
    margin-left: 0 !important;
    clear: none !important;
}

body.woocommerce .single_add_to_cart_button,
body.woocommerce div.product form.cart .single_add_to_cart_button {
    border-radius: var(--radius-none);
    width: min(100%, clamp(16rem, 46vw, 24rem));
    min-height: 3rem;
}

body.woocommerce :is(a.button,
    button.button,
    input.button,
    .woocommerce-button,
    .wc-block-components-button,
    .wc-block-components-product-button__button,
    .single_add_to_cart_button,
    .added_to_cart) {
    border-radius: var(--radius-none) !important;
}

body.woocommerce a.button.ghost,
body.woocommerce button.button.ghost,
body.woocommerce .cart .button,
body.woocommerce .wc-block-mini-cart__footer-actions .wc-block-components-button,
body.woocommerce .wc-block-components-button.is-tertiary,
body.woocommerce .wc-block-components-button.is-secondary {
    background: var(--btn-secondary-bg);
    border-color: var(--btn-secondary-border);
    color: var(--btn-secondary-text);
}

body.woocommerce #respond input#submit:hover,
body.woocommerce a.button:hover,
body.woocommerce button.button:hover,
body.woocommerce input.button:hover,
body.woocommerce #respond input#submit.alt:hover,
body.woocommerce a.button.alt:hover,
body.woocommerce button.button.alt:hover,
body.woocommerce input.button.alt:hover,
body.woocommerce .single_add_to_cart_button:hover,
body.woocommerce-checkout button#place_order.alt:hover,
body.woocommerce .wc-proceed-to-checkout a:hover,
body.woocommerce .coupon .button:hover,
body.woocommerce .wc-block-components-button:hover,
body.woocommerce .wc-block-components-product-button__button:hover,
body.woocommerce .wc-block-mini-cart__button:hover,
body.woocommerce .wc-block-next-previous-buttons__button:hover,
body.woocommerce .wc-block-attribute-filter__button:hover,
body.woocommerce .wc-block-components-filter-submit-button:hover,
body.woocommerce .wc-block-components-panel__button:hover {
    background: var(--btn-primary-hover-bg);
    border-color: var(--btn-primary-hover-border);
    color: var(--btn-primary-hover-text);
}

body.woocommerce #respond input#submit:active,
body.woocommerce a.button:active,
body.woocommerce button.button:active,
body.woocommerce input.button:active,
body.woocommerce #respond input#submit.alt:active,
body.woocommerce a.button.alt:active,
body.woocommerce button.button.alt:active,
body.woocommerce input.button.alt:active,
body.woocommerce .single_add_to_cart_button:active,
body.woocommerce .wc-proceed-to-checkout a:active,
body.woocommerce .coupon .button:active,
body.woocommerce .wc-block-components-button:active,
body.woocommerce .wc-block-components-product-button__button:active {
    background: var(--btn-primary-active-bg);
    border-color: var(--btn-primary-active-border);
    color: var(--btn-primary-active-text);
}

body.woocommerce-checkout #place_order {
    background: var(--btn-primary-bg);
    border-color: var(--btn-primary-border);
    color: var(--btn-primary-text);
    font-size: 1.125rem;
    padding: var(--space-lg);
    width: 100%;
}

body.woocommerce-checkout #place_order:hover {
    background: var(--btn-primary-hover-bg);
    border-color: var(--btn-primary-hover-border);
    color: var(--btn-primary-hover-text);
}

body.woocommerce-checkout #place_order:active {
    background: var(--btn-primary-active-bg);
    border-color: var(--btn-primary-active-border);
    color: var(--btn-primary-active-text);
}

body.woocommerce :is(#respond input#submit,
    a.button,
    button.button,
    input.button,
    .wp-element-button,
    .single_add_to_cart_button,
    .wc-proceed-to-checkout a,
    .woocommerce-button,
    .woocommerce-Button,
    .coupon .button,
    .wc-block-components-button,
    .wc-block-components-product-button__button,
    .wc-block-mini-cart__button,
    .wc-block-next-previous-buttons__button,
    .wc-block-attribute-filter__button,
    .wc-block-components-filter-submit-button,
    .wc-block-components-panel__button):is(:hover, :focus-visible, :active) {
    transform: none !important;
}

body.woocommerce .wc-proceed-to-checkout a {
    background: var(--btn-primary-bg);
    border-color: var(--btn-primary-border);
    color: var(--btn-primary-text);
}

/* Block proceed-to-checkout button (Woo Blocks). */
body.woocommerce .wp-block-woocommerce-proceed-to-checkout-block .wc-block-components-button {
    background: var(--btn-primary-bg);
    border-color: var(--btn-primary-border);
    color: var(--btn-primary-text);
    -webkit-text-fill-color: var(--btn-primary-text);
}

/* Checkout (Blocks) primary action button sometimes ships with low-contrast defaults. */
body.woocommerce-checkout .wc-block-checkout__actions :is(button, a).wc-block-components-button,
body.woocommerce-checkout .wp-block-woocommerce-checkout-actions-block :is(button, a).wc-block-components-button {
    background: var(--btn-primary-bg) !important;
    border-color: var(--btn-primary-border) !important;
    color: var(--btn-primary-text) !important;
    -webkit-text-fill-color: var(--btn-primary-text) !important;
}

body.woocommerce .wc-proceed-to-checkout a:hover {
    background: var(--btn-primary-hover-bg);
    border-color: var(--btn-primary-hover-border);
    color: var(--btn-primary-hover-text);
}

body.woocommerce .wp-block-woocommerce-proceed-to-checkout-block .wc-block-components-button:hover {
    background: var(--btn-primary-hover-bg);
    border-color: var(--btn-primary-hover-border);
    color: var(--btn-primary-hover-text);
    -webkit-text-fill-color: var(--btn-primary-hover-text);
}

body.woocommerce-checkout .wc-block-checkout__actions :is(button, a).wc-block-components-button:hover,
body.woocommerce-checkout .wp-block-woocommerce-checkout-actions-block :is(button, a).wc-block-components-button:hover {
    background: var(--btn-primary-hover-bg) !important;
    border-color: var(--btn-primary-hover-border) !important;
    color: var(--btn-primary-hover-text) !important;
    -webkit-text-fill-color: var(--btn-primary-hover-text) !important;
}

body.woocommerce ul.products li.product .button:hover,
body.woocommerce ul.products li.product .button:hover *,
body.woocommerce .wc-block-grid__product .wc-block-components-product-button__button:hover,
body.woocommerce .wc-block-grid__product .wc-block-components-product-button__button:hover * {
    color: var(--btn-primary-hover-text) !important;
}

body.woocommerce .single_variation_wrap .single_add_to_cart_button:disabled,
body.woocommerce .single_variation_wrap .single_add_to_cart_button.disabled,
body.woocommerce button.button:disabled,
body.woocommerce button.button:disabled[disabled],
body.woocommerce .wc-block-components-button:disabled,
body.woocommerce .wc-block-components-button[disabled],
body.woocommerce .wc-block-components-product-button__button:disabled,
body.woocommerce a.button.loading,
body.woocommerce button.button.loading,
body.woocommerce input.button.loading {
    background: var(--disabled-surface);
    border-color: var(--border-strong);
    color: var(--text-secondary);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.9;
}

/* Variant button: "select an option" state — visible but clearly inactive */
body.single-product .single_variation_wrap .single_add_to_cart_button.wc-variation-selection-needed,
body.single-product .single_variation_wrap .single_add_to_cart_button.disabled.wc-variation-selection-needed,
body.single-product .single_variation_wrap .single_add_to_cart_button.wc-variation-selection-needed:disabled,
body.single-product .single_variation_wrap .single_add_to_cart_button.disabled.wc-variation-selection-needed:disabled {
    background: var(--btn-primary-bg) !important;
    border: 1px dashed var(--btn-primary-border) !important;
    color: var(--btn-primary-text) !important;
    -webkit-text-fill-color: var(--btn-primary-text) !important;
    opacity: 0.62 !important;
    cursor: default !important;
    pointer-events: none !important;
}

/* Variant button: "unavailable" state — distinct signal */
body.single-product .single_variation_wrap .single_add_to_cart_button.wc-variation-is-unavailable {
    background: var(--disabled-surface) !important;
    border: 1px solid var(--border-strong) !important;
    color: var(--text-secondary) !important;
    -webkit-text-fill-color: var(--text-secondary) !important;
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

body.single-product .single_variation_wrap .single_add_to_cart_button:not(:disabled):hover {
    background: var(--btn-primary-hover-bg);
    border-color: var(--btn-primary-hover-border);
    color: var(--btn-primary-hover-text);
}

body.woocommerce a.button.loading::after,
body.woocommerce button.button.loading::after,
body.woocommerce input.button.loading::after {
    color: inherit;
}

body.woocommerce table.shop_table a.remove,
body.woocommerce table.shop_table a.remove:hover {
    background: transparent;
    border: 0;
    color: var(--link-destructive);
}

body.woocommerce table.shop_table td.product-remove {
    width: 2.25rem;
    padding-right: 0;
}

body.woocommerce table.shop_table a.remove {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body.woocommerce table.shop_table a.remove:hover,
body.woocommerce table.shop_table a.remove:focus-visible {
    color: var(--urgent-fill);
    background: color-mix(in srgb, var(--urgent-fill) 10%, transparent);
    outline: none;
    box-shadow: var(--shadow-focus);
}

/* 5) Product cards / loop / related / cross-sells / upsells */
body.woocommerce :is(ul.products,
    .wc-block-grid__products,
    .wc-block-product-template) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--layout-grid-gap);
    grid-auto-flow: row;
    align-items: stretch;
    align-content: start;
}

body.woocommerce :is(ul.products,
    .wc-block-grid__products,
    .wc-block-product-template)::before,
body.woocommerce :is(ul.products,
    .wc-block-grid__products,
    .wc-block-product-template)::after {
    content: none !important;
    display: none !important;
}

body.woocommerce ul.products.columns-1 {
    grid-template-columns: 1fr;
}

body.woocommerce ul.products.columns-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.woocommerce ul.products.columns-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.woocommerce ul.products.columns-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.woocommerce ul.products.columns-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.woocommerce :is(ul.products li.product,
    .wc-block-grid__product,
    .wc-block-product-template > li,
    .wc-block-product-template > li.wc-block-product) {
    float: none !important;
    clear: none !important;
    width: auto !important;
    margin: 0 !important;
    min-width: 0;
}

body.woocommerce ul.products li.product,
body.woocommerce .upsells.products ul.products li.product,
body.woocommerce .related.products ul.products li.product,
body.woocommerce .cross-sells ul.products li.product,
body.woocommerce-cart .cross-sells ul.products li.product,
body.woocommerce-cart .upsells.products ul.products li.product,
body.woocommerce .wc-block-grid__product,
body.woocommerce .wc-block-cart__cross-sells .wc-block-grid__product,
body.woocommerce .wp-block-woocommerce-product-recommendations .wc-block-grid__product,
body.woocommerce .wp-block-woocommerce-related-products .wc-block-grid__product,
body.woocommerce-checkout .wc-block-checkout__cross-sells .wc-block-grid__product,
body.woocommerce .wp-block-woocommerce-product-collection .wc-block-grid__product,
body.woocommerce .wc-block-all-products .wc-block-grid__product,
body.woocommerce .wc-block-product-template>li,
body.woocommerce .wc-block-product-template>li.wc-block-product {
    background: var(--surface-section);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: none;
    padding: 0;
    transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    /* Reduced from clamp(14.5rem, 20vw, 20rem) — less bulky cards */
    min-height: clamp(12rem, 15vw, 17rem);
}

/* 5.1) Cart + empty cart recommendations: harden against block/plugin overrides. */
body.woocommerce-cart .cross-sells ul.products li.product,
body.woocommerce .wc-block-cart__cross-sells .wc-block-grid__product,
body.woocommerce .wp-block-woocommerce-cart .wp-block-woocommerce-cart-cross-sells-block .wc-block-grid__product,
body.woocommerce .wp-block-woocommerce-related-products .wc-block-grid__product,
body.woocommerce .wp-block-woocommerce-product-recommendations .wc-block-grid__product,
body.woocommerce .wp-block-woocommerce-product-collection .wc-block-product {
    background: var(--surface-section) !important;
    border-color: var(--border-strong) !important;
    color: var(--text-body);
}

body.woocommerce-cart .cross-sells ul.products li.product:hover,
body.woocommerce .wc-block-cart__cross-sells .wc-block-grid__product:hover,
body.woocommerce .wp-block-woocommerce-cart .wp-block-woocommerce-cart-cross-sells-block .wc-block-grid__product:hover,
body.woocommerce .wp-block-woocommerce-related-products .wc-block-grid__product:hover,
body.woocommerce .wp-block-woocommerce-product-recommendations .wc-block-grid__product:hover,
body.woocommerce .wp-block-woocommerce-product-collection .wc-block-product:hover {
    border-color: var(--border-strong) !important;
}

body.woocommerce .wp-block-woocommerce-product-collection .wc-block-product :is(.wc-block-grid__product-title, .wc-block-components-product-name),
body.woocommerce .wp-block-woocommerce-related-products .wc-block-grid__product-title,
body.woocommerce .wp-block-woocommerce-product-recommendations .wc-block-grid__product-title,
body.woocommerce .wc-block-cart__cross-sells .wc-block-grid__product-title {
    color: var(--text-primary) !important;
}

body.woocommerce .wp-block-woocommerce-product-collection .wc-block-product :is(.wc-block-grid__product-price, .wc-block-components-product-price),
body.woocommerce .wp-block-woocommerce-related-products .wc-block-grid__product-price,
body.woocommerce .wp-block-woocommerce-product-recommendations .wc-block-grid__product-price,
body.woocommerce .wc-block-cart__cross-sells .wc-block-grid__product-price {
    color: var(--text-body) !important;
}

body.woocommerce ul.products li.product:hover,
body.woocommerce .upsells.products ul.products li.product:hover,
body.woocommerce .related.products ul.products li.product:hover,
body.woocommerce .cross-sells ul.products li.product:hover,
body.woocommerce .wc-block-grid__product:hover,
body.woocommerce .wp-block-woocommerce-cart-cross-sells-block .wc-block-grid__product:hover,
body.woocommerce .wc-block-product-template>li:hover,
body.woocommerce .wc-block-product-template>li.wc-block-product:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

body.woocommerce .woocommerce-ordering {
    margin-bottom: var(--layout-content-gap);
    float: none;
}

body.woocommerce .woocommerce-result-count {
    margin: 0 0 var(--layout-content-gap);
    float: none;
}

body.woocommerce ul.products li.product:hover,
body.woocommerce ul.products li.product:focus-within,
body.woocommerce .upsells.products ul.products li.product:hover,
body.woocommerce .related.products ul.products li.product:hover,
body.woocommerce .cross-sells ul.products li.product:hover,
body.woocommerce .wc-block-grid__product:hover,
body.woocommerce .wc-block-product-template>li:hover,
body.woocommerce .wc-block-product-template>li.wc-block-product:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

body.woocommerce ul.products li.product .woocommerce-loop-product__link {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1 1 auto;
    height: 100%;
    /* Tighter padding for less bulk */
    padding: clamp(0.75rem, 1.2vw, 1.1rem);
}

/* Alias: legacy LoopProduct link class (some themes/plugins still emit this). */
body.woocommerce ul.products li.product .woocommerce-LoopProduct-link {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    flex: 1 1 auto;
    height: 100%;
    padding: clamp(0.75rem, 1.2vw, 1.1rem);
}

body.woocommerce ul.products li.product> :is(.button, .added_to_cart),
body.woocommerce ul.products li.product .wc-block-components-product-button {
    margin: var(--space-sm) var(--layout-card-padding) var(--layout-card-padding);
    width: calc(100% - (var(--layout-card-padding) * 2));
    order: 4;
}

body.woocommerce ul.products li.product :is(.button,
    .added_to_cart,
    .wc-block-components-product-button__button) {
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Surgical: full class chain hardening for archive add-to-cart buttons. */
body.woocommerce ul.products li.product a.button.product_type_simple.add_to_cart_button.ajax_add_to_cart,
body.woocommerce ul.products li.product a.button.product_type_variable.add_to_cart_button {
    width: 100%;
    max-width: 100%;
}

body.woocommerce ul.products li.product a img,
body.woocommerce .wc-block-grid__product .wc-block-components-product-image,
body.woocommerce .wc-block-components-product-image,
body.woocommerce .wc-block-components-product-image--aspect-ratio-auto,
body.woocommerce .wc-block-product-gallery,
body.woocommerce .wc-block-product-gallery-thumbnails,
body.woocommerce .wc-block-product-gallery-thumbnails__scrollable {
    border-radius: var(--radius-none);
    border: none;
    background: transparent;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Surgical: direct thumbnail class support (Woo core). */
body.woocommerce img.attachment-woocommerce_thumbnail {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

body.woocommerce .woocommerce-product-gallery__trigger {
    display: none !important;
}

body.woocommerce ul.products li.product a img {
    width: 100%;
    /* Middle-ground: square aspect keeps cards balanced without cropping tall products */
    aspect-ratio: 1 / 1;
    object-fit: cover;
    /* Top-biased so product heads/logos appear rather than base/feet */
    object-position: center 15%;
    margin: 0;
}

body.woocommerce ul.products li.product .woocommerce-loop-product__title,
body.woocommerce .wc-block-grid__product-title,
body.woocommerce .wc-block-components-product-details,
body.woocommerce .wc-block-components-product-metadata {
    color: var(--text-primary);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heading-soft);
    font-size: 1rem;
    line-height: 1.35;
    margin: 0;
    text-align: left;
    order: 2;
    flex-grow: 0;
}

body.woocommerce ul.products li.product .woocommerce-loop-product__title {
    display: block;
    min-height: 0;
    overflow: visible;
    white-space: normal;
    text-overflow: unset;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

body.woocommerce ul.products li.product .woocommerce-loop-category__title {
    font-family: var(--font-family-ui);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--metal);
    margin: 0;
    text-align: left;
    order: 1;
    /* Add padding to the category title card block so text doesn't hit borders */
    padding: clamp(0.75rem, 1.2vw, 1.1rem) clamp(0.85rem, 1.4vw, 1.25rem);
    background: var(--surface-section);
}

body.woocommerce ul.products li.product .woocommerce-loop-category__title mark,
body.search-results ul.products li.product .woocommerce-loop-category__title mark {
    display: inline;
    padding: 0;
    margin: 0 0 0 0.35rem;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
}

body.woocommerce ul.products li.product .price,
body.woocommerce .wc-block-components-product-price,
body.woocommerce .wc-block-grid__product-price {
    margin: 0;
    text-align: left;
    order: 3;
    margin-top: 0.35rem;
}

body.woocommerce .wc-block-grid__product-add-to-cart,
body.woocommerce .wc-block-components-product-button {
    margin-top: var(--space-sm);
}

body.woocommerce :is(.wc-block-grid__product,
    .wc-block-product-template > li,
    .wc-block-product-template > li.wc-block-product) {
    padding: var(--layout-card-padding);
    gap: var(--space-sm);
}

body.woocommerce :is(.wc-block-grid__product .wc-block-components-product-details,
    .wc-block-grid__product .wc-block-components-product-price,
    .wc-block-grid__product .wc-block-grid__product-title,
    .wc-block-product-template > li .wc-block-components-product-details,
    .wc-block-product-template > li .wc-block-components-product-price,
    .wc-block-product-template > li .wc-block-grid__product-title) {
    margin: 0;
}

/* Add breathing room around recommendations. */
body.woocommerce :is(.upsells.products,
    .related.products,
    .cross-sells,
    .wc-block-cart__cross-sells,
    .wc-block-checkout__cross-sells,
    .wp-block-woocommerce-cart-cross-sells-block,
    .wp-block-woocommerce-related-products,
    .wp-block-woocommerce-product-recommendations) {
    margin-top: var(--space-3xl);
}

body.woocommerce :is(.upsells.products ul.products,
    .related.products ul.products,
    .cross-sells ul.products,
    .wc-block-cart__cross-sells :is(ul.wc-block-grid__products, .wc-block-grid__products),
    .wc-block-checkout__cross-sells :is(ul.wc-block-grid__products, .wc-block-grid__products),
    .wp-block-woocommerce-cart-cross-sells-block :is(ul.wc-block-grid__products, .wc-block-grid__products)) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--layout-grid-gap);
}

body.woocommerce :is(.upsells.products ul.products li.product,
    .related.products ul.products li.product,
    .cross-sells ul.products li.product) {
    /* Reduced from clamp(16.5rem, 22vw, 22rem) */
    min-height: clamp(13rem, 17vw, 19rem);
}

/* 6) Prices + stock */
body.woocommerce .price,
body.woocommerce p.price,
body.woocommerce span.price,
body.woocommerce div.product p.price,
body.woocommerce div.product span.price,
body.woocommerce .woocommerce-variation-price .price,
body.woocommerce .woocommerce-variation .price,
body.woocommerce .wc-block-components-product-price,
body.woocommerce .wc-block-components-product-price__value,
body.woocommerce .wc-block-grid__product-price,
body.woocommerce .wc-block-components-formatted-money-amount,
body.woocommerce .wc-block-formatted-money-amount,
body.woocommerce .woocommerce-Price-currencySymbol {
    color: var(--text-primary);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heading);
}

body.woocommerce ul.products li.product .price {
    font-size: 1.5rem;
}

body.woocommerce div.product p.price {
    font-size: clamp(1.75rem, 1.4rem + 2vw, 2.25rem);
    color: var(--text-primary);
    margin-bottom: var(--layout-content-gap);
}

body.woocommerce .price ins,
body.woocommerce .wc-block-components-product-price ins,
body.woocommerce .wc-block-grid__product-price ins {
    text-decoration: none;
    color: var(--urgent-text);
}

body.woocommerce .price ins .woocommerce-Price-currencySymbol,
body.woocommerce .price del .woocommerce-Price-currencySymbol,
body.woocommerce .wc-block-components-product-price ins .wc-block-formatted-money-amount__currency,
body.woocommerce .wc-block-components-product-price del .wc-block-formatted-money-amount__currency {
    color: inherit;
}

body.woocommerce .price del,
body.woocommerce .wc-block-components-product-price del,
body.woocommerce .wc-block-grid__product-price del {
    color: var(--text-muted);
    opacity: 0.8;
}

body.woocommerce :is(.woocommerce-Price-amount,
    .wc-block-formatted-money-amount,
    .wc-block-components-formatted-money-amount) :is(.woocommerce-Price-currencySymbol,
    .wc-block-formatted-money-amount__currency) {
    color: inherit;
    font: inherit;
}

body.woocommerce .price .from,
body.woocommerce .wc-block-components-product-price .from {
    color: var(--text-secondary);
    font-family: var(--font-family-ui);
    font-size: var(--font-size-small);
    text-transform: uppercase;
}

body.woocommerce .stock,
body.woocommerce .stock.in-stock,
body.woocommerce .stock.available-on-backorder,
body.woocommerce .woocommerce-variation-availability .stock {
    color: var(--success-text);
    font-family: var(--font-family-ui);
    font-size: var(--font-size-small);
}

body.woocommerce .stock.out-of-stock,
body.woocommerce .out-of-stock-badge,
body.woocommerce .wc-block-grid__product-out-of-stock {
    color: var(--urgent-text);
}

/* 7) Badges / on sale */
body.woocommerce span.onsale,
body.woocommerce .wc-block-grid__product-onsale {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2xs);
    border-radius: var(--radius-none);
    background: var(--urgent-fill);
    color: var(--btn-urgent-text);
    font-family: var(--font-family-ui);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.5;
    padding: 0.42rem 0.68rem;
    margin: 0;
    z-index: 100;
    min-height: auto;
    min-width: auto;
    height: auto;
    width: auto;
    max-width: 150px;
    transform: none;
}

body.woocommerce :is(ul.products li.product,
    .wc-block-grid__product,
    .wc-block-product-template > li,
    .wc-block-product-template > li.wc-block-product) {
    position: relative;
}

body.woocommerce :is(ul.products li.product span.onsale,
    ul.products li.product .wc-block-grid__product-onsale,
    .wc-block-grid__product span.onsale,
    .wc-block-grid__product .wc-block-grid__product-onsale) {
    position: absolute;
    top: 1rem !important;
    right: 1rem !important;
    left: auto !important;
}

body.single-product div.product :is(div.images, .woocommerce-product-gallery) {
    position: relative;
    background: var(--surface-panel);
    border: 1px solid var(--border-strong);
    padding: clamp(0.95rem, 1.4vw, 1.25rem);
}

body.single-product div.product :is(div.images, .woocommerce-product-gallery) span.onsale {
    position: absolute;
    top: 1rem !important;
    right: 1rem !important;
    left: auto !important;
}

body.woocommerce ul.products li.product .out-of-stock-badge,
body.woocommerce ul.products li.product .wc-block-grid__product-out-of-stock,
body.search-results ul.products li.product .out-of-stock-badge {
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-family: var(--font-family-ui);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    padding: 0.42rem 0.68rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-none);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 1rem !important;
    left: 1rem !important;
    right: auto !important;
    transform: none;
    z-index: 100;
    width: auto;
    text-align: center;
}

body.woocommerce span.onsale::before,
body.woocommerce .wc-block-grid__product-onsale::before,
body.woocommerce .wc-block-grid__product-out-of-stock::before {
    color: currentColor;
}

/* 8) Forms + inputs (classic + blocks + account + coupon) */
body.woocommerce form .form-row input.input-text,
body.woocommerce form .form-row textarea,
body.woocommerce form .form-row select,
body.woocommerce .select2-container .select2-selection--single,
body.woocommerce .woocommerce-Input,
body.woocommerce .woocommerce-Input--text,
body.woocommerce .woocommerce-form__input,
body.woocommerce .coupon .input-text,
body.woocommerce #coupon_code,
body.woocommerce #customer_login input,
body.woocommerce .quantity .qty,
body.woocommerce .wc-block-components-text-input input,
body.woocommerce .wc-block-components-text-input textarea,
body.woocommerce .wc-blocks-components-select__select,
body.woocommerce .wc-block-gateway-input,
body.woocommerce .wc-card-cvc-element,
body.woocommerce .wc-card-expiry-element,
body.woocommerce .wc-block-components-quantity-selector,
body.woocommerce .wc-block-components-radio-control,
body.woocommerce .wc-block-components-radio-control__option,
body.woocommerce .wc-block-components-radio-control-accordion-option,
body.woocommerce .wc-block-components-checkbox {
    width: 100%;
    background: var(--field-bg) !important;
    border: 1px solid var(--field-border) !important;
    border-radius: var(--radius-none) !important;
    /* Strictly enforce sharp corners */
    color: var(--field-text) !important;
    font-family: var(--font-family-body);
    padding: var(--space-sm) var(--space-md) !important;
    transition: border-color var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}

/* Checkout field + headings harmonization for Woo blocks */
body.woocommerce-checkout select#shipping-country.wc-blocks-components-select__select {
    background: var(--field-bg) !important;
    border-color: var(--field-border) !important;
    color: var(--field-text) !important;
}

body.woocommerce-checkout select#billing-country.wc-blocks-components-select__select {
    background: var(--field-bg) !important;
    border-color: var(--field-border) !important;
    color: var(--field-text) !important;
}

body.woocommerce-checkout .wc-block-components-checkout-place-order-button__text {
    color: var(--btn-primary-text) !important;
    font-family: var(--font-family-ui);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

body.woocommerce-checkout h3.wc-block-components-product-name {
    color: var(--text-primary);
    font-family: var(--font-family-display);
    font-weight: var(--font-weight-display);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Checkout (blocks): soften fields so they are less harsh */
body.woocommerce-checkout :is(.wc-block-components-text-input input,
    .wc-block-components-text-input textarea,
    .wc-block-gateway-input,
    .wc-card-cvc-element,
    .wc-card-expiry-element,
    .wc-block-components-radio-control__option,
    .wc-block-components-radio-control-accordion-option,
    .wc-block-components-checkbox,
    .wc-block-components-quantity-selector) {
    background: color-mix(in srgb, var(--surface-control) 92%, var(--surface-panel)) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text-body) !important;
}

/* Fix for white flash during autofill or generic styling */
body.woocommerce :is(input, textarea, select):-webkit-autofill,
body.woocommerce :is(input, textarea, select):-webkit-autofill:hover,
body.woocommerce :is(input, textarea, select):-webkit-autofill:focus {
    -webkit-text-fill-color: var(--field-text) !important;
    -webkit-box-shadow: 0 0 0px 1000px var(--field-bg) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

body.woocommerce form .form-row select,
body.woocommerce .woocommerce-ordering select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-repeat: no-repeat;
    background-position: calc(100% - 1rem) calc(50% - 1px), calc(100% - 0.65rem) calc(50% - 1px);
    background-size: 6px 6px, 6px 6px;
    padding-right: 2.5rem !important;
}

body.woocommerce form .form-row input.input-text:focus,
body.woocommerce form .form-row textarea:focus,
body.woocommerce form .form-row select:focus,
body.woocommerce .select2-container--default.select2-container--open .select2-selection--single,
body.woocommerce .woocommerce-Input:focus,
body.woocommerce .woocommerce-Input--text:focus,
body.woocommerce .coupon .input-text:focus,
body.woocommerce .quantity .qty:focus,
body.woocommerce .wc-block-components-text-input input:focus,
body.woocommerce .wc-block-components-text-input textarea:focus,
body.woocommerce .wc-blocks-components-select__select:focus,
body.woocommerce .wc-block-components-radio-control__option:focus-within,
body.woocommerce .wc-block-components-checkbox:focus-within {
    border-color: var(--metal) !important;
    background: var(--surface-raised) !important;
    outline: none !important;
    box-shadow: none !important;
    /* Remove generic glows */
}

body.woocommerce .quantity .minus,
body.woocommerce .quantity .plus {
    background: var(--surface-control);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    border-radius: var(--radius-none);
}

body.woocommerce .quantity .minus:hover,
body.woocommerce .quantity .plus:hover {
    background: var(--surface-raised);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

body.woocommerce .woocommerce-form__input-checkbox,
body.woocommerce form .form-row .input-checkbox,
body.woocommerce .wc-block-components-checkbox input[type="checkbox"],
body.woocommerce .wc-block-product-filter-checkbox-list__input {
    accent-color: var(--interactive);
}

body.woocommerce .select2-container--default .select2-selection--single .select2-selection__rendered,
body.woocommerce .select2-container--default .select2-selection--single .select2-selection__arrow,
body.woocommerce .wc-block-components-radio-control__label,
body.woocommerce .wc-block-components-radio-control__description {
    color: var(--text-secondary);
}

body.woocommerce :is(input.input-text,
    textarea,
    select,
    .woocommerce-Input,
    .woocommerce-Input--text,
    .coupon .input-text,
    .wc-block-components-text-input input,
    .wc-block-components-text-input textarea)::placeholder {
    color: var(--field-placeholder);
    opacity: 1;
}

body.woocommerce :is(input.input-text,
    textarea,
    select,
    .woocommerce-Input,
    .woocommerce-Input--text,
    .coupon .input-text,
    .wc-block-components-text-input input,
    .wc-block-components-text-input textarea):disabled {
    background: var(--field-disabled-bg);
    border-color: var(--field-disabled-border);
    color: var(--field-disabled-text);
}

body.woocommerce :is(input.input-text,
    textarea,
    select,
    .woocommerce-Input,
    .woocommerce-Input--text,
    .coupon .input-text,
    .wc-block-components-text-input input,
    .wc-block-components-text-input textarea)[aria-invalid="true"],
body.woocommerce .form-row.woocommerce-invalid :is(input.input-text,
    textarea,
    select,
    .select2-container) {
    border-color: var(--field-invalid-border);
    background: var(--field-invalid-bg);
}

body.woocommerce .form-row.woocommerce-validated :is(input.input-text,
    textarea,
    select,
    .select2-container) {
    border-color: var(--field-success-border);
    background: var(--field-success-bg);
}

/* 8.1) Empty states */
body.woocommerce :is(.woocommerce-no-products-found,
    .cart-empty,
    .wc-block-cart__empty-cart__title,
    .wp-block-woocommerce-empty-cart-block) {
    background: var(--surface-panel);
    border: 1px solid var(--border-strong);
    color: var(--text-body);
    padding: var(--space-lg);
}

/* 9) Notices + info/error boxes + action feedback */
body.woocommerce .woocommerce-message,
body.woocommerce .woocommerce-info,
body.woocommerce .woocommerce-error,
body.woocommerce .woocommerce-store-notice,
body.woocommerce .woocommerce-message--info,
body.woocommerce .woocommerce-message--success,
body.woocommerce .wc-block-components-notice-banner,
body.woocommerce .wc-block-components-notice-banner__content,
body.woocommerce .wc-block-components-notices,
body.woocommerce .wc-block-components-validation-error {
    background: var(--surface-panel) !important;
    border: 1px solid var(--border-strong) !important;
    border-left-width: 4px !important;
    border-radius: var(--radius-sm);
    box-shadow: none;
    color: var(--text-body);
    margin-bottom: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    font-family: var(--font-family-body);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

body.woocommerce .woocommerce-message,
body.woocommerce .woocommerce-message--success {
    border-left-color: var(--notice-success-border) !important;
    border-left-style: solid;
}

body.woocommerce .woocommerce-error {
    border-left-color: var(--notice-error-border) !important;
    border-left-style: double;
}

body.woocommerce .woocommerce-info,
body.woocommerce .woocommerce-message--info,
body.woocommerce .wc-block-components-notice-banner {
    border-left-color: var(--notice-info-border) !important;
    border-left-style: dashed;
}

body.woocommerce .woocommerce-info::before,
body.woocommerce .woocommerce-message::before,
body.woocommerce .woocommerce-error::before,
body.woocommerce .wc-block-components-notice-banner__dismiss {
    color: currentColor;
}

/* Mini cart + checkout buttons harmonized */
body.woocommerce .wc-block-mini-cart__button,
body.woocommerce .wc-block-mini-cart__footer-actions .wc-block-components-button,
body.woocommerce a.o2b-button.o2b-button--primary[href*="checkout"] {
    background: var(--btn-secondary-bg) !important;
    border-color: var(--btn-secondary-border) !important;
    color: var(--btn-secondary-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-text) !important;
}

body.woocommerce .wc-block-mini-cart__button:hover,
body.woocommerce .wc-block-mini-cart__footer-actions .wc-block-components-button:hover,
body.woocommerce a.o2b-button.o2b-button--primary[href*="checkout"]:hover {
    background: var(--btn-secondary-hover-bg) !important;
    border-color: var(--btn-secondary-hover-border) !important;
    color: var(--btn-secondary-hover-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-hover-text) !important;
}

/* View basket / add-to-cart confirmation buttons: quieter, still legible */
body.woocommerce :is(.added_to_cart,
    .woocommerce-message .button,
    .woocommerce-info .button,
    .woocommerce-error .button) {
    background: var(--btn-secondary-bg) !important;
    border-color: var(--btn-secondary-border) !important;
    color: var(--btn-secondary-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-text) !important;
    box-shadow: none;
}

body.woocommerce a.added_to_cart.wc-forward {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.85rem 1rem;
    font-family: var(--font-family-ui);
    font-size: 0.85rem;
    font-weight: var(--font-weight-strong);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    gap: 0.5rem;
}

body.woocommerce :is(.added_to_cart,
    .woocommerce-message .button,
    .woocommerce-info .button,
    .woocommerce-error .button):hover {
    background: var(--btn-secondary-hover-bg) !important;
    border-color: var(--btn-secondary-hover-border) !important;
    color: var(--btn-secondary-hover-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-hover-text) !important;
}

/* 10) Cart + checkout tables / panels */
@media (max-width: 768px) {

    body.woocommerce table.shop_table,
    body.woocommerce table.shop_table_responsive,
    body.woocommerce .woocommerce-checkout-review-order-table {
        display: block !important;
        width: 100% !important;
        border: none !important;
    }

    body.woocommerce table.shop_table thead {
        display: none !important;
    }

    body.woocommerce table.shop_table tbody,
    body.woocommerce table.shop_table tr,
    body.woocommerce table.shop_table td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    body.woocommerce table.shop_table tr {
        margin-bottom: var(--space-lg) !important;
        padding: var(--layout-card-padding) !important;
        border: 1px solid var(--border-subtle) !important;
        background: var(--surface-panel) !important;
        border-radius: var(--radius-sm) !important;
    }

    body.woocommerce table.shop_table td {
        text-align: right !important;
        padding: var(--space-xs) 0 !important;
        border: none !important;
        position: relative !important;
        padding-left: 50% !important;
    }

    body.woocommerce table.shop_table td::before {
        content: attr(data-title);
        position: absolute !important;
        left: 0 !important;
        width: 45% !important;
        padding-right: 10px !important;
        white-space: nowrap !important;
        text-align: left !important;
        font-weight: 600 !important;
        color: var(--text-muted) !important;
    }

    body.woocommerce table.shop_table td.product-thumbnail {
        padding-left: 0 !important;
        text-align: center !important;
    }

    body.woocommerce table.shop_table td.product-thumbnail img {
        width: 80px !important;
        margin: 0 auto !important;
    }

    body.woocommerce table.shop_table td.product-remove {
        text-align: left !important;
        padding-left: 0 !important;
    }
}

body.woocommerce table.shop_table,
body.woocommerce .woocommerce-checkout-review-order-table,
body.woocommerce .wc-block-order-confirmation-totals__table,
body.woocommerce .wc-block-order-confirmation-downloads__table,
body.woocommerce .woocommerce-table,
body.woocommerce .woocommerce-table__line-item,
body.woocommerce .woocommerce-table__product-name,
body.woocommerce .wc-block-components-totals-item,
body.woocommerce .wc-block-components-order-summary,
body.woocommerce .wc-block-components-sidebar,
body.woocommerce .wc-block-components-sidebar-layout,
body.woocommerce .wc-block-components-totals-wrapper,
body.woocommerce .wp-block-woocommerce-cart .wc-block-components-totals-wrapper,
body.woocommerce .cart_totals,
body.woocommerce-checkout .woocommerce-checkout-review-order,
body.woocommerce-checkout .woocommerce-checkout-payment,
body.woocommerce-checkout #payment,
body.woocommerce-checkout #payment ul.payment_methods,
body.woocommerce-checkout #payment ul.payment_methods li,
body.woocommerce-checkout #payment div.payment_box,
body.woocommerce-checkout .place-order,
body.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper,
body.woocommerce-checkout .woocommerce-terms-and-conditions,
body.woocommerce-checkout .woocommerce-form__label-for-checkbox.woocommerce-terms-and-conditions-checkbox,
body.woocommerce .shipping-calculator-form,
body.woocommerce .shipping-calculator-button,
body.woocommerce ul#shipping_method,
body.woocommerce ul#shipping_method li,
body.woocommerce .wp-block-woocommerce-cart,
body.woocommerce .wp-block-woocommerce-cart .wc-block-cart-items,
body.woocommerce .wp-block-woocommerce-cart .wc-block-cart-items__row,
body.woocommerce .wp-block-woocommerce-filled-cart-block,
body.woocommerce .wp-block-woocommerce-cart-items-block,
body.woocommerce .wp-block-woocommerce-cart-line-items-block,
body.woocommerce .wp-block-woocommerce-cart-order-summary-totals-block,
body.woocommerce .wp-block-woocommerce-cart-order-summary-coupon-form-block,
body.woocommerce .wc-block-cart-items__row,
body.woocommerce .wc-block-cart-item__image,
body.woocommerce .wc-block-cart-item__total,
body.woocommerce .wc-block-components-product-name,
body.woocommerce .wc-block-components-totals-item__label,
body.woocommerce .wc-block-components-totals-item__value,
body.woocommerce .wc-block-components-totals-coupon,
body.woocommerce .wc-block-components-local-pickup-select,
body.woocommerce .wc-block-components-payment-method-icon,
body.woocommerce-checkout .wp-block-woocommerce-checkout-contact-information-block,
body.woocommerce-checkout .wp-block-woocommerce-checkout-billing-address-block,
body.woocommerce-checkout .wp-block-woocommerce-checkout-shipping-address-block,
body.woocommerce-checkout .wp-block-woocommerce-checkout-shipping-methods-block,
body.woocommerce-checkout .wp-block-woocommerce-checkout-payment-block,
body.woocommerce-checkout .wp-block-woocommerce-checkout-terms-block {
    background: var(--surface-section);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-none);
    color: var(--text-body);
}

body.woocommerce-checkout #customer_details,
body.woocommerce-checkout #order_review,
body.woocommerce-checkout h3#order_review_heading {
    background-color: var(--surface-section) !important;
    padding: clamp(1.5rem, 3vw, 3rem) !important;
    border: 1px solid var(--border-strong) !important;
    border-radius: var(--radius-none);
}

body.woocommerce-checkout h3#order_review_heading {
    border-bottom: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: var(--space-sm) !important;
}

body.woocommerce-checkout #order_review {
    margin-top: 0 !important;
    border-top: 0 !important;
}

body.woocommerce :is(.cart_totals,
    .wc-block-components-order-summary,
    .wc-block-components-sidebar,
    .wc-block-components-totals-wrapper,
    .wc-block-components-checkout-step,
    .wc-block-components-panel,
    .shipping-calculator-form,
    .woocommerce-checkout-payment,
    #payment,
    #payment ul.payment_methods,
    .woocommerce-terms-and-conditions,
    .woocommerce-terms-and-conditions-wrapper) {
    background: var(--surface-panel);
}

/* Coupon apply button: keep text visible on dark button. */
body.woocommerce #wc-block-components-totals-coupon__form :is(button, a).wc-block-components-button,
body.woocommerce .wc-block-components-totals-coupon__form :is(button, a).wc-block-components-button {
    color: var(--btn-primary-text) !important;
    -webkit-text-fill-color: var(--btn-primary-text) !important;
}

body.woocommerce #wc-block-components-totals-coupon__form :is(button, a).wc-block-components-button>div,
body.woocommerce .wc-block-components-totals-coupon__form :is(button, a).wc-block-components-button>div {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
}

body.woocommerce #wc-block-components-totals-coupon__form :is(button, a).wc-block-components-button:is(:hover, :focus-visible, :active),
body.woocommerce .wc-block-components-totals-coupon__form :is(button, a).wc-block-components-button:is(:hover, :focus-visible, :active) {
    color: var(--btn-primary-hover-text) !important;
    -webkit-text-fill-color: var(--btn-primary-hover-text) !important;
}

body.woocommerce #wc-block-components-totals-coupon__form :is(button, a).wc-block-components-button:is(:hover, :focus-visible, :active)>div,
body.woocommerce .wc-block-components-totals-coupon__form :is(button, a).wc-block-components-button:is(:hover, :focus-visible, :active)>div {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
}

body.woocommerce-checkout #payment div.payment_box {
    position: relative;
    background: var(--surface-control);
    color: var(--text-body);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-none);
    padding: var(--space-md);
    margin: var(--space-sm) 0;
    font-size: 0.9rem;
}

body.woocommerce-checkout #payment div.payment_box::before {
    content: "";
    display: block;
    position: absolute;
    top: -0.75rem;
    left: 1.5rem;
    border: 0.4rem solid transparent;
    border-bottom-color: var(--border-strong);
}

/* 10.1) Cart block layout reinforcement */
body.woocommerce .wc-block-components-sidebar-layout.wc-block-cart {
    padding: clamp(1.25rem, 2.6vw, 2rem);
    gap: clamp(1.2rem, 2.4vw, 2rem);
    background: var(--surface-panel);
}

body.woocommerce .wc-block-cart__main,
body.woocommerce .wc-block-cart__sidebar {
    background: var(--surface-section);
    border: 1px solid var(--border-subtle);
    padding: clamp(1rem, 2vw, 1.6rem);
}

/* 10.2) Checkout structure reinforcement */
body.woocommerce-checkout form.woocommerce-checkout {
    display: grid;
    gap: clamp(1.25rem, 2.6vw, 2rem);
}

/* 10.3) Checkout block layout reinforcement (Blocks). */
body.woocommerce-checkout .wp-block-woocommerce-checkout.wc-block-checkout {
    display: grid;
    gap: clamp(1.25rem, 2.6vw, 2rem);
}

body.woocommerce-checkout .wp-block-woocommerce-checkout-fields-block {
    min-width: 0;
}

body.woocommerce-checkout .wc-block-checkout__main.wp-block-woocommerce-checkout-fields-block>form {
    padding: clamp(1rem, 2vw, 1.6rem);
}

body.woocommerce-checkout :is(.wc-block-components-checkout-step, .wc-block-components-panel) {
    padding: clamp(1rem, 2vw, 1.6rem);
}

body.woocommerce-checkout :is(#customer_details, #order_review) {
    padding: clamp(1rem, 2vw, 1.6rem);
}

body.woocommerce-checkout #payment {
    background: var(--surface-panel);
    border: 1px solid var(--border-strong);
    padding: clamp(1rem, 2vw, 1.6rem);
}

body.woocommerce-checkout #payment div.payment_box::after {
    content: "";
    display: block;
    position: absolute;
    top: -0.65rem;
    left: 1.5rem;
    border: 0.4rem solid transparent;
    border-bottom-color: var(--surface-control);
}

body.woocommerce-cart :is(.woocommerce,
    .cart-collaterals,
    .cross-sells),
body.woocommerce-checkout :is(.woocommerce,
    #customer_details,
    #order_review,
    .woocommerce-checkout-review-order-table),
body.woocommerce-account :is(.woocommerce,
    .woocommerce-MyAccount-content,
    .woocommerce-MyAccount-navigation) {
    margin-top: clamp(1.5rem, 1rem + 1.9vw, 3rem);
}

body.woocommerce table.shop_table th,
body.woocommerce table.shop_table td,
body.woocommerce .woocommerce-checkout-review-order-table th,
body.woocommerce .woocommerce-checkout-review-order-table td {
    padding: var(--space-md);
}

body.woocommerce-checkout #customer_details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--layout-panel-gap);
}

body.woocommerce-checkout #customer_details .col-1,
body.woocommerce-checkout #customer_details .col-2 {
    width: auto;
    float: none;
    margin: 0;
}

body.woocommerce-checkout h3#order_review_heading {
    border-bottom: none;
    margin-bottom: 0;
}

body.woocommerce .cart-collaterals .cart_totals {
    background-color: var(--surface-raised);
    border: 1px solid var(--border-strong);
    padding: var(--layout-card-padding);
}

body.woocommerce table.shop_table th,
body.woocommerce .woocommerce-checkout-review-order-table th,
body.woocommerce .wc-block-order-confirmation-summary-list-item__key,
body.woocommerce .wc-block-components-totals-item__label {
    color: var(--text-primary);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heading);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

body.woocommerce table.shop_table td,
body.woocommerce table.shop_table td.product-name,
body.woocommerce table.shop_table td.product-name .variation,
body.woocommerce table.shop_table td.product-name dl,
body.woocommerce table.shop_table td.product-name p,
body.woocommerce .wc-block-order-confirmation-summary-list-item__value {
    color: var(--text-body);
}

body.woocommerce-cart table.shop_table {
    background: var(--surface-panel);
    overflow: hidden;
}

body.woocommerce-cart table.shop_table tbody tr.cart_item {
    background: color-mix(in srgb, var(--surface-panel) 88%, var(--surface-page));
}

body.woocommerce-cart table.shop_table td {
    vertical-align: middle;
}

body.woocommerce-cart table.shop_table td.product-remove {
    width: 3.25rem;
    text-align: center;
}

body.woocommerce-cart table.shop_table td.product-thumbnail {
    width: clamp(5rem, 8vw, 6.5rem);
}

body.woocommerce-cart table.shop_table td.product-thumbnail img {
    width: clamp(4.5rem, 7vw, 5.75rem);
    min-width: clamp(4.5rem, 7vw, 5.75rem);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--surface-control);
    border: 1px solid var(--border-subtle);
}

body.woocommerce-cart table.shop_table td.product-name a,
body.woocommerce .wc-block-components-product-name {
    color: var(--text-primary);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heading-soft);
    line-height: 1.35;
}

body.woocommerce-cart table.shop_table td.product-name .variation,
body.woocommerce-cart table.shop_table td.product-name dl,
body.woocommerce-cart table.shop_table td.product-name p {
    margin-top: var(--space-2xs);
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
}

body.woocommerce-cart table.shop_table td.product-price .amount,
body.woocommerce-cart table.shop_table td.product-subtotal .amount,
body.woocommerce .wc-block-cart-item__total .wc-block-components-formatted-money-amount,
body.woocommerce .wc-block-cart-item__prices {
    color: var(--text-primary);
    font-family: var(--font-family-ui);
    font-weight: var(--font-weight-strong);
}

body.woocommerce-cart table.shop_table td.product-quantity .quantity {
    min-width: clamp(8.25rem, 14vw, 9.75rem);
}

body.woocommerce-cart table.shop_table a.remove {
    background: transparent;
    border: 0;
    border-radius: 999px;
}

body.woocommerce-cart table.shop_table a.remove:hover {
    color: var(--urgent-fill);
}

body.woocommerce .wc-block-cart-items__row {
    padding-top: var(--layout-card-padding);
    padding-bottom: var(--layout-card-padding);
}

body.woocommerce .wc-block-cart-item__image img {
    width: clamp(4.5rem, 7vw, 5.75rem);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--surface-control);
    border: 1px solid var(--border-subtle);
}

body.woocommerce .wc-block-cart-item__remove-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0;
    line-height: 1;
}

body.woocommerce .wc-block-cart-item__remove-link:hover {
    color: var(--urgent-fill);
    background: color-mix(in srgb, var(--urgent-fill) 10%, transparent);
}

body.woocommerce .wc-block-cart-item__remove-link::before {
    content: "×";
    font-size: 1.35rem;
    line-height: 1;
}

/* 11) Pagination + ordering */
body.woocommerce .woocommerce-pagination .page-numbers,
body.woocommerce .wc-block-components-pagination,
body.woocommerce .wc-block-components-pagination__page,
body.woocommerce .wc-block-pagination-page {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}

body.woocommerce nav.woocommerce-pagination ul,
body.woocommerce nav.woocommerce-pagination ul li {
    border: none;
    background: transparent;
}

body.woocommerce nav.woocommerce-pagination {
    text-align: center;
    margin-top: var(--space-3xl);
    margin-bottom: var(--space-xl);
}

body.woocommerce nav.woocommerce-pagination ul li {
    margin: 0 var(--space-2xs);
}

body.woocommerce .woocommerce-pagination .page-numbers li span.current,
body.woocommerce .woocommerce-pagination .page-numbers li a,
body.woocommerce .wc-block-components-pagination__page {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-none);
    background: var(--surface-control);
    color: var(--text-secondary);
    min-width: clamp(2.75rem, 2.5rem + 0.7vw, 3rem);
    min-height: clamp(2.75rem, 2.5rem + 0.7vw, 3rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(0.4rem, 0.3rem + 0.4vw, 0.75rem);
}

body.woocommerce .woocommerce-pagination .page-numbers li span.current,
body.woocommerce .woocommerce-pagination .page-numbers li a:hover,
body.woocommerce .wc-block-components-pagination__page[aria-current="page"],
body.woocommerce .wc-block-components-pagination__page:hover {
    background: var(--surface-raised);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

/* 12) Single product details */
body.woocommerce div.product,
body.woocommerce div.product div.images,
body.woocommerce div.product div.summary,
body.woocommerce .woocommerce-product-details__short-description,
body.woocommerce div.product form.cart,
body.woocommerce div.product form.cart .variations,
body.woocommerce div.product form.cart .variations label,
body.woocommerce .product_meta,
body.woocommerce .product_meta .sku_wrapper,
body.woocommerce .product_meta .posted_in,
body.woocommerce .product_meta .tagged_as,
body.woocommerce div.product .woocommerce-tabs ul.tabs,
body.woocommerce div.product .woocommerce-tabs ul.tabs li,
body.woocommerce div.product .woocommerce-tabs ul.tabs li a,
body.woocommerce div.product .woocommerce-tabs ul.tabs li.active,
body.woocommerce .single_variation,
body.woocommerce .woocommerce-variation-availability,
body.woocommerce .wc-item-meta {
    color: var(--text-body);
}

body.single-product div.product {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--layout-panel-gap);
    width: 100%;
    max-width: var(--container-md, 1200px);
    margin: 0 auto;
    min-width: 0;
}

body.single-product div.product :is(div.images, .woocommerce-product-gallery, .wpgs-gallery, #wpgs-gallery),
body.single-product div.product :is(div.summary, .summary, .entry-summary) {
    float: none !important;
    /* NOTE: do NOT set width:100% here — it fights the grid auto-sizing */
    clear: none !important;
    max-width: none !important;
    min-width: 0;
}

body.single-product div.product {
    margin-bottom: var(--layout-section-gap);
}

body.single-product .o2b-commerce-shell__content,
body.single-product .woocommerce,
body.single-product .woocommerce-page,
body.single-product .woocommerce div.product {
    width: 100%;
    max-width: none;
}

body.single-product .o2b-main--commerce>.o2b-container,
body.single-product .o2b-main--commerce>.container-lg {
    width: 100%;
    max-width: var(--container-lg);
}

body.single-product div.product :is(div.images, .woocommerce-product-gallery, .wpgs-gallery, #wpgs-gallery) {
    background: var(--surface-section);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: var(--layout-media-frame-padding, 20px) !important;
    box-shadow: var(--shadow-sm);
    margin: 0 !important;
}

body.single-product div.product :is(div.images, .woocommerce-product-gallery, .wpgs-gallery, #wpgs-gallery) img {
    border-radius: var(--radius-sm);
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Surgical: gallery navigation carousel containers (plugin variants). */
body.single-product .gallery-navigation-carousel-wrapper {
    border-radius: var(--radius-sm);
    overflow: hidden;
    max-width: 100%;
}

body.single-product :is(.gallery-navigation-carousel, .wcgs-carousel) {
    max-width: 100%;
}

body.single-product :is(.gallery-navigation-carousel, .wcgs-carousel) img {
    border-radius: var(--radius-sm);
}

@media (min-width: 960px) {
    body.single-product div.product {
        /* Equal columns: gallery and summary feel like one unified card pair */
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        /* Tight gap — gallery and summary should feel connected, not separated */
        gap: clamp(1rem, 2vw, 1.5rem);
        align-items: start;
    }

    body.single-product div.product :is(div.images, .woocommerce-product-gallery, .wpgs-gallery, #wpgs-gallery),
    body.single-product div.product :is(div.summary, .summary, .entry-summary) {
        width: auto !important;
        margin: 0 !important;
    }

    /* Fix: force single-product shell to always stay 1 column regardless of
       the base .o2b-commerce-shell 2-column override in page-shells.css */
    .o2b-commerce-shell--single {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

body.single-product div.product :is(div.summary, .summary, .entry-summary) {
    display: grid;
    /* Tighter internal gap — elements feel part of the same information block */
    gap: clamp(0.8rem, 1.5vw, 1.2rem);
    align-content: start;
    background: var(--surface-section);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    /* Match the gallery frame padding exactly so they feel like siblings */
    padding: clamp(1.2rem, 2vw, 1.8rem) !important;
    box-shadow: var(--shadow-sm);
    margin: 0 !important;
}

body.single-product div.product :is(div.summary, .summary, .entry-summary)>* {
    margin-top: 0;
    margin-bottom: 0;
}

body.single-product div.product :is(div.summary, .summary, .entry-summary) .price {
    margin-top: 0;
    margin-bottom: 0;
}

body.single-product div.product .woocommerce-product-details__short-description {
    margin-top: 0;
    margin-bottom: 0;
}

body.woocommerce div.product form.cart {
    background: var(--surface-panel);
    padding: clamp(0.85rem, 1.4vw, 1.1rem);
    /* Sits inside the summary grid — no top margin needed, the grid gap handles it */
    margin-top: 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

body.single-product div.product form.cart {
    margin-top: 0;
    padding: clamp(0.85rem, 1.4vw, 1.1rem);
}

body.single-product div.product form.cart:not(.variations_form) {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--layout-control-gap);
}

body.single-product div.product form.cart:not(.variations_form) .quantity {
    margin: 0;
}

body.single-product div.product form.cart .variations {
    margin: 0 0 var(--space-sm) 0;
    width: 100%;
}

body.single-product div.product form.cart .variations th,
body.single-product div.product form.cart .variations td {
    padding-bottom: var(--space-sm);
}

body.single-product div.product form.cart .quantity .qty {
    min-width: 5.5rem;
    text-align: center;
}

body.single-product div.product form.cart .single_add_to_cart_button {
    margin-left: 0;
}

body.single-product div.product form.cart .single_variation_wrap .single_add_to_cart_button {
    margin-left: 0;
    margin-top: 0;
}

body.single-product div.product form.variations_form .single_variation_wrap {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--layout-control-gap);
    width: 100%;
}

body.single-product div.product form.variations_form .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--layout-control-gap);
}

body.single-product div.product form.variations_form .woocommerce-variation-add-to-cart .quantity {
    margin: 0;
}

body.single-product div.product form.variations_form .woocommerce-variation-add-to-cart .single_add_to_cart_button {
    color: color-mix(in srgb, var(--btn-primary-text) 80%, #fff);
    -webkit-text-fill-color: color-mix(in srgb, var(--btn-primary-text) 80%, #fff);
}

/* Variations selects: avoid glaring white option UI in dark mode */
html[data-theme="dark"] body.single-product div.product form.variations_form select,
html.dark-mode body.single-product div.product form.variations_form select,
html:not([data-theme]) body.single-product div.product form.variations_form select {
    background: var(--field-bg);
    border-color: var(--field-border);
    color: var(--field-text);
    color-scheme: dark;
}

html[data-theme="dark"] body.single-product div.product form.variations_form select option,
html.dark-mode body.single-product div.product form.variations_form select option,
html:not([data-theme]) body.single-product div.product form.variations_form select option {
    background: var(--surface-control);
    color: var(--text-primary);
}

/* Surgical: attributes table (Woo core). */
body.single-product .woocommerce-product-attributes.shop_attributes {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

body.single-product .woocommerce-product-attributes.shop_attributes :is(th, td) {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
    font-size: 0.92rem;
    line-height: 1.45;
}

body.single-product .woocommerce-product-attributes.shop_attributes th {
    color: var(--text-muted);
    font-family: var(--font-family-ui);
    font-weight: var(--font-weight-ui);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

body.single-product .woocommerce-product-attributes-item:last-child :is(th, td) {
    border-bottom: 0;
}

body.woocommerce div.product :is(.woocommerce-tabs, .wc-tabs-wrapper) {
    background: var(--surface-section);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    /* Generous but consistent inner padding */
    padding: clamp(1.2rem, 2vw, 2rem) !important;
    /* Separated from product panels with clear breathing room */
    margin-top: var(--layout-section-gap) !important;
    margin-bottom: var(--layout-section-gap);
    clear: both;
    box-shadow: var(--shadow-sm);
    /* Span both columns of the div.product grid so tabs sit below gallery+summary */
    grid-column: 1 / -1;
    width: 100%;
}

body.woocommerce div.product .woocommerce-tabs::before,
body.woocommerce div.product .woocommerce-tabs ul.tabs::before,
body.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
body.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
    display: none;
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li {
    background: var(--surface-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0;
    transition: border-color var(--transition-base), background-color var(--transition-base);
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li:hover:not(.active) {
    border-color: var(--border-strong);
    background: var(--surface-raised);
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    border-color: var(--border-strong);
    background: var(--surface-section);
    box-shadow: inset 0 -2px 0 0 var(--text-primary);
}

body.woocommerce div.product :is(.woocommerce-tabs, .wc-tabs-wrapper) ul.tabs li a {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heading-soft);
    display: block;
    padding: clamp(0.8rem, 1.5vw, 1rem) clamp(1rem, 2vw, 1.5rem) !important;
}

body.woocommerce div.product .woocommerce-tabs ul.tabs li a,
body.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
body.woocommerce div.product .woocommerce-tabs ul.tabs li a:hover {
    color: var(--text-primary);
}

body.woocommerce div.product :is(.woocommerce-tabs, .wc-tabs-wrapper) .panel {
    background: var(--surface-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-top: var(--layout-content-gap) !important;
    /* More generous padding for the reading area */
    padding: clamp(1.5rem, 2.5vw, 2.5rem) !important;
    /* Inner typography breathing room */
    line-height: var(--line-height-body);
}

body.woocommerce div.product .woocommerce-tabs .panel h2 {
    font-size: var(--font-size-h4);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

body.woocommerce div.product .woocommerce-tabs .panel h3 {
    font-size: var(--font-size-h5);
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

body.woocommerce div.product .woocommerce-tabs .panel p {
    color: var(--text-body);
    margin-bottom: var(--space-sm);
}

body.woocommerce div.product .woocommerce-tabs .panel>:last-child {
    margin-bottom: 0;
}

body.woocommerce div.product .woocommerce-tabs ul.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin: 0 0 var(--space-lg);
}

body.woocommerce div.product .woocommerce-tabs .woocommerce-product-attributes {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

body.woocommerce div.product .woocommerce-tabs .woocommerce-product-attributes th,
body.woocommerce div.product .woocommerce-tabs .woocommerce-product-attributes td {
    padding: clamp(0.65rem, 1.4vw, 1rem) clamp(0.85rem, 1.6vw, 1.2rem);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
    font-size: var(--font-size-small);
}

body.woocommerce div.product .woocommerce-tabs .woocommerce-product-attributes tr:last-child th,
body.woocommerce div.product .woocommerce-tabs .woocommerce-product-attributes tr:last-child td {
    border-bottom: 0;
}

body.woocommerce div.product .woocommerce-tabs .woocommerce-product-attributes th {
    width: 30%;
    font-family: var(--font-family-ui);
    font-weight: var(--font-weight-ui);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: color-mix(in srgb, var(--surface-control) 65%, var(--surface-panel));
}

body.woocommerce div.product .woocommerce-tabs .woocommerce-product-attributes td {
    background: transparent;
    color: var(--text-body);
}

/* Product meta: slim inline row at the bottom of the summary, not a full box */
body.woocommerce .product_meta {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--border-subtle);
    padding: var(--space-sm) 0 0;
    margin-top: var(--space-sm);
    clear: both;
    font-family: var(--font-family-ui);
    font-size: var(--font-size-small);
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-md);
    align-items: center;
}

body.woocommerce .product_meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
}

body.woocommerce .product_meta .label {
    color: var(--text-secondary);
    font-weight: var(--font-weight-ui);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.72rem;
}

body.single-product :is(.related.products,
    .upsells.products,
    .cross-sells) {
    clear: both;
    width: 100%;
    max-width: 100%;
    /* Span full width if rendered inside a grid context */
    grid-column: 1 / -1;
    margin-top: var(--layout-section-gap);
}

/* Prevent related/upsell headings from double-stacking margin */
body.single-product :is(.related.products > h2,
    .upsells.products > h2,
    .cross-sells > h2) {
    margin-top: 0;
    margin-bottom: var(--space-lg);
    font-family: var(--font-family-heading);
    color: var(--text-primary);
}

/* Upsell + cross-sell swipeable layout (max 3 items, viewport-driven).
   Uses a static 3-col grid on desktop rather than overflow-x to avoid
   collision with an incorrectly constrained parent. */
body.single-product .upsells.products ul.products,
body.woocommerce-cart .cross-sells ul.products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: var(--layout-grid-gap);
    width: 100%;
    overflow-x: visible;
}

body.single-product .upsells.products ul.products>li.product,
body.woocommerce-cart .cross-sells ul.products>li.product {
    scroll-snap-align: start;
    width: auto !important;
    margin: 0 !important;
}

@media (min-width: 769px) and (max-width: 1023px) {

    body.single-product .upsells.products ul.products,
    body.woocommerce-cart .cross-sells ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {

    body.single-product .upsells.products ul.products,
    body.woocommerce-cart .cross-sells ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

body.single-product .woocommerce-tabs+:is(.related.products,
    .upsells.products,
    .cross-sells) {
    margin-top: var(--layout-section-gap);
}

/* Related/upsells: section heading styled as a labelled divider */
body.single-product :is(.related.products > h2,
    .upsells.products > h2,
    .cross-sells > h2,
    .related.products > .heading,
    .upsells.products > .heading) {
    margin-top: 0 !important;
    margin-bottom: var(--space-xl) !important;
    font-family: var(--font-family-ui);
    font-size: 0.82rem;
    font-weight: var(--font-weight-ui);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

body.single-product :is(.related.products > h2,
    .upsells.products > h2,
    .cross-sells > h2,
    .related.products > .heading,
    .upsells.products > .heading)::before,
body.single-product :is(.related.products > h2,
    .upsells.products > h2,
    .cross-sells > h2,
    .related.products > .heading,
    .upsells.products > .heading)::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* Cart/Checkout cross-sells (Blocks): match the labelled divider heading. */
body.woocommerce :is(.wc-block-cart__cross-sells, .wc-block-checkout__cross-sells, .wp-block-woocommerce-cart-cross-sells-block) :is(h2, .wp-block-heading) {
    margin-top: 0 !important;
    margin-bottom: var(--space-xl) !important;
    font-family: var(--font-family-ui);
    font-size: 0.82rem;
    font-weight: var(--font-weight-ui);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

body.woocommerce :is(.wc-block-cart__cross-sells, .wc-block-checkout__cross-sells, .wp-block-woocommerce-cart-cross-sells-block) :is(h2, .wp-block-heading)::before,
body.woocommerce :is(.wc-block-cart__cross-sells, .wc-block-checkout__cross-sells, .wp-block-woocommerce-cart-cross-sells-block) :is(h2, .wp-block-heading)::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

body.single-product :is(.related.products,
    .upsells.products,
    .cross-sells) {
    padding: clamp(1.2rem, 2vw, 2rem) !important;
    background: var(--surface-section);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--layout-section-gap) !important;
}

body.single-product .product_meta .sku_wrapper,
body.single-product .product_meta .tagged_as {
    display: none;
}

/* 13) My account */
body.woocommerce-account .woocommerce-MyAccount-navigation,
body.woocommerce-account .woocommerce-MyAccount-content,
body.woocommerce-account .woocommerce-order-details,
body.woocommerce-account .woocommerce-customer-details,
body.woocommerce-account .woocommerce-MyAccount-downloads,
body.woocommerce-account .woocommerce-Address,
body.woocommerce-account form.woocommerce-EditAccountForm,
body.woocommerce-account form.woocommerce-form,
body.woocommerce form.woocommerce-form-login,
body.woocommerce form.woocommerce-form-register,
body.woocommerce #customer_login {
    background: var(--surface-panel);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-none);
    color: var(--text-body);
    padding: var(--layout-card-padding);
}

body.woocommerce-account .woocommerce-MyAccount-navigation,
body.woocommerce-account .woocommerce-MyAccount-content {
    background: transparent;
    border: 0;
    padding: 0;
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

body.woocommerce-account .woocommerce {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--layout-content-gap);
    align-items: start;
    background: var(--surface-panel);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-none);
    padding: var(--layout-card-padding);
}

body.woocommerce-account .woocommerce-MyAccount-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

body.woocommerce-account .woocommerce-MyAccount-content {
    padding-top: var(--layout-card-padding);
    background: var(--surface-section);
    border: 1px solid var(--border-subtle);
    padding: clamp(1rem, 2vw, 1.6rem);
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link a {
    display: block;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-none);
    background: var(--surface-section);
    font-family: var(--font-family-ui);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
}

body.woocommerce-account .woocommerce-MyAccount-navigation-link.is-active a,
body.woocommerce-account .woocommerce-MyAccount-navigation-link a:hover {
    background: var(--surface-raised);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

body.woocommerce-account .woocommerce-MyAccount-content>* {
    background: transparent;
    border: 0;
    box-shadow: none;
}

body.woocommerce-account .woocommerce-MyAccount-content :is(table.shop_table, .woocommerce-orders-table, .woocommerce-MyAccount-downloads) {
    background: transparent;
    border: 0;
}

body.woocommerce-account .woocommerce-MyAccount-content :is(table.shop_table th, table.shop_table td) {
    border-color: var(--border-subtle);
}

body.woocommerce-account .woocommerce-MyAccount-content :is(.woocommerce-MyAccount-orders, .woocommerce-MyAccount-downloads) {
    margin: 0;
}

/* 14) Mini cart / off-canvas */
body.woocommerce .widget_shopping_cart,
body.woocommerce .widget_shopping_cart .widget_shopping_cart_content,
body.woocommerce .woocommerce-mini-cart,
body.woocommerce .woocommerce-mini-cart-item,
body.woocommerce .woocommerce-mini-cart__total,
body.woocommerce .woocommerce-mini-cart__buttons,
body.woocommerce .wc-block-mini-cart,
body.woocommerce .wc-block-mini-cart__badge,
body.woocommerce .wc-block-mini-cart__drawer,
body.woocommerce .wc-block-mini-cart__footer,
body.woocommerce .wc-block-mini-cart__footer-actions,
body.woocommerce .wp-block-woocommerce-mini-cart-contents {
    background: var(--surface-raised);
    border-color: var(--border-strong);
    color: var(--text-body);
}

body.woocommerce .widget_shopping_cart .woocommerce-mini-cart__empty-message,
body.woocommerce .woocommerce-mini-cart__empty-message {
    margin: 0;
    padding: var(--layout-card-padding);
    background: var(--surface-panel);
    border: 1px solid var(--border-strong);
}

body.woocommerce .woocommerce-mini-cart li.mini_cart_item {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: var(--layout-control-gap);
    align-items: start;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
}

body.woocommerce .woocommerce-mini-cart li.mini_cart_item img {
    width: 4.5rem;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    float: none;
    margin: 0;
    background: var(--surface-control);
    border: 1px solid var(--border-subtle);
}

body.woocommerce .woocommerce-mini-cart li.mini_cart_item a:not(.remove) {
    color: var(--text-primary);
    font-family: var(--font-family-heading);
    line-height: 1.35;
}

body.woocommerce .woocommerce-mini-cart li.mini_cart_item .quantity {
    margin-top: var(--space-2xs);
    color: var(--text-muted);
    font-size: 0.85rem;
}

body.woocommerce .woocommerce-mini-cart__total,
body.woocommerce .woocommerce-mini-cart__buttons {
    margin-top: var(--layout-content-gap);
}

/* 15) Widgets + filters + search */
body.woocommerce .widget_price_filter,
body.woocommerce .widget_price_filter .price_slider_wrapper,
body.woocommerce .widget_price_filter .ui-slider,
body.woocommerce .widget_price_filter .ui-slider .ui-slider-handle,
body.woocommerce .widget_price_filter .ui-slider .ui-slider-range,
body.woocommerce .wc-block-product-filters__open-overlay,
body.woocommerce .wc-block-product-filters__overlay,
body.woocommerce .wc-block-product-filters__overlay-content,
body.woocommerce .wc-block-product-filters__overlay-dialog,
body.woocommerce .wc-block-product-filter-removable-chips__items,
body.woocommerce .wc-block-product-filter-checkbox-list__input,
body.woocommerce .wc-block-rating-filter,
body.woocommerce .woocommerce-search-list__item-input,
body.woocommerce .woocommerce-search-list__item-label,
body.woocommerce .woocommerce-search-list__item-prefix,
body.woocommerce .woocommerce-product-search,
body.woocommerce .woocommerce-widget-layered-nav-dropdown {
    color: var(--text-body);
    border-color: var(--border-subtle);
}

body.woocommerce .widget_price_filter .ui-slider {
    position: relative;
    height: 0.4rem;
    background: var(--surface-control);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-none);
}

body.woocommerce .widget_price_filter .ui-slider .ui-slider-range {
    background: var(--interactive);
}

body.woocommerce .widget_price_filter .ui-slider .ui-slider-handle {
    top: -0.35rem;
    width: 1rem;
    height: 1rem;
    background: var(--surface-raised);
    border: 1px solid var(--interactive);
    border-radius: 999px;
}

body.woocommerce .widget_price_filter .ui-slider .ui-slider-handle:focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--shadow-focus);
}

body.woocommerce .wc-block-product-filters__overlay {
    background: var(--veil-black-64, rgba(0, 0, 0, 0.64));
}

body.woocommerce .wc-block-product-filters__overlay-dialog {
    background: var(--surface-panel);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
}

body.woocommerce :is(.wc-block-product-filter-removable-chips__items button,
    .wc-block-product-filter-removable-chips__items a,
    .wc-block-product-filter-removable-chips__button) {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: 2.4rem;
    padding: 0 var(--space-md);
    background: var(--selection-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-none);
    color: var(--text-secondary);
    text-decoration: none;
    transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

body.woocommerce :is(.wc-block-product-filter-removable-chips__items button:hover,
    .wc-block-product-filter-removable-chips__items a:hover,
    .wc-block-product-filter-removable-chips__button:hover) {
    background: var(--surface-control);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

body.woocommerce :is(.wc-block-product-filter-removable-chips__items button:focus-visible,
    .wc-block-product-filter-removable-chips__items a:focus-visible,
    .wc-block-product-filter-removable-chips__button:focus-visible) {
    outline: 2px solid transparent;
    box-shadow: var(--shadow-focus);
}

/* 16) Reviews + ratings */
body.woocommerce #reviews,
body.woocommerce #review_form,
body.woocommerce .woocommerce-Reviews,
body.woocommerce .commentlist,
body.woocommerce .comment-form-rating,
body.woocommerce .star-rating,
body.woocommerce p.stars,
body.woocommerce .wc-block-components-review-list-item__author,
body.woocommerce .wc-block-components-review-list-item__meta,
body.woocommerce .wc-block-components-review-list-item__published-date,
body.woocommerce .wc-block-components-review-list-item__product,
body.woocommerce .wc-block-components-review-list-item__rating__stars,
body.woocommerce .wc-block-components-product-rating,
body.woocommerce .wc-block-components-product-rating__stars,
body.woocommerce .wc-block-grid__product-rating__stars {
    color: var(--text-body);
}

body.single-product #reviews .commentlist,
body.single-product #review_form_wrapper,
body.single-product .woocommerce-product-attributes {
    background: var(--surface-panel);
    border: 1px solid var(--border-strong);
    padding: var(--layout-card-padding);
}

body.single-product .woocommerce-product-attributes th,
body.single-product .woocommerce-product-attributes td {
    border-color: var(--border-subtle);
}

/* 17) Order received / confirmation blocks */
body.woocommerce-order-received .woocommerce-order .cross-sells,
body.woocommerce .wc-block-order-confirmation-address-wrapper,
body.woocommerce .wc-block-order-confirmation-summary-list-item,
body.woocommerce .wc-block-order-confirmation-summary-list-item__key,
body.woocommerce .wc-block-order-confirmation-summary-list-item__value,
body.woocommerce .wc-block-order-confirmation-totals__total {
    color: var(--text-body);
}

/* 18) Wishlist (YITH) */
body.woocommerce .add-to-wishlist-after_add_to_cart,
body.woocommerce .yith-wcwl-add-to-wishlist,
body.woocommerce .yith-wcwl-add-button,
body.woocommerce .product .yith-wcwl-add-to-wishlist {
    margin-top: var(--space-sm);
}

body.woocommerce .add-to-wishlist-after_add_to_cart a,
body.woocommerce .yith-wcwl-add-button a,
body.woocommerce .yith-wcwl-wishlistexistsbrowse a,
body.woocommerce .yith-wcwl-wishlistaddedbrowse a,
body.woocommerce .yith-wcwl-add-to-wishlist a,
body.woocommerce .yith-wcwl-add-to-wishlist a.add_to_wishlist,
body.woocommerce .yith-wcwl-add-to-wishlist a.browse-wishlist {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.4rem;
    padding: 0 var(--space-md);
    border: 1px solid var(--btn-tertiary-border);
    border-radius: var(--radius-none);
    background: var(--btn-tertiary-bg);
    color: var(--btn-tertiary-text);
    font-family: var(--font-family-ui);
    font-size: var(--font-size-small);
    text-transform: uppercase;
}

body.woocommerce .add-to-wishlist-after_add_to_cart a:hover,
body.woocommerce .yith-wcwl-add-button a:hover,
body.woocommerce .yith-wcwl-add-to-wishlist a:hover {
    background: var(--btn-tertiary-hover-bg);
    border-color: var(--btn-tertiary-hover-border);
    color: var(--btn-tertiary-hover-text);
}

body.woocommerce .wishlist_table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-panel);
    border: 1px solid var(--border-strong);
}

body.woocommerce .wishlist_table thead th {
    background: var(--surface-section);
    color: var(--text-secondary);
    font-family: var(--font-family-ui);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
    padding: 0.85rem;
    border-bottom: 1px solid var(--border-subtle);
}

body.woocommerce .wishlist_table td {
    padding: 0.95rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-body);
    background: var(--surface-panel);
}

body.woocommerce .wishlist_table tr {
    background: var(--surface-panel);
}

body.woocommerce .wishlist_table tbody tr:hover td {
    background: color-mix(in srgb, var(--surface-panel) 94%, var(--surface-section));
}

body.woocommerce .wishlist_table .product-remove a {
    color: var(--text-muted);
    display: inline-flex;
    min-height: 2.75rem;
    min-width: 2.75rem;
    align-items: center;
    justify-content: center;
}

body.woocommerce .wishlist_table .product-remove a:hover {
    color: var(--text-primary);
}

body.woocommerce .wishlist_table .product-price,
body.woocommerce .wishlist_table .product-stock-status {
    color: var(--text-body);
}

body.woocommerce .wishlist_table .product-name a {
    color: var(--link-content);
}

body.woocommerce .wishlist_table .product-name a:hover {
    color: var(--link-content-hover);
}

body.woocommerce .wishlist_table .add_to_cart,
body.woocommerce .wishlist_table .button {
    background: var(--btn-primary-bg);
    border: 1px solid var(--btn-primary-border);
    color: var(--btn-primary-text);
}

body.woocommerce .wishlist_table .add_to_cart:hover,
body.woocommerce .wishlist_table .button:hover {
    background: var(--btn-primary-hover-bg);
    border-color: var(--btn-primary-hover-border);
    color: var(--btn-primary-hover-text);
}

body.woocommerce .yith-wcwl-share {
    margin-top: var(--space-lg);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

body.woocommerce .yith-wcwl-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0 var(--space-md);
    border-radius: var(--radius-none);
    border: 1px solid var(--border-strong);
    background: var(--surface-control);
    color: var(--text-secondary);
    font-family: var(--font-family-ui);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base), transform var(--transition-fast);
}

body.woocommerce .yith-wcwl-share a:hover {
    background: var(--surface-raised);
    color: var(--text-primary);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

body.woocommerce .yith-wcwl-share a :is(svg, i) {
    color: currentColor;
    fill: currentColor;
}

/* 18.2) Wishlist mobile layout (YITH "responsive mobile" markup) */
body.woocommerce .yith-wcwl-form .wishlist-title-container {
    margin-bottom: var(--space-lg);
}

body.woocommerce .yith-wcwl-form .wishlist-title-with-form {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-sm);
}

body.woocommerce .yith-wcwl-form .wishlist-title-with-form h2 {
    margin: 0;
}

body.woocommerce .yith-wcwl-form .wishlist-title-with-form .button,
body.woocommerce .yith-wcwl-form .hidden-title-form :is(.hide-title-form, .save-title-form, input[type="text"]) {
    font-family: var(--font-family-ui);
}

body.woocommerce .yith-wcwl-form .wishlist-title-with-form .button {
    min-height: 2.4rem;
    padding: 0 var(--space-md);
    border: 1px solid var(--btn-tertiary-border);
    border-radius: var(--radius-none);
    background: var(--btn-tertiary-bg);
    color: var(--btn-tertiary-text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
    transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

body.woocommerce .yith-wcwl-form .wishlist-title-with-form .button:hover,
body.woocommerce .yith-wcwl-form .wishlist-title-with-form .button:focus-visible {
    background: var(--btn-tertiary-hover-bg);
    border-color: var(--btn-tertiary-hover-border);
    color: var(--btn-tertiary-hover-text);
}

body.woocommerce .yith-wcwl-form .hidden-title-form {
    margin-top: var(--space-sm);
}

body.woocommerce .yith-wcwl-form .hidden-title-form input[type="text"] {
    width: min(28rem, 100%);
    background: var(--field-bg);
    border: 1px solid var(--field-border);
    color: var(--field-text);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
}

body.woocommerce .yith-wcwl-form .hidden-title-form .edit-title-buttons {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    margin-left: var(--space-sm);
}

body.woocommerce .yith-wcwl-form .hidden-title-form :is(.hide-title-form, .save-title-form) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    min-height: 2.5rem;
    border: 1px solid var(--border-subtle);
    background: var(--surface-control);
    color: var(--text-secondary);
    transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

body.woocommerce .yith-wcwl-form .hidden-title-form :is(.hide-title-form:hover, .save-title-form:hover),
body.woocommerce .yith-wcwl-form .hidden-title-form :is(.hide-title-form:focus-visible, .save-title-form:focus-visible) {
    background: var(--surface-raised);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

body.woocommerce .wishlist_table.mobile {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--layout-grid-gap);
    background: transparent;
    border: 0;
}

body.woocommerce .wishlist_table.mobile>li {
    margin: 0;
    padding: clamp(1rem, 2vw, 1.35rem);
    border: 1px solid var(--border-subtle);
    background: var(--surface-panel);
    color: var(--text-body);
    display: grid;
    gap: var(--space-md);
    transition: border-color var(--transition-base), background-color var(--transition-base);
}

body.woocommerce .wishlist_table.mobile>li:hover {
    border-color: var(--border-strong);
    background: color-mix(in srgb, var(--surface-panel) 94%, var(--surface-section));
}

body.woocommerce .wishlist_table.mobile .item-wrapper {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

body.woocommerce .wishlist_table.mobile .product-thumbnail {
    flex: 0 0 auto;
}

body.woocommerce .wishlist_table.mobile .product-thumbnail img {
    width: clamp(4.75rem, 18vw, 6.5rem);
    height: auto;
    border: 1px solid var(--border-subtle);
    background: var(--surface-section);
}

body.woocommerce .wishlist_table.mobile .item-details {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: var(--space-xs);
}

body.woocommerce .wishlist_table.mobile .product-name h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
}

body.woocommerce .wishlist_table.mobile .product-name a {
    color: var(--text-primary);
    text-decoration: none;
}

body.woocommerce .wishlist_table.mobile .product-name a:hover {
    color: var(--link-content-hover);
}

body.woocommerce .wishlist_table.mobile :is(.item-details-table, .additional-info) {
    width: 100%;
    border-collapse: collapse;
}

body.woocommerce .wishlist_table.mobile :is(.item-details-table td, .additional-info td) {
    padding: 0.2rem 0;
    border: 0;
    font-size: 0.92rem;
    color: var(--text-body);
}

body.woocommerce .wishlist_table.mobile :is(.item-details-table td.label, .additional-info td.label) {
    color: var(--text-muted);
    font-family: var(--font-family-ui);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem;
    padding-right: var(--space-sm);
    white-space: nowrap;
}

body.woocommerce .wishlist_table.mobile .additional-info-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
}

body.woocommerce .wishlist_table.mobile .product-add-to-cart {
    margin: 0;
}

body.woocommerce .wishlist_table.mobile .product-add-to-cart a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0 var(--space-lg);
    border-radius: var(--radius-none);
    background: var(--btn-primary-bg);
    border: 1px solid var(--btn-primary-border);
    color: var(--btn-primary-text);
    -webkit-text-fill-color: var(--btn-primary-text);
    font-family: var(--font-family-ui);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

body.woocommerce .wishlist_table.mobile .product-add-to-cart a:hover,
body.woocommerce .wishlist_table.mobile .product-add-to-cart a:focus-visible {
    background: var(--btn-primary-hover-bg);
    border-color: var(--btn-primary-hover-border);
    color: var(--btn-primary-hover-text);
    -webkit-text-fill-color: var(--btn-primary-hover-text);
}

body.woocommerce .wishlist_table.mobile .product-remove a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

body.woocommerce .wishlist_table.mobile .product-remove a:hover,
body.woocommerce .wishlist_table.mobile .product-remove a:focus-visible {
    background: var(--surface-control);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

body.woocommerce .yith-wcwl-share-title {
    margin: 0;
    color: var(--text-muted);
    font-family: var(--font-family-ui);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

body.woocommerce .yith-wcwl-share ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

body.woocommerce .yith-wcwl-form .yith-wcwl-share a:hover {
    transform: none;
}

/* Wishlist page (YITH) can render outside body.woocommerce; harden against plugin defaults. */
body .yith-wcwl-form .wishlist-title-with-form,
body .yith-wcwl-form .wishlist-title-with-form h2 {
    background: transparent !important;
    box-shadow: none !important;
}

body .yith-wcwl-form .wishlist-title-with-form h2 {
    color: var(--text-primary) !important;
    padding: 0 !important;
    margin: 0 !important;
}

body .wishlist_table {
    background: var(--surface-panel) !important;
    border-color: var(--border-strong) !important;
    color: var(--text-body);
}

body .wishlist_table thead th {
    background: var(--surface-section) !important;
    color: var(--text-secondary) !important;
}

body .wishlist_table td,
body .wishlist_table tr {
    background: var(--surface-panel) !important;
    color: var(--text-body);
}

body .wishlist_table tbody tr:hover td {
    background: color-mix(in srgb, var(--surface-panel) 94%, var(--surface-section)) !important;
}

body .wishlist_table .product-name a {
    color: var(--link-content) !important;
}

body .wishlist_table .product-name a:hover {
    color: var(--link-content-hover) !important;
}

body .wishlist_table :is(.add_to_cart, .button) {
    background: var(--btn-primary-bg) !important;
    border-color: var(--btn-primary-border) !important;
    color: var(--btn-primary-text) !important;
    -webkit-text-fill-color: var(--btn-primary-text) !important;
}

body .wishlist_table :is(.add_to_cart, .button):hover {
    background: var(--btn-primary-hover-bg) !important;
    border-color: var(--btn-primary-hover-border) !important;
    color: var(--btn-primary-hover-text) !important;
    -webkit-text-fill-color: var(--btn-primary-hover-text) !important;
}

/* 18.1) Legacy coverage completion (theme-agnostic only) */
body.woocommerce .select2-dropdown {
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    color: var(--text-body);
}

body.woocommerce .select2-results__option {
    color: var(--text-secondary);
}

body.woocommerce .select2-results__option--highlighted,
body.woocommerce .select2-results__option--selected {
    background: var(--surface-control);
    color: var(--text-primary);
    border-left: 2px solid var(--border-strong);
}

body.woocommerce .woocommerce-widgets-wrapper {
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    padding: var(--space-xl);
}

body.woocommerce.archive :is(.woocommerce-widgets-wrapper,
    .woocommerce-widget-layered-nav,
    .widget_layered_nav,
    .widget_price_filter,
    .wc-block-product-filters,
    .wc-block-product-filter-price,
    .wc-block-product-filter-attribute,
    .wc-block-product-filter-rating) {
    width: 100%;
    max-width: clamp(15rem, 24vw, 21rem);
}

body.woocommerce .wc-block-product-filters__overlay-dialog {
    width: 100%;
    max-width: clamp(16rem, 24vw, 21rem);
}

body.woocommerce .woocommerce-widgets-wrapper .widget-title {
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
}

body.single-product .flex-control-thumbs {
    margin-top: var(--space-md);
}

body.single-product .flex-control-thumbs li {
    border: 1px solid transparent;
}

body.single-product .flex-control-thumbs li:hover,
body.single-product .flex-control-thumbs li.flex-active {
    border-color: var(--border-strong);
}

body.single-product #reviews .comment-meta {
    margin-bottom: var(--space-sm);
}

body.single-product #reviews .comment-author {
    color: var(--text-primary);
    font-family: var(--font-family-ui);
    font-weight: var(--font-weight-ui);
}

body.single-product #reviews .comment-metadata {
    color: var(--text-secondary);
    font-size: var(--font-size-small);
}

body.single-product .variations_form .variations .value {
    margin-bottom: var(--space-md);
}

body.woocommerce-checkout .form-row.woocommerce-validated :is(.select2-container,
    input.input-text,
    select) {
    border-color: var(--field-success-border);
    background: var(--field-success-bg);
}

body.woocommerce-checkout .form-row.woocommerce-invalid :is(.select2-container,
    input.input-text,
    select) {
    border-color: var(--field-invalid-border);
    background: var(--field-invalid-bg);
}

body.woocommerce-checkout :is(.woocommerce-billing-fields h3,
    .woocommerce-shipping-fields h3,
    h3#order_review_heading) {
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heading);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
}

body.woocommerce-order-received .woocommerce-thankyou-order-received {
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    padding: var(--space-lg);
}

body.woocommerce-order-received .woocommerce-thankyou-order-received strong,
body.woocommerce-order-received :is(.woocommerce-order-details__title,
    .woocommerce-customer-details__title) {
    color: var(--text-primary);
}

body.woocommerce-order-received .woocommerce-order-downloads {
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

body.woocommerce-order-received .woocommerce-order-downloads .woocommerce-MyAccount-downloads-file {
    color: var(--link-content);
}

body.woocommerce-order-received .woocommerce-order-downloads .woocommerce-MyAccount-downloads-file:hover {
    color: var(--link-content-hover);
}

body.woocommerce .woocommerce-noreviews {
    background: var(--surface-panel);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    padding: var(--space-md);
}

body.woocommerce-account :is(.woocommerce-orders-table__header-order-number,
    .woocommerce-orders-table thead th,
    .woocommerce-MyAccount-content .woocommerce-orders-table__header,
    .woocommerce-MyAccount-content .title) {
    background: var(--surface-section);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

/* 19) Focus states */
body.woocommerce :where(a,
    button,
    input,
    select,
    textarea,
    [tabindex],
    .woocommerce-form__input-checkbox,
    .wc-block-components-radio-control__option,
    .wc-block-components-checkbox,
    .wc-block-components-quantity-selector__button,
    .wc-block-components-notice-banner__dismiss,
    .woocommerce-MyAccount-navigation-link a,
    .woocommerce-tabs ul.tabs li a):focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--shadow-focus);
}

/* 19.1) Exact hook coverage addendum (from docs/woo-selectors.md) */
body.woocommerce .price .woocommerce-Price-amount,
body.woocommerce .price .amount,
body.woocommerce ul.products li.product .price,
body.woocommerce .wc-block-cart__cross-sells ul.wc-block-grid__products,
body.woocommerce .wp-block-woocommerce-product-recommendations ul.wc-block-grid__products,
body.woocommerce .wp-block-woocommerce-related-products ul.wc-block-grid__products,
body.woocommerce .woocommerce-ResetPassword,
body.woocommerce .woocommerce-MyAccount-downloads,
body.woocommerce .woocommerce-form-coupon-toggle,
body.woocommerce .woocommerce-form-login-toggle,
body.woocommerce .woocommerce-Addresses,
body.woocommerce-checkout #order_review_heading,
body.woocommerce-checkout #ship-to-different-address,
body.woocommerce-checkout .woocommerce-checkout-review-order-table,
body.woocommerce-checkout .shipping-calculator-button,
body.woocommerce-checkout .shipping-calculator-form,
body.single-product .post-navigation,
body.single-product .nav-links,
.woocommerce-form-coupon-toggle,
.woocommerce-form-login-toggle,
.woocommerce-Addresses,
.wc-block-gateway-container,
.wc-block-components-quantity-selector__button--minus,
.wc-block-components-quantity-selector__button--plus,
.wc-block-mini-cart__icon,
.wc-block-mini-cart__amount,
.wc-block-next-previous-buttons__icon {
    color: var(--text-body);
    border-color: var(--border-subtle);
}

/* Keep Woo button text visible in every state and avoid late selector collisions. */
body.woocommerce :is(#respond input#submit,
    a.button,
    button.button,
    input.button,
    .wp-element-button,
    .single_add_to_cart_button,
    .wc-proceed-to-checkout a,
    .woocommerce-button,
    .woocommerce-Button,
    .coupon .button,
    .wc-block-components-button,
    .wc-block-components-product-button__button) {
    color: var(--btn-primary-text) !important;
    -webkit-text-fill-color: var(--btn-primary-text) !important;
}

body.woocommerce :is(#respond input#submit:hover,
    a.button:hover,
    button.button:hover,
    input.button:hover,
    .wp-element-button:hover,
    .single_add_to_cart_button:hover,
    .wc-proceed-to-checkout a:hover,
    .coupon .button:hover,
    .wc-block-components-button:hover,
    .wc-block-components-product-button__button:hover) {
    color: var(--btn-primary-hover-text) !important;
    -webkit-text-fill-color: var(--btn-primary-hover-text) !important;
}

body.woocommerce :is(#respond input#submit:active,
    a.button:active,
    button.button:active,
    input.button:active,
    .wp-element-button:active,
    .single_add_to_cart_button:active,
    .wc-proceed-to-checkout a:active,
    .coupon .button:active,
    .wc-block-components-button:active,
    .wc-block-components-product-button__button:active) {
    color: var(--btn-primary-active-text) !important;
    -webkit-text-fill-color: var(--btn-primary-active-text) !important;
}

body.woocommerce :is(#respond input#submit,
    a.button,
    button.button,
    input.button,
    .wp-element-button,
    .single_add_to_cart_button,
    .wc-proceed-to-checkout a,
    .woocommerce-button,
    .woocommerce-Button,
    .coupon .button,
    .wc-block-components-button,
    .wc-block-components-product-button__button):is(:hover, :focus-visible, :active) * {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
    fill: currentColor;
}

body.woocommerce :is(#respond input#submit,
    a.button,
    button.button,
    input.button,
    .wp-element-button,
    .single_add_to_cart_button,
    .wc-proceed-to-checkout a,
    .woocommerce-button,
    .woocommerce-Button,
    .coupon .button,
    .wc-block-components-button,
    .wc-block-components-product-button__button):is(:hover, :focus-visible, :active)::before,
body.woocommerce :is(#respond input#submit,
    a.button,
    button.button,
    input.button,
    .single_add_to_cart_button,
    .wc-proceed-to-checkout a,
    .woocommerce-button,
    .woocommerce-Button,
    .coupon .button,
    .wc-block-components-button,
    .wc-block-components-product-button__button):is(:hover, :focus-visible, :active)::after {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
}

/* Secondary Actions Contrast */
body.woocommerce :is(.wc-block-mini-cart__button, .added_to_cart) {
    color: var(--btn-secondary-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-text) !important;
}

body.woocommerce :is(.wc-block-mini-cart__button:hover, .added_to_cart:hover) {
    color: var(--btn-secondary-hover-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-hover-text) !important;
}

body.woocommerce :is(.wc-block-mini-cart__button:active, .added_to_cart:active) {
    color: var(--btn-secondary-active-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-active-text) !important;
}

body.woocommerce :is(.wc-block-mini-cart__button, .added_to_cart):is(:hover, :focus-visible, :active) * {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
    fill: currentColor;
}

body.woocommerce :is(.wc-block-mini-cart__button, .added_to_cart):is(:hover, :focus-visible, :active)::before,
body.woocommerce :is(.wc-block-mini-cart__button, .added_to_cart):is(:hover, :focus-visible, :active)::after {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
}

body.woocommerce-checkout #place_order,
body.woocommerce-checkout #place_order:hover,
body.woocommerce-checkout #place_order:active {
    color: var(--btn-primary-text) !important;
    -webkit-text-fill-color: var(--btn-primary-text) !important;
}

body.woocommerce :is(a.button.ghost,
    button.button.ghost,
    .wp-element-button.ghost,
    .cart .button,
    .wc-block-mini-cart__footer-actions .wc-block-components-button,
    .wc-block-components-button.is-tertiary,
    .wc-block-components-button.is-secondary) {
    color: var(--btn-secondary-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-text) !important;
}

body.woocommerce :is(a.button.ghost:hover,
    button.button.ghost:hover,
    .wp-element-button.ghost:hover,
    .cart .button:hover,
    .wc-block-mini-cart__footer-actions .wc-block-components-button:hover,
    .wc-block-components-button.is-tertiary:hover,
    .wc-block-components-button.is-secondary:hover) {
    color: var(--btn-secondary-hover-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-hover-text) !important;
}

body.woocommerce :is(a.button.ghost:active,
    button.button.ghost:active,
    .wp-element-button.ghost:active,
    .cart .button:active,
    .wc-block-mini-cart__footer-actions .wc-block-components-button:active,
    .wc-block-components-button.is-tertiary:active,
    .wc-block-components-button.is-secondary:active) {
    color: var(--btn-secondary-active-text) !important;
    -webkit-text-fill-color: var(--btn-secondary-active-text) !important;
}

body.woocommerce :is(.shipping-calculator-button,
    .shipping-calculator-form button,
    .wc-block-next-previous-buttons__button,
    .wc-block-attribute-filter__button,
    .wc-block-components-filter-submit-button,
    .wc-block-components-panel__button) {
    color: var(--btn-primary-text) !important;
    -webkit-text-fill-color: var(--btn-primary-text) !important;
}

body.woocommerce :is(.shipping-calculator-button:hover,
    .shipping-calculator-form button:hover,
    .wc-block-next-previous-buttons__button:hover,
    .wc-block-attribute-filter__button:hover,
    .wc-block-components-filter-submit-button:hover,
    .wc-block-components-panel__button:hover) {
    color: var(--btn-primary-hover-text) !important;
    -webkit-text-fill-color: var(--btn-primary-hover-text) !important;
}

body.woocommerce :is(.shipping-calculator-button:active,
    .shipping-calculator-form button:active,
    .wc-block-next-previous-buttons__button:active,
    .wc-block-attribute-filter__button:active,
    .wc-block-components-filter-submit-button:active,
    .wc-block-components-panel__button:active) {
    color: var(--btn-primary-active-text) !important;
    -webkit-text-fill-color: var(--btn-primary-active-text) !important;
}

body.woocommerce :is(.shipping-calculator-button,
    .shipping-calculator-form button,
    .wc-block-next-previous-buttons__button,
    .wc-block-attribute-filter__button,
    .wc-block-components-filter-submit-button,
    .wc-block-components-panel__button):is(:hover, :focus-visible, :active) * {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
    fill: currentColor;
}

body.woocommerce .blockUI.blockOverlay {
    background: var(--veil-black-80, var(--overlay-ink-20)) !important;
}

body.woocommerce .blockUI.blockOverlay::before {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
}

body.woocommerce form .form-row .input-checkbox:checked {
    border-color: var(--border-strong);
}

body.woocommerce form .form-row .input-checkbox:checked::after {
    color: var(--text-primary);
}

body.woocommerce li.product:has(.out-of-stock-badge) span.onsale,
body.woocommerce .wc-block-grid__product:has(.wc-block-grid__product-out-of-stock) .wc-block-grid__product-onsale {
    opacity: 1;
}

/* Ensure light-flash hover buttons always switch text to dark. */
.btn--primary:hover,
.wp-element-button:hover {
    color: var(--btn-primary-hover-text);
}

.btn,
.wp-element-button {
    border-radius: var(--radius-none);
}

/* Smarter responsive logo sizing (reduced bulk, still clearly visible). */
.site-brand-logo {
    width: clamp(2.6rem, 4vw, 3.6rem);
}

.site-header,
.site-footer {
    background: var(--surface-frame) !important;
}

:is(body.woocommerce, body.woocommerce-page) {
    overflow-x: clip;
}

body.woocommerce.archive .woocommerce-products-header,
body.post-type-archive-product .woocommerce-products-header,
body.tax-product_cat .woocommerce-products-header,
body.tax-product_tag .woocommerce-products-header {
    background: var(--surface-page);
    margin-bottom: clamp(1.5rem, 1rem + 2vw, 3rem);
    padding-bottom: clamp(0.75rem, 0.5rem + 0.8vw, 1rem);
    border-bottom: 1px solid var(--border-subtle);
}

body.woocommerce :is(.woocommerce-products-header,
    .woocommerce-result-count,
    .woocommerce-ordering) {
    margin-top: 0;
}

body.woocommerce.archive :is(.products,
    .upsells.products,
    .related.products,
    .cross-sells ul.products) {
    margin-top: clamp(1rem, 0.8rem + 1vw, 1.5rem);
}

/* 20) Responsive Layouts */
@media (max-width: 768px) {

    body.woocommerce .woocommerce-message,
    body.woocommerce .woocommerce-info,
    body.woocommerce .woocommerce-error {
        padding: var(--space-sm) var(--space-md);
    }

    body.woocommerce .woocommerce-ordering select {
        width: 100%;
    }

    body.woocommerce :is(ul.products, .wc-block-grid__products, .wc-block-product-template),
    body.search-results :is(ul.products, .wc-block-grid__products, .wc-block-product-template) {
        grid-template-columns: 1fr;
    }

    body.woocommerce ul.products:is(.columns-1, .columns-2, .columns-3, .columns-4, .columns-5),
    body.search-results ul.products:is(.columns-1, .columns-2, .columns-3, .columns-4, .columns-5) {
        grid-template-columns: 1fr;
    }

    body.woocommerce table.shop_table .product-thumbnail {
        display: none;
    }

    body.woocommerce-cart table.shop_table td.product-name {
        padding-left: 0;
    }

    body.woocommerce-cart table.shop_table td.product-quantity .quantity {
        min-width: 100%;
    }

    body.woocommerce-checkout #customer_details .col-1,
    body.woocommerce-checkout #customer_details .col-2 {
        width: 100%;
        float: none;
    }

    body.woocommerce-checkout #customer_details {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    body.single-product div.product form.cart .quantity {
        margin: 0;
    }

    /* Mobile: full-width add to cart, stacked flex */
    body.single-product div.product form.cart .single_add_to_cart_button {
        margin-left: 0;
        margin-top: 0;
        width: 100%;
    }

    body.single-product div.product form.cart:not(.variations_form),
    body.single-product div.product form.variations_form .single_variation_wrap {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: stretch;
    }

    /* Mobile: single product grid stacks to 1 column */
    body.single-product div.product {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: var(--space-md);
    }

    /* Mobile: reduce section gap above tabs + related so the page doesn't feel too sparse */
    body.woocommerce div.product .woocommerce-tabs {
        margin-top: var(--space-2xl);
        margin-bottom: var(--space-2xl);
        padding: clamp(0.85rem, 4vw, 1.25rem);
    }

    body.woocommerce div.product .woocommerce-tabs .panel {
        padding: clamp(0.85rem, 4vw, 1.25rem);
    }

    /* Mobile: tabs list becomes a horizontal scrollable strip */
    body.woocommerce div.product .woocommerce-tabs ul.tabs {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: var(--space-xs);
        padding-bottom: var(--space-xs);
        padding-inline: var(--container-padding-inline);
        scroll-padding-inline: var(--container-padding-inline);
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-inline: calc(var(--container-padding-inline) * -1);
        margin-bottom: var(--space-md);
    }

    body.woocommerce div.product .woocommerce-tabs ul.tabs::-webkit-scrollbar {
        display: none;
    }

    body.woocommerce div.product .woocommerce-tabs ul.tabs li {
        flex: 0 0 auto;
        display: block;
        margin: 0;
        scroll-snap-align: start;
        border: 1px solid var(--border-strong);
        border-radius: var(--radius-sm);
    }

    /* Mobile: related/upsell/cross-sells horizontal scroller */
    .o2b-scroller-wrapper {
        margin-inline: calc(var(--container-padding-inline) * -1);
        width: auto;
    }

    body.single-product .upsells.products ul.products,
    body.single-product .related.products ul.products,
    body.woocommerce-cart .cross-sells ul.products {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: min(80vw, 16.5rem);
        gap: var(--layout-grid-gap);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-inline: var(--container-padding-inline);
        scroll-padding-inline: var(--container-padding-inline);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100% !important;
        grid-template-columns: none !important;
    }

    body.single-product :is(.upsells.products, .related.products, .cross-sells) ul.products::-webkit-scrollbar {
        display: none;
    }

    /* Mobile: section gaps tighten */
    body.single-product :is(.related.products,
        .upsells.products,
        .cross-sells) {
        margin-top: var(--space-2xl);
    }

    /* Scroller Control Mechanism: Elegant & Minimal */
    .o2b-scroller-wrapper {
        position: relative;
        width: 100%;
        overflow: visible;
        display: flex;
        flex-direction: column;
        gap: var(--space-md);
    }

    .o2b-scroller-controls {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: var(--space-md);
        margin-top: var(--space-md);
        width: 100%;
    }

    .o2b-scroller-arrow {
        width: 2.75rem;
        height: 2.75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-none);
        background: color-mix(in srgb, var(--surface-section) 92%, transparent);
        color: var(--text-primary);
        transition: all var(--transition-base);
        cursor: pointer;
        opacity: 0.35;
        pointer-events: none;
    }

    .o2b-scroller-arrow.is-visible {
        opacity: 0.65;
        pointer-events: auto;
    }

    .o2b-scroller-arrow:hover {
        opacity: 1;
        border-color: var(--border-strong);
        background: color-mix(in srgb, var(--surface-panel) 94%, transparent);
    }

    .o2b-scroller-arrow:active {
        background: var(--surface-raised);
        transform: scale(0.96);
    }

    .o2b-scroller-arrow.is-left,
    .o2b-scroller-arrow.is-right {
        position: static;
        transform: none;
    }
    .o2b-scroller-arrow svg,
    .o2b-archive-sidebar__header .o2b-icon-button svg {
        display: block !important;
        width: 1.25rem !important;
        height: 1.25rem !important;
        stroke: var(--text-primary) !important;
        stroke-width: 2.5px !important;
        pointer-events: none;
    }

    /* Absolute purge for Desktop (ghost box fix) */
    @media (min-width: 960px) {
        .o2b-scroller-controls,
        .o2b-scroller-controls *,
        .o2b-scroller-arrow { 
            display: none !important; 
            opacity: 0 !important;
            visibility: hidden !important;
            width: 0 !important;
            height: 0 !important;
            margin: 0 !important;
            padding: 0 !important;
            pointer-events: none !important;
        }
    }

    /* Cart Coupon Box: Dark & Precise */
    body.woocommerce-cart :is(.coupon, .wc-block-components-totals-coupon) {
        display: flex;
        gap: var(--space-xs);
        background: var(--surface-section) !important;
        padding: var(--space-sm);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
    }

    body.woocommerce-cart :is(.coupon input#coupon_code, #wc-block-components-totals-coupon__input-coupon) {
        background: var(--surface-control) !important;
        border: 1px solid var(--border-subtle) !important;
        color: var(--text-primary) !important;
        padding: 0.65rem 0.85rem !important;
        font-size: 0.85rem !important;
        width: 100% !important;
        border-radius: var(--radius-none) !important;
        box-shadow: none !important;
    }

    body.woocommerce-cart :is(.coupon input#coupon_code, #wc-block-components-totals-coupon__input-coupon):focus {
        border-color: var(--metal) !important;
        background: var(--surface-raised) !important;
    }

    body.woocommerce-cart :is(.coupon .button, .wc-block-components-totals-coupon__button) {
        padding: 0 var(--space-md) !important;
        min-height: 2.6rem !important;
        font-size: 0.8rem !important;
        letter-spacing: 0.05em !important;
    }

    body.woocommerce-account .woocommerce-MyAccount-navigation,
    body.woocommerce-account .woocommerce-MyAccount-content {
        width: 100%;
        float: none;
    }

    body.woocommerce-account .woocommerce {
        grid-template-columns: 1fr;
    }

    body.woocommerce.archive :is(.woocommerce-widgets-wrapper,
        .woocommerce-widget-layered-nav,
        .widget_layered_nav,
        .widget_price_filter,
        .wc-block-product-filters,
        .wc-block-product-filter-price,
        .wc-block-product-filter-attribute,
        .wc-block-product-filter-rating,
        .wc-block-product-filters__overlay-dialog) {
        max-width: 100%;
    }

    body.woocommerce :is(.wc-block-product-filters__open-overlay,
        .wc-block-product-filters__overlay) {
        display: none !important;
    }
}

/* =========================================================
   Tablet breakpoint (769px - 959px): single-column product, but generous breathing
   ========================================================= */
@media (min-width: 769px) and (max-width: 959px) {
    body.single-product div.product {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: var(--layout-content-gap);
    }

    body.single-product div.product div.summary {
        padding: clamp(1rem, 2.5vw, 1.4rem);
    }

    body.woocommerce div.product .woocommerce-tabs {
        padding: clamp(1rem, 2.5vw, 1.4rem);
        margin-top: var(--space-3xl);
        margin-bottom: var(--space-3xl);
    }

    body.woocommerce div.product .woocommerce-tabs .panel {
        padding: clamp(1rem, 2.5vw, 1.4rem);
    }

    body.single-product .upsells.products ul.products,
    body.single-product .related.products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   Mid-tablet breakpoint (769px - 1024px): existing Woo tweaks
   ========================================================= */
@media (min-width: 960px) and (max-width: 1024px) {
    body.woocommerce.single-product div.product span.onsale {
        top: clamp(0.65rem, 1.2vw, 0.8rem);
        right: clamp(0.65rem, 1.2vw, 0.8rem);
        left: auto;
        font-size: 0.6875rem;
        padding: 0.3em 0.65em;
    }

    body.woocommerce :is(ul.products, .wc-block-grid__products, .wc-block-product-template) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.woocommerce ul.products.columns-1 {
        grid-template-columns: 1fr;
    }

    body.woocommerce ul.products.columns-2,
    body.woocommerce ul.products.columns-3,
    body.woocommerce ul.products.columns-4,
    body.woocommerce ul.products.columns-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.woocommerce-account .woocommerce {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1200px) {
    body.woocommerce.archive ul.products.columns-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 21) Motion safety */
@media (prefers-reduced-motion: reduce) {

    body.woocommerce *,
    body.woocommerce *::before,
    body.woocommerce *::after,
    body.woocommerce-page *,
    body.woocommerce-page *::before,
    body.woocommerce-page *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 22) Layout overrides removed (GeneratePress-safe). */

/* Pagination should stay neutral gray, not blue. */
body.woocommerce .woocommerce-pagination .page-numbers li span.current,
body.woocommerce .woocommerce-pagination .page-numbers li a:hover,
body.woocommerce .wc-block-components-pagination__page[aria-current="page"],
body.woocommerce .wc-block-components-pagination__page:hover {
    background: var(--metal) !important;
    color: var(--text-inverse) !important;
    border-color: var(--metal) !important;
}

/* Additional info / tabs active state should not use blue accents. */
body.woocommerce div.product .woocommerce-tabs ul.tabs li.active,
body.woocommerce div.product .woocommerce-tabs ul.tabs li.active a,
body.woocommerce div.product .woocommerce-tabs ul.tabs li.active a:hover {
    border-color: var(--border-strong) !important;
    color: var(--text-primary) !important;
    background: var(--surface-section) !important;
}

/* 24) Archive product rows: desktop/tablet = 2, mobile = 1 */
:is(body.woocommerce.archive,
    body.post-type-archive-product,
    body.tax-product_cat,
    body.tax-product_tag,
    body.search-results) :is(ul.products,
    .wc-block-grid__products,
    .wc-block-product-template) {
    grid-template-columns: 1fr;
}

:is(body.woocommerce.archive,
    body.post-type-archive-product,
    body.tax-product_cat,
    body.tax-product_tag,
    body.search-results) ul.products:is(.columns-1,
    .columns-2,
    .columns-3,
    .columns-4,
    .columns-5) {
    grid-template-columns: 1fr;
}

@media (min-width: 769px) {

    :is(body.woocommerce.archive,
        body.post-type-archive-product,
        body.tax-product_cat,
        body.tax-product_tag,
        body.search-results) :is(ul.products,
        .wc-block-grid__products,
        .wc-block-product-template) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    :is(body.woocommerce.archive,
        body.post-type-archive-product,
        body.tax-product_cat,
        body.tax-product_tag,
        body.search-results) ul.products:is(.columns-1,
        .columns-2,
        .columns-3,
        .columns-4,
        .columns-5) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 25) Final archive/search refinement pass */
body.woocommerce .woocommerce-products-header__title,
body.search-results .woocommerce-products-header__title {
    font-size: clamp(2.15rem, 1.6rem + 2.2vw, 3.15rem);
    letter-spacing: 0.04em;
}

body.woocommerce .woocommerce-products-header__description,
body.woocommerce .archive-description,
body.woocommerce .term-description {
    color: var(--text-body);
    font-family: var(--font-family-body);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 48rem;
    margin-top: 0;
    margin-bottom: clamp(1.35rem, 1.1rem + 0.9vw, 2rem);
}

body.woocommerce .woocommerce-products-header__description p,
body.woocommerce .archive-description p,
body.woocommerce .term-description p {
    margin: 0.2rem 0 0;
}

body.woocommerce ul.products li.product,
body.search-results ul.products li.product {
    overflow: hidden;
    min-height: 0;
}

body.woocommerce.archive ul.products li.product,
body.search-results ul.products li.product {
    /* Reduced from clamp(15rem, 20vw, 20rem) */
    min-height: clamp(12rem, 15vw, 17rem);
}

body.woocommerce.archive ul.products li.product.product-category,
body.search-results ul.products li.product.product-category {
    min-height: auto;
}

body.woocommerce.archive ul.products li.product.product-category .woocommerce-loop-category__link,
body.search-results ul.products li.product.product-category .woocommerce-loop-category__link {
    background: var(--surface-section);
    border: 1px solid var(--border-subtle);
    padding: clamp(0.9rem, 1.6vw, 1.2rem);
    display: grid;
    gap: 0.5rem;
}

body.woocommerce.archive ul.products li.product.product-category .woocommerce-loop-category__title,
body.search-results ul.products li.product.product-category .woocommerce-loop-category__title {
    font-size: 0.82rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-primary);
}

body.woocommerce.archive ul.products li.product .woocommerce-loop-product__link,
body.search-results ul.products li.product .woocommerce-loop-product__link {
    padding: var(--layout-card-padding);
    gap: var(--space-sm);
}

body.woocommerce.archive :is(ul.products, .wc-block-grid__products, .wc-block-product-template),
body.search-results :is(ul.products, .wc-block-grid__products, .wc-block-product-template) {
    gap: clamp(1rem, 2vw, 1.6rem);
}

body.woocommerce ul.products li.product .woocommerce-loop-category__title,
body.search-results ul.products li.product .woocommerce-loop-category__title,
body.woocommerce ul.products li.product .ast-woo-product-category,
body.search-results ul.products li.product .ast-woo-product-category {
    margin-top: 0;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}

body.woocommerce span.onsale,
body.search-results span.onsale,
body.woocommerce .wc-block-grid__product-onsale {
    line-height: 1.2;
    max-width: calc(100% - 1.5rem);
}

body.woocommerce li.product:has(.out-of-stock-badge) span.onsale,
body.search-results li.product:has(.out-of-stock-badge) span.onsale,
body.woocommerce .wc-block-grid__product:has(.wc-block-grid__product-out-of-stock) .wc-block-grid__product-onsale {
    display: none !important;
}

body.woocommerce :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::before,
body.search-results :is(.woocommerce-message, .woocommerce-info, .woocommerce-error)::before {
    position: static;
    inset: auto;
    margin: 0.08rem 0 0;
    flex: 0 0 auto;
}

body.woocommerce :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) .button,
body.search-results :is(.woocommerce-message, .woocommerce-info, .woocommerce-error) .button {
    margin-left: auto;
}

body.search-results nav.woocommerce-pagination {
    margin: var(--space-2xl) 0 0;
    text-align: left;
}

body.search-results nav.woocommerce-pagination ul,
body.search-results nav.woocommerce-pagination .page-numbers {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

body.search-results nav.woocommerce-pagination ul li {
    margin: 0;
}

body.search-results .woocommerce-pagination .page-numbers li span.current,
body.search-results .woocommerce-pagination .page-numbers li a {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-none);
    background: var(--surface-control);
    color: var(--text-secondary);
    min-width: clamp(2.75rem, 2.5rem + 0.7vw, 3rem);
    min-height: clamp(2.75rem, 2.5rem + 0.7vw, 3rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(0.4rem, 0.3rem + 0.4vw, 0.75rem);
}

body.search-results .woocommerce-pagination .page-numbers li span.current,
body.search-results .woocommerce-pagination .page-numbers li a:hover {
    background: var(--metal);
    color: var(--text-inverse);
    border-color: var(--metal);
}

body.woocommerce ul.products li.product .woocommerce-loop-product__title {
    display: block !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* 26) Product card hardening */
body.woocommerce ul.products li.product .woocommerce-LoopProduct-link,
body.search-results ul.products li.product .woocommerce-LoopProduct-link,
body.woocommerce ul.products li.product .ast-woo-product-description,
body.search-results ul.products li.product .ast-woo-product-description {
    width: 100%;
    min-width: 0;
}

body.woocommerce ul.products li.product .ast-woo-product-description,
body.search-results ul.products li.product .ast-woo-product-description {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

body.woocommerce ul.products li.product .price,
body.search-results ul.products li.product .price {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 0.45rem;
    overflow-wrap: anywhere;
}

body.woocommerce ul.products li.product .out-of-stock-badge,
body.search-results ul.products li.product .out-of-stock-badge,
body.woocommerce ul.products li.product .wc-block-grid__product-out-of-stock {
    max-width: calc(100% - 1.5rem);
}
