:root {
	--kuwa-liquid-base: var(--kuwa-action);
	--kuwa-liquid-ink: var(--kuwa-action-ink);
	--kuwa-liquid-focus: var(--kuwa-action-focus);
	--kuwa-liquid-border: var(--kuwa-action-border);
	/* Every button inverts on hover: black surface, white text. The white edge keeps the shape visible on dark sections. */
	--kuwa-button-hover-surface: #000;
	--kuwa-button-hover-ink: #fff;
	--kuwa-button-hover-border: #fff;
	--kuwa-liquid-shadow:
		0 2px 4px rgba(24, 32, 29, 0.08),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Color is reserved for conversion actions, while native WooCommerce behaviour stays intact. */
:is(
	.hello-biz-cube-story__button,
	.kuwa-cart-checkout,
	.kuwa-product-quick-cart__form button,
	.kuwa-product-quick-cart__button,
	.single-product div.product .single_add_to_cart_button,
	.woocommerce ul.products li.product .button,
	.woocommerce .checkout-button,
	:where(.woocommerce #place_order)
) {
	position: relative;
	isolation: isolate;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	overflow: hidden;
	min-height: 44px;
	background: var(--kuwa-liquid-base);
	border: 1px solid var(--kuwa-liquid-border);
	border-radius: 10px;
	box-shadow: var(--kuwa-liquid-shadow);
	color: var(--kuwa-liquid-ink);
	transform: translate3d(0, 0, 0);
	transition:
		background-color 180ms ease,
		border-color 220ms ease,
		box-shadow 220ms ease,
		color 420ms ease,
		transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Keep WooCommerce's classic cart action full-width after the shared flex styling. */
body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button.button {
	display: flex;
	width: 100%;
}

:is(
	.hello-biz-cube-story__button,
	.kuwa-cart-checkout,
	.kuwa-product-quick-cart__form button,
	.kuwa-product-quick-cart__button,
	.single-product div.product .single_add_to_cart_button,
	.woocommerce ul.products li.product .button,
	.woocommerce .checkout-button,
	:where(.woocommerce #place_order)
)::before {
	content: none;
}

:is(
	.hello-biz-cube-story__button,
	.kuwa-cart-checkout,
	.kuwa-product-quick-cart__form button,
	.kuwa-product-quick-cart__button,
	.single-product div.product .single_add_to_cart_button,
	.woocommerce ul.products li.product .button,
	.woocommerce .checkout-button,
	:where(.woocommerce #place_order)
):not(:disabled):not(.disabled):not([aria-disabled='true']):hover,
:is(
	.hello-biz-cube-story__button,
	.kuwa-cart-checkout,
	.kuwa-product-quick-cart__form button,
	.kuwa-product-quick-cart__button,
	.single-product div.product .single_add_to_cart_button,
	.woocommerce ul.products li.product .button,
	.woocommerce .checkout-button,
	:where(.woocommerce #place_order)
):not(:disabled):not(.disabled):not([aria-disabled='true']):focus-visible {
	background: var(--kuwa-button-hover-surface);
	border-color: var(--kuwa-button-hover-border);
	box-shadow:
		0 4px 10px rgba(24, 32, 29, 0.12),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
	color: var(--kuwa-button-hover-ink);
	transform: translate3d(0, -1px, 0);
}

:is(
	.hello-biz-cube-story__button,
	.kuwa-cart-checkout,
	.kuwa-product-quick-cart__form button,
	.kuwa-product-quick-cart__button,
	.single-product div.product .single_add_to_cart_button,
	.woocommerce ul.products li.product .button,
	.woocommerce .checkout-button,
	:where(.woocommerce #place_order)
):not(:disabled):not(.disabled):not([aria-disabled='true']):hover::before,
:is(
	.hello-biz-cube-story__button,
	.kuwa-cart-checkout,
	.kuwa-product-quick-cart__form button,
	.kuwa-product-quick-cart__button,
	.single-product div.product .single_add_to_cart_button,
	.woocommerce ul.products li.product .button,
	.woocommerce .checkout-button,
	:where(.woocommerce #place_order)
):not(:disabled):not(.disabled):not([aria-disabled='true']):focus-visible::before {
	filter: blur(12px) brightness(0.96) saturate(1.45);
	opacity: 0.84;
	transform: translate3d(5%, 0, 0) rotate(2deg) scale(1.04);
}

:is(
	.hello-biz-cube-story__button,
	.kuwa-cart-checkout,
	.kuwa-product-quick-cart__form button,
	.kuwa-product-quick-cart__button,
	.single-product div.product .single_add_to_cart_button,
	.woocommerce ul.products li.product .button,
	.woocommerce .checkout-button,
	:where(.woocommerce #place_order)
):not(:disabled):not(.disabled):not([aria-disabled='true']):active {
	box-shadow:
		0 5px 15px rgba(40, 92, 120, 0.26),
		inset 0 1px 4px rgba(24, 50, 59, 0.28);
	transform: translate3d(0, 1px, 0);
}

:is(
	.hello-biz-cube-story__button,
	.kuwa-cart-checkout,
	.kuwa-product-quick-cart__form button,
	.kuwa-product-quick-cart__button,
	.single-product div.product .single_add_to_cart_button,
	.woocommerce ul.products li.product .button,
	.woocommerce .checkout-button,
	:where(.woocommerce #place_order)
):focus-visible {
	outline: 3px solid var(--kuwa-liquid-focus);
	outline-offset: 4px;
}

/* Checkout navigates away, so it receives the directional cue from the reference. */
.kuwa-cart-checkout::after {
	flex: 0 0 auto;
	width: 1em;
	height: 1em;
	background: currentColor;
	content: '';
	-webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M7%2017%2017%207M7%207h10v10'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M7%2017%2017%207M7%207h10v10'%20fill='none'%20stroke='black'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	transform: translate3d(0, 0, 0);
	transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

:is(
	.hello-biz-cube-story__button,
	.kuwa-cart-checkout,
	.kuwa-product-quick-cart__form button,
	.kuwa-product-quick-cart__button,
	.single-product div.product .single_add_to_cart_button,
	.woocommerce ul.products li.product .button,
	.woocommerce .checkout-button,
	:where(.woocommerce #place_order)
):is(.disabled, :disabled, [aria-disabled='true']) {
	box-shadow: none;
	filter: saturate(0.45);
	opacity: 0.52;
	transform: none;
}

:is(
	.hello-biz-cube-story__button,
	.kuwa-cart-checkout,
	.kuwa-product-quick-cart__form button,
	.kuwa-product-quick-cart__button,
	.single-product div.product .single_add_to_cart_button,
	.woocommerce ul.products li.product .button,
	.woocommerce .checkout-button,
	:where(.woocommerce #place_order)
):is(.disabled, :disabled, [aria-disabled='true'])::before {
	filter: blur(18px) saturate(0.35);
	opacity: 0.18;
	transform: none;
}

/* Supporting navigation reads as a link rather than a second purchase button. */
:is(.hello-biz-cube-story__secondary-button, .kuwa-site-footer__cta) {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	overflow: visible;
	min-height: 44px;
	padding: 0 2px;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--kuwa-accent);
	background-image: linear-gradient(rgba(33, 101, 80, 0.34), rgba(33, 101, 80, 0.34));
	background-position: 2px calc(50% + 0.72em);
	background-repeat: no-repeat;
	background-size: calc(100% - 1.55em) 1px;
	text-decoration: none;
	transform: none;
	transition: color 220ms ease;
}

:is(.hello-biz-cube-story__secondary-button, .kuwa-site-footer__cta)::before {
	display: none;
}

:is(.hello-biz-cube-story__secondary-button, .kuwa-site-footer__cta):hover,
:is(.hello-biz-cube-story__secondary-button, .kuwa-site-footer__cta):focus-visible {
	background: transparent;
	background-image: linear-gradient(currentColor, currentColor);
	background-position: 2px calc(50% + 0.72em);
	background-repeat: no-repeat;
	background-size: calc(100% - 1.55em) 1px;
	border-color: transparent;
	box-shadow: none;
	color: var(--kuwa-accent-text);
	transform: none;
}

:is(.hello-biz-cube-story__secondary-button, .kuwa-site-footer__cta):active {
	color: var(--kuwa-accent);
	transform: none;
}

:is(.hello-biz-cube-story__secondary-button, .kuwa-site-footer__cta):focus-visible {
	outline: 3px solid var(--kuwa-liquid-focus);
	outline-offset: 4px;
}

.hello-biz-cube-story__secondary-button > span,
.kuwa-site-footer__cta > span {
	display: inline-block;
	transform: rotate(-45deg);
	transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: no-preference) {
	.kuwa-cart-checkout:not(:disabled):not(.disabled):not([aria-disabled='true']):hover::after,
	.kuwa-cart-checkout:not(:disabled):not(.disabled):not([aria-disabled='true']):focus-visible::after {
		transform: translate3d(3px, -3px, 0);
	}

	.hello-biz-cube-story__secondary-button:hover > span,
	.hello-biz-cube-story__secondary-button:focus-visible > span,
	.kuwa-site-footer__cta:hover > span,
	.kuwa-site-footer__cta:focus-visible > span {
		transform: translate3d(3px, -3px, 0) rotate(-45deg);
	}
}

/* Icon, quantity, and close controls stay recognisable without competing with CTAs. */
:is(.kuwa-menu-toggle, .kuwa-cart-drawer__close, .kuwa-cart-fab) {
	background: var(--kuwa-surface-soft);
	border: 1px solid var(--kuwa-border);
	box-shadow:
		0 8px 22px rgba(11, 25, 48, 0.06),
		inset 0 1px 0 rgba(255, 255, 255, 0.08);
	color: var(--kuwa-accent);
	transition: filter 200ms ease, box-shadow 200ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

:is(.kuwa-menu-toggle, .kuwa-cart-drawer__close, .kuwa-cart-fab):hover,
:is(.kuwa-menu-toggle, .kuwa-cart-drawer__close, .kuwa-cart-fab):focus-visible {
	background: var(--kuwa-surface);
	box-shadow:
		0 11px 26px rgba(11, 25, 48, 0.10),
		inset 0 1px 0 rgba(255, 255, 255, 0.12);
	color: var(--kuwa-accent-text);
	filter: brightness(1.04);
	transform: translate3d(0, -1px, 0) scale(1.04);
}

:is(.kuwa-menu-toggle, .kuwa-cart-drawer__close, .kuwa-cart-fab):active {
	transform: translate3d(0, 1px, 0) scale(0.96);
}

:is(.kuwa-menu-toggle, .kuwa-cart-drawer__close, .kuwa-cart-fab):focus-visible {
	outline: 3px solid var(--kuwa-liquid-focus);
	outline-offset: 3px;
}

.kuwa-cart-quantity {
	background: var(--kuwa-surface-soft);
	border-color: var(--kuwa-border);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.08),
		0 5px 14px rgba(11, 25, 48, 0.04);
}

.kuwa-cart-quantity button:hover,
.kuwa-cart-quantity button:focus-visible {
	background: rgba(173, 237, 194, 0.16);
	color: var(--kuwa-accent);
}

:is(button, input, a).disabled,
:is(button, input, a):disabled,
:is(button, input, a)[aria-disabled='true'] {
	box-shadow: none;
	filter: saturate(0.45);
	opacity: 0.52;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	:is(
		.hello-biz-cube-story__button,
		.kuwa-cart-checkout,
		.kuwa-product-quick-cart__form button,
		.kuwa-product-quick-cart__button,
		.single-product div.product .single_add_to_cart_button,
		.woocommerce ul.products li.product .button,
		.woocommerce .checkout-button,
		:where(.woocommerce #place_order),
		.hello-biz-cube-story__secondary-button,
		.kuwa-site-footer__cta,
		.kuwa-menu-toggle,
		.kuwa-cart-drawer__close,
		.kuwa-cart-fab
	) {
		transition: none;
	}

	:is(
		.hello-biz-cube-story__button,
		.kuwa-cart-checkout,
		.kuwa-product-quick-cart__form button,
		.kuwa-product-quick-cart__button,
		.single-product div.product .single_add_to_cart_button,
		.woocommerce ul.products li.product .button,
		.woocommerce .checkout-button,
		:where(.woocommerce #place_order)
	)::before {
		transition: none;
	}

	.kuwa-cart-checkout::after {
		transform: none;
		transition: none;
	}

	.hello-biz-cube-story__secondary-button > span,
	.kuwa-site-footer__cta > span {
		transform: rotate(-45deg);
		transition: none;
	}
}

@media (forced-colors: active) {
	:is(
		.hello-biz-cube-story__button,
		.kuwa-cart-checkout,
		.kuwa-product-quick-cart__form button,
		.kuwa-product-quick-cart__button,
		.single-product div.product .single_add_to_cart_button,
		.woocommerce ul.products li.product .button,
		.woocommerce .checkout-button,
		:where(.woocommerce #place_order),
		.kuwa-menu-toggle,
		.kuwa-cart-drawer__close,
		.kuwa-cart-fab
	) {
		background: ButtonFace;
		border: 1px solid ButtonText;
		box-shadow: none;
		color: ButtonText;
	}

	:is(.hello-biz-cube-story__secondary-button, .kuwa-site-footer__cta) {
		background: transparent;
		border: 0;
		box-shadow: none;
		color: LinkText;
	}

	:is(.hello-biz-cube-story__secondary-button, .kuwa-site-footer__cta):focus-visible {
		outline-color: Highlight;
	}

	:is(
		.hello-biz-cube-story__button,
		.kuwa-cart-checkout,
		.kuwa-product-quick-cart__form button,
		.kuwa-product-quick-cart__button,
		.single-product div.product .single_add_to_cart_button,
		.woocommerce ul.products li.product .button,
		.woocommerce .checkout-button,
		:where(.woocommerce #place_order)
	)::before {
		display: none;
	}
}

/*
 * Site-wide hover inversion. Plain buttons replace the theme's mint fallback
 * at the same low specificity, so unstyled controls follow without extra rules.
 */
[type=button]:where(:not(:disabled)):hover,
[type=reset]:where(:not(:disabled)):hover,
[type=submit]:where(:not(:disabled)):hover,
button:where(:not(:disabled)):hover,
[type=button]:where(:not(:disabled)):focus,
[type=reset]:where(:not(:disabled)):focus,
[type=submit]:where(:not(:disabled)):focus,
button:where(:not(:disabled)):focus {
	background-color: var(--kuwa-button-hover-surface);
	border-color: var(--kuwa-button-hover-border);
	color: var(--kuwa-button-hover-ink);
}

/*
 * Styled buttons get their hover colours from several later stylesheets
 * (homepage, commerce, purchase pill, Complianz, Elementor). Only the three
 * colour properties are forced here; size, shape and motion stay with each
 * component. The unavailable purchase pill is disabled on purpose but still
 * shows a hover state, so it is listed separately from the disabled guard.
 */
@media not (forced-colors: active) {
	:is(
		.hello-biz-cube-story__button,
		.kuwa-cart-checkout,
		.kuwa-product-quick-cart__form button,
		.kuwa-product-quick-cart__button,
		.single_add_to_cart_button,
		:is(.woocommerce, .woocommerce-page) .button,
		.woocommerce-button,
		.wp-block-button__link,
		.wp-element-button,
		.elementor-button,
		.cmplz-btn,
		.kuwa-cymatics-cta,
		.kuwa-product-reveal__cta,
		.kuwa-timeline__arrow,
		.kuwa-menu-toggle,
		.kuwa-cart-drawer__close,
		.kuwa-cart-fab,
		input[type=submit]
	):not(:disabled, .disabled, [aria-disabled='true']):is(:hover, :focus-visible),
	.kuwa-unavailable-purchase:is(:hover, :focus-visible) {
		--kuwa-buy-surface: var(--kuwa-button-hover-surface) !important;
		--kuwa-buy-outline: var(--kuwa-button-hover-border) !important;
		--kuwa-buy-ink: var(--kuwa-button-hover-ink) !important;
		background: var(--kuwa-button-hover-surface) !important;
		border-color: var(--kuwa-button-hover-border) !important;
		color: var(--kuwa-button-hover-ink) !important;
	}
}
