/* Scoped WCAG fixes for the cart and classic checkout only. */
.woocommerce-cart,
.woocommerce-checkout {
	--adt-commerce-deep-green: #0f3315;
	--adt-commerce-deep-green-hover: #183b21;
	--adt-commerce-surface: #fff;
	--adt-commerce-divider: #bfbfbf;
}

.woocommerce-cart .screen-reader-text,
.woocommerce-checkout .screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.woocommerce-cart .screen-reader-text:focus,
.woocommerce-checkout .screen-reader-text:focus {
	position: fixed !important;
	top: 16px !important;
	left: 16px !important;
	width: auto !important;
	height: auto !important;
	padding: 12px 16px !important;
	margin: 0 !important;
	clip: auto !important;
	background: var(--adt-commerce-surface) !important;
	color: var(--adt-commerce-deep-green) !important;
	z-index: 1000001;
}

.woocommerce-cart :where(a, button, input, select, textarea):focus-visible,
.woocommerce-checkout :where(a, button, input, select, textarea):focus-visible {
	outline: 3px solid var(--adt-commerce-deep-green) !important;
	outline-offset: 2px !important;
}

.woocommerce-cart .woocommerce a.remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	line-height: 1;
}

.woocommerce-cart .woocommerce :where(button.button, a.button),
.woocommerce-checkout .woocommerce :where(button.button, a.button) {
	min-height: 48px;
	border-radius: 0;
}

.woocommerce-cart .woocommerce :where(button.button, a.button):not(.alt),
.woocommerce-checkout .woocommerce :where(button.button, a.button):not(.alt) {
	border-color: var(--adt-commerce-deep-green);
	color: var(--adt-commerce-deep-green);
}

.woocommerce-cart .woocommerce :where(button.button, a.button):not(.alt):hover,
.woocommerce-checkout .woocommerce :where(button.button, a.button):not(.alt):hover {
	border-color: var(--adt-commerce-deep-green-hover);
	color: var(--adt-commerce-deep-green-hover);
}

.woocommerce-checkout .woocommerce-checkout :where(input.input-text, select, textarea) {
	min-height: 44px;
	border: 1px solid var(--adt-commerce-divider);
	border-radius: 0;
}

.woocommerce-checkout .woocommerce-shipping-methods {
	margin: 0 0 12px;
	padding-left: 0;
	list-style: none;
}

.woocommerce-checkout .woocommerce-shipping-methods > li {
	display: flex;
	align-items: center;
	gap: 10px;
	list-style: none;
}

.woocommerce-checkout .woocommerce-shipping-methods > li + li {
	margin-top: 10px;
}

.woocommerce-checkout .woocommerce-shipping-methods > li > input[type="radio"] {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
}

.woocommerce-checkout .woocommerce-shipping-methods > li > label {
	margin: 0;
}

@media (prefers-reduced-motion: reduce) {
	.woocommerce-cart *,
	.woocommerce-checkout * {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}

/* Cart Blocks need centered controls independently of classic Woo input styles. */
.wp-block-woocommerce-cart .wc-block-components-quantity-selector__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 1;
	min-width: 44px;
	min-height: 44px;
}

/* Both cart variants run inside a theme shell whose link styles must not override the solid checkout button. */
.checkout-button.button.alt,
.wc-block-cart__submit-button {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 20px;
	background: #31aa47 !important;
	color: #fff !important;
	font-weight: 700;
	font-size: 20px;
	text-decoration: none !important;
	border-radius: 0;
}

/* Blocks colors its inner label separately; inherit the contrast-checked button color. */
.wc-block-cart__submit-button .wc-block-components-button__text {
	color: inherit !important;
}

/* The darker hover green needs white text to keep the checkout label legible. */
.checkout-button.button.alt:hover,
.wc-block-cart__submit-button:hover {
	background: #288538 !important;
	color: #fff !important;
}

/* Woo's theme focus shadow can be transparent, so keyboard focus needs its own ring. */
.checkout-button.button.alt:focus-visible,
.wc-block-cart__submit-button:focus-visible {
	outline: 3px solid #0f3315 !important;
	outline-offset: 2px !important;
}

/* Keep the disclosure compact without inheriting checkout submit-button styling. */
.adt-shipping-discount-info {
	margin-top: 8px;
	line-height: 1.4;
}

.adt-shipping-discount-info__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin: -4px 0 -4px 4px;
	background: transparent;
	border: 0;
	padding: 3px;
	color: inherit;
	cursor: pointer;
	vertical-align: middle;
}

/* Woo's pale source asset needs ink contrast when it becomes an interactive checkout control. */
.adt-shipping-discount-info__icon {
	display: block;
	width: 18px;
	height: 18px;
	filter: brightness(0);
	opacity: 0.7;
}

.adt-shipping-discount-info__button:hover .adt-shipping-discount-info__icon,
.adt-shipping-discount-info__button:focus-visible .adt-shipping-discount-info__icon {
	opacity: 1;
}

/* The compact icon still needs an unmistakable keyboard focus indicator. */
.adt-shipping-discount-info__button:focus-visible {
	outline: 2px solid #0f3315;
	outline-offset: 1px;
}

.adt-shipping-discount-info p {
	margin: 6px 0 0;
}
