/**
 * Airtight — WooCommerce Style Overrides
 *
 * Loaded conditionally only when WooCommerce is active.
 * Uses theme custom properties for consistent styling.
 */

/* ===========================================
   PRODUCT GRID
   =========================================== */

.wc-block-grid__products .wc-block-grid__product,
.wp-block-woocommerce-product-template .wc-block-layout {
	transition: box-shadow var(--transition-base);
}

.wc-block-grid__products .wc-block-grid__product:hover,
.wp-block-woocommerce-product-template .wc-block-layout:hover {
	box-shadow: var(--shadow-md);
}


/* ===========================================
   SALE BADGE
   =========================================== */

.wc-block-components-product-sale-badge,
.wc-block-components-product-sale-badge--align-left,
.wc-block-components-product-sale-badge--align-right {
	background-color: var(--color-sale-badge);
	color: var(--color-sale-badge-text);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--x-small);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-radius: var(--radius-sm);
	padding: 4px 8px;
}


/* ===========================================
   PRODUCT PRICE
   =========================================== */

.wc-block-components-product-price del {
	color: var(--color-price-regular);
	opacity: 0.7;
}

.wc-block-components-product-price ins {
	color: var(--color-price-sale);
	text-decoration: none;
	font-weight: 700;
}


/* ===========================================
   STAR RATINGS
   =========================================== */

.wc-block-components-product-rating .wc-block-components-product-rating__stars {
	color: var(--color-star-filled);
}

.wc-block-components-product-rating .wc-block-components-product-rating__stars span::before {
	color: var(--color-star-empty);
}


/* ===========================================
   STOCK STATUS
   =========================================== */

.wc-block-components-product-stock-indicator--in-stock {
	color: var(--color-stock-in);
}

.wc-block-components-product-stock-indicator--out-of-stock {
	color: var(--color-stock-out);
}

.wc-block-components-product-stock-indicator--on-backorder {
	color: var(--color-stock-backorder);
}


/* ===========================================
   MINI CART
   =========================================== */

.wc-block-mini-cart__button {
	position: relative;
}

.wc-block-mini-cart__badge {
	font-weight: 700;
	font-size: var(--wp--preset--font-size--x-small);
}

.wc-block-mini-cart__drawer {
	z-index: var(--z-modal);
}


/* ===========================================
   CART & CHECKOUT
   =========================================== */

.wc-block-cart .wc-block-components-totals-wrapper {
	border-color: var(--color-border);
}

.wc-block-checkout .wc-block-components-checkout-step__heading {
	font-weight: 600;
}

.wc-block-checkout .wc-block-components-checkout-step__description {
	color: var(--color-text-secondary);
	font-size: var(--wp--preset--font-size--small);
}

.wc-block-components-order-summary .wc-block-components-order-summary__button-text {
	font-weight: 600;
}


/* ===========================================
   NOTICES
   =========================================== */

.wc-block-components-notice-banner.is-info {
	background-color: var(--color-notice-info-bg);
	border-left-color: var(--color-notice-info-border);
}

.wc-block-components-notice-banner.is-success {
	background-color: var(--color-notice-success-bg);
	border-left-color: var(--color-notice-success-border);
}

.wc-block-components-notice-banner.is-error {
	background-color: var(--color-notice-error-bg);
	border-left-color: var(--color-notice-error-border);
}


/* ===========================================
   PRODUCT BUTTON
   =========================================== */

.wc-block-components-product-button .wc-block-components-product-button__button {
	transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.wc-block-components-product-button .wc-block-components-product-button__button:hover {
	transform: translateY(-1px);
}

.wc-block-components-product-button .wc-block-components-product-button__button:active {
	transform: translateY(0);
}


/* ===========================================
   BREADCRUMBS
   =========================================== */

.woocommerce-breadcrumb.airtight-breadcrumb {
	font-size: var(--wp--preset--font-size--small);
	color: var(--color-text-secondary);
}

.woocommerce-breadcrumb.airtight-breadcrumb a {
	color: var(--color-text-secondary);
	text-decoration: none;
}

.woocommerce-breadcrumb.airtight-breadcrumb a:hover {
	color: var(--color-primary);
}


/* ===========================================
   VARIATION FORM
   =========================================== */

.woocommerce div.product form.cart table.variations select {
	position: relative;
	z-index: 1;
	pointer-events: auto;
	cursor: pointer;
	opacity: 1;
	min-height: var(--input-height);
	padding: var(--input-padding);
	padding-right: 2.5em;
	font-size: var(--input-font-size);
	border: 1px solid var(--input-border-color);
	border-radius: var(--input-border-radius);
	background-color: var(--input-bg);
	color: var(--color-text-primary);
}

.woocommerce div.product form.cart table.variations select:focus {
	border-color: var(--input-focus-border-color);
	box-shadow: var(--input-focus-shadow);
	outline: none;
}


/* ===========================================
   WAPF (Advanced Product Fields) DROPDOWNS
   =========================================== */

.wapf-field-select select.wapf-input {
	min-height: var(--input-height);
	padding: var(--input-padding);
	padding-right: 2.5em;
	font-size: var(--input-font-size);
	border: 1px solid var(--input-border-color);
	border-radius: var(--input-border-radius);
	background-color: var(--input-bg);
	color: var(--color-text-primary);
	cursor: pointer;
}

.wapf-field-select select.wapf-input:focus {
	border-color: var(--input-focus-border-color);
	box-shadow: var(--input-focus-shadow);
	outline: none;
}


/* ===========================================
   CATALOG RULES (RT SITE MANAGER) — QUOTE / RESELLER MODE
   The theme owns all presentation for the rsm- elements the
   catalog-rules module injects (catalog-visibility.js) or renders
   hidden (inline quote form). The plugin's own stylesheet
   (handle: rsm-catalog-quote-mode) is dequeued in functions.php.
   The injected quote/reseller buttons inherit the classes of the button
   they replace (loop tiles — so they render exactly like their card's
   native buttons) or the native block-button classes
   (`wp-block-button__link wp-element-button button`, single product /
   fallback), so color, hover, radius and typography come from the same
   theme rules as the buttons around them — only structural rules live
   here. RSM supplies only the label and target (catalog-visibility.js).
   =========================================== */

/* Price message shown in place of the price in quote mode */
.rsm-catalog-quote-price-message {
	display: block;
	font-style: italic;
	color: var(--wp--preset--color--text-muted);
}

/* Quote button wrapper (single product) */
.rsm-catalog-quote-button-wrapper {
	margin: var(--wp--preset--spacing--20) 0;
}

.rsm-catalog-quote-button {
	display: inline-block;
	text-align: center;
}

.rsm-catalog-quote-button-wrapper .rsm-catalog-quote-button {
	width: auto;
}

/* Shop loop quote button */
.woocommerce ul.products li.product .rsm-catalog-quote-button {
	margin-top: 0.5em;
}

/* "Unavailable in your region" notices */
.rsm-catalog-unavailable {
	font-style: italic;
	color: var(--wp--preset--color--text-muted);
	margin: var(--wp--preset--spacing--20) 0;
}

.rsm-variation-notice {
	font-style: italic;
	color: var(--wp--preset--color--text-muted);
	margin: 0.5em 0 0;
}

/* Inline quote form: rendered hidden by the plugin, revealed by
   catalog-visibility.js for quote-mode visitors. The [hidden] rule
   backstops the UA default so the wrapper stays collapsed even if
   another rule sets display on it. */
.rsm-catalog-quote-form-wrapper[hidden] {
	display: none;
}

.rsm-catalog-quote-form-wrapper {
	margin: var(--wp--preset--spacing--20) 0;
}

.rsm-catalog-quote-form-wrapper .gform_wrapper {
	margin: 0;
}

/* Reseller mode: hide purchase controls, keep prices visible.
   Behavioral hiding (mirrors the plugin's server-side purchase block) —
   moved here with the rest of the plugin stylesheet; keep in sync with
   catalog-visibility.js, which toggles the rsm-reseller-mode class. */
.rsm-reseller-mode .variations_form .variations,
.rsm-reseller-mode .single_variation_wrap,
.rsm-reseller-mode .woocommerce-variation-add-to-cart,
.rsm-reseller-mode .single_add_to_cart_button,
.rsm-reseller-mode .quantity,
.rsm-reseller-mode .reset_variations,
.rsm-reseller-mode form.cart {
	display: none !important;
}

/* Shop loop reseller button */
.woocommerce ul.products li.product .rsm-reseller-mode-button {
	margin-top: 0.5em;
}


/* ===========================================
   PRIMARY BUTTONS — UNIFORM SYSTEM
   theme.json styles the button *element* (.wp-element-button /
   .wp-block-button__link), but WooCommerce's classic buttons
   (.button, .alt, #place_order, single_add_to_cart_button) and the
   wc-block component buttons (.wc-block-components-button) carry
   their own markup and never receive those element styles. This
   section maps every WooCommerce primary action onto the same
   --btn-* tokens theme.json uses, so all buttons render
   identically site-wide. Selectors mirror WooCommerce core's
   (including .alt and #respond input#submit) so this file wins on
   equal specificity by loading later — no !important needed.
   =========================================== */

.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce #respond input#submit.alt,
.woocommerce div.product form.cart .single_add_to_cart_button,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce #payment #place_order,
.woocommerce-page #payment #place_order,
.wc-block-components-button:not(.outlined) {
	display: inline-flex;
	align-items: center;
	justify-content: var(--btn-justify-content);
	gap: 0.5em;
	min-height: var(--button-base-min-height);
	padding: var(--btn-padding-block) var(--btn-padding-inline);
	border: var(--btn-border-width) var(--btn-border-style) var(--color-primary);
	border-radius: var(--btn-border-radius);
	background-color: var(--color-primary);
	color: var(--color-text-inverse);
	font-family: var(--font-primary);
	font-size: var(--btn-font-size);
	font-weight: var(--btn-font-weight);
	line-height: var(--btn-line-height);
	letter-spacing: var(--btn-letter-spacing);
	text-align: var(--btn-text-align);
	text-decoration: var(--btn-text-decoration);
	text-transform: var(--btn-text-transform);
	cursor: pointer;
	transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

/* Hover / focus — mirrors theme.json's :hover/:focus element styles */
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce #respond input#submit.alt:hover,
.woocommerce div.product form.cart .single_add_to_cart_button:hover,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce #payment #place_order:hover,
.woocommerce-page #payment #place_order:hover,
.wc-block-components-button:not(.outlined):hover,
.wc-block-components-button:not(.outlined):focus {
	background-color: var(--color-primary-dark);
	border-color: var(--color-primary-dark);
	color: var(--color-text-inverse);
	text-decoration: var(--btn-text-decoration-hover);
	transform: translateY(-1px);
}

.woocommerce a.button:active,
.woocommerce button.button:active,
.woocommerce input.button:active,
.woocommerce #respond input#submit:active,
.woocommerce div.product form.cart .single_add_to_cart_button:active,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:active,
.woocommerce #payment #place_order:active,
.wc-block-components-button:not(.outlined):active {
	transform: translateY(0);
}

/* Visible keyboard focus ring on top of the hover treatment */
.woocommerce a.button:focus-visible,
.woocommerce button.button:focus-visible,
.woocommerce input.button:focus-visible,
.woocommerce #respond input#submit:focus-visible,
.woocommerce div.product form.cart .single_add_to_cart_button:focus-visible,
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:focus-visible,
.woocommerce #payment #place_order:focus-visible,
.wc-block-components-button:not(.outlined):focus-visible {
	outline: 2px solid var(--color-primary-dark);
	outline-offset: 2px;
}

/* Disabled / AJAX loading — keep the primary fill, signal state via
   opacity so the button doesn't appear to change variant */
.woocommerce a.button.disabled,
.woocommerce button.button.disabled,
.woocommerce input.button.disabled,
.woocommerce a.button:disabled,
.woocommerce button.button:disabled,
.woocommerce input.button:disabled,
.woocommerce button.button:disabled[disabled],
.woocommerce input.button:disabled[disabled],
.woocommerce div.product form.cart .single_add_to_cart_button.disabled,
.woocommerce a.button.loading,
.woocommerce button.button.loading,
.wc-block-components-button:not(.outlined):disabled {
	background-color: var(--color-primary);
	border-color: var(--color-primary);
	color: var(--color-text-inverse);
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}
