/**
 * Site-wide toasts (assets/js/toasts.js).
 *
 * Same look as the catalogue's cart-motion toasts. Selectors carry one
 * extra level on purpose: profhairclub-cart-motion's cart-motion.css and
 * profhairclub-account's account.css both still style a bare `.phc-toast`
 * (0,1,0) with different padding/colour/offsets, and either can load after
 * this file.
 *
 * @package ProfHairClub_Shop
 */

body .phc-toast-stack {
	position: fixed;
	top: auto;
	left: auto;
	right: clamp(12px, 3vw, 24px);
	bottom: clamp(12px, 3vw, 24px);
	z-index: 10000;
	display: flex;
	flex-direction: column-reverse;
	gap: 0.6rem;
	pointer-events: none;
	width: min(380px, calc(100vw - 24px));
	max-width: none;
}

/* Sit above the floating call button (inc/consultation-request.php)
   instead of covering it. */
body:has(.phc-call-widget) .phc-toast-stack {
	bottom: 104px;
}

.phc-toast-stack .phc-toast {
	pointer-events: auto;
	display: flex;
	align-items: flex-start;
	gap: 0.7em;
	max-width: none;
	background: var(--phc-ink);
	color: var(--phc-paper);
	border-radius: var(--phc-radius-m, 12px);
	padding: 0.85em 0.9em 0.85em 1.2em;
	font-family: inherit;
	font-size: 0.86rem;
	font-weight: 600;
	line-height: 1.4;
	box-shadow: 0 12px 30px rgba(10, 10, 8, 0.25);
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.35s var(--phc-ease, ease), transform 0.35s var(--phc-ease, ease);
}

.phc-toast-stack .phc-toast.is-shown {
	opacity: 1;
	transform: translateY(0);
}

.phc-toast-stack .phc-toast--error {
	box-shadow: 0 12px 30px rgba(10, 10, 8, 0.25), inset 3px 0 0 var(--phc-danger, #c0392b);
}

.phc-toast-stack .phc-toast__icon {
	flex-shrink: 0;
	display: inline-flex;
	width: 18px;
	height: 18px;
	margin-top: 0.05em;
}

.phc-toast-stack .phc-toast__icon svg {
	width: 100%;
	height: 100%;
}

.phc-toast-stack .phc-toast--success .phc-toast__icon {
	color: #6fcf7a;
}

.phc-toast-stack .phc-toast--error .phc-toast__icon {
	color: #e57373;
}

.phc-toast-stack .phc-toast--info .phc-toast__icon {
	color: var(--phc-yellow);
}

.phc-toast-stack .phc-toast__text {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

.phc-toast-stack .phc-toast__text p {
	margin: 0;
}

.phc-toast-stack .phc-toast__text p + p {
	margin-top: 0.4em;
}

.phc-toast-stack .phc-toast__text a {
	color: var(--phc-yellow);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* «Просмотр корзины» and similar buttons inside a notice. */
.phc-toast-stack .phc-toast__text a.button,
.phc-toast-stack .phc-toast__text .wc-forward {
	float: none;
	display: inline-block;
	margin: 0 0.6em 0 0;
	padding: 0.2em 0.8em;
	border: 1px solid var(--phc-yellow);
	border-radius: 999px;
	background: transparent;
	color: var(--phc-yellow);
	font-size: 0.78rem;
	text-decoration: none;
}

.phc-toast-stack .phc-toast__close {
	flex-shrink: 0;
	margin: -0.25em 0 0;
	padding: 0 0.2em;
	border: 0;
	background: none;
	color: inherit;
	opacity: 0.55;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
}

.phc-toast-stack .phc-toast__close:hover,
.phc-toast-stack .phc-toast__close:focus-visible {
	opacity: 1;
}

/* The in-page box a notice was moved out of. */
.phc-notice-toasted {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.phc-toast-stack .phc-toast {
		transition-duration: 0.01ms !important;
	}
}

@media (max-width: 480px) {
	body .phc-toast-stack {
		left: 12px;
		right: 12px;
		width: auto;
	}
}
