/* Favorites: heart button on cards (top right of the image), on the product page, header heart, /favorites/ empty state. */

.tp-fav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0;
	font: inherit;
	color: var(--tp-ink, #1f3147);
	cursor: pointer;
	border: 0;
	background: none;
	-webkit-tap-highlight-color: transparent;
}

.tp-fav .tp-icon {
	width: 20px;
	height: 20px;
	flex: none;
}

.tp-fav .tp-fav__on,
.tp-fav.is-on .tp-fav__off {
	display: none;
}

.tp-fav.is-on .tp-fav__on {
	display: block;
	color: #e5314b;
}

.tp-fav:focus-visible {
	outline: 2px solid var(--tp-primary, #155dff);
	outline-offset: 2px;
}

/* On a card: white round button over the image */
.tp-card__media > .tp-fav {
	position: absolute;
	z-index: 2; /* above the hover scrim and the link */
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
	opacity: 0; /* shown while hovering the card (see below) */
	transition: transform 0.15s, background-color 0.15s, opacity 0.2s;
}

.tp-card:hover .tp-card__media > .tp-fav,
.tp-card:focus-within .tp-card__media > .tp-fav,
.tp-card__media > .tp-fav.is-on,
.tp-card__media > .tp-fav:focus-visible {
	opacity: 1;
}

@media (hover: none) {
	.tp-card__media > .tp-fav {
		opacity: 1; /* no hover on touch screens */
	}
}

.tp-card__media > .tp-fav:hover {
	background: #fff;
	transform: scale(1.08);
}

.tp-card__media > .tp-fav:active {
	transform: scale(0.94);
}

.tp-card--compact .tp-card__media > .tp-fav {
	top: 6px;
	right: 6px;
	width: 30px;
	height: 30px;
}

/* Product page: round heart at the top right of the buy box, level with the category chip */
.tp-buy__fav .tp-fav {
	width: 40px;
	height: 40px;
	background: #fff;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px var(--tp-line, #d8dee7);
	transition: box-shadow 0.15s, transform 0.15s;
}

.tp-buy__fav .tp-fav:hover {
	box-shadow: inset 0 0 0 1px var(--tp-ink, #1f3147);
}

.tp-buy__fav .tp-fav:active {
	transform: scale(0.94);
}

/* Header heart sits left of the cart icon; its badge reuses .tp-hdr__count */
.tp-hdr__fav {
	position: relative;
}

/* Empty state */
.tp-favs__empty {
	display: grid;
	justify-items: center;
	gap: 16px;
	padding: 64px 16px;
	text-align: center;
	color: var(--tp-muted, #5b6475);
}

.tp-favs__empty[hidden] {
	display: none;
}

.tp-favs__empty .tp-icon {
	width: 48px;
	height: 48px;
	color: var(--tp-line, #d8dee7);
}

.tp-favs__empty p {
	max-width: 360px;
	margin: 0;
}
