/* =========================================================
   Light / dark color modes
   The default theme.json palette is light. These variables override the same
   semantic tokens when the visitor chooses dark mode.
   ========================================================= */

html[data-oravio-theme="dark"] {
	color-scheme: dark;
	--wp--preset--color--background: #0d1015;
	--wp--preset--color--surface: #151a22;
	--wp--preset--color--text: #f3f5f7;
	--wp--preset--color--muted: #a8b0bd;
	--wp--preset--color--border: #2b3340;
	--wp--preset--color--primary:
		color-mix(in srgb, var(--wp--preset--color--brand) 48%, #ffffff);
	--wp--preset--color--primary-dark:
		color-mix(in srgb, var(--wp--preset--color--brand) 30%, #ffffff);
	--wp--preset--color--soft:
		color-mix(in srgb, var(--wp--preset--color--brand) 12%, #151a22);

	--oravio-header-glass-bg: rgba(9, 13, 19, 0.44);
	--oravio-header-glass-bg-overlay: rgba(7, 11, 17, 0.26);
	--oravio-header-glass-bg-scrolled: rgba(9, 13, 19, 0.68);
	--oravio-header-glass-highlight: rgba(255, 255, 255, 0.045);
	--oravio-header-glass-highlight-overlay: rgba(255, 255, 255, 0.03);
	--oravio-header-glass-highlight-scrolled: rgba(255, 255, 255, 0.065);
	--oravio-header-solid-bg: #11161d;
	--oravio-header-border: rgba(255, 255, 255, 0.085);
	--oravio-header-border-scrolled: rgba(255, 255, 255, 0.12);
	--oravio-header-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.055),
		0 1px 2px rgba(0, 0, 0, 0.18),
		0 10px 34px rgba(0, 0, 0, 0.22);
	--oravio-header-shadow-overlay:
		inset 0 1px 0 rgba(255, 255, 255, 0.04),
		0 1px 0 rgba(0, 0, 0, 0.14),
		0 8px 26px rgba(0, 0, 0, 0.16);
	--oravio-header-shadow-scrolled:
		inset 0 1px 0 rgba(255, 255, 255, 0.075),
		0 1px 2px rgba(0, 0, 0, 0.22),
		0 14px 44px rgba(0, 0, 0, 0.34);
	--oravio-header-control-bg: rgba(255, 255, 255, 0.045);
	--oravio-header-control-bg-hover: rgba(255, 255, 255, 0.09);
	--oravio-header-drawer-bg: rgba(12, 17, 24, 0.88);
	--oravio-header-drawer-backdrop: rgba(2, 5, 10, 0.62);
	--oravio-footer-bg: #080a0e;
	--oravio-footer-text: #eef1f5;
	--oravio-dark-section-bg: #07090d;
	--oravio-dark-section-text: #f6f7f9;

	--oravio-commerce-card-shadow:
		0 1px 2px rgba(0, 0, 0, 0.18),
		0 12px 36px rgba(0, 0, 0, 0.22);
	--oravio-commerce-card-shadow-hover:
		0 1px 3px rgba(0, 0, 0, 0.20),
		0 18px 46px rgba(0, 0, 0, 0.29);
	--oravio-commerce-panel-shadow:
		0 2px 5px rgba(0, 0, 0, 0.20),
		0 24px 72px rgba(0, 0, 0, 0.31);
	--oravio-commerce-media-bg:
		color-mix(in srgb, var(--wp--preset--color--surface) 72%, var(--wp--preset--color--background));
	--oravio-commerce-glow: color-mix(in srgb, var(--wp--preset--color--primary) 10%, transparent);

	--oravio-access-card-shadow:
		0 1px 2px rgba(0, 0, 0, 0.18),
		0 16px 48px rgba(0, 0, 0, 0.24);
	--oravio-access-card-shadow-hover:
		0 1px 3px rgba(0, 0, 0, 0.20),
		0 18px 46px rgba(0, 0, 0, 0.28);
	--oravio-access-player-shadow:
		0 28px 86px rgba(0, 0, 0, 0.46);
}

html[data-oravio-theme="light"] {
	color-scheme: light;
	--oravio-dark-section-bg: #17191d;
	--oravio-dark-section-text: #ffffff;
}

html[data-oravio-theme="dark"] body {
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text);
}

html[data-oravio-theme="dark"] :where(input, textarea, select) {
	color: var(--wp--preset--color--text);
	background-color: var(--wp--preset--color--surface);
	border-color: var(--wp--preset--color--border);
}

html[data-oravio-theme="dark"] .oravio-site-header .oravio-language-switcher__toggle,
html[data-oravio-theme="dark"] .oravio-theme-toggle__button,
html[data-oravio-theme="dark"] .oravio-site-header .wc-block-mini-cart__button {
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}


html[data-oravio-theme="dark"] .oravio-home-media__placeholder,
html[data-oravio-theme="dark"] .oravio-starter-gallery-placeholder {
	background:
		linear-gradient(135deg, rgba(139, 174, 255, 0.10), rgba(21, 26, 34, 0.50)),
		var(--wp--preset--color--soft);
}

html[data-oravio-theme="dark"] .oravio-access-library-resource {
	background:
		linear-gradient(
			145deg,
			color-mix(in srgb, var(--wp--preset--color--surface) 72%, var(--wp--preset--color--background)),
			color-mix(in srgb, var(--wp--preset--color--surface) 88%, transparent)
		);
}

html[data-oravio-theme="dark"] .woocommerce-account .woocommerce-MyAccount-navigation .is-active a {
	background: color-mix(in srgb, var(--wp--preset--color--primary) 12%, var(--wp--preset--color--surface));
	border-color: color-mix(in srgb, var(--wp--preset--color--primary) 28%, var(--wp--preset--color--border));
	color: var(--wp--preset--color--text);
}

html[data-oravio-theme="dark"] .oravio-product-grid .wc-block-components-product-sale-badge,
html[data-oravio-theme="dark"] .oravio-product__related .wc-block-components-product-sale-badge {
	background: var(--wp--preset--color--primary);
	color: #0b0e13;
}

html[data-oravio-theme="dark"] .wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	border-color: var(--wp--preset--color--border);
	color: var(--wp--preset--color--text);
}

html[data-oravio-theme="dark"] .wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--surface);
}

html[data-oravio-theme="dark"] .wc-block-components-order-summary,
html[data-oravio-theme="dark"] .wc-block-components-totals-wrapper,
html[data-oravio-theme="dark"] .woocommerce-order-details,
html[data-oravio-theme="dark"] .woocommerce-customer-details {
	border-color: var(--wp--preset--color--border);
}


/* WooCommerce Blocks can ship white field backgrounds with selectors that are
   more specific than generic theme form rules. Keep checkout controls coherent
   with dark mode rather than mixing a white field with light labels. */
html[data-oravio-theme="dark"] .wp-block-woocommerce-checkout :where(
	.wc-block-components-text-input input,
	.wc-block-components-combobox-control input,
	.wc-block-components-address-form input,
	.wc-block-components-address-form select,
	.wc-block-components-textarea,
	textarea,
	select
) {
	background: var(--wp--preset--color--surface) !important;
	background-color: var(--wp--preset--color--surface) !important;
	border-color: var(--wp--preset--color--border) !important;
	color: var(--wp--preset--color--text) !important;
	caret-color: var(--wp--preset--color--text);
}

html[data-oravio-theme="dark"] .wp-block-woocommerce-checkout :where(
	.wc-block-components-text-input label,
	.wc-block-components-combobox-control label,
	.wc-block-components-address-form label,
	.wc-block-components-checkbox__label,
	.wc-block-components-radio-control__label
) {
	color: var(--wp--preset--color--muted) !important;
}

html[data-oravio-theme="dark"] .wp-block-woocommerce-checkout :where(input, textarea)::placeholder {
	color: var(--wp--preset--color--muted) !important;
	opacity: 0.82;
}

html[data-oravio-theme="dark"] .wp-block-woocommerce-checkout :where(
	.wc-block-components-text-input input,
	.wc-block-components-combobox-control input,
	.wc-block-components-address-form input,
	.wc-block-components-address-form select,
	.wc-block-components-textarea
):focus {
	border-color: var(--wp--preset--color--primary) !important;
	box-shadow: 0 0 0 1px var(--wp--preset--color--primary) !important;
}

html[data-oravio-theme="dark"] .wp-block-woocommerce-checkout input:-webkit-autofill,
html[data-oravio-theme="dark"] .wp-block-woocommerce-checkout input:-webkit-autofill:hover,
html[data-oravio-theme="dark"] .wp-block-woocommerce-checkout input:-webkit-autofill:focus {
	-webkit-text-fill-color: var(--wp--preset--color--text) !important;
	-webkit-box-shadow: 0 0 0 1000px var(--wp--preset--color--surface) inset !important;
	caret-color: var(--wp--preset--color--text);
}

html[data-oravio-theme="dark"] .wp-block-woocommerce-checkout :where(
	.wc-block-components-order-summary,
	.wc-block-components-totals-wrapper,
	.wc-block-checkout__order-notes
) {
	background-color: color-mix(
		in srgb,
		var(--wp--preset--color--surface) 88%,
		var(--wp--preset--color--background)
	);
}
