/**
 * «Избранное» (inc/favorites.php): heart on product cards, header counter, page /izbrannoe/.
 */

/* ---------- Heart on the card photo, top right (badges are top left, the cart button bottom right) ---------- */
.astra-shop-thumbnail-wrap {
	position: relative;
}

body .astra-shop-thumbnail-wrap .pcm-fav-btn {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-height: 0;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0;
	background: transparent !important;
	box-shadow: none !important;
	color: #9a9a9a !important;
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

/* Astra's round on-image cart button (shown on hover) sits top right by default: bottom right instead,
 * so the heart owns the top corner. Its look and behaviour are unchanged. */
body .astra-shop-thumbnail-wrap .ast-on-card-button:not(.ast-onsale-card) {
	top: auto;
	bottom: 16px;
}

.pcm-fav-btn__icon {
	display: block;
	width: 22px;
	height: 22px;
	fill: transparent;
	transition: fill 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

body .astra-shop-thumbnail-wrap .pcm-fav-btn.is-active {
	color: #000 !important;
}

.pcm-fav-btn.is-active .pcm-fav-btn__icon {
	fill: currentColor;
}

@media (hover: hover) {
	body .astra-shop-thumbnail-wrap .pcm-fav-btn:hover {
		color: #000 !important;
	}

	.pcm-fav-btn:hover .pcm-fav-btn__icon {
		fill: currentColor;
	}
}

.pcm-fav-btn:active .pcm-fav-btn__icon {
	transform: scale(0.88);
}

body .astra-shop-thumbnail-wrap .pcm-fav-btn:focus {
	outline: none;
}

body .astra-shop-thumbnail-wrap .pcm-fav-btn:focus-visible {
	outline: 2px solid #000;
	outline-offset: -6px;
}

@media (max-width: 767px) {
	body .astra-shop-thumbnail-wrap .pcm-fav-btn {
		top: 4px;
		right: 4px;
		width: 36px;
		height: 36px;
	}

	.pcm-fav-btn__icon {
		width: 20px;
		height: 20px;
	}

	body .astra-shop-thumbnail-wrap .ast-on-card-button:not(.ast-onsale-card) {
		bottom: 10px;
	}
}

/* ---------- Header counter (own class: WooCommerce cart fragments replace span.pcm-hdr__count) ---------- */
.pcm-hdr__fav-count {
	position: absolute;
	top: 5px;
	right: 3px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 8px;
	background: #000;
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	line-height: 16px;
	text-align: center;
	box-sizing: border-box;
}

.pcm-hdr__fav-count.is-empty {
	display: none;
}

@media (min-width: 1025px) {
	body.pcm-hdr-overlay .pcm-hdr__fav-count {
		background: var(--pcm-hdr-badge-bg);
		color: var(--pcm-hdr-badge-fg);
	}
}

/* ---------- Page /izbrannoe/ ---------- */
.pcm-fav-page[data-state="loading"] {
	min-height: 40vh;
}

.pcm-fav-page .pcm-fav-empty {
	display: none;
}

.pcm-fav-page[data-state="empty"] .pcm-fav-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
	padding: 64px 0 96px;
	text-align: center;
}

.pcm-fav-page[data-state="empty"] .woocommerce {
	display: none;
}

.pcm-fav-empty__text {
	margin: 0;
	color: #1a1a1a;
	font-size: 18px;
}

body .pcm-fav-empty__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 240px;
	height: 48px;
	padding: 0 32px;
	border: 1px solid #1a1a1a;
	background: #fff;
	color: #1a1a1a;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease;
}

body .pcm-fav-empty__btn:hover,
body .pcm-fav-empty__btn:focus-visible {
	background: #1a1a1a;
	color: #fff;
}

.pcm-fav-page ul.products > li.is-removing {
	opacity: 0;
	transition: opacity 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
	.pcm-fav-btn__icon,
	.pcm-fav-page ul.products > li.is-removing {
		transition: none;
	}
}
