/*
 * CNZ Theme — WooCommerce cart / checkout button styling.
 *
 * Twenty Twenty-Five exposes no `button` element style, so WooCommerce's
 * block buttons (`.wc-block-components-button.wp-element-button`) fall back to
 * white text on a transparent background — i.e. an invisible "Place order"
 * button at checkout. These rules give the primary commerce actions the CNZ
 * accent fill (matching `.cnz-btn-accent`) for both the block and classic
 * cart/checkout, so the buttons are visible and on-brand.
 *
 * Enqueued by `cnz_enqueue_woocommerce_styles()` on WooCommerce pages only.
 * Bump the filename version to bust the CDN cache, per CLAUDE.md.
 */

/* ----- Primary commerce buttons (block) ----- */
.wc-block-components-button.wp-element-button.contained,
.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button,
.wp-block-woocommerce-cart .wc-block-cart__submit-container .wc-block-components-button {
	background-color: var(--wp--preset--color--accent, #008b45);
	color: #fff;
	border: 2px solid var(--wp--preset--color--accent, #008b45);
	border-radius: 4px;
	padding: 0.75rem 1.75rem;
	font-weight: 700;
	font-size: 0.9rem;
	letter-spacing: 0.04em;
	text-decoration: none;
	min-height: 48px;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.wc-block-components-button.wp-element-button.contained .wc-block-components-button__text,
.wc-block-components-checkout-place-order-button .wc-block-components-button__text {
	color: #fff;
}

.wc-block-components-button.wp-element-button.contained:hover,
.wc-block-components-checkout-place-order-button:hover,
.wc-block-cart__submit-button:hover {
	background-color: #006b35;
	border-color: #006b35;
	color: #fff;
}

.wc-block-components-button.wp-element-button.contained:focus-visible,
.wc-block-components-checkout-place-order-button:focus-visible,
.wc-block-cart__submit-button:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent, #008b45);
	outline-offset: 2px;
}

.wc-block-components-button.wp-element-button.contained:disabled,
.wc-block-components-button.wp-element-button.contained.wc-block-components-button--loading {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ----- Classic cart / checkout fallback (in case shortcodes are used) ----- */
.woocommerce #place_order,
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.woocommerce a.checkout-button.button.alt {
	background-color: var(--wp--preset--color--accent, #008b45);
	color: #fff;
	border: 2px solid var(--wp--preset--color--accent, #008b45);
	border-radius: 4px;
	padding: 0.75rem 1.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.woocommerce #place_order:hover,
.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover,
.woocommerce a.checkout-button.button.alt:hover {
	background-color: #006b35;
	border-color: #006b35;
	color: #fff;
}

/* ----- "Back to my registrations" escape hatch on checkout / order-pay ----- */
/* Prepended to the checkout block by cnz_checkout_back_to_portal_link() so users
   are never stranded on the payment screen (the registration pages are excluded
   from the nav and the account icon isn't shown on checkout pages).
   KEEP IN SYNC with the duplicate in registration-v1.4.2.css (the registration
   interstitial uses the same .cnz-checkout-back pattern but not this file). */
.cnz-checkout-back {
	margin: 0 0 1.5rem;
	font-size: 0.95rem;
}

.cnz-checkout-back a {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	font-weight: 600;
	text-decoration: none;
	color: var(--wp--preset--color--accent, #008b45);
}

.cnz-checkout-back a:hover,
.cnz-checkout-back a:focus-visible {
	text-decoration: underline;
}

.cnz-checkout-back__arrow {
	font-size: 1.1em;
	line-height: 1;
}
