/**
 * Wishlist heart control (shared by shop cards, related products and the
 * single product page) plus the dedicated /wishlist/ page layout. Loaded
 * sitewide since a product — and therefore a heart — can appear on any
 * page; class names are unique enough that this never touches unrelated
 * markup, so no page-scoping wrapper is needed here.
 */

.u3ds-wishlist-heart {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--2-xs);
	background: none;
	border: none;
	padding: 0;
	color: var(--wp--preset--color--text-primary);
	cursor: pointer;
}

.u3ds-wishlist-heart:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
	border-radius: 999px;
}

.u3ds-wishlist-heart--compact {
	width: 36px;
	height: 36px;
	justify-content: center;
	background-color: rgba(8, 9, 13, 0.65);
	backdrop-filter: blur(4px);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	transition: border-color 200ms ease, background-color 200ms ease;
}

.u3ds-wishlist-heart--compact:hover {
	border-color: var(--wp--preset--color--accent);
}

.u3ds-wishlist-heart--full {
	padding: var(--wp--preset--spacing--s) var(--wp--preset--spacing--l);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--button);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	transition: border-color 200ms ease, color 200ms ease;
}

.u3ds-wishlist-heart--full:hover {
	border-color: var(--wp--preset--color--accent);
}

.u3ds-wishlist-heart__icon {
	flex-shrink: 0;
	transition: fill 150ms ease, stroke 150ms ease, transform 150ms ease;
}

.u3ds-wishlist-heart.is-active .u3ds-wishlist-heart__icon {
	transform: scale(1.08);
}

/* The path carries its own fill="none"/stroke="currentColor" presentation
   attributes, which take precedence over a color set on the parent <svg>
   — target the path itself so the active state actually paints it. */
.u3ds-wishlist-heart.is-active .u3ds-wishlist-heart__icon path {
	fill: var(--wp--preset--color--accent);
	stroke: var(--wp--preset--color--accent);
}

.u3ds-wishlist-heart.is-active.u3ds-wishlist-heart--compact {
	border-color: var(--wp--preset--color--accent);
}

/* One-shot confirmation pop, triggered by wishlist.js on a successful
   toggle (add or remove) — layered on top of the steady is-active scale
   above, which resumes automatically once the animation class is removed. */
@keyframes u3ds-heart-pop {
	0% { transform: scale(1); }
	45% { transform: scale(1.3); }
	100% { transform: scale(1); }
}

.u3ds-wishlist-heart__icon.is-popping {
	animation: u3ds-heart-pop 260ms ease;
}

@media (prefers-reduced-motion: reduce) {
	.u3ds-wishlist-heart__icon {
		transition: none;
	}

	.u3ds-wishlist-heart__icon.is-popping {
		animation: none;
	}
}

/* ------------------------------------------------------------------ */
/* /wishlist/ page                                                     */
/* ------------------------------------------------------------------ */

.u3ds-wishlist-app {
	color: var(--wp--preset--color--text-primary);
}

.u3ds-wishlist-loading,
.u3ds-wishlist-empty {
	text-align: center;
	padding: var(--wp--preset--spacing--3-xl) 0;
	color: var(--wp--preset--color--text-secondary);
}

.u3ds-wishlist-empty p {
	margin: 0 0 var(--wp--preset--spacing--l);
}

.u3ds-wishlist-empty .button {
	display: inline-flex;
	border-radius: var(--wp--custom--radius--button);
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--text-primary);
	text-decoration: none;
	font-weight: 700;
	text-transform: uppercase;
	font-size: var(--wp--preset--font-size--small);
	padding: var(--wp--preset--spacing--s) var(--wp--preset--spacing--xl);
}

.u3ds-wishlist-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--l);
}

.u3ds-wishlist-item {
	position: relative;
	display: flex;
	flex-direction: column;
	background-color: var(--wp--preset--color--bg-secondary);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--surface);
	padding: var(--wp--preset--spacing--m);
	transition: border-color 200ms ease;
}

.u3ds-wishlist-item:hover {
	border-color: var(--wp--preset--color--accent);
}

.u3ds-wishlist-item__media {
	display: block;
	aspect-ratio: 1 / 1;
	background-color: var(--wp--preset--color--bg-primary);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--button);
	overflow: hidden;
	margin-bottom: var(--wp--preset--spacing--m);
}

.u3ds-wishlist-item__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.u3ds-wishlist-item__title {
	display: block;
	color: var(--wp--preset--color--text-primary);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	margin-bottom: var(--wp--preset--spacing--2-xs);
}

.u3ds-wishlist-item__price {
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--small);
	margin-bottom: var(--wp--preset--spacing--m);
}

.u3ds-wishlist-item__actions {
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--xs);
}

.u3ds-wishlist-item__add {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--wp--custom--radius--button);
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--text-primary);
	text-decoration: none;
	font-weight: 700;
	text-transform: uppercase;
	font-size: var(--wp--preset--font-size--small);
	padding: var(--wp--preset--spacing--s) var(--wp--preset--spacing--m);
	transition: background-color 200ms ease;
}

.u3ds-wishlist-item__add:hover {
	background-color: var(--wp--preset--color--accent-highlight);
	color: var(--wp--preset--color--text-primary);
}

.u3ds-wishlist-item__remove {
	background: none;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--button);
	color: var(--wp--preset--color--text-secondary);
	font-size: var(--wp--preset--font-size--small);
	padding: var(--wp--preset--spacing--s) var(--wp--preset--spacing--m);
	cursor: pointer;
	transition: border-color 200ms ease, color 200ms ease;
}

.u3ds-wishlist-item__remove:hover {
	border-color: var(--wp--preset--color--error);
	color: var(--wp--preset--color--error);
}

.u3ds-wishlist-item__remove:focus-visible,
.u3ds-wishlist-item__add:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

@media (max-width: 1024px) {
	.u3ds-wishlist-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 781px) {
	.u3ds-wishlist-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--wp--preset--spacing--m);
	}
}

@media (max-width: 480px) {
	.u3ds-wishlist-grid {
		grid-template-columns: 1fr;
	}
}
