/*
 * Sweet Corner: wishlist messages (2026-11-26), js/sc-wishlist.js and "Wishlist flow" in
 * inc/sc-wishlist.php.
 * A dark pill at the top of the screen, centred left to right (owner, 2026-11-27), confirms each
 * add / removal, with "Voir mes favoris" after an add. It replaces YITH's popup
 * (#yith-wcwl-popup-message), which this theme showed empty. Centred with auto margins rather than
 * a transform, so nothing on the page can shift it sideways. Taps pass through it except on the
 * link, so it never blocks the header or a heart under it.
 */
#yith-wcwl-popup-message {
	display: none !important;
}

/*
 * Saving a heart (owner, 2026-11-28: "the old theme spinner"). YITH faded the heart to 60% and laid
 * its 40px loading GIF over it (blockUI) while the request ran. The GIF and the fade are gone: the
 * heart stays fully visible and beats until the answer arrives. A second tap is ignored meanwhile
 * (as with YITH's overlay). Cards, product photo and anywhere else a YITH heart shows.
 */
.yith-wcwl-add-to-wishlist a .blockUI {
	display: none !important;
}

.yith-wcwl-add-to-wishlist a[style*="opacity"] {
	opacity: 1 !important;
}

.yith-wcwl-add-to-wishlist a:has(.blockUI) {
	pointer-events: none;
}

.yith-wcwl-add-to-wishlist a:has(.blockUI) svg {
	animation: sc-wl-beat .7s ease-in-out infinite;
	transform-origin: 50% 55%;
}

@keyframes sc-wl-beat {
	0%, 100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.22);
	}
}

@media (prefers-reduced-motion: reduce) {
	.yith-wcwl-add-to-wishlist a:has(.blockUI) svg {
		animation: none;
		opacity: .55;
	}
}

.sc-wl-toast {
	position: fixed;
	left: 0;
	right: 0;
	top: calc(16px + env(safe-area-inset-top, 0px));
	margin: 0 auto;
	z-index: 2147483620; /* above the sticky header, the WhatsApp badge and the wheel button */
	display: flex;
	align-items: center;
	gap: 14px;
	width: max-content;
	max-width: calc(100vw - 32px);
	padding: 12px max(18px, env(safe-area-inset-right, 0px)) 12px max(18px, env(safe-area-inset-left, 0px));
	border-radius: 999px;
	background: #1f1f1f;
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.3;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
	pointer-events: none;
}

.sc-wl-toast.is-on {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .2s ease, transform .2s ease;
	pointer-events: none; /* over the page: taps pass through to the header and hearts below */
}

.sc-wl-toast.is-on .sc-wl-toast__link {
	pointer-events: auto; /* only "Voir mes favoris" takes taps */
}

.sc-wl-toast__text {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

/* Filled heart before "Ajouté…", grey after a removal */
.sc-wl-toast__text::before {
	content: "";
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	background-color: #f19ac2;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.3C1 8.4 3 4.5 6.8 4.5c2.1 0 3.6 1.2 5.2 3 1.6-1.8 3.1-3 5.2-3 3.8 0 5.8 3.9 4.4 7.2C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.3C1 8.4 3 4.5 6.8 4.5c2.1 0 3.6 1.2 5.2 3 1.6-1.8 3.1-3 5.2-3 3.8 0 5.8 3.9 4.4 7.2C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sc-wl-toast.is-removed .sc-wl-toast__text::before {
	background-color: #bdbdbd;
}

.sc-wl-toast.is-error .sc-wl-toast__text::before {
	display: none;
}

.sc-wl-toast.is-error {
	border-radius: 16px;
}

.sc-wl-toast.is-error .sc-wl-toast__text {
	white-space: normal;
}

.sc-wl-toast__link,
.sc-wl-toast__link:visited {
	flex: 0 0 auto;
	margin: -8px -6px; /* bigger tap area without a bigger pill */
	padding: 12px 6px;
	color: #f19ac2 !important;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
}

.sc-wl-toast__link:hover,
.sc-wl-toast__link:focus-visible {
	color: #fff !important;
}

@media (max-width: 767px) {
	.sc-wl-toast {
		top: calc(12px + env(safe-area-inset-top, 0px));
		font-size: 13px;
	}
}

/* Very narrow phones (320–399px): the link goes under the text instead of spilling out. */
@media (max-width: 399px) {
	.sc-wl-toast {
		flex-wrap: wrap;
		justify-content: center;
		row-gap: 2px;
		border-radius: 18px;
		text-align: center;
	}

	.sc-wl-toast__text {
		white-space: normal;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sc-wl-toast,
	.sc-wl-toast.is-on {
		transition: none;
		transform: none;
	}
}
