/*
 * enitan hope: favourites heart and toast (inc/favourites.php, assets/js/favourites.js).
 * Loaded on every page (hearts are on every card tile). The Favourites page itself: account.css.
 * Heart (decision 5.4, as ProductV2): outline Swedish blue; hover shows the yellow fill;
 * saved = yellow fill with an ink outline, so it never relies on yellow alone. Tokens only.
 */

/* ---------- Heart ---------- */
.eh-heart {
	display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
	width: var(--wp--custom--eh--tap); height: var(--wp--custom--eh--tap); margin: 0; padding: 0;
	border: 0; border-radius: 0; background: none; box-shadow: none; cursor: pointer;
	color: var(--wp--preset--color--blue);
	transition: transform var(--wp--custom--eh--motion), background var(--wp--custom--eh--motion);
}
.eh-heart__i { position: relative; display: inline-flex; width: 20px; height: 20px; }
.eh-heart__i svg { position: absolute; inset: 0; }
.eh-heart__f { color: var(--wp--preset--color--yellow); opacity: 0; transition: opacity var(--wp--custom--eh--motion); }
.eh-heart__o { color: var(--wp--preset--color--blue); }
@media (hover: hover) and (pointer: fine) { .eh-heart:hover .eh-heart__f { opacity: 1; } }
.eh-heart[aria-pressed="true"] .eh-heart__f, .eh-heart--remove .eh-heart__f { opacity: 1; }
.eh-heart[aria-pressed="true"] .eh-heart__o, .eh-heart--remove .eh-heart__o { color: var(--wp--preset--color--ink); }
.eh-heart:active { transform: scale(.92); }
.eh-heart:focus-visible { outline: var(--wp--custom--eh--focus); outline-offset: 2px; }
.eh-heart[disabled] { cursor: progress; opacity: .6; }

/* On a card tile: top right of the grey frame. */
.woocommerce ul.products li.product figure,
.eh-products .wc-block-components-product-image { position: relative; }
.eh-heart--tile, .eh-heart--remove { position: absolute; top: 8px; right: 8px; z-index: 2; }

/* Product page: a 56px square after Add to basket (ProductV2). */
.eh-buy .eh-buy__actions--heart { grid-template-columns: auto minmax(0, 1fr) var(--eh-p-control, 56px); }
.eh-buy .eh-heart--buy { width: var(--eh-p-control, 56px); height: var(--eh-p-control, 56px); border: var(--wp--custom--eh--border-strong); background: var(--wp--preset--color--white); }
@media (hover: hover) and (pointer: fine) { .eh-buy .eh-heart--buy:hover { background: var(--wp--preset--color--studio-grey); } }
.eh-buy .eh-buy__actions--heart .eh-buy__add { padding: 0 8px; white-space: nowrap; }

/* ---------- Toast (canvas .toast) ---------- */
.eh-toast {
	position: fixed; left: 50%; bottom: 24px; z-index: 1000; transform: translateX(-50%);
	display: flex; align-items: center; gap: var(--wp--preset--spacing--s);
	width: max-content; max-width: min(560px, calc(100vw - 24px)); box-sizing: border-box;
	padding: 6px 6px 6px 18px; background: var(--wp--preset--color--ink); color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--sans); font-size: 14px; line-height: 1.5;
	box-shadow: 0 12px 32px rgba(26, 26, 26, .2);
}
.eh-toast[hidden] { display: none; }
.eh-toast__msg { flex: 1 1 auto; padding: 6px 0; }
.eh-toast__act, .eh-toast__act:visited {
	flex: none; display: inline-flex; align-items: center; min-height: var(--wp--custom--eh--tap); padding: 0 4px; margin: 0;
	border: 0; background: none; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap;
	color: var(--wp--preset--color--white) !important; text-decoration: underline; text-underline-offset: 4px;
}
@media (hover: hover) and (pointer: fine) { .eh-toast__act:hover { color: var(--wp--preset--color--yellow) !important; } }
.eh-toast__x {
	flex: none; display: inline-flex; align-items: center; justify-content: center;
	width: var(--wp--custom--eh--tap); height: var(--wp--custom--eh--tap); margin: 0; padding: 0;
	border: 0; background: none; color: var(--wp--preset--color--white); cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .eh-toast__x:hover { background: rgba(255, 255, 255, .12); } }
.eh-toast :focus-visible { outline: 2px solid var(--wp--preset--color--white); outline-offset: 2px; }

@media (max-width: 689.98px) {
	.eh-toast { left: 12px; right: 12px; bottom: 12px; transform: none; width: auto; max-width: none; }
	.eh-toast__act { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
	.eh-heart, .eh-heart__f { transition: none; }
	.eh-heart:active { transform: none; }
}
