/**
 * Add-to-cart confirmation: fixed viewport toast, one-shot slide from the right.
 * Uses a dedicated .jaj-cart-toast host (not .woocommerce-notices-wrapper) so WC
 * fragment replaceWith / header-height updates cannot replay the entrance.
 */

.jaj-cart-toast {
	position: fixed;
	top: 88px;
	right: 16px;
	left: auto;
	z-index: 100050;
	max-width: min(420px, calc(100vw - 32px));
	width: max-content;
	margin: 0;
	padding: 0;
	border: none;
	outline: none;
	box-sizing: border-box;
	pointer-events: none;
	opacity: 0;
	transform: translateX(calc(100% + 32px));
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.jaj-cart-toast.is-visible {
	pointer-events: auto;
	opacity: 1;
	transform: translateX(0);
}

.jaj-cart-toast.is-hiding {
	pointer-events: none;
	opacity: 0;
	transform: translateX(calc(100% + 32px));
}

@media (max-width: 767px) {
	.jaj-cart-toast {
		right: 12px;
		max-width: calc(100vw - 24px);
	}
}

.jaj-cart-toast .woocommerce-message,
.jaj-cart-toast .woocommerce-error,
.jaj-cart-toast .woocommerce-info,
.jaj-cart-toast .wc-block-components-notice-banner {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0;
	text-align: center;
	margin: 0 !important;
	padding: 12px 14px !important;
	border: none !important;
	border-radius: 8px;
	outline: none !important;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
	animation: none !important;
	line-height: 1.4;
}

.jaj-cart-toast .woocommerce-message,
.jaj-cart-toast .wc-block-components-notice-banner.is-success {
	background-color: #2E5AA7 !important;
	color: #FFFFFF !important;
}

.jaj-cart-toast .woocommerce-message .button,
.jaj-cart-toast .woocommerce-message a,
.jaj-cart-toast .woocommerce-message button,
.jaj-cart-toast .woocommerce-message .button:hover,
.jaj-cart-toast .woocommerce-message a:hover,
.jaj-cart-toast .woocommerce-message button:hover,
.jaj-cart-toast .wc-block-components-notice-banner.is-success a {
	color: #FFFFFF !important;
	border-color: #FFFFFF !important;
	background: none !important;
}

.jaj-cart-toast .woocommerce-error,
.jaj-cart-toast .wc-block-components-notice-banner.is-error {
	background-color: #FDE466 !important;
	color: #2E5AA7 !important;
}

.jaj-cart-toast .woocommerce-error .button,
.jaj-cart-toast .woocommerce-error a,
.jaj-cart-toast .woocommerce-error button,
.jaj-cart-toast .woocommerce-error .button:hover,
.jaj-cart-toast .woocommerce-error a:hover,
.jaj-cart-toast .woocommerce-error button:hover,
.jaj-cart-toast .wc-block-components-notice-banner.is-error a {
	color: #2E5AA7 !important;
	border-color: #2E5AA7 !important;
	background: none !important;
}

.jaj-cart-toast .woocommerce-message:before,
.jaj-cart-toast .woocommerce-error:before,
.jaj-cart-toast .woocommerce-info:before {
	display: none !important;
}

.jaj-cart-toast .woocommerce-message p,
.jaj-cart-toast .woocommerce-error p,
.jaj-cart-toast .woocommerce-info p {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	text-align: center;
	flex: none;
	min-width: 0;
	width: 100%;
	padding: 0 !important;
	margin: 0 !important;
}

.jaj-cart-toast .woocommerce-message .button,
.jaj-cart-toast .woocommerce-message a,
.jaj-cart-toast .woocommerce-message button,
.jaj-cart-toast .woocommerce-error .button,
.jaj-cart-toast .woocommerce-error a,
.jaj-cart-toast .woocommerce-error button {
	position: static !important;
	left: auto !important;
	right: auto !important;
	display: block !important;
	flex-shrink: 0;
	margin: 10px 0 0 !important;
}

/* Hide in-page WC notice bars on shop/PDP — toast host carries the message. */
body:not(.woocommerce-cart):not(.woocommerce-checkout):not(.woocommerce-account):not(.woocommerce-wishlist)
	.woocommerce-notices-wrapper:not(.jaj-cart-toast) {
	display: none !important;
}
