/* ==========================================================================
   WooCommerce Reset
   ==========================================================================
   Neutralizes woocommerce-general.css layout opinions so our custom styles
   can work without !important. Loaded after woocommerce-general, before
   our woocommerce.css. Only strips problematic opinions — preserves
   WooCommerce's useful form/accessibility base styles.
   ========================================================================== */

/* --- Blocktheme overrides ---
   woocommerce-blocktheme.css constrains cart/checkout to 1000px
   and shop tables to 70%. We use our own layout widths. */
.woocommerce-cart main .woocommerce,
.woocommerce-checkout main .woocommerce {
    max-width: none;
}

.woocommerce-page table.shop_table {
    width: 100%;
}

/* --- Breadcrumb --- */
.woocommerce .woocommerce-breadcrumb {
    margin: 0;
    padding: 0;
}

/* --- Font inheritance ---
   WooCommerce doesn't inherit the theme font. */
.woocommerce,
.woocommerce-page {
    font-family: var(--wp--preset--font-family--body, 'Quicksand', sans-serif);
}

/* --- Product grid: strip float-based layout ---
   WooCommerce uses floats and fixed widths for the product loop.
   We use CSS grid instead. */
.woocommerce ul.products {
    display: grid;
    padding: 0;
    margin: 0;
    list-style: none;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
    display: none;
    content: none;
}

.woocommerce ul.products li.product {
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    clear: none;
}

/* --- Product images in loop: strip defaults --- */
.woocommerce ul.products li.product a img {
    box-shadow: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
}

/* --- Product title in loop: strip overrides --- */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h3 {
    font-size: inherit;
    font-weight: inherit;
    margin: 0;
    padding: 0;
}

/* --- Product price in loop: strip overrides --- */
.woocommerce ul.products li.product .price {
    font-size: inherit;
    margin: 0;
    color: inherit;
}

/* --- Sale badge: strip circular default --- */
.woocommerce span.onsale {
    min-width: auto;
    min-height: auto;
    line-height: inherit;
}

/* --- Notices: strip left border ---
   WooCommerce adds a colored left border on notices. */
.woocommerce-info,
.woocommerce-message,
.woocommerce-error {
    border: none;
}

/* --- Notices: strip block notice link color ---
   wc-blocks.css forces .wc-forward to dark via !important. */
.wc-block-components-notice-banner > .wc-block-components-notice-banner__content .wc-forward {
    color: inherit !important;
    background: none;
    padding: 0;
    border: none;
    min-height: auto;
}

/* --- Block cart items: restore the card fill ---
   wc-blocks cart.css forces `table.wc-block-cart-items { background: none !important }`,
   which lets the page gradient bleed through the items card (the table IS the card —
   there is no separate wrapper). Re-assert the white fill; !important is the only way
   to override WooCommerce's own !important. cart-blocks.css keeps the border/radius. */
.wp-block-woocommerce-cart table.wc-block-cart-items {
    background-color: var(--wp--preset--color--base) !important;
}

/* --- Buttons: inherit font, normalize --- */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
    font-family: inherit;
    border-radius: var(--wp--custom--border-radius);
}

/* --- Related / upsell products: strip blocktheme's 5em top margin --- */
.woocommerce div.product .related.products,
.woocommerce div.product .up-sells {
    margin-top: 0;
}

/* --- Gallery thumbnails: strip zero-margin reset --- */
.woocommerce div.product div.images .flex-control-thumbs {
    margin: 0;
}

/* --- Variations table: fix label alignment ---
   woocommerce-blocktheme.css sets display: block on the table. Use flex on
   each row so the label vertically centers beside the select. */
.woocommerce table.variations tr {
    display: flex;
    align-items: center;
}

.woocommerce div.product form.cart .variations td,
.woocommerce div.product form.cart .variations th {
    line-height: normal;
}

/* WooCommerce JS sets inline display: inline — !important needed to override */
.woocommerce div.product form.cart .reset_variations {
    display: none !important;
}

/* --- Star ratings: set brand color --- */
.woocommerce .star-rating {
    color: #FFB800;
}

/* --- Payment box: strip WooCommerce's default background and speech bubble --- */
.woocommerce-checkout #payment div.payment_box {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

.woocommerce-checkout #payment div.payment_box::before {
    display: none;
}

/* --- Select2: strip default grey selected / blue highlighted backgrounds --- */
.woocommerce-page .select2-container--default .select2-results__option[aria-selected=true],
.woocommerce-page .select2-container--default .select2-results__option[data-selected=true] {
    background-color: transparent;
}

.woocommerce-page .select2-container--default .select2-results__option--highlighted[aria-selected],
.woocommerce-page .select2-container--default .select2-results__option--highlighted[data-selected] {
    background-color: transparent;
    color: inherit;
}

/* --- Checkout validation: strip green/red borders --- */
.woocommerce form .form-row.woocommerce-validated input.input-text,
.woocommerce form .form-row.woocommerce-validated select,
.woocommerce form .form-row.woocommerce-validated .select2-container--default .select2-selection--single {
    border-color: inherit;
}

/* --- Checkbox: strip WooCommerce's negative top margin and right spacing --- */
.woocommerce form .form-row .input-checkbox {
    margin-top: 0;
    margin-right: 0;
}
