/*
 * Shared classic WooCommerce notice presentation.
 *
 * Keep the selectors global: notices can be rendered after cart, account,
 * product, coupon, and checkout actions. Checkout-specific behaviour and
 * field-level feedback remain in checkout-feedback.css and .js.
 */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	--abch-notice-accent: #256c47;
	--abch-notice-border: #a3dfc0;
	--abch-notice-bg: #edfbf3;
	--abch-notice-text: #155e35;
	box-sizing: border-box;
	position: relative;
	width: 100%;
	min-height: 3.25rem;
	margin: 0 0 1.25rem;
	padding: .9rem 1rem;
	border: 1px solid var(--abch-notice-border);
	border-left: 4px solid var(--abch-notice-accent);
	border-radius: var(--radius-lg, 8px);
	color: var(--abch-notice-text);
	background: var(--abch-notice-bg);
	box-shadow: 0 4px 16px rgb(33 56 76 / 6%);
	font-size: .92rem;
	line-height: 1.5;
	list-style: none !important;
	overflow-wrap: anywhere;
}

.woocommerce-message,
.woocommerce-info {
	display: flex;
	align-items: flex-start;
	gap: .75rem;
}

/*
 * Action notices often place the button before or after a bare text node.
 * Grid gives both markup orders the same icon / flexible copy / action layout.
 */
.woocommerce-message:has(> .button),
.woocommerce-info:has(> .button) {
	display: grid;
	grid-template-columns: 1.5rem minmax(0, 1fr) max-content;
	align-items: center;
	column-gap: .75rem;
}

.woocommerce-message:has(> .button)::before,
.woocommerce-info:has(> .button)::before {
	grid-column: 1;
	grid-row: 1;
}

.woocommerce-info {
	--abch-notice-accent: #4c7898;
	--abch-notice-border: #b8cfdf;
	--abch-notice-bg: #eef5f9;
	--abch-notice-text: #21384c;
}

.woocommerce-error {
	--abch-notice-accent: #b42318;
	--abch-notice-border: #f0a8a0;
	--abch-notice-bg: #fef3f2;
	--abch-notice-text: #6b1a14;
	display: block;
	padding-left: 3.35rem;
}

.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
	box-sizing: border-box;
	position: static;
	top: auto;
	left: auto;
	display: inline-grid;
	place-items: center;
	flex: 0 0 1.5rem;
	width: 1.5rem;
	height: 1.5rem;
	margin: .05rem 0 0;
	border-radius: 999px;
	color: #fff;
	background: var(--abch-notice-accent);
	font: 800 .78rem/1 var(--font, system-ui, -apple-system, "Segoe UI", sans-serif);
	content: "\2713" / "";
}

.woocommerce-info::before {
	font-family: Georgia, "Times New Roman", serif;
	font-size: .9rem;
	font-style: italic;
	content: "i" / "";
}

.woocommerce-error::before {
	position: absolute;
	top: .95rem;
	left: 1rem;
	margin: 0;
	font-family: var(--font, system-ui, -apple-system, "Segoe UI", sans-serif);
	font-size: .9rem;
	font-style: normal;
	content: "!" / "";
}

.woocommerce-message::after,
.woocommerce-info::after,
.woocommerce-error::after {
	display: none;
	content: none;
}

.woocommerce-error > li {
	margin: 0;
	padding: 0 !important;
	list-style: none !important;
}

.woocommerce-error > li + li {
	margin-top: .35rem;
}

.woocommerce-message a:not(.button),
.woocommerce-info a:not(.button),
.woocommerce-error a:not(.button) {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.woocommerce-message .button,
.woocommerce-info .button {
	order: 2;
	float: none;
	flex: 0 0 auto;
	align-self: center;
	margin: -.15rem 0 -.15rem auto;
	white-space: nowrap;
}

.woocommerce-message:has(> .button) > .button,
.woocommerce-info:has(> .button) > .button {
	grid-column: 3;
	grid-row: 1;
	justify-self: end;
	margin: -.15rem 0;
}

.woocommerce-error .button {
	float: none;
	margin: .65rem 0 0;
}

/* Empty cart is a page state, but its message still inherits the same notice. */
.woocommerce-cart .wc-empty-cart-message,
.woocommerce-cart .return-to-shop {
	width: 100%;
	max-width: 760px;
	margin-right: auto;
	margin-left: auto;
}

.woocommerce-cart .wc-empty-cart-message {
	margin-top: clamp(.75rem, 3vw, 2rem);
}

.woocommerce-cart .cart-empty.woocommerce-info {
	margin-bottom: 0;
	padding: clamp(1rem, 2.5vw, 1.35rem);
	font-size: clamp(.95rem, 2vw, 1.05rem);
}

.woocommerce-cart .return-to-shop {
	margin-top: 1rem;
	margin-bottom: 0;
}

.woocommerce-cart .return-to-shop .button {
	min-height: 44px;
	padding: .7rem 1.25rem;
}

@media (max-width: 600px) {
	.woocommerce-message,
	.woocommerce-info,
	.woocommerce-error {
		min-height: 0;
		padding: .8rem .85rem;
		border-left-width: 3px;
		border-radius: var(--radius, 4px);
		font-size: .88rem;
	}

	.woocommerce-message,
	.woocommerce-info {
		flex-wrap: wrap;
		gap: .6rem .7rem;
	}

	.woocommerce-error {
		padding-left: 3rem;
	}

	.woocommerce-error::before {
		top: .8rem;
		left: .85rem;
	}

	.woocommerce-message .button,
	.woocommerce-info .button {
		flex-basis: 100%;
		justify-content: center;
		width: auto;
		margin: .15rem 0 0 2.2rem;
	}

	.woocommerce-message:has(> .button),
	.woocommerce-info:has(> .button) {
		grid-template-columns: 1.5rem minmax(0, 1fr);
		row-gap: .6rem;
	}

	.woocommerce-message:has(> .button) > .button,
	.woocommerce-info:has(> .button) > .button {
		grid-column: 1 / -1;
		grid-row: 2;
		justify-self: stretch;
		width: 100%;
		min-height: 44px;
		margin: .15rem 0 0;
	}

	.woocommerce-cart .wc-empty-cart-message {
		margin-top: .5rem;
	}

	.woocommerce-cart .return-to-shop .button {
		justify-content: center;
		width: 100%;
	}
}
