/*
 * JustDSL wishlist: hearts (cards, product page, Quick View), the header
 * count, the toast and the [jdsl_wishlist] page. Loaded on every page.
 */

/* ------------------------------------------------------------------ *
 * Heart
 * ------------------------------------------------------------------ */

.jdsl-wl-heart {
	display: block;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linejoin: round;
	transition: fill .15s, stroke .15s;
}

.jdsl-wl-btn,
.jdsl-wl-btn:hover,
.jdsl-wl-btn:focus {
	display: inline-grid;
	place-items: center;
	padding: 0;
	margin: 0;
	border: 0;
	background: #fff;
	color: #111;
	box-shadow: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: background .15s, color .15s, border-color .15s, transform .15s;
}

.jdsl-wl-btn:hover {
	color: var(--jd-red, #d10000);
}

.jdsl-wl-btn:focus-visible {
	outline: 2px solid #111;
	outline-offset: 2px;
}

.jdsl-wl-btn.is-active {
	color: var(--jd-red, #d10000);
}

.jdsl-wl-btn.is-active .jdsl-wl-heart {
	fill: currentColor;
}

.jdsl-wl-btn.is-pop .jdsl-wl-heart {
	animation: jdsl-wl-pop .35s ease;
}

@keyframes jdsl-wl-pop {
	40% {
		transform: scale(1.3);
	}
}

/* On the card photo, top right */
.jdsl-shop ul.products li.product .jdsl-wl-btn--card {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}

.jdsl-shop ul.products li.product .jdsl-wl-btn--card .jdsl-wl-heart {
	width: 19px;
	height: 19px;
}

/* Product page + Quick View: a square next to "add to cart" */
.jdsl-pd form.cart .jdsl-wl-btn--single {
	flex: 0 0 54px;
	width: 54px;
	height: 54px;
	border: 1px solid #d6d6d6;
	border-radius: var(--jd-radius, 8px);
}

.jdsl-pd form.cart .jdsl-wl-btn--single:hover,
.jdsl-pd form.cart .jdsl-wl-btn--single.is-active {
	border-color: currentColor;
}

.jdsl-pd form.cart .jdsl-wl-btn--single .jdsl-wl-heart {
	width: 22px;
	height: 22px;
}

/* ------------------------------------------------------------------ *
 * Header count ([jdsl_wishlist_count])
 * ------------------------------------------------------------------ */

.jdsl-wl-count {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	color: inherit;
	text-decoration: none;
}

.jdsl-wl-count .jdsl-wl-heart {
	width: 22px;
	height: 22px;
}

.jdsl-wl-count__num {
	position: absolute;
	top: 1px;
	right: -2px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 9px;
	background: var(--jd-red, #d10000);
	color: #fff;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
}

.jdsl-wl-count__num[hidden] {
	display: none;
}

/* ------------------------------------------------------------------ *
 * Toast
 * ------------------------------------------------------------------ */

.jdsl-wl-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 100001;
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: calc(100% - 32px);
	padding: 12px 18px;
	border-radius: 999px;
	background: #111;
	color: #fff;
	font-family: "Noto Sans", sans-serif;
	font-size: 14px;
	line-height: 1.3;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 12px);
	transition: opacity .2s, transform .2s;
}

.jdsl-wl-toast.is-on {
	opacity: 1;
	pointer-events: auto;
	transform: translate(-50%, 0);
}

.jdsl-wl-toast a {
	color: #fff;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
}

body.jdsl-pd-bar-on .jdsl-wl-toast {
	bottom: 88px;
}

/* ------------------------------------------------------------------ *
 * The list page
 * ------------------------------------------------------------------ */

.jdsl-shop.jdsl-wl {
	--jd-cols: 4;
	max-width: none;
	margin: 0;
	padding: 0 0 24px;
}

.jdsl-wl__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--jd-line);
}

.jdsl-wl__bar[hidden],
.jdsl-wl__guest[hidden],
.jdsl-wl__empty[hidden] {
	display: none;
}

.jdsl-wl__total {
	font-size: 14px;
	font-weight: 600;
	color: var(--jd-black);
}

.jdsl-shop .jdsl-wl__clear,
.jdsl-shop .jdsl-wl__clear:hover,
.jdsl-shop .jdsl-wl__clear:focus {
	padding: 0;
	border: 0;
	background: none;
	color: var(--jd-muted);
	font: inherit;
	font-size: 13.5px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.jdsl-shop .jdsl-wl__clear:hover {
	color: var(--jd-red);
}

.jdsl-wl__guest {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 16px 0 0;
	padding: 12px 16px;
	border-radius: var(--jd-radius);
	background: var(--jd-soft);
	font-size: 14px;
	color: var(--jd-text);
}

.jdsl-wl__guest .jdsl-wl-heart {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	color: var(--jd-red);
}

.jdsl-shop .jdsl-wl__guest a {
	font-weight: 600;
	color: var(--jd-black);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.jdsl-wl__items li.product {
	transition: opacity .25s, transform .25s;
}

.jdsl-wl__items li.product.is-leaving {
	opacity: 0;
	transform: scale(.96);
}

/* Loading */
.jdsl-shop ul.products.jdsl-wl__skeleton li {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.jdsl-wl__skeleton li span {
	display: block;
	border-radius: 6px;
	background: linear-gradient(90deg, #f2f2f2 0, #e9e9e9 50%, #f2f2f2 100%);
	background-size: 200% 100%;
	animation: jdsl-wl-shimmer 1.2s linear infinite;
}

.jdsl-wl__skeleton li span:nth-child(1) {
	aspect-ratio: 2 / 3;
}

.jdsl-wl__skeleton li span:nth-child(2) {
	width: 80%;
	height: 14px;
	margin: 6px auto 0;
}

.jdsl-wl__skeleton li span:nth-child(3) {
	width: 40%;
	height: 14px;
	margin: 0 auto;
}

@keyframes jdsl-wl-shimmer {
	to {
		background-position: -200% 0;
	}
}

/* Empty */
.jdsl-wl__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 440px;
	margin: 0 auto;
	padding: 48px 16px 24px;
	text-align: center;
}

.jdsl-wl__empty-icon {
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	margin-bottom: 20px;
	border-radius: 50%;
	background: var(--jd-soft);
	color: var(--jd-red);
}

.jdsl-wl__empty-icon .jdsl-wl-heart {
	width: 30px;
	height: 30px;
}

.jdsl-shop .jdsl-wl__empty-title {
	margin: 0 0 8px;
	font-family: var(--jd-font);
	font-size: 22px;
	font-weight: 600;
	color: var(--jd-black);
}

.jdsl-wl__empty-text {
	margin: 0 0 24px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--jd-muted);
}

.jdsl-shop a.jdsl-wl__empty-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	padding: 0 32px;
	border-radius: var(--jd-radius);
	background: var(--jd-black);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	transition: background .15s;
}

.jdsl-shop a.jdsl-wl__empty-btn:hover {
	background: #333;
}

@media (max-width: 1024px) {
	.jdsl-shop.jdsl-wl {
		--jd-cols: 3;
	}
}

@media (max-width: 767px) {
	.jdsl-shop.jdsl-wl {
		--jd-cols: 2;
	}

	.jdsl-shop ul.products li.product .jdsl-wl-btn--card {
		top: 8px;
		right: 8px;
		width: 32px;
		height: 32px;
	}

	.jdsl-wl-toast {
		bottom: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jdsl-wl-btn.is-pop .jdsl-wl-heart,
	.jdsl-wl__skeleton li span {
		animation: none;
	}
}
