/* WooCommerce notices — match Kilvassanta typography and palette. */

.woocommerce-notices-wrapper {
	font-family: var(--font-body);
	font-size: var(--text-small);
	line-height: 1.5;
}

.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .is-success,
.woocommerce-notices-wrapper .is-error,
.woocommerce-notices-wrapper .is-info {
	font-family: var(--font-body);
	font-size: var(--text-small);
	font-weight: 500;
	color: var(--text-dark);
	border-radius: 14px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	padding: 16px 18px;
	margin: 0 0 12px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
	background-color: #ffffff;
	background-image: none;
	opacity: 1;
	list-style: none;
	/* Flow layout so WooCommerce’s absolute ::before icon cannot sit on top of text. */
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0.35rem 0.75rem;
}

/* WooCommerce positions the checkmark / icon in ::before; pull it into normal flex flow. */
.woocommerce-notices-wrapper .woocommerce-message::before,
.woocommerce-notices-wrapper .woocommerce-info::before,
.woocommerce-notices-wrapper .woocommerce-error::before {
	position: static !important;
	inset: auto !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	left: auto !important;
	transform: none !important;
	float: none !important;
	flex: 0 0 auto;
	margin: 0.12em 0 0;
	line-height: 1;
}

.woocommerce-notices-wrapper ul.woocommerce-error {
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	gap: 0.35rem 0;
	padding: 16px 18px;
}

.woocommerce-notices-wrapper ul.woocommerce-error::before {
	margin-bottom: 0.15rem;
}

.woocommerce-notices-wrapper .woocommerce-message .button,
.woocommerce-notices-wrapper .woocommerce-error .button,
.woocommerce-notices-wrapper .woocommerce-info .button {
	float: none !important;
	margin-left: auto;
	align-self: center;
}

.woocommerce-notices-wrapper .woocommerce-message:last-child,
.woocommerce-notices-wrapper .woocommerce-error:last-child,
.woocommerce-notices-wrapper .woocommerce-info:last-child {
	margin-bottom: 0;
}

.woocommerce-notices-wrapper .woocommerce-message a,
.woocommerce-notices-wrapper .woocommerce-error a,
.woocommerce-notices-wrapper .woocommerce-info a {
	font-family: var(--font-body);
	font-weight: 600;
	color: var(--primary-base);
	text-decoration: none;
}

.woocommerce-notices-wrapper .woocommerce-message a:hover,
.woocommerce-notices-wrapper .woocommerce-error a:hover,
.woocommerce-notices-wrapper .woocommerce-info a:hover {
	color: var(--primary-dark);
	text-decoration: underline;
}

.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .is-success {
	border-left: 4px solid #059669;
	background-color: #ffffff;
}

.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-notices-wrapper .is-error {
	border-left: 4px solid var(--primary-base);
	background-color: #ffffff;
}

.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .is-info {
	border-left: 4px solid #2563eb;
	background-color: #ffffff;
}

.woocommerce-notices-wrapper .button,
.woocommerce-notices-wrapper a.button {
	font-family: var(--font-heading);
	font-size: var(--text-small);
	font-weight: 600;
	border-radius: 10px;
	background: var(--primary-base);
	color: #fff !important;
	border: none;
	padding: 10px 16px;
	margin-top: 8px;
	box-shadow: 0 6px 16px rgba(229, 57, 53, 0.2);
}

.woocommerce-notices-wrapper .button:hover,
.woocommerce-notices-wrapper a.button:hover {
	background: var(--primary-dark);
	color: #fff !important;
}

/* Toast stack: fixed below top safe area (no scroll jump on add-to-cart redirect). */
body:not(.woocommerce-checkout) .woocommerce-notices-wrapper {
	position: fixed;
	top: max(20px, env(safe-area-inset-top, 0px));
	left: 50%;
	transform: translateX(-50%);
	z-index: 100000;
	width: min(440px, calc(100vw - 32px));
	max-height: min(70vh, 320px);
	overflow-y: auto;
	pointer-events: auto;
}

body.woocommerce-checkout .woocommerce-notices-wrapper {
	position: static;
	transform: none;
	width: auto;
	max-height: none;
	overflow: visible;
}

body:not(.woocommerce-checkout) .woocommerce-notices-wrapper .woocommerce-message,
body:not(.woocommerce-checkout) .woocommerce-notices-wrapper .woocommerce-error,
body:not(.woocommerce-checkout) .woocommerce-notices-wrapper .woocommerce-info {
	animation: kilvassanta-notice-in 0.35s ease-out;
}

@keyframes kilvassanta-notice-in {
	from {
		opacity: 0;
		transform: translateY(-12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.woocommerce-notices-wrapper .woocommerce-message.kilv-notice-fadeout,
.woocommerce-notices-wrapper .woocommerce-info.kilv-notice-fadeout,
.woocommerce-notices-wrapper .is-success.kilv-notice-fadeout,
.woocommerce-notices-wrapper .is-info.kilv-notice-fadeout {
	opacity: 0 !important;
	transition: opacity 0.32s ease;
}
