/**
 * Wishlist ("Αγαπημένα") — heart buttons, header count, wishlist page.
 * Loaded on every front-end page (hearts appear wherever product cards do).
 * Logic: inc/woocommerce/wishlist.php + assets/js/modules/wishlist.js.
 */

.myshop-wishlist-count[hidden] {
	display: none;
}

/* ======================================================================
   Heart button
   ====================================================================== */

.myshop-wishlist-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-text);
	font: inherit;
	cursor: pointer;
	transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.myshop-wishlist-toggle__icon {
	flex-shrink: 0;
	transition: fill 160ms ease, transform 200ms ease;
}

.myshop-wishlist-toggle.is-active {
	color: var(--color-error);
}

.myshop-wishlist-toggle.is-active .myshop-wishlist-toggle__icon {
	fill: currentColor;
}

.myshop-wishlist-toggle:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

/* On a product card — a round chip over the top-right of the image tile.
   li.product is already position: relative (components/cards.css). */
.woocommerce ul.products li.product .myshop-wishlist-toggle--card {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.92);
	box-shadow: 0 1px 4px rgba(35, 34, 29, 0.12);
}

.woocommerce ul.products li.product .myshop-wishlist-toggle--card .myshop-wishlist-toggle__icon {
	width: 19px;
	height: 19px;
}

.woocommerce ul.products li.product .myshop-wishlist-toggle--card:hover {
	color: var(--color-error);
	transform: scale(1.06);
}

.myshop-wishlist-toggle.is-active .myshop-wishlist-toggle__icon {
	animation: myshop-heart-pop 260ms ease;
}

@keyframes myshop-heart-pop {
	50% { transform: scale(1.25); }
}

@media (prefers-reduced-motion: reduce) {
	.myshop-wishlist-toggle,
	.myshop-wishlist-toggle__icon {
		transition: none;
		animation: none !important;
	}
}

/* On the product page — text button under add-to-cart. */
.myshop-wishlist-toggle--labeled {
	margin-block: -12px 28px;
	padding: 6px 0;
	font-size: 15px;
	font-weight: 500;
	color: var(--color-text-muted);
}

.myshop-wishlist-toggle--labeled:hover {
	color: var(--color-error);
}

.myshop-wishlist-toggle--labeled.is-active {
	color: var(--color-error);
}

/* ======================================================================
   Wishlist page — [myshop_wishlist]
   ====================================================================== */

/* Same page-title treatment as the cart and checkout (pages/cart-checkout.css). */
.myshop-wishlist-template .entry-header {
	margin-block-end: clamp(28px, 2.6vw, 44px);
}

.myshop-wishlist-template .entry-title {
	font-size: clamp(32px, 2.4vw, 44px);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--color-heading);
}

.myshop-wishlist__loading,
.myshop-wishlist__empty,
.myshop-wishlist__items {
	display: none;
}

.myshop-wishlist[data-state="loading"] .myshop-wishlist__loading {
	display: block;
	padding-block: 48px;
	text-align: center;
	color: var(--color-text-muted);
}

.myshop-wishlist[data-state="empty"] .myshop-wishlist__empty {
	display: flex;
}

.myshop-wishlist[data-state="filled"] .myshop-wishlist__items {
	display: block;
}

.myshop-wishlist__empty {
	flex-direction: column;
	align-items: center;
	max-width: 520px;
	margin: clamp(24px, 4vw, 56px) auto;
	padding: clamp(36px, 4vw, 56px) 24px;
	border: 1px solid var(--color-border);
	border-radius: 12px;
	background-color: var(--color-surface);
	text-align: center;
}

.myshop-wishlist__empty-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin-block-end: 18px;
	border-radius: 50%;
	background-color: var(--color-background);
	color: var(--color-error);
}

.myshop-wishlist__empty-icon .myshop-wishlist-toggle__icon {
	width: 28px;
	height: 28px;
}

.myshop-wishlist__empty-title {
	margin: 0 0 8px;
	font-size: clamp(22px, 1.5vw, 26px);
	font-weight: 500;
	color: var(--color-heading);
}

.myshop-wishlist__empty-text {
	margin: 0 0 24px;
	color: var(--color-text-muted);
}

/* Same grid as the shop (pages/shop-content.css), incl. WooCommerce's
   clearfix pseudo-elements, which would otherwise take a grid cell. */
.myshop-wishlist__items ul.products {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)) !important;
	gap: clamp(40px, 3.5vw, 52px) clamp(20px, 2vw, 28px) !important;
	margin: 0 !important;
}

.myshop-wishlist__items ul.products::before,
.myshop-wishlist__items ul.products::after {
	content: none;
	display: none;
}
