/**
 * KFeiz Dark Contrast
 *
 * Scope rules:
 * - Only applies while Blocksy's dark color mode is active.
 * - Uses stable WooCommerce selectors where possible.
 * - Does not target Checkout, payment methods, the trust seal or theme files.
 */

html[data-color-mode="dark"] {
	--kfeiz-dc-orange: #ff6310;
	--kfeiz-dc-orange-hover: #fd7c47;
	--kfeiz-dc-on-orange: #111827;
	--kfeiz-dc-primary-text: #e5e7eb;
	--kfeiz-dc-secondary-text: #aab6c2;
	--kfeiz-dc-control-border: #667481;
}

/* Product-category and shop purchase buttons. */
html[data-color-mode="dark"] body.woocommerce.archive ul.products li.product .button,
html[data-color-mode="dark"] body.woocommerce-page.archive ul.products li.product .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 9px 16px;
	border: 1px solid var(--kfeiz-dc-orange) !important;
	border-radius: 8px;
	background: var(--kfeiz-dc-orange) !important;
	color: var(--kfeiz-dc-on-orange) !important;
	font-weight: 800;
	line-height: 1.5;
	opacity: 1 !important;
	text-decoration: none !important;
}

html[data-color-mode="dark"] body.woocommerce.archive ul.products li.product .button:hover,
html[data-color-mode="dark"] body.woocommerce.archive ul.products li.product .button:focus-visible,
html[data-color-mode="dark"] body.woocommerce-page.archive ul.products li.product .button:hover,
html[data-color-mode="dark"] body.woocommerce-page.archive ul.products li.product .button:focus-visible {
	border-color: var(--kfeiz-dc-orange-hover) !important;
	background: var(--kfeiz-dc-orange-hover) !important;
	color: var(--kfeiz-dc-on-orange) !important;
}

html[data-color-mode="dark"] body.woocommerce.archive ul.products li.product .button:focus-visible,
html[data-color-mode="dark"] body.woocommerce-page.archive ul.products li.product .button:focus-visible {
	outline: 3px solid rgba(253, 124, 71, 0.38);
	outline-offset: 3px;
}

/* Sale badge: keep the existing orange but use an accessible foreground. */
html[data-color-mode="dark"] body.woocommerce .onsale,
html[data-color-mode="dark"] body.woocommerce-page .onsale {
	background: var(--kfeiz-dc-orange) !important;
	color: var(--kfeiz-dc-on-orange) !important;
}

/* Product-card price and supporting information. */
html[data-color-mode="dark"] body.woocommerce.archive ul.products li.product .price,
html[data-color-mode="dark"] body.woocommerce.archive ul.products li.product .price ins,
html[data-color-mode="dark"] body.woocommerce.archive ul.products li.product .price > .woocommerce-Price-amount,
html[data-color-mode="dark"] body.woocommerce-page.archive ul.products li.product .price,
html[data-color-mode="dark"] body.woocommerce-page.archive ul.products li.product .price ins,
html[data-color-mode="dark"] body.woocommerce-page.archive ul.products li.product .price > .woocommerce-Price-amount {
	color: var(--kfeiz-dc-primary-text) !important;
	opacity: 1 !important;
}

html[data-color-mode="dark"] body.woocommerce.archive ul.products li.product .price del,
html[data-color-mode="dark"] body.woocommerce-page.archive ul.products li.product .price del,
html[data-color-mode="dark"] body.woocommerce.archive ul.products li.product .entry-meta,
html[data-color-mode="dark"] body.woocommerce.archive ul.products li.product .entry-meta a,
html[data-color-mode="dark"] body.woocommerce-page.archive ul.products li.product .entry-meta,
html[data-color-mode="dark"] body.woocommerce-page.archive ul.products li.product .entry-meta a {
	color: var(--kfeiz-dc-secondary-text) !important;
	opacity: 1 !important;
}

/* Selected secondary information on a single product; the purchase button is untouched. */
html[data-color-mode="dark"] body.single-product .product_meta,
html[data-color-mode="dark"] body.single-product .product_meta a,
html[data-color-mode="dark"] body.single-product .product_meta .sku,
html[data-color-mode="dark"] body.single-product .summary .reset_variations {
	color: var(--kfeiz-dc-secondary-text) !important;
	opacity: 1 !important;
}

/* Controls limited to shop/category and product pages; Checkout is intentionally excluded. */
html[data-color-mode="dark"] body.woocommerce.archive .woocommerce-ordering select,
html[data-color-mode="dark"] body.woocommerce-page.archive .woocommerce-ordering select,
html[data-color-mode="dark"] body.single-product .summary select,
html[data-color-mode="dark"] body.single-product .summary input.qty {
	border-color: var(--kfeiz-dc-control-border) !important;
	color: var(--kfeiz-dc-primary-text) !important;
}

/* Existing custom footer controls with bright mint backgrounds. */
html[data-color-mode="dark"] .kf-footer-contact-button,
html[data-color-mode="dark"] .kf-footer-disclaimer-icon {
	color: #0e141b !important;
}

/* Disabled controls stay recognisably disabled without becoming unreadable. */
html[data-color-mode="dark"] body.woocommerce.archive ul.products li.product .button.disabled,
html[data-color-mode="dark"] body.woocommerce.archive ul.products li.product .button:disabled,
html[data-color-mode="dark"] body.woocommerce-page.archive ul.products li.product .button.disabled,
html[data-color-mode="dark"] body.woocommerce-page.archive ul.products li.product .button:disabled {
	opacity: 0.72 !important;
}
