/**
 * Wishlist page — Figma "VATALY — Wishlist" (wishlist-desktop.md,
 * wishlist-mobile.md, wishlist-states.md). See inc/wishlist-page.php.
 *
 * Loaded after css/bag.css: the page wrapper is `.vwl.vbag`, so the shared
 * Form/Button (.vco-btn, Secondary for ADD TO BAG), Feedback/Notice
 * (.vcart-notice) and Empty State (.vcart-empty) apply unchanged. This file
 * holds the page layout, the wishlist card, the notice's Dismissible close
 * button (only the wishlist guest notice is dismissible in Figma), state D and
 * the SELECT A SIZE picker (modal ≥768px, bottom sheet below).
 *
 * The card mirrors the PLP card's measurements (css/plp.css, scoped to the
 * archive) rather than sharing its rules — see inc/wishlist-page.php.
 *
 * Tokens (style.css :root): --ink_text, --bg_clr1, --bg_clr2, --b_clr,
 * --h_clr, --space_*, --font1, --font2.
 *
 * Desktop (1440 frame): content padding 48, header / notice inset 48, grid
 * edge to edge — 4 columns, 2px column gap, 32px row gap (4 × 358 + 3 × 2 +
 * 1px each side). ≤767.98px (Figma 402): 20px inset, Title 30, 2 columns.
 */

/* ---------------------------------------------------------------------------
 * Page shell
 * ------------------------------------------------------------------------ */

.vataly-wishlist .site-content,
.vataly-wishlist .site-main {
	background: var(--bg_clr1);
}

/* The theme's "Wishlist" title: the template prints WISHLIST. */
.vataly-wishlist .page-header,
.vataly-wishlist .entry-header {
	display: none;
}

/* Figma Content padding 48 top and bottom (the theme's 60px + .entry-content
 * margin otherwise). */
.vataly-wishlist .site-content {
	padding-top: 48px;
	padding-bottom: 0;
}

.vataly-wishlist .entry-content {
	margin: 0;
}

.vwl {
	display: flex;
	flex-direction: column;
	gap: 32px;
	padding-bottom: 48px;
	color: var(--ink_text);
	font-family: var(--font2), sans-serif;
}

/* js/wishlist-page.js switches the count, grid, empty state and notices with
 * the `hidden` attribute; the display rules below would otherwise win. */
.vwl [hidden] {
	display: none !important;
}

/* A REMOVE / UNDO in flight: further clicks wait for it. */
.vwl[aria-busy="true"] .vwl-item__remove,
.vwl[aria-busy="true"] .vcart-notice__action {
	cursor: progress;
}

/* ---------------------------------------------------------------------------
 * Page header — Title 40 + "(n) ITEMS" (Body 14)
 * ------------------------------------------------------------------------ */

.vwl-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space_16);
	min-height: 48px;
	padding: 0 48px;
}

.vwl .vwl-title {
	margin: 0;
	color: var(--ink_text);
	font-family: var(--font1), serif !important;
	font-size: 40px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0;
	text-transform: uppercase;
}

.vwl-count {
	margin: 0;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.36;
	text-transform: uppercase;
	white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * Notice slot — guest persistence notice (E1), WCBoost's own notices.
 * Collapsed when nothing is shown, so the 32px gaps don't double up.
 * ------------------------------------------------------------------------ */

.vwl-notices {
	display: flex;
	flex-direction: column;
	gap: var(--space_12);
	padding: 0 48px;
}

.vwl-notices:not(:has(> :not([hidden]):not(script))) {
	display: none;
}

.vwl-notices .vcart-notice__content {
	flex: 1 1 auto;
}

/* Figma Feedback/Notice Dismissible: Icon/Close 16 × 16 at the right. */
.vwl .vcart-notice__close {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	margin: 1px 0 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--ink_text);
	cursor: pointer;
}

.vwl .vcart-notice__close:hover,
.vwl .vcart-notice__close:focus {
	background: transparent;
	color: var(--ink_text);
}

.vwl .vcart-notice__close:focus-visible {
	outline: 2px solid var(--ink_text);
	outline-offset: 2px;
}

/* WCBoost's notices (no-JS REMOVE → "… is removed from the wishlist. Undo?")
 * drawn as the Info banner. */
.vwl-notices .woocommerce-message,
.vwl-notices .woocommerce-info,
.vwl-notices .woocommerce-error {
	margin: 0;
	padding: var(--space_16);
	border: 1px solid var(--h_clr);
	border-radius: 0;
	background: var(--bg_clr1);
	color: var(--ink_text);
	font-family: var(--font2), sans-serif;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.36;
	list-style: none;
}

.vwl-notices .woocommerce-message::before,
.vwl-notices .woocommerce-info::before,
.vwl-notices .woocommerce-error::before {
	content: none;
}

/* Konte's success / info glyph: the Figma banner here has none. Its close
 * (×, .close-message) is kept. */
.vwl-notices .message-icon {
	display: none;
}

/* …at the Figma Icon/Close size (16), like the guest notice's. */
.vwl-notices .close-message,
.vwl-notices .close-message svg {
	width: 16px !important; /* Konte sizes .svg-icon with !important */
	height: 16px !important;
}

.vwl-notices .woocommerce-message a,
.vwl-notices .woocommerce-info a,
.vwl-notices .woocommerce-error a {
	margin-left: var(--space_8);
	color: var(--ink_text);
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
	text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
 * Grid — edge to edge, 4 columns, 2px / 32px gaps
 * ------------------------------------------------------------------------ */

.vwl-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 32px 2px;
	align-items: start;
	margin: 0;
	padding: 0 1px;
	list-style: none;
}

/* Wishlist item: card, then Item actions, 12px apart. */
.vwl-item {
	display: flex;
	flex-direction: column;
	gap: var(--space_12);
	min-width: 0;
	margin: 0;
	padding: 0;
}

/* ---------------------------------------------------------------------------
 * Card — Web Product Card (358 × 574.93): image 358 × 503, info block 5px
 * below it inset 7 / 8, heart top-right of the info block.
 * ------------------------------------------------------------------------ */

.vwl-card {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"media"
		"info";
}

.vwl-card__media {
	grid-area: media;
	position: relative;
	display: block;
	aspect-ratio: 358 / 503;
	overflow: hidden;
	border: 0.1px solid var(--ink_text);
	background: var(--bg_clr2);
}

.vwl-card__media .vwl-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
}

/* Selected heart (the saved colour) — 20 × 19, not a control (heart un-save is
 * out of scope). Shares the info area so it sits level with the name. */
.vwl-card__heart {
	grid-area: info;
	justify-self: end;
	align-self: start;
	z-index: 1;
	width: 20px;
	height: 19px;
	margin: 5px 8px 0 0;
	color: var(--ink_text);
	line-height: 0;
	pointer-events: none;
}

.vwl-card__heart-icon {
	display: block;
	width: 100%;
	height: 100%;
	fill: currentColor;
}

/* Phase 4: filled on the saved colour, outline while another colour is
 * previewed (that colour is not saved). */
.vwl-card__heart-icon--outline,
.vwl-item.is-preview .vwl-card__heart-icon--saved {
	display: none;
}

.vwl-item.is-preview .vwl-card__heart-icon--outline {
	display: block;
}

.vwl-card__info {
	grid-area: info;
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 5px 8px 0 7px;
}

/* Product name (+ colour, as on the PLP card), Body 14, one line. */
.vwl .vwl-card__title {
	order: 1;
	margin: 0;
	padding-right: 26px; /* clears the 20px heart */
	overflow: hidden;
	color: var(--ink_text);
	font-family: var(--font2), sans-serif !important;
	font-size: 14px;
	font-weight: 300;
	line-height: 19px;
	letter-spacing: 0;
	text-overflow: ellipsis;
	text-transform: none;
	white-space: nowrap;
}

.vwl .vwl-card__title a {
	color: inherit;
	text-decoration: none;
}

/* Price: inside the card on desktop (Figma y 21 → 2px under the name). */
.vwl .vwl-card__price {
	order: 2;
	margin: 2px 0 0;
	color: var(--ink_text);
	font-size: 14px;
	font-weight: 300;
	line-height: 19px;
}

.vwl .vwl-card__price del {
	color: var(--h_clr);
}

.vwl .vwl-card__price ins {
	text-decoration: none;
}

/* Swatches — vataly_plp_card_swatches_html() markup, the PLP chip sizes:
 * 15.857px chips, 11px apart, 11px under the price. Six on desktop. */
.vwl-card__swatches {
	order: 3;
	display: flex;
	align-items: center;
	margin-top: 11px;
}

.vwl .vataly-card-swatches {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 11px;
	margin: 0 !important; /* Konte: .woocommerce .wcboost-variation-swatches__wrapper margin !important */
	padding: 0;
	list-style: none;
}

.vwl .vataly-card-swatches li,
.vwl .vataly-card-swatches .wcboost-variation-swatches__item {
	position: relative;
	flex: 0 0 auto;
	width: 15.857px !important;
	height: 15.857px !important;
	margin: 0 !important;
	padding: 0;
	border-radius: 0;
	overflow: visible;
}

.vwl .vataly-card-swatches .wcboost-variation-swatches__item img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
}

.vwl .vataly-card-swatches .wcboost-variation-swatches__item[style*='--wcboost-swatches-item-color'] {
	background-color: var(--wcboost-swatches-item-color);
}

/* Swatches preview their colour (js/wishlist-page.js). */
.vwl .vataly-card-swatches .wcboost-variation-swatches__item {
	cursor: pointer;
}

.vwl .vataly-card-swatches .wcboost-variation-swatches__item:focus-visible {
	outline: 1px solid var(--ink_text);
	outline-offset: 2px;
}

/* Colours past the 6 chips exist only for the PLP's mobile colour sheet. */
.vwl .vataly-card-swatches li.vataly-swatch--sheet-only {
	display: none;
}

.vwl .vataly-card-swatches .wcboost-variation-swatches__name {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Saved colour (desktop): Figma's 17 × 17 square ring, 0.5px taupe. */
.vwl .vataly-card-swatches .wcboost-variation-swatches__item.is-current::after {
	content: '';
	position: absolute;
	inset: -0.57px;
	border: 0.5px solid var(--h_clr);
	pointer-events: none;
}

/* The PLP Portrait colour name is not part of the wishlist card; "+ N Colours"
 * is mobile only. */
.vwl .vataly-card-colour-name,
.vwl .vataly-card-more-colours {
	display: none;
}

/* ---------------------------------------------------------------------------
 * Item actions — ADD TO BAG (Secondary, full width × 55) + REMOVE
 * ------------------------------------------------------------------------ */

.vwl-item__actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space_12);
}

.vwl .vwl-item__add {
	width: 100%;
	text-decoration: none;
}

.vwl .vwl-item__remove {
	color: var(--ink_text);
	font-size: 12px;
	font-weight: 700;
	line-height: 16px;
	text-decoration: underline;
	text-decoration-thickness: from-font;
	text-underline-offset: 2px;
	text-transform: uppercase;
}

.vwl .vwl-item__remove:hover,
.vwl .vwl-item__remove:focus-visible {
	color: var(--ink_text);
	text-decoration-thickness: 1px;
}

/* Disabled ADD TO BAG (state D) keeps the Figma Disabled look on hover too:
 * bag.css's Secondary :hover (inverted) would otherwise win. */
.vwl .vco-btn:disabled:not(.is-loading):hover,
.vwl-picker .vco-btn:disabled:not(.is-loading):hover {
	border-color: var(--b_clr);
	background: var(--bg_clr2);
	color: var(--h_clr);
}

/* State D — "Currently unavailable." Warning / Inline between the card and its
 * actions, inset like the card's info block. */
.vwl-item__notice {
	padding: 0 8px 0 7px;
}

.vwl-item__notice .vcart-notice__body {
	margin: 0;
	font-size: 14px;
	line-height: 1.36;
}

/* Mobile card's select-size "+" (Figma 16 × 16, right 12 / top 13 of the info
 * block). Desktop cards have none. */
.vwl-card__info {
	position: relative;
}

.vwl .vwl-card__size {
	display: none;
}

/* ---------------------------------------------------------------------------
 * Empty state — 480 wide, centred (bag.css draws it)
 * ------------------------------------------------------------------------ */

.vwl-empty {
	display: flex;
	justify-content: center;
	padding: 0 48px;
}

.vwl-empty .vcart-empty {
	width: 480px;
	max-width: 100%;
}

/* ---------------------------------------------------------------------------
 * Mobile (Figma 402): Body padding 24 / 20, gap 24; 2 columns of 199.
 * Card: image 199 × 274 with the 13 × 12 heart over it (top 13, right 11);
 * name Body 12; 3 chips + "+ N Colours"; the price is the Wishlist-local line
 * 12px under the card.
 * ------------------------------------------------------------------------ */

@media (max-width: 767.98px) {
	.vataly-wishlist .site-content {
		padding-top: 24px;
	}

	.vwl {
		gap: 24px;
	}

	.vwl-header {
		min-height: 36px;
		padding: 0 20px;
	}

	.vwl .vwl-title {
		font-size: 30px;
	}

	.vwl-notices {
		padding: 0 20px;
	}

	.vwl-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.vwl-card__media {
		aspect-ratio: 199 / 274;
		border-color: var(--b_clr);
	}

	.vwl-card__heart {
		grid-area: media;
		width: 13px;
		height: 12px;
		margin: 13px 11px 0 0;
	}

	.vwl-card__info {
		padding: 8px 4px 0;
	}

	.vwl .vwl-card__title {
		padding-right: 24px; /* room for the select-size "+" (Phase 3) */
		font-size: 12px;
		line-height: 16px;
	}

	/* Name → chips 13px; 3 chips (13 / 14 / 13 wide, 11 apart) + "+ N Colours". */
	/* Fixed at the chip height: the taller "+ N Colours" line (19px) must not
	 * push this card's price and buttons below its neighbour's. */
	.vwl-card__swatches {
		order: 2;
		height: 14px;
		margin-top: 13px;
	}

	.vwl .vataly-card-swatches li.vataly-swatch--mobile-hidden {
		display: none;
	}

	.vwl .vataly-card-swatches li,
	.vwl .vataly-card-swatches .wcboost-variation-swatches__item {
		width: 13px !important;
		height: 14px !important;
	}

	.vwl .vataly-card-swatches li:nth-child(2) {
		width: 14px !important;
	}

	/* Saved colour (mobile): 1px ink underline 4px under the chip. */
	.vwl .vataly-card-swatches .wcboost-variation-swatches__item.is-current::after {
		inset: auto 0 -4px;
		height: 1px;
		border: 0;
		background-color: var(--ink_text);
	}

	/* A button (opens the CHOOSE YOUR COLOUR sheet, js/plp-colour-sheet.js)
	 * drawn as the Figma text label: the theme's button chrome stripped. */
	.vwl .vataly-card-more-colours {
		display: block;
		height: auto;
		min-height: 0;
		margin: 0 0 0 11px;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: none;
		box-shadow: none;
		transform: translateY(-3px);
		color: var(--ink_text);
		font-family: var(--font2), sans-serif;
		font-size: 14px;
		font-weight: 300;
		line-height: 19px;
		letter-spacing: 0;
		text-transform: none;
		white-space: nowrap;
		cursor: pointer;
	}

	.vwl .vataly-card-more-colours:hover,
	.vwl .vataly-card-more-colours:focus {
		background: none;
		color: var(--ink_text);
	}

	.vwl .vataly-card-more-colours:focus-visible {
		outline: 1px solid var(--ink_text);
		outline-offset: 2px;
	}

	/* Wishlist-local price line: Body 12, 12px under the 327px card (the
	 * chip row ends 2px above the card edge). */
	.vwl .vwl-card__price {
		order: 3;
		margin-top: 14px;
		font-size: 12px;
		line-height: 16px;
	}

	.vwl-empty {
		padding: 0 20px;
	}

	.vwl .vwl-card__size {
		position: absolute;
		top: 13px;
		right: 12px;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 16px;
		height: 16px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: transparent;
		color: var(--ink_text);
		cursor: pointer;
	}

	/* Bigger tap area without moving the icon. */
	.vwl .vwl-card__size::after {
		content: '';
		position: absolute;
		inset: -12px;
	}

	.vwl-item__notice {
		padding: 0 4px;
	}
}

/* ---------------------------------------------------------------------------
 * SELECT A SIZE — Figma Overlay/Modal "Select a size" (560 wide, size rows
 * 494 × 57, footer CANCEL Secondary + ADD TO BAG Primary) over Overlay/Scrim.
 * Title as the bag drawer's header (Header 18); scrim as its backdrop.
 * ------------------------------------------------------------------------ */

html.vwl-picker-open {
	overflow: hidden;
}

.vwl-picker {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.vwl-picker[hidden] {
	display: none;
}

.vwl-picker__scrim {
	position: absolute;
	inset: 0;
	background: color-mix(in srgb, var(--ink_text) 40%, transparent);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.vwl-picker__dialog {
	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: var(--space_24);
	width: 560px;
	max-width: calc(100% - 32px);
	max-height: calc(100% - 32px);
	padding: 32px 33px;
	overflow-y: auto;
	border: 1px solid var(--b_clr);
	background: var(--bg_clr1);
	color: var(--ink_text);
	font-family: var(--font2), sans-serif;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.vwl-picker__dialog *,
.vwl-picker__dialog *::before,
.vwl-picker__dialog *::after {
	box-sizing: border-box;
}

.vwl-picker.is-open .vwl-picker__scrim {
	opacity: 1;
}

.vwl-picker.is-open .vwl-picker__dialog {
	opacity: 1;
	transform: none;
}

.vwl-picker__dialog:focus {
	outline: none;
}

.vwl-picker__grabber {
	display: none;
}

.vwl-picker__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space_16);
}

.vwl-picker .vwl-picker__title {
	margin: 0;
	color: var(--ink_text);
	font-family: var(--font2), sans-serif !important; /* css/typography.css: h2 → Cormorant !important */
	font-size: 18px;
	font-weight: 700;
	line-height: 1.36;
	letter-spacing: 0;
	text-transform: uppercase;
}

/* Close icon: mobile sheet only (the modal has CANCEL). */
.vwl-picker .vwl-picker__close {
	display: none;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin: -4px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--ink_text);
	cursor: pointer;
}

/* Size rows — 57 high, no fill or stroke; Selected = stone fill; Unavailable =
 * taupe and not selectable. Full size names, as on the PDP. */
.vwl-picker__sizes {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vwl-picker .vwl-size {
	display: flex;
	align-items: center;
	width: 100%;
	height: 57px;
	margin: 0;
	padding: 0 var(--space_16);
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--ink_text);
	font-family: var(--font2), sans-serif;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.36;
	letter-spacing: 0;
	text-align: left;
	text-transform: uppercase;
	opacity: 1;
	cursor: pointer;
	transition: none; /* the theme's button transition delayed the Selected fill */
}

.vwl-picker .vwl-size:hover,
.vwl-picker .vwl-size:focus {
	background: transparent;
	color: var(--ink_text);
}

.vwl-picker .vwl-size:focus-visible {
	outline: 2px solid var(--ink_text);
	outline-offset: -2px;
}

.vwl-picker .vwl-size[aria-pressed="true"] {
	background: var(--bg_clr2);
}

.vwl-picker .vwl-size.is-unavailable,
.vwl-picker .vwl-size.is-unavailable:hover {
	background: transparent;
	color: var(--h_clr);
	cursor: not-allowed;
}

.vwl-picker__notice:empty {
	display: none;
}

.vwl-picker__notice .vcart-notice__body {
	margin: 0;
}

.vwl-picker__foot {
	display: flex;
	gap: var(--space_12);
}

.vwl-picker__foot .vco-btn {
	flex: 1 1 0;
	width: auto;
	min-width: 0;
}

/* Mobile — Figma Overlay/Drawer bottom sheet (402 × 520): grabber 40 × 4,
 * title + close icon, size rows 360 wide, ADD TO BAG only (no CANCEL). */
@media (max-width: 767.98px) {
	.vwl-picker {
		align-items: flex-end;
	}

	.vwl-picker__dialog {
		width: 100%;
		max-width: none;
		max-height: calc(100% - 40px);
		padding: 12px 21px 24px;
		border-width: 1px 0 0;
		transform: translateY(100%);
	}

	.vwl-picker__grabber {
		display: block;
		flex: none;
		width: 40px;
		height: 4px;
		margin: 0 auto -8px;
		background: var(--b_clr);
	}

	.vwl-picker .vwl-picker__close {
		display: flex;
	}

	.vwl-picker .vwl-picker__cancel {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vwl-picker__scrim,
	.vwl-picker__dialog {
		transition: none;
	}
}
