/* ==========================================================================
   Nordparts wishlist
   Heart toggle (card + single), header badge, wishlist page grid.
   Loaded site-wide. Kept out of style.css on purpose.
   ========================================================================== */

/* ---------- heart toggle button ---------- */
.wishlist-toggle {
	background: transparent;
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	line-height: 1;
	color: #98a1ab;
	transition: color .15s ease, transform .15s ease;
	-webkit-appearance: none;
	appearance: none;
}
.wishlist-toggle i { pointer-events: none; }
.wishlist-toggle:hover { color: #E82020; }
.wishlist-toggle:active { transform: scale(.88); }
.wishlist-toggle.is-active { color: #E82020; }

/* heart sitting over the product image on catalog cards */
ul.products > li { position: relative; }
.wishlist-toggle--card {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(46, 65, 88, .18);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
}
.wishlist-toggle--card:hover { background: #fff; }

/* on the wishlist page the corner control is a "remove": show an × that reads
   as delete — neutral by default, red on hover. */
.wishlist-toggle--remove.is-active { color: #6b7480; }
.wishlist-toggle--remove i { font-size: 18px; }
.wishlist-toggle--remove:hover,
.wishlist-toggle--remove.is-active:hover { color: #E82020; }
.wishlist-toggle--remove:hover { box-shadow: 0 3px 10px rgba(232, 32, 32, .22); }

/* heart used as a labelled button on the single product page */
.wishlist-toggle--single {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	font-family: 'Rubik', sans-serif;
	font-size: 14px;
	font-weight: 500;
	color: #D77A2C; /* soft, not-bright orange so it's noticeable without shouting */
	transition: color .15s ease;
}
.wishlist-toggle--single i { font-size: 18px; color: #D77A2C; transition: color .15s ease; }
.wishlist-toggle--single:hover,
.wishlist-toggle--single.is-active { color: #E82020; }
.wishlist-toggle--single:hover i,
.wishlist-toggle--single.is-active i { color: #E82020; }
.wishlist-toggle--single .wishlist-label-remove { display: none; }
.wishlist-toggle--single.is-active .wishlist-label-add { display: none; }
.wishlist-toggle--single.is-active .wishlist-label-remove { display: inline; }

/* ---------- header heart + count badge ---------- */
.wishlist-li .wishlist-link {
	position: relative;
	display: inline-block;
	color: inherit;
	font-size: 20px;
	line-height: 1;
}
.wishlist-li .wishlist-link:hover { color: #E82020; }
.wishlist-count {
	background: #E82020;
	border-radius: 50%;
	box-shadow: 0 8px 14px 0 rgba(253, 193, 0, .3);
	color: #fff;
	font-size: 12px;
	width: 18px;
	height: 18px;
	line-height: 18px;
	text-align: center;
	position: absolute;
	top: -10px;
	left: 14px;
	display: none;
}
.wishlist-count.has-items { display: inline-block; }

/* ---------- wishlist page ---------- */
#wishlist-app { min-height: 200px; }

.wishlist-empty {
	text-align: center;
	padding: 60px 20px;
	font-family: 'Rubik', sans-serif;
	color: #515252;
}
.wishlist-empty p { font-size: 18px; margin-bottom: 20px; }
.wishlist-empty .button {
	display: inline-block;
	background: #2E4158;
	color: #fff;
	padding: 12px 26px;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 500;
}
.wishlist-empty .button:hover { background: #E82020; color: #fff; }

.wishlist-loading { text-align: center; padding: 60px 0; }
.wishlist-spinner {
	display: inline-block;
	width: 38px;
	height: 38px;
	border: 4px solid #e6e9ec;
	border-top-color: #2E4158;
	border-radius: 50%;
	animation: wishlist-spin .8s linear infinite;
}
@keyframes wishlist-spin { to { transform: rotate(360deg); } }

/* grid + cards. The wishlist page does NOT carry the theme's archive inline
   styles, and we deliberately drop the global `.products` class to avoid its
   `li{width:25%;overflow:hidden}` rule clobbering the layout — so everything a
   card needs is defined here, fully scoped to #wishlist-app, with !important on
   the few properties the global stylesheet would otherwise win. */
#wishlist-app .wishlist-grid {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 20px;
}
#wishlist-app .wishlist-grid > li {
	width: auto !important;
	float: none !important;
	margin: 0 !important;
	overflow: visible !important;
	display: flex !important;
	flex-direction: column;
	position: relative;
	border: 1px solid #e6e9ec;
	border-radius: 8px;
	padding: 14px;
	background: #fff;
	text-align: left;
}
/* image sits in a fixed-height box so every card lines up, image never upscaled */
#wishlist-app .wishlist-grid > li > a:first-of-type {
	display: flex !important;
	align-items: center;
	justify-content: center;
	height: 170px;
	margin-bottom: 12px;
}
#wishlist-app .wishlist-grid > li > a:first-of-type img {
	width: auto !important;
	max-width: 100% !important;
	max-height: 170px !important;
	height: auto !important;
	object-fit: contain;
}
#wishlist-app .loop-product { display: flex; flex-direction: column; flex: 1 1 auto; }
#wishlist-app .loop-product .product-title { min-height: 40px; margin: 4px 0 6px; }
#wishlist-app .loop-product .product-title a {
	font-family: 'Rubik', sans-serif;
	color: #2E4158;
	font-weight: 700;
	font-size: 14px;
	line-height: 17px;
	text-decoration: none;
}
#wishlist-app .loop-product .product-sku {
	font-family: 'Rubik', sans-serif;
	font-size: 13px;
	color: #515252;
	margin-bottom: 6px;
}
#wishlist-app .loop-product .product-in-stock { font-size: 12px; line-height: 1.4; margin-bottom: 6px; }
#wishlist-app .loop-product .product-in-stock .green { color: #2e8b57; }
#wishlist-app .loop-product .product-in-stock .red { color: #E82020; }
/* margin-top:auto pushes the price (and the button right after it) to the
   bottom, so price + add-to-cart line up across every card regardless of how
   long the title / stock text above them is. */
#wishlist-app .loop-product .product-price {
	display: block;
	font-family: 'Rubik', sans-serif;
	font-size: 17px;
	color: #2E4158;
	font-weight: 700;
	margin: auto 0 12px;
}
#wishlist-app .loop-product form.cart { margin: 0 !important; padding: 0 !important; }
#wishlist-app .loop-product .add_to_cart_button {
	display: flex !important;
	width: 100%;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #2E4158 !important;
	color: #fff !important;
	border: 0;
	border-radius: 6px;
	padding: 11px 14px !important;
	font-family: 'Rubik', sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
}
#wishlist-app .loop-product .add_to_cart_button:hover { background: #E82020 !important; }
#wishlist-app .loop-product .add_to_cart_button img {
	height: 18px !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	filter: brightness(0) invert(1); /* white icon on dark button */
}

@media (max-width: 600px) {
	#wishlist-app .wishlist-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
	#wishlist-app .wishlist-grid > li { padding: 10px; }
	#wishlist-app .wishlist-grid > li > a:first-of-type { height: 130px; }
	#wishlist-app .wishlist-grid > li > a:first-of-type img { max-height: 130px !important; }
	#wishlist-app .loop-product .product-title { min-height: 34px; }
	#wishlist-app .loop-product .product-title a { font-size: 13px; }
	#wishlist-app .loop-product .add_to_cart_button { font-size: 13px; padding: 10px 8px !important; }
	.wishlist-toggle--card { width: 32px; height: 32px; font-size: 14px; top: 6px; right: 6px; }
}
@media (max-width: 360px) {
	#wishlist-app .loop-product .add_to_cart_button { font-size: 12px; }
}
