/**
 * MHB Wishlist — heart-button visual states.
 *
 * The pattern markup provides an outline button with an SVG heart icon
 * and a label span. JS toggles `.is-saved` and the aria-pressed state.
 */

.mhb-wishlist-button .mhb-wishlist-button__icon {
	display: inline-block;
	transform-origin: center;
}

.mhb-wishlist-button .mhb-wishlist-button__icon svg {
	transition: fill 160ms ease, color 160ms ease;
	fill: transparent;
}

[data-mhb-wishlist-id].is-saved .mhb-wishlist-button__icon svg {
	fill: var(--wp--preset--color--red, #C9291C);
	color: var(--wp--preset--color--red, #C9291C);
}

@keyframes mhb-wishlist-pulse {
	0%   { transform: scale(1); }
	30%  { transform: scale(1.35); }
	55%  { transform: scale(0.92); }
	80%  { transform: scale(1.08); }
	100% { transform: scale(1); }
}

[data-mhb-wishlist-id].is-pulsing .mhb-wishlist-button__icon {
	animation: mhb-wishlist-pulse 480ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion: reduce) {
	[data-mhb-wishlist-id].is-pulsing .mhb-wishlist-button__icon {
		animation: none;
	}
}

/* Flyer — a filled heart that arcs from a wishlist toggle to the
   main-nav heart on add. Body-appended, animated via WAAPI, removed
   on finish. */
.mhb-wishlist-flyer {
	position: fixed;
	left: 0;
	top: 0;
	z-index: 9999;
	pointer-events: none;
	color: var(--wp--preset--color--red, #C9291C);
	will-change: transform, opacity;
}
.mhb-wishlist-flyer svg {
	display: block;
	fill: currentColor;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

/* Heart-break — arrow flies through the heart and splits it into two
   halves that fall away. Body-appended overlay positioned over the
   source heart's centre via inline left/top; halves and arrow are
   absolutely positioned children animated via WAAPI. */
.mhb-wishlist-break {
	position: fixed;
	z-index: 9999;
	pointer-events: none;
	width: 0;
	height: 0;
}
.mhb-wishlist-break__half,
.mhb-wishlist-break__arrow {
	position: absolute;
	left: 0;
	top: 0;
	will-change: transform, opacity;
}
.mhb-wishlist-break__half svg {
	display: block;
	color: var(--wp--preset--color--red, #C9291C);
	fill: currentColor;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}
.mhb-wishlist-break__half--left svg {
	clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}
.mhb-wishlist-break__half--right svg {
	clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}
.mhb-wishlist-break__arrow svg {
	display: block;
	color: var(--wp--preset--color--ink, #25211D);
}

.mhb-wishlist-button .wp-block-button__link.is-saved {
	color: var(--wp--preset--color--navy, #0F314B);
}

.mhb-wishlist-error {
	display: inline-block;
	margin-top: 0.5em;
	font-size: 0.8125rem;
	color: var(--wp--preset--color--red, #C9291C);
	font-family: var(--wp--preset--font-family--sans, system-ui, sans-serif);
}

.mhb-wishlist-button a:focus-visible {
	outline: 2px solid var(--wp--preset--color--navy, #0F314B);
	outline-offset: 2px;
}

/* /wishlist page */

.mhb-wishlist-page {
	margin-block: var(--wp--preset--spacing--40, 1.5rem);
}

.mhb-wishlist-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: var(--wp--preset--spacing--40, 1.5rem);
}

.mhb-wishlist-card {
	position: relative;
	transition: opacity 220ms ease, transform 220ms ease;
}

.mhb-wishlist-card.is-removing {
	opacity: 0;
	transform: scale(0.96);
	pointer-events: none;
}

.mhb-wishlist-card__remove {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	border: none;
	background: rgba(15, 49, 75, 0.85);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	line-height: 0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
	transition: background-color 160ms ease, transform 160ms ease;
}

.mhb-wishlist-card__remove:hover,
.mhb-wishlist-card__remove:focus-visible {
	background: var(--wp--preset--color--red, #C9291C);
	transform: scale(1.05);
}

.mhb-wishlist-card__remove:focus-visible {
	outline: 2px solid var(--wp--preset--color--navy, #0F314B);
	outline-offset: 2px;
}

.mhb-wishlist-empty {
	text-align: center;
	padding: var(--wp--preset--spacing--60, 2.5rem);
}

.mhb-wishlist-empty__cta {
	margin-top: var(--wp--preset--spacing--30, 1rem);
}
