/**
 * The Bio Edit — WooCommerce Toast Notification System
 * Matches React/Sonner design language from the bio-edit source template.
 * Bottom-right positioned toasts with slide-in animation, icons, and luxury styling.
 */

/* ==========================================================================
   Design Tokens (shared with checkout.css / cart.css)
   ========================================================================== */
:root {
	--bio-toast-cream:       #FAF8F4;
	--bio-toast-charcoal:    #2A2520;
	--bio-toast-gold:        #C9A96E;
	--bio-toast-gold-light:  #F7EFE2;
	--bio-toast-red:         #c94a4a;
	--bio-toast-red-light:   #fdf2f2;
	--bio-toast-blue:        #4A7CC9;
	--bio-toast-blue-light:  #f0f4fd;
	--bio-toast-border:      #DED8CE;
	--bio-toast-shadow:      0 8px 32px rgba(42,37,32,0.12), 0 2px 8px rgba(42,37,32,0.06);
	--bio-font-body:         'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	--bio-font-display:      'Cormorant Garamond', Georgia, serif;
}

/* ==========================================================================
   Toast Container — fixed bottom-right (matches React Sonner placement)
   ========================================================================== */
#bio-toast-container {
	position: fixed;
	bottom: 28px;
	right: 28px;
	z-index: 999999;
	display: flex;
	flex-direction: column-reverse;
	gap: 10px;
	pointer-events: none;
	max-width: 380px;
	width: calc(100vw - 56px);
}

/* ==========================================================================
   Individual Toast
   ========================================================================== */
.bio-toast {
	pointer-events: all;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	background: var(--bio-toast-cream);
	border: 1px solid var(--bio-toast-border);
	border-left: 3px solid var(--bio-toast-gold);
	padding: 14px 16px;
	font-family: var(--bio-font-body);
	font-size: 13px;
	line-height: 1.55;
	color: var(--bio-toast-charcoal);
	box-shadow: var(--bio-toast-shadow);
	border-radius: 2px;
	position: relative;
	overflow: hidden;

	/* Slide-in animation */
	animation: bio-toast-in 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
	will-change: transform, opacity;
}

.bio-toast.bio-toast--exiting {
	animation: bio-toast-out 0.28s cubic-bezier(0.06, 0.71, 0.55, 1) forwards;
}

/* Toast variants */
.bio-toast--success {
	border-left-color: var(--bio-toast-gold);
}
.bio-toast--error {
	border-left-color: var(--bio-toast-red);
	background: var(--bio-toast-red-light);
}
.bio-toast--info {
	border-left-color: var(--bio-toast-blue);
	background: var(--bio-toast-blue-light);
}

/* Progress bar */
.bio-toast::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	height: 2px;
	background: var(--bio-toast-gold);
	width: 100%;
	animation: bio-toast-progress var(--bio-toast-duration, 5s) linear forwards;
	animation-play-state: var(--bio-bar-state, running);
	transform-origin: left;
}
.bio-toast--error::after {
	background: var(--bio-toast-red);
}
.bio-toast--info::after {
	background: var(--bio-toast-blue);
}

/* ==========================================================================
   Toast Icon
   ========================================================================== */
.bio-toast__icon {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 1px;
}
.bio-toast__icon svg {
	width: 18px;
	height: 18px;
}

/* ==========================================================================
   Toast Body
   ========================================================================== */
.bio-toast__body {
	flex: 1;
	min-width: 0;
}
.bio-toast__title {
	font-family: var(--bio-font-display);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.01em;
	margin-bottom: 3px;
	color: var(--bio-toast-charcoal);
}
.bio-toast__msg {
	font-size: 12px;
	color: #5A5248;
	line-height: 1.55;
}
.bio-toast__msg a {
	color: var(--bio-toast-charcoal);
	text-decoration: underline;
	text-underline-offset: 2px;
}
.bio-toast__msg a:hover {
	color: var(--bio-toast-gold);
}

/* ==========================================================================
   Close Button
   ========================================================================== */
.bio-toast__close {
	flex-shrink: 0;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #7D7168;
	opacity: 0.6;
	transition: opacity 0.2s;
	margin-top: 1px;
}
.bio-toast__close:hover {
	opacity: 1;
}
.bio-toast__close svg {
	width: 13px;
	height: 13px;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes bio-toast-in {
	0%   { transform: translateX(calc(100% + 28px)); opacity: 0; }
	100% { transform: translateX(0); opacity: 1; }
}
@keyframes bio-toast-out {
	0%   { transform: translateX(0); opacity: 1; max-height: 200px; margin-bottom: 0; }
	60%  { transform: translateX(calc(100% + 28px)); opacity: 0; max-height: 200px; }
	100% { transform: translateX(calc(100% + 28px)); opacity: 0; max-height: 0; padding: 0; margin-bottom: -10px; }
}
@keyframes bio-toast-progress {
	0%   { transform: scaleX(1); }
	100% { transform: scaleX(0); }
}

/* ==========================================================================
   Hide ALL default WooCommerce inline notices — replaced by toast system
   ========================================================================== */

/* Hide EVERY native WC notice everywhere, unconditionally */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.woocommerce-notices-wrapper,
.woocommerce-NoticeGroup,
.woocommerce-NoticeGroup-checkout {
	display: none !important;
}


/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 480px) {
	#bio-toast-container {
		bottom: 16px;
		right: 16px;
		left: 16px;
		width: auto;
		max-width: none;
	}
	@keyframes bio-toast-in {
		0%   { transform: translateY(calc(100% + 16px)); opacity: 0; }
		100% { transform: translateY(0); opacity: 1; }
	}
	@keyframes bio-toast-out {
		0%   { transform: translateY(0); opacity: 1; max-height: 200px; }
		60%  { transform: translateY(calc(100% + 16px)); opacity: 0; max-height: 200px; }
		100% { transform: translateY(calc(100% + 16px)); opacity: 0; max-height: 0; padding: 0; }
	}
}
