/*
 * Final brand layer. Feature styles own layout; this file owns the shared
 * storefront palette and intentionally loads after every feature/integration.
 */
:root {
	--kev-brand-primary-hover: color-mix(in srgb, var(--kev-color-brand-primary) 82%, white);
	--kev-brand-primary-soft: color-mix(in srgb, var(--kev-color-brand-primary) 22%, transparent);
	--kev-brand-secondary-soft: color-mix(in srgb, var(--kev-color-brand-secondary) 12%, transparent);
	--kev-color-sale: #c92f36;
}

html,
body,
.wp-site-blocks,
.content-area,
.woocommerce-account .woocommerce,
.woocommerce-cart .woocommerce,
.woocommerce-checkout .woocommerce {
	background: var(--kev-color-canvas);
	color: var(--kev-color-text);
}

:where(
	.kev-coffee-site-header,
	.kev-coffee-mobile-header,
	.kev-coffee-site-footer,
	.kev-coffee-mobile-bottom-nav,
	.kev-coffee-product-catalog,
	.kev-coffee-blog-archive,
	.kev-coffee-search,
	.kev-coffee-single-article,
	.kev-coffee-informational-page,
	.woocommerce-account
) {
	background-color: var(--kev-color-canvas);
}

:where(
	.kev-coffee-site-header__cart-panel,
	.kev-coffee-mobile-header__panel,
	.kev-coffee-product-card,
	.kev-featured-products__item,
	.kev-coffee-article-card__card,
	.kev-coffee-product-catalog__filters,
	.kev-coffee-order-card,
	.kev-coffee-order-progress,
	.woocommerce-MyAccount-content,
	.kevira-checkout__step,
	.kevira-checkout__summary,
	.kevira-checkout__delivery-module,
	.kevira-checkout__payment-card
) {
	border-color: var(--kev-color-border) !important;
	background-color: var(--kev-color-surface) !important;
}

:where(
	h1,
	h2,
	h3,
	.kev-coffee-site-header__cart-title,
	.kev-coffee-product-information__title,
	.kev-coffee-order-progress__title,
	.kevira-checkout__module-title h2,
	.kevira-checkout__payment-card > h2
):not(:where(.woocommerce-tabs .panel *, .kev-coffee-single-article__content *)) {
	color: var(--kev-color-brand-secondary) !important;
}

:where(
	a:hover,
	a:focus-visible,
	.kev-coffee-site-header__nav .current-menu-item > a,
	.kev-coffee-site-header__nav .current-menu-ancestor > a,
	.kev-coffee-mobile-header__panel a:hover,
	.kev-coffee-mobile-bottom-nav a[aria-current="page"],
	.woocommerce-MyAccount-navigation .is-active a,
	.kev-coffee-product-information__price,
	.kev-coffee-order-status
) {
	color: var(--kev-color-brand-secondary);
}

:where(
	button[type="submit"],
	input[type="submit"],
	.button,
	.wp-element-button,
	.wp-block-button__link,
	.add_to_cart_button,
	.single_add_to_cart_button,
	.kev-coffee-site-header__cart-link,
	.kev-coffee-product-catalog__filters-apply,
	.kevira-checkout__primary,
	.kevira-checkout__payment-left #place_order,
	.woocommerce-MyAccount-content .button
):not(.button-link):not(.button-link-delete):not(:disabled) {
	border-color: var(--kev-color-brand-primary) !important;
	background: var(--kev-color-brand-primary) !important;
	color: var(--kev-color-brand-secondary) !important;
}

:where(
	button[type="submit"],
	input[type="submit"],
	.button,
	.wp-element-button,
	.wp-block-button__link,
	.add_to_cart_button,
	.single_add_to_cart_button,
	.kevira-checkout__primary,
	.kevira-checkout__payment-left #place_order
):not(:disabled):hover {
	background: var(--kev-brand-primary-hover) !important;
	color: var(--kev-color-brand-secondary) !important;
}

/* Make primary storefront actions unmistakably interactive on the key buying routes. */
body:is(.home, .single-product) :where(
	button[type="submit"],
	input[type="submit"],
	.button,
	.wp-element-button,
	.wp-block-button__link,
	.add_to_cart_button,
	.single_add_to_cart_button,
	.kev-coffee-site-header__cta,
	.kev-coffee-site-header__cart-link,
	.kev-marketing-card__button
):not(.button-link):not(.button-link-delete):not(:disabled):is(:hover, :focus-visible) {
	border-color: var(--kev-color-brand-secondary) !important;
	background: var(--kev-color-brand-secondary) !important;
	color: var(--kev-color-brand-primary) !important;
}

:where(
	input,
	select,
	textarea,
	.kevira-checkout__choice,
	.kevira-checkout__fields input,
	.woocommerce form .form-row input.input-text
) {
	border-color: var(--kev-color-border) !important;
	background-color: var(--kev-color-surface-elevated) !important;
	color: var(--kev-color-text) !important;
}

:where(input, select, textarea, button, a, .kevira-checkout__choice):focus-visible {
	border-color: var(--kev-color-brand-primary) !important;
	outline: 2px solid var(--kev-color-brand-primary) !important;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px var(--kev-brand-primary-soft) !important;
}

:where(
	.kevira-checkout__choice[aria-pressed="true"],
	.kev-coffee-order-progress__step.is-active,
	.kev-coffee-order-progress__step.is-complete,
	.kev-coffee-order-filters a.is-active,
	.woocommerce-pagination .page-numbers.current
) {
	border-color: var(--kev-color-brand-primary) !important;
	background: var(--kev-color-brand-primary) !important;
	color: var(--kev-color-brand-secondary) !important;
}

:where(
	.kev-coffee-site-header__cart-count,
	.kev-coffee-mobile-header__cart-count
) {
	border-color: color-mix(in srgb, var(--kev-color-brand-secondary) 34%, transparent) !important;
	background: var(--kev-color-brand-primary) !important;
	color: var(--kev-color-brand-secondary) !important;
}

:where(hr, .wp-block-separator, .kev-coffee-order-progress__line) {
	border-color: var(--kev-color-border);
	background-color: var(--kev-color-brand-primary);
}

::selection {
	background: var(--kev-color-brand-primary);
	color: var(--kev-color-brand-secondary);
}
