/* ==========================================================================
   Nova Toast Notifications
   Replaces WooCommerce's inline .woocommerce-error / .woocommerce-message /
   .woocommerce-info notices with slide-in toast popups.
   ========================================================================== */

/* ---- Container: fixed top-right stack ---- */
.nova-toast-container {
	position: fixed;
	top: 24px;
	right: 24px;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
	max-width: 420px;
	width: calc(100vw - 48px);
}

/* ---- Individual toast ---- */
.nova-toast {
	pointer-events: auto;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border-radius: 12px;
	background: #fff;
	box-shadow:
		0 4px 24px rgba(0, 0, 0, 0.12),
		0 1px 4px rgba(0, 0, 0, 0.08);
	font-family: var(--nova-font-body, 'Inter', sans-serif);
	font-size: 14px;
	line-height: 1.5;
	color: #1a1a2e;
	transform: translateX(120%);
	opacity: 0;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
	max-width: 100%;
	overflow: hidden;
}

.nova-toast.nova-toast--visible {
	transform: translateX(0);
	opacity: 1;
}

.nova-toast.nova-toast--exit {
	transform: translateX(120%);
	opacity: 0;
}

/* ---- Left icon ---- */
.nova-toast__icon {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 1px;
}

.nova-toast__icon svg {
	width: 14px;
	height: 14px;
}

/* ---- Content ---- */
.nova-toast__body {
	flex: 1;
	min-width: 0;
}

.nova-toast__body a {
	color: var(--nova-accent, #8a4fff);
	text-decoration: underline;
}

.nova-toast__body a.button {
	display: inline-block;
	margin-top: 6px;
	padding: 6px 14px;
	background: var(--nova-accent, #8a4fff);
	color: #fff;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.2s;
}

.nova-toast__body a.button:hover {
	background: var(--nova-accent-hover, #7a3de8);
}

/* ---- Close button ---- */
.nova-toast__close {
	flex-shrink: 0;
	background: none;
	border: none;
	cursor: pointer;
	padding: 2px;
	color: #999;
	transition: color 0.2s;
	line-height: 1;
}

.nova-toast__close:hover {
	color: #333;
}

.nova-toast__close svg {
	width: 16px;
	height: 16px;
}

/* ---- Progress bar (auto-dismiss timer) ---- */
.nova-toast__progress {
	position: absolute;
	bottom: 0;
	left: 0;
	height: 3px;
	border-radius: 0 0 12px 12px;
	animation: nova-toast-shrink linear forwards;
}

@keyframes nova-toast-shrink {
	from { width: 100%; }
	to   { width: 0; }
}

/* ---- Type variants ---- */

/* Success (green) */
.nova-toast--success .nova-toast__icon {
	background: #dcfce7;
}

.nova-toast--success .nova-toast__icon svg {
	color: #16a34a;
}

.nova-toast--success .nova-toast__progress {
	background: #16a34a;
}

/* Error (red) */
.nova-toast--error .nova-toast__icon {
	background: #fee2e2;
}

.nova-toast--error .nova-toast__icon svg {
	color: #dc2626;
}

.nova-toast--error .nova-toast__progress {
	background: #dc2626;
}

/* Info (purple / brand) */
.nova-toast--info .nova-toast__icon {
	background: rgba(138, 79, 255, 0.12);
}

.nova-toast--info .nova-toast__icon svg {
	color: var(--nova-accent, #8a4fff);
}

.nova-toast--info .nova-toast__progress {
	background: var(--nova-accent, #8a4fff);
}

/* ---- Hide original WC notices (globally) ---- */
.woocommerce-error:not(.nova-toast-keep),
.woocommerce-message:not(.nova-toast-keep),
.woocommerce-info:not(.nova-toast-keep) {
	display: none !important;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
	.nova-toast-container {
		top: 12px;
		right: 12px;
		left: 12px;
		max-width: none;
		width: auto;
	}

	.nova-toast {
		font-size: 13px;
		padding: 12px 14px;
	}
}

/* ============================================================
   Responsive ladder — Phase 29 Plan 11
   Standard ≤768 / ≤480 ladder that lives alongside the existing
   ≤600 query above. Toasts must fit a 320px viewport, leave room
   for the mobile bottom bar / cart drawer trigger, and stack with
   readable spacing when multiple notices fire at once.
   ============================================================ */

@media (max-width: 768px) {
	.nova-toast-container {
		top: 12px;
		right: 12px;
		left: 12px;
		max-width: none;
		width: auto;
		gap: 8px;
		/* Keep toasts above the mobile bottom bar / floating
		   action buttons (~72-80px tall) so they aren't masked. */
		padding-bottom: 0;
	}

	.nova-toast {
		font-size: 14px;
		line-height: 1.4;
		padding: 12px 14px;
		gap: 10px;
		border-radius: 10px;
		max-width: calc(100vw - 24px);
	}

	.nova-toast__icon {
		width: 20px;
		height: 20px;
	}

	.nova-toast__icon svg {
		width: 12px;
		height: 12px;
	}

	.nova-toast__body a.button {
		min-height: 36px;
		padding: 8px 14px;
		font-size: 13px;
	}
}

@media (max-width: 480px) {
	.nova-toast-container {
		top: 10px;
		right: 10px;
		left: 10px;
		gap: 8px;
	}

	.nova-toast {
		font-size: 13px;
		line-height: 1.4;
		padding: 10px 12px;
		gap: 8px;
		max-width: calc(100vw - 20px);
	}

	.nova-toast__close svg {
		width: 14px;
		height: 14px;
	}
}

