/**
 * FP Toast — shared transient notice presentation for WooCommerce + URL coupons.
 * z-index below cart drawer (9999) and above sticky CTA (1000).
 */

.fp-toast {
	--fp-toast-offset-top: var(--header-height, 72px);
	--fp-toast-offset-bottom: 20px;

	position: fixed;
	z-index: 9500;
	box-sizing: border-box;
	max-width: min(420px, calc(100vw - 32px));
	padding: 14px 40px 14px 16px;
	border-radius: 4px;
	border: 1px solid var(--color-success, #0b7006);
	background: var(--color-success-bg, #e6ffe9);
	color: var(--color-text, #242426);
	font-family: var(--font-body, "Poppins", sans-serif);
	font-size: 14px;
	line-height: 1.45;
	overflow-wrap: anywhere;
	box-shadow: 0 4px 12px rgba(11, 112, 6, 0.18);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: auto;
}

.fp-toast.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.fp-toast.is-info {
	border-color: var(--color-primary, #3651d9);
	background: var(--color-primary-light, #e6eeff);
	box-shadow: 0 4px 12px rgba(54, 81, 217, 0.18);
}

.fp-toast.is-error {
	border-color: var(--color-error-border, #d60b00);
	background: var(--color-error-bg, #ffece6);
	box-shadow: 0 4px 12px rgba(224, 51, 33, 0.18);
}

.fp-toast__message {
	margin: 0;
	color: var(--color-success, #0b7006);
}

.fp-toast.is-info .fp-toast__message {
	color: var(--color-primary, #3651d9);
}

.fp-toast.is-error .fp-toast__message {
	color: var(--color-error, #e03321);
}

.fp-toast__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.fp-toast__close:hover,
.fp-toast__close:focus-visible {
	background: rgba(0, 0, 0, 0.06);
	outline: 2px solid var(--color-primary, #3651d9);
	outline-offset: 1px;
}

/* Mobile: below sticky site header — avoids sticky ATC / cookie / drawer footer */
@media (max-width: 749px) {
	.fp-toast {
		top: calc(var(--fp-toast-offset-top) + 12px);
		left: 16px;
		right: 16px;
		bottom: auto;
		margin-inline: auto;
		width: calc(100vw - 32px);
		max-width: none;
	}
}

/* Desktop: bottom-right, lifted above sticky bars / cookie when measured */
@media (min-width: 750px) {
	.fp-toast {
		right: 20px;
		bottom: var(--fp-toast-offset-bottom);
		left: auto;
		top: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fp-toast {
		transition: none;
		transform: none;
	}
}

/* Source wrapper: notices are converted to toasts by JS; errors stay inline */
.woocommerce-notices-wrapper {
	position: static !important;
	bottom: auto !important;
	right: auto !important;
	width: auto !important;
	max-width: none !important;
	z-index: auto !important;
	pointer-events: auto;
	margin: 0;
	padding: 0;
}

.woocommerce-notices-wrapper:empty {
	display: none;
}

/* Inline critical errors (checkout, login, payment) */
.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-error li {
	pointer-events: auto;
}

.woocommerce-notices-wrapper .woocommerce-error {
	margin: 16px auto;
	max-width: var(--content-width, 1200px);
	padding: 0 16px;
	list-style: none;
}

.woocommerce-notices-wrapper .woocommerce-error li {
	margin: 0 0 8px;
}
