/* × to close WooCommerce's printed notices (see close.js). */
.wc-block-components-notice-banner.has-axelle-close {
	position: relative;
	padding-right: 48px;
}

.axelle-notice-close {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	min-width: 32px;
	min-height: 32px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-family: inherit;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
}

/*
 * WooCommerce focuses the first notice 0.5 s after load so screen readers
 * announce it; its focus outline then looked like a thicker border. The notice
 * can't be reached with Tab (tabindex -1), so it needs no visible outline.
 */
.wc-block-components-notice-banner[tabindex="-1"]:focus,
.wc-block-components-notice-banner[tabindex="-1"]:focus-visible {
	outline: none;
}

.axelle-notice-close:hover,
.axelle-notice-close:focus-visible {
	opacity: 1;
}

/*
 * Phones/tablets: the product page's buy bar (Additional CSS, .buy-bar) is
 * fixed at the bottom, but WooCommerce prints add-to-cart errors (e.g. "up to
 * 5 copies") above the form in the page flow, often scrolled out of view.
 * Float them just above the bar instead. --buy-bar-height is measured by
 * close.js (150px fallback, as in Additional CSS); z-index sits above the
 * bar's 90. No block setting places these notices, hence code.
 */
@media (max-width: 781px) {
	body:has(.buy-bar) .wc-block-components-notices > .wc-block-components-notice-banner {
		position: fixed;
		left: var(--wp--preset--spacing--50, 24px);
		right: var(--wp--preset--spacing--50, 24px);
		bottom: calc(var(--buy-bar-height, 150px) + 8px);
		z-index: 91;
		margin: 0;
		box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
	}
}

/*
 * WooCommerce's own × on these add-to-cart notices is 16px, with its size and
 * margins forced by !important: keep the icon, widen the tap area to 40px
 * with an invisible layer around it.
 */
.wc-block-components-notices > .wc-block-components-notice-banner .wc-block-components-notice-banner__dismiss {
	position: relative;
}

.wc-block-components-notices > .wc-block-components-notice-banner .wc-block-components-notice-banner__dismiss::before {
	content: "";
	position: absolute;
	inset: -12px;
}
