/* ==========================================================================
   BikerDroid — wishlist: heart toggle states, toasts and the /wishlist/ page
   ========================================================================== */

/* ---------- Heart toggle ----------
   The product card positions the button; the base look below uses :where() (zero specificity)
   so placement/size rules from the card always win. State styles are regular specificity. */
:where(.bd-wish) {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: var(--bd-r-pill);
	background: var(--bd-white);
	color: var(--bd-black);
	box-shadow: var(--bd-shadow-sm);
	line-height: 1;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.bd-wish {
	transition: background-color var(--bd-dur) var(--bd-ease), color var(--bd-dur) var(--bd-ease), transform var(--bd-dur) var(--bd-ease), box-shadow var(--bd-dur) var(--bd-ease);
}
.bd-wish .bd-icon {
	transition: transform var(--bd-dur) var(--bd-ease), fill var(--bd-dur) var(--bd-ease);
}
.bd-theme .bd-wish:hover,
.bd-theme .bd-wish:focus {
	background: var(--bd-white);
	color: var(--bd-black);
}
.bd-theme .bd-wish:hover .bd-icon {
	transform: scale(1.12);
	fill: var(--bd-gold-soft);
}
.bd-theme .bd-wish:active {
	transform: scale(0.92);
}
/* Saved: gold heart with a black outline (matches the product card). */
.bd-theme .bd-wish.is-active,
.bd-theme .bd-wish[aria-pressed="true"] {
	color: var(--bd-black);
}
.bd-theme .bd-wish.is-active .bd-icon,
.bd-theme .bd-wish[aria-pressed="true"] .bd-icon,
.bd-theme .bd-wish.is-active:hover .bd-icon,
.bd-theme .bd-wish[aria-pressed="true"]:hover .bd-icon {
	fill: var(--bd-gold);
}
/* Any other wishlist toggle (e.g. a text button on the product page) fills its heart when active. */
[data-bd-wish].is-active .bd-icon--heart,
[data-bd-wish][aria-pressed="true"] .bd-icon--heart {
	fill: var(--bd-gold);
}

/* Pop + gold ring when saved */
.bd-wish::after {
	content: "";
	position: absolute;
	inset: -2px;
	border: 2px solid var(--bd-gold);
	border-radius: inherit;
	opacity: 0;
	transform: scale(0.7);
	pointer-events: none;
}
.bd-wish.is-popping .bd-icon {
	animation: bd-wishlist-pop 0.5s var(--bd-ease-out);
}
.bd-wish.is-popping::after {
	animation: bd-wishlist-ring 0.6s var(--bd-ease-out);
}
@keyframes bd-wishlist-pop {
	0% { transform: scale(1); }
	30% { transform: scale(1.35); }
	60% { transform: scale(0.9); }
	100% { transform: scale(1); }
}
@keyframes bd-wishlist-ring {
	0% { opacity: 0.9; transform: scale(0.7); }
	100% { opacity: 0; transform: scale(1.55); }
}
@media (pointer: coarse) {
	:where(.bd-wish) {
		width: 44px;
		height: 44px;
	}
}

/* ---------- Toasts ---------- */
.bd-wishtoast > span {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.bd-wishtoast__icon {
	flex: none;
	color: var(--bd-gold);
}
.bd-wishtoast__icon.is-filled {
	fill: currentColor;
}
.bd-toast .bd-toast__action {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	margin-left: 4px;
	padding: 0 0 0 14px;
	border: 0;
	border-left: 1px solid var(--bd-dark-line-2);
	border-radius: 0;
	background: transparent;
	color: var(--bd-gold);
	font: inherit;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.bd-toast .bd-toast__action:hover,
.bd-toast .bd-toast__action:focus {
	background: transparent;
	color: var(--bd-gold-300);
}

/* ---------- Wishlist page ---------- */
/* Restore the container gutter (base.css' `.one-container .container { padding: 0 }` also
   matches #page) and give the page its own vertical rhythm. */
.bd-theme.bd-wishlist-page .site.grid-container {
	padding-left: var(--bd-gutter);
	padding-right: var(--bd-gutter);
}
.bd-theme.bd-wishlist-page .site-main {
	padding-top: clamp(28px, 4vw, 48px);
	padding-bottom: clamp(56px, 7vw, 96px);
}
.bd-wishlist-page .entry-content {
	color: var(--bd-text);
	font-size: var(--bd-fs-base);
	line-height: var(--bd-lh);
}
/* Shield the UI from the long-form prose styles of .entry-content. */
.bd-theme .entry-content .bd-wishlist .bd-chip,
.bd-theme .entry-content .bd-wishlist .bd-link-arrow,
.bd-theme .entry-content .bd-wishlist .bd-btn {
	text-decoration: none;
}
.bd-theme .entry-content .bd-wishlist p {
	margin-bottom: 0;
}
.bd-wishlist {
	--wl-gap-x: 12px;
	--wl-gap-y: 28px;
}
.bd-wishlist__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px 24px;
	margin: 0 0 28px;
	padding: 0 0 20px;
	border-bottom: 1px solid var(--bd-line);
}
.bd-wishlist__count {
	margin: 0;
	font-family: var(--bd-font-display);
	font-size: var(--bd-fs-xl);
	font-weight: 800;
	font-stretch: 108%;
	line-height: 1.1;
	text-transform: uppercase;
	color: var(--bd-text);
}
.bd-theme .entry-content .bd-wishlist .bd-wishlist__hint {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--bd-text-3);
}
.bd-wishlist__actions {
	display: flex;
	align-items: center;
	gap: 8px 24px;
	flex-wrap: wrap;
}
.bd-theme .bd-wishlist__continue {
	color: var(--bd-text);
}
.bd-theme .bd-wishlist__clear {
	border-color: var(--bd-line-2);
}
.bd-theme .bd-wishlist__clear:hover {
	border-color: var(--bd-black);
}

/* Grid of standard product cards */
.bd-theme .bd-wishlist ul.products.bd-wishlist__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wl-gap-y) var(--wl-gap-x);
	margin: 0;
	padding: 0;
	list-style: none;
	transition: opacity var(--bd-dur) var(--bd-ease);
}
.bd-theme .bd-wishlist ul.products.bd-wishlist__grid::before,
.bd-theme .bd-wishlist ul.products.bd-wishlist__grid::after {
	content: none;
	display: none;
}
.bd-theme .bd-wishlist ul.products.bd-wishlist__grid > li.product {
	float: none;
	width: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	transition: opacity 0.3s var(--bd-ease), transform 0.3s var(--bd-ease);
}
.bd-theme .bd-wishlist ul.products.bd-wishlist__grid > li.product.is-leaving {
	opacity: 0;
	transform: scale(0.94);
	pointer-events: none;
}
.bd-wishlist.is-refreshing .bd-wishlist__grid {
	opacity: 0.6;
}

/* Skeleton cards */
.bd-wishlist__skel {
	display: flex;
	flex-direction: column;
	gap: 10px;
	list-style: none;
}
.bd-wishlist__skel-img {
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: var(--bd-r-lg);
}
.bd-wishlist__skel-line {
	display: block;
	width: 80%;
	height: 14px;
}
.bd-wishlist__skel-line--short {
	width: 45%;
}

/* States */
.bd-wishlist__empty,
.bd-wishlist__error {
	display: none;
}
.bd-wishlist[data-state="empty"] .bd-wishlist__bar,
.bd-wishlist[data-state="empty"] .bd-wishlist__grid,
.bd-wishlist[data-state="error"] .bd-wishlist__grid {
	display: none;
}
.bd-wishlist[data-state="loading"] .bd-wishlist__clear {
	visibility: hidden;
}
.bd-wishlist[data-state="empty"] .bd-wishlist__empty {
	display: flex;
}
.bd-wishlist[data-state="error"] .bd-wishlist__error {
	display: flex;
}

/* Empty state */
.bd-wishlist__empty {
	position: relative;
	flex-direction: column;
	align-items: center;
	overflow: hidden;
	padding: clamp(44px, 7vw, 80px) 20px;
	border-radius: var(--bd-r-xl);
	background: var(--bd-paper);
	text-align: center;
	animation: bd-toast-in 0.4s var(--bd-ease-out);
}
.bd-wishlist__empty-icon {
	position: relative;
	display: grid;
	place-items: center;
	width: 88px;
	height: 88px;
	margin-bottom: 28px;
	border-radius: 50%;
	background: var(--bd-black);
	color: var(--bd-gold);
	box-shadow: 0 0 0 10px var(--bd-gold-soft);
}
.bd-wishlist__empty-icon::after {
	content: "";
	position: absolute;
	right: -8px;
	bottom: 10px;
	width: 28px;
	height: 5px;
	border-radius: 1px;
	background: var(--bd-gold);
	transform: skewX(-30deg);
}
.bd-theme .bd-wishlist .bd-wishlist__empty-title {
	margin: 0 0 12px;
	font-size: var(--bd-fs-2xl);
	font-weight: 800;
	font-stretch: 108%;
	line-height: 1.05;
	text-transform: uppercase;
	color: var(--bd-text);
}
.bd-theme .entry-content .bd-wishlist .bd-wishlist__empty-text {
	max-width: 480px;
	margin: 0 0 28px;
	font-size: 15.5px;
	line-height: 1.65;
	color: var(--bd-text-2);
}
.bd-wishlist__empty .bd-emptychips {
	max-width: 640px;
	margin-top: 36px;
}

/* Error state */
.bd-wishlist__error {
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 40px 20px;
	border: 1px solid var(--bd-line);
	border-radius: var(--bd-r-lg);
	text-align: center;
}
.bd-wishlist__error p,
.bd-wishlist__noscript {
	margin: 0;
	color: var(--bd-text-2);
}

/* "New arrivals" rail under the list */
.bd-wishlist-more {
	margin-top: clamp(48px, 6vw, 80px);
	padding-top: clamp(40px, 5vw, 64px);
	border-top: 1px solid var(--bd-line);
}

@media (min-width: 768px) {
	.bd-wishlist {
		--wl-gap-x: 20px;
		--wl-gap-y: 36px;
	}
	.bd-theme .bd-wishlist ul.products.bd-wishlist__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (min-width: 1024px) {
	.bd-wishlist {
		--wl-gap-x: 24px;
		--wl-gap-y: 44px;
	}
	.bd-theme .bd-wishlist ul.products.bd-wishlist__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}
@media (max-width: 767px) {
	.bd-wishlist__bar {
		align-items: flex-end;
	}
	.bd-wishlist__count {
		font-size: var(--bd-fs-lg);
	}
	.bd-wishlist__continue {
		display: none;
	}
	.bd-wishlist__empty {
		padding-left: 16px;
		padding-right: 16px;
		border-radius: var(--bd-r-lg);
	}
}
