/**
 * WooCommerce: theme colours, fonts and shapes for the store.
 *
 * Every value comes from the theme's CSS variables, so the Customizer's colour and typography settings
 * (and Pro's dark mode) apply to the store as well. WooCommerce compiles its colours into its stylesheets,
 * so each rule below repeats WooCommerce's own selector (same specificity) and wins by loading after it.
 */

/* WooCommerce reads only these of its variables (form fields). */
:root {
    --wc-form-border-color: var(--wpi--base-border-color);
    --wc-form-border-radius: 0;
    --wc-form-border-width: 0.1rem;
}

/* Header cart count. */
.cart .number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: var(--wpi--primary-bg-color);
    color: var(--wpi--primary-text-color);
    font-size: 1.2rem;
    transform: translateY(-0.6rem);
}

/* Buttons: the theme's button. :is(*, .alt) gives normal and .alt buttons the specificity of .alt. */
.woocommerce #respond input#submit,
.woocommerce :is(a, button, input).button:is(*, .alt),
.wc-block-components-button:not(.is-link) {
    background-color: var(--wpi--primary-bg-color);
    color: var(--wpi--primary-text-color);
    border-radius: 0;
    font-family: var(--wpi--font-general);
    font-weight: var(--wpi--font-general-weight);
    line-height: 1.2;
    padding: 1.4rem 2rem;
}
.woocommerce #respond input#submit:is(:hover, :focus-visible),
.woocommerce :is(a, button, input).button:is(*, .alt):is(:hover, :focus-visible),
.wc-block-components-button:not(.is-link):is(:hover, :focus-visible) {
    background-color: var(--wpi--secondary-bg-color);
    color: var(--wpi--secondary-text-color);
}
/* Disabled (e.g. a variable product before an option is chosen): WooCommerce dims it. */
.woocommerce :is(a, button, input).button:is(*, .alt):is(.disabled, :disabled, :disabled[disabled]:hover) {
    background-color: var(--wpi--primary-bg-color);
    color: var(--wpi--primary-text-color);
}

/* Product titles in lists use the theme's small heading (Pro's typography settings, else the free theme's heading font). */
.woocommerce ul.products li.product :is(.woocommerce-loop-product__title, .woocommerce-loop-category__title) {
    font-family: var(--wpi--font-family-small, var(--wpi--font-heading));
    font-size: var(--wpi--font-size-small);
    font-weight: var(--wpi--font-weight-small, var(--wpi--font-heading-weight));
    letter-spacing: var(--wpi--letter-spacing-small, normal);
    line-height: var(--wpi--line-height-small, 1.2);
    text-transform: var(--wpi--text-transform-small, none);
}

/* Prices and stock. Sale prices are <ins>: no text highlight (the classic templates already clear it). */
.woocommerce ul.products li.product .price,
.woocommerce div.product p.price,
.woocommerce div.product span.price,
.woocommerce div.product .stock {
    color: var(--wpi--base-text-color);
}
.wc-block-components-product-price ins {
    background: none;
}

/* Sale badge. */
.woocommerce span.onsale {
    min-height: 0;
    min-width: 0;
    padding: 0.6rem 1rem;
    border-radius: 0;
    background-color: var(--wpi--primary-bg-color);
    color: var(--wpi--primary-text-color);
    font-size: 1.2rem;
    line-height: 1;
    text-transform: uppercase;
    top: 1rem;
    right: 1rem;
}
.woocommerce ul.products li.product .onsale {
    top: 1rem;
    left: 1rem;
    right: auto;
    margin: 0;
}

/* Product tabs: a flat row with the active tab underlined. */
.woocommerce div.product .woocommerce-tabs ul.tabs {
    padding: 0;
    border-bottom: 0.1rem solid var(--wpi--base-border-color);
}
.woocommerce div.product .woocommerce-tabs ul.tabs::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after {
    display: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
    padding: 1.2rem 1.6rem;
    color: var(--wpi--base-text-color);
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
    background: none;
    box-shadow: inset 0 -0.2rem 0 var(--wpi--primary-bg-color);
}

/* Notices. */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    background-color: rgba(var(--wpi--rgb-color), 0.03);
    color: var(--wpi--base-text-color);
}
.woocommerce-message,
.woocommerce-info {
    border-top-color: var(--wpi--primary-bg-color);
}
.woocommerce-message::before,
.woocommerce-info::before {
    color: var(--wpi--primary-bg-color);
}
.woocommerce-store-notice,
p.demo_store {
    background-color: var(--wpi--primary-bg-color);
    color: var(--wpi--primary-text-color);
}

/* Borders and accents that WooCommerce draws in its own colours. */
.woocommerce form.login,
.woocommerce form.register,
.woocommerce form.checkout_coupon {
    border-color: var(--wpi--base-border-color);
    border-radius: 0;
}
.woocommerce nav.woocommerce-pagination ul,
.woocommerce nav.woocommerce-pagination ul li {
    border-color: var(--wpi--base-border-color);
}
.woocommerce nav.woocommerce-pagination ul li a:focus,
.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li span.current {
    background: var(--wpi--primary-bg-color);
    color: var(--wpi--primary-text-color);
}
.woocommerce .star-rating::before {
    color: var(--wpi--base-border-color);
}
.woocommerce .widget_price_filter .ui-slider .ui-slider-handle,
.woocommerce .widget_price_filter .ui-slider .ui-slider-range {
    background-color: var(--wpi--primary-bg-color);
}
.woocommerce-checkout #payment div.payment_box {
    background-color: rgba(var(--wpi--rgb-color), 0.05);
    color: var(--wpi--base-text-color);
}
.woocommerce-checkout #payment div.payment_box::before {
    border-bottom-color: rgba(var(--wpi--rgb-color), 0.05);
}
