/* ==========================================================================
   Kidoclassic Mall, custom /wishlist page + the heart button on product cards
   --------------------------------------------------------------------------
   Two concerns in one sheet, because the heart that feeds the wishlist lives
   out on the product cards, not on this page:

     1. .kc-wish-heart  the small heart overlaid on the top-right of every
        product image (loop cards, the single product gallery, and the saved
        cards on this page). It carries its own token block because it renders
        outside .kc-wishlist and cannot inherit that scope.

     2. .kc-wishlist     the saved-pieces page itself: editorial header matched
        to /orders and /addresses, a warm empty state, and a responsive grid
        (1 / 2 / 3 columns).

   Self-contained: the design tokens below are copied from the theme's
   global.css :root so this module never imports the theme file yet every colour
   and font matches the store exactly.

   Mobile first: base rules are the phone layout; the media queries near the
   bottom widen the grid for tablet and desktop.
   ========================================================================== */

/* ==========================================================================
   1. The heart button (product cards, single product, saved cards)
   ========================================================================== */

.kc-wish-heart {
	/* Tokens (from global.css :root) */
	--kido-magenta: #C4186C;
	--kido-magenta-deep: #A8125B;
	--kido-ink: #2B1A20;
	--kido-muted: #8C7B83;
	--kido-surface: #FFFFFF;
	--kido-shadow-sm: 0 2px 10px rgba(43, 26, 32, 0.08);
	--kido-shadow-md: 0 10px 28px rgba(43, 26, 32, 0.10);
	--kido-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;

	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	margin: 0;

	color: var(--kido-ink);
	background: rgba(255, 255, 255, 0.92);
	border: none;
	border-radius: 999px;
	box-shadow: var(--kido-shadow-sm);
	cursor: pointer;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	transition: transform 0.16s var(--kido-ease), box-shadow 0.16s var(--kido-ease),
		color 0.16s var(--kido-ease), background 0.16s var(--kido-ease);
}

.kc-wish-heart:hover {
	color: var(--kido-magenta);
	background: #fff;
	box-shadow: var(--kido-shadow-md);
	transform: translateY(-1px);
}

.kc-wish-heart:active {
	transform: scale(0.9);
}

.kc-wish-heart__icon {
	width: 20px;
	height: 20px;
	fill: none;
	transition: fill 0.16s var(--kido-ease);
	pointer-events: none;
}

/* Saved: a filled magenta heart. */
.kc-wish-heart.is-wished {
	color: var(--kido-magenta);
}
.kc-wish-heart.is-wished .kc-wish-heart__icon {
	fill: var(--kido-magenta);
}
.kc-wish-heart.is-wished:hover {
	color: var(--kido-magenta-deep);
}
.kc-wish-heart.is-wished:hover .kc-wish-heart__icon {
	fill: var(--kido-magenta-deep);
}

/* A small pop the instant she saves a piece. */
@keyframes kc-wish-pop {
	0%   { transform: scale(1); }
	40%  { transform: scale(1.24); }
	100% { transform: scale(1); }
}
.kc-wish-heart.is-wished .kc-wish-heart__icon {
	animation: kc-wish-pop 0.28s var(--kido-ease);
}

/* On the single product page the heart is appended inside the gallery wrapper,
   which WooCommerce already positions relative; assert it so the overlay anchors
   to the gallery on any theme setup. */
.woocommerce-product-gallery {
	position: relative;
}
.kc-wish-heart--single {
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
}
.kc-wish-heart--single .kc-wish-heart__icon {
	width: 22px;
	height: 22px;
}

/* ==========================================================================
   2. The /wishlist page
   ========================================================================== */

.kc-wishlist {
	/* Tokens (from global.css :root) */
	--kido-magenta: #C4186C;
	--kido-magenta-deep: #A8125B;
	--kido-magenta-deeper: #7E1450;
	--kido-magenta-wash: #FBE2EE;
	--kido-magenta-tint: #FDF1F6;

	--kido-ink: #2B1A20;
	--kido-ink-2: #5A464E;
	--kido-muted: #8C7B83;
	--kido-border: #F0E2E9;
	--kido-border-strong: #E2CFD8;
	--kido-surface: #FFFFFF;
	--kido-surface-2: #F8EEF3;

	--kido-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
	--kido-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

	--kido-r-sm: 10px;
	--kido-r-md: 16px;
	--kido-r-lg: 24px;
	--kido-r-pill: 999px;

	--kido-shadow-xs: 0 1px 2px rgba(43, 26, 32, 0.06);
	--kido-shadow-sm: 0 2px 10px rgba(43, 26, 32, 0.08);
	--kido-shadow-md: 0 10px 28px rgba(43, 26, 32, 0.10);

	--kido-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--kido-t-fast: 0.16s var(--kido-ease);
	--kido-t: 0.26s var(--kido-ease);

	--kido-gutter: 20px;

	background: #FFFFFF;
	padding-bottom: 96px;
}

.kc-wishlist__shell {
	max-width: 1080px;
	margin: 0 auto;
	padding: 28px var(--kido-gutter) 0;
}

/* Back to profile -------------------------------------------------------- */

.kc-wishlist__back {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-family: var(--kido-body);
	font-size: 14px;
	font-weight: 500;
	color: var(--kido-muted);
	transition: color var(--kido-t-fast);
}
.kc-wishlist__back:hover {
	color: var(--kido-magenta);
}
.kc-wishlist__back-arrow {
	font-size: 16px;
	line-height: 1;
	transition: transform var(--kido-t-fast);
}
.kc-wishlist__back:hover .kc-wishlist__back-arrow {
	transform: translateX(-3px);
}

/* Header ----------------------------------------------------------------- */

.kc-wishlist__head {
	margin: 22px 0 28px;
}
.kc-wishlist__eyebrow {
	display: block;
	font-family: var(--kido-body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--kido-muted);
	margin-bottom: 10px;
}
.kc-wishlist__title {
	font-family: var(--kido-display);
	font-weight: 700;
	font-size: clamp(30px, 5vw, 40px);
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--kido-ink);
	margin: 0;
}

/* Empty state ------------------------------------------------------------ */

.kc-wishlist__empty {
	max-width: 460px;
	margin: 24px auto 0;
	padding: 56px 24px 64px;
	text-align: center;
}
.kc-wishlist__empty-art {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin-bottom: 22px;
	color: var(--kido-magenta);
	background: var(--kido-magenta-wash);
	border-radius: var(--kido-r-pill);
}
.kc-wishlist__empty-title {
	font-family: var(--kido-display);
	font-weight: 700;
	font-size: clamp(22px, 4vw, 27px);
	color: var(--kido-ink);
	margin: 0 0 8px;
}
.kc-wishlist__empty-text {
	font-family: var(--kido-body);
	font-size: 15px;
	line-height: 1.6;
	color: var(--kido-muted);
	margin: 0 0 28px;
}

/* Wishlist grid ---------------------------------------------------------- */

.kc-wishlist__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.kc-wishlist__item {
	display: flex;
	flex-direction: column;
	background: var(--kido-surface);
	border: 1px solid var(--kido-border);
	border-radius: var(--kido-r-md);
	overflow: hidden;
	box-shadow: var(--kido-shadow-xs);
	opacity: 1;
	transform: none;
	transition: box-shadow var(--kido-t), transform var(--kido-t), opacity var(--kido-t), border-color var(--kido-t);
}
.kc-wishlist__item:hover {
	box-shadow: var(--kido-shadow-md);
	border-color: var(--kido-border-strong);
}
/* Optimistic removal: fade and lift out. */
.kc-wishlist__item.is-removing {
	opacity: 0;
	transform: scale(0.94);
	pointer-events: none;
}

.kc-wishlist__media {
	position: relative;
	aspect-ratio: 1 / 1;
	background: var(--kido-surface-2);
	overflow: hidden;
}
.kc-wishlist__media-link {
	display: block;
	width: 100%;
	height: 100%;
}
.kc-wishlist__media img,
.kc-wishlist__media .kc-wishlist__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s var(--kido-ease);
}
.kc-wishlist__item:hover .kc-wishlist__media img {
	transform: scale(1.04);
}

/* "Added to bag" note, floated over the image. */
.kc-wishlist__added {
	position: absolute;
	left: 12px;
	bottom: 12px;
	z-index: 3;
	padding: 6px 13px;
	font-family: var(--kido-body);
	font-size: 12.5px;
	font-weight: 600;
	color: #fff;
	background: var(--kido-magenta);
	border-radius: var(--kido-r-pill);
	box-shadow: var(--kido-shadow-sm);
	opacity: 0;
	transform: translateY(6px);
	transition: opacity var(--kido-t), transform var(--kido-t);
}
.kc-wishlist__added.is-shown {
	opacity: 1;
	transform: translateY(0);
}

.kc-wishlist__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px 16px;
	flex: 1;
}
.kc-wishlist__name {
	font-family: var(--kido-body);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--kido-ink);
}
.kc-wishlist__name:hover {
	color: var(--kido-magenta);
}
.kc-wishlist__price {
	font-family: var(--kido-body);
	font-weight: 700;
	font-size: 17px;
	color: var(--kido-magenta-deeper);
}
.kc-wishlist__price del {
	color: var(--kido-muted);
	font-weight: 400;
	font-size: 14px;
	margin-right: 6px;
}
.kc-wishlist__price ins {
	text-decoration: none;
	background: none;
}

.kc-wishlist__bag {
	margin-top: 12px;
	position: relative;
}
.kc-wishlist__bag.is-loading .kc-wishlist__bag-text {
	visibility: hidden;
}
.kc-wishlist__spinner {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: kc-wishlist-spin 0.6s linear infinite;
}
.kc-wishlist__bag.is-loading .kc-wishlist__spinner {
	display: block;
}
@keyframes kc-wishlist-spin {
	to { transform: rotate(360deg); }
}

/* Guard shown by the shortcode when dropped on a page for a guest. */
.kc-wishlist-guard {
	max-width: 460px;
	margin: 60px auto;
	padding: 0 20px;
	text-align: center;
}

/* ==========================================================================
   Responsive: 2 columns on tablet, 3 on desktop
   ========================================================================== */

@media (min-width: 600px) {
	.kc-wishlist__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 22px;
	}
}

@media (min-width: 900px) {
	.kc-wishlist__shell {
		padding-top: 36px;
	}
	.kc-wishlist__grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 24px;
	}
	.kc-wishlist__head {
		margin: 26px 0 34px;
	}
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.kc-wish-heart.is-wished .kc-wish-heart__icon {
		animation: none;
	}
	.kc-wishlist__item,
	.kc-wishlist__media img,
	.kc-wishlist__added {
		transition: none;
	}
}
