/* ==========================================================================
   SAS permanent site fixes (Issue Log, Nov 2026) — see inc/sas-site-fixes.php
   Neutral colours here; the Christmas stylesheet recolours them in season.
   ========================================================================== */

body {
	--sas-btn: #2b2420;
	--sas-btn-ink: #fff;
	--sas-btn-hover: #bba195;
	--sas-wish-on: #b3263a;
}

/* ---------- Search: always-open bar in the desktop header ---------- */
@media (min-width: 768px) {
	header .header-v6 .search-wrapper { padding-right: 24px; }
	header .header-v6 .search-wrapper .toggle-search { visibility: hidden; }
	header .header-v6 .ts-search-by-category,
	header .header-v6 .search-wrapper.active .ts-search-by-category {
		left: 0;
		right: 24px;
		max-width: 380px;
		visibility: visible;
		transition: none;
	}
	header .header-v6 .ts-search-by-category input[type="text"] {
		height: 46px;
		padding: 0 52px 0 18px;
		border: 1px solid #cbbfae;
		border-radius: 999px;
		background: #fff;
		font-size: 15px;
		box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
	}
	header .header-v6 .ts-search-by-category input[type="text"]:focus { border-color: var(--sas-btn); }
	header .header-v6 .ts-search-by-category .search-button input {
		top: 4px;
		right: 6px;
		opacity: .75;
	}
}

/* ---------- Search dropdown: last result was cropped ----------
 * Each result floats its thumbnail (left) and price (right) but nothing
 * cleared them, so rows were shorter than their content and the dropdown's
 * white box (ul::before) ended above the last result's image and price. */
#ts-search-result-container ul li { display: flow-root; }
/* products with no short description: theme prints "..." (flagged by sas-search.js) */
#ts-search-result-container ul li .description.sas-empty { display: none; }
/* price on its own line under the name (an older rule floated it right,
   which put it beside the title once the "..." line was gone) */
#ts-search-result-container ul li .meta .price {
	float: none !important;
	display: block;
	margin: 6px 0 0 !important;
	padding-left: 0 !important;
}

/* ---------- #2 Add-to-cart button on product cards ----------
 * Larger, solid button + wishlist heart. Still revealed on hover only,
 * using the parent theme's fade + slide-in (opacity 0 → 1, right -5px → 10px). */
.woocommerce .product .thumbnail-wrapper .product-group-button {
	top: 10px;
	width: 44px;
	transition: opacity .3s, right 400ms;
}
.woocommerce .product .thumbnail-wrapper:hover .product-group-button,
.woocommerce .product .thumbnail-wrapper:focus-within .product-group-button {
	opacity: 1;
	z-index: 6;
	right: 10px;
}
.woocommerce .product .thumbnail-wrapper .product-group-button > div,
.woocommerce .product .thumbnail-wrapper .product-group-button > div a {
	width: 44px;
	height: 44px;
	line-height: 44px;
}
.woocommerce .product .thumbnail-wrapper .product-group-button > div { margin-bottom: 8px; }
.woocommerce .product .thumbnail-wrapper .product-group-button .loop-add-to-cart a {
	border-radius: 50%;
	background: var(--sas-btn) !important;
	color: var(--sas-btn-ink) !important;
	border: 0 !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
	transition: background .2s, transform .2s;
}
.woocommerce .product .thumbnail-wrapper .product-group-button .loop-add-to-cart a:hover {
	background: var(--sas-btn-hover) !important;
	transform: scale(1.06);
}
.woocommerce .product .thumbnail-wrapper .product-group-button .loop-add-to-cart a:first-child:before,
.woocommerce .product .product-wrapper .thumbnail-wrapper .loop-add-to-cart a.added:first-child:before {
	font-size: 21px;
	line-height: 44px;
	font-weight: 600;
}
/* hide the hover-only tooltip on touch screens */
@media (hover: none) {
	.product-group-button .button-tooltip { display: none !important; }
}

/* ---------- #4 Wishlist heart on product cards ---------- */
.product-group-button .sas-loop-wishlist { background: none !important; }
.product-group-button .sas-loop-wishlist .yith-wcwl-add-to-wishlist { margin: 0; }
.product-group-button .sas-loop-wishlist .yith-wcwl-add-button,
.product-group-button .sas-loop-wishlist .yith-wcwl-wishlistexistsbrowse,
.product-group-button .sas-loop-wishlist .yith-wcwl-wishlistaddedbrowse { display: block; margin: 0; }
.product-group-button .sas-loop-wishlist a {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 44px !important;
	height: 44px !important;
	padding: 0 !important;
	border-radius: 50%;
	background: #fff !important;
	color: var(--sas-btn) !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .14);
	font-size: 0 !important;
	line-height: 0 !important;
}
.product-group-button .sas-loop-wishlist a:hover { color: var(--sas-btn-hover) !important; }
.product-group-button .sas-loop-wishlist a::before { content: none !important; }
.product-group-button .sas-loop-wishlist svg,
.product-group-button .sas-loop-wishlist img,
.product-group-button .sas-loop-wishlist i {
	width: 21px !important;
	height: 21px !important;
	margin: 0 !important;
	font-size: 19px !important;
	line-height: 1 !important;
	color: inherit;
	border: 0 !important; /* theme puts a border + 10px padding on svg/img inside cards */
	padding: 0 !important;
	box-sizing: content-box !important;
	stroke-width: 2px;
}
.product-group-button .sas-loop-wishlist span,
.product-group-button .sas-loop-wishlist .feedback,
.product-group-button .sas-loop-wishlist .separator,
.product-group-button .sas-loop-wishlist .view-wishlist,
.product-group-button .sas-loop-wishlist .yith-wcwl-add-to-wishlist__feedback { display: none !important; }

/* In the wishlist (just added, or already there on page load): YITH swaps the
 * button for a "Browse wishlist" link and puts a filled heart in .feedback,
 * which the rule above hid, leaving an empty circle. Show that heart, filled,
 * on top of the circle; taps go through to the link (opens the wishlist). */
.product-group-button .sas-loop-wishlist .yith-wcwl-wishlistaddedbrowse,
.product-group-button .sas-loop-wishlist .yith-wcwl-wishlistexistsbrowse {
	position: relative;
	width: 44px;
	height: 44px;
}
.product-group-button .sas-loop-wishlist .yith-wcwl-wishlistaddedbrowse .feedback,
.product-group-button .sas-loop-wishlist .yith-wcwl-wishlistexistsbrowse .feedback {
	display: flex !important;
	align-items: center;
	justify-content: center;
	position: absolute;
	inset: 0;
	z-index: 2;
	margin: 0 !important;
	font-size: 0 !important;
	pointer-events: none;
	color: var(--sas-wish-on);
}
.product-group-button .sas-loop-wishlist .yith-wcwl-wishlistaddedbrowse .feedback svg,
.product-group-button .sas-loop-wishlist .yith-wcwl-wishlistexistsbrowse .feedback svg {
	display: block !important;
	color: inherit;
	fill: currentColor;
	stroke: currentColor;
}
.product-group-button .sas-loop-wishlist .feedback svg path { fill: currentColor; }
/* a short "pop" when the heart fills */
.product-group-button .sas-loop-wishlist .yith-wcwl-wishlistaddedbrowse .feedback svg { animation: sas-heart-pop .45s ease-out; }
@keyframes sas-heart-pop {
	0% { transform: scale(.4); }
	60% { transform: scale(1.25); }
	100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
	.product-group-button .sas-loop-wishlist .feedback svg { animation: none !important; }
}
/* while YITH saves, its square grey overlay covers the button: keep it round and light */
.product-group-button .sas-loop-wishlist .blockUI.blockOverlay {
	border-radius: 50%;
	background: rgba(255, 255, 255, .6) !important;
	opacity: 1 !important;
}

/* Phones & tablets (≤1229px): the theme hides the whole hover button group
 * (there is no hover), which took the heart with it. Show just the heart,
 * always visible, in the photo's top-right corner; the cart button under
 * the card stays as it is. */
@media only screen and (max-width: 1229px), only screen and (max-device-width: 1229px) {
	.woocommerce .product .thumbnail-wrapper .product-group-button {
		display: block !important;
		opacity: 1;
		top: 8px;
		right: 8px;
		bottom: auto;
		width: 38px;
		height: auto;
		z-index: 6;
		transition: none;
	}
	.woocommerce .product .thumbnail-wrapper .product-group-button > div:not(.sas-loop-wishlist) { display: none !important; }
	.woocommerce .product .thumbnail-wrapper .product-group-button > div.sas-loop-wishlist { margin: 0; }
	.product-group-button .sas-loop-wishlist a,
	.product-group-button .sas-loop-wishlist .yith-wcwl-wishlistaddedbrowse,
	.product-group-button .sas-loop-wishlist .yith-wcwl-wishlistexistsbrowse,
	.woocommerce .product .thumbnail-wrapper .product-group-button > div.sas-loop-wishlist {
		width: 38px !important;
		height: 38px !important;
		line-height: 38px;
	}
	.product-group-button .sas-loop-wishlist svg { width: 19px !important; height: 19px !important; }
	/* the theme hides the group while the photo lazy-loads; keep the heart */
	.thumbnail-wrapper.lazy-loading .product-group-button { display: block !important; }
}

/* ---------- #3 Wishlist on mobile ---------- */
.sas-m-wishlist {
	display: none;
	float: left; /* sits before the cart in the mobile top bar */
	width: 34px;
	height: 34px;
	margin: -2px 6px 0 0;
	padding: 6px;
	color: inherit;
}
.sas-m-wishlist svg { width: 22px; height: 22px; display: block; }

/* Wishlist count badge on the header links (assets/js/sas-wishlist-count.js) */
.sas-wl-link { position: relative; }
.sas-wl-count {
	display: inline-block;
	min-width: 18px;
	height: 18px;
	margin-left: 5px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--sas-wish-on);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	line-height: 18px;
	text-align: center;
	vertical-align: 1px;
	letter-spacing: 0;
}
.sas-wl-count.is-empty,
.sas-wl-count:empty { display: none; }
/* mobile heart: badge on its top-right corner */
.sas-m-wishlist .sas-wl-count {
	position: absolute;
	top: -2px;
	right: -4px;
	margin: 0;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	font-size: 10px;
	line-height: 16px;
	box-shadow: 0 0 0 2px var(--sas-badge-ring, #fff);
}
@media (max-width: 767px) {
	.header-top .sas-m-wishlist { display: inline-block; }

	/* product page: "Product added! Browse wishlist" ran off the screen */
	div.product .summary .yith-wcwl-add-to-wishlist {
		float: none !important;
		clear: both;
		display: block;
		width: 100%;
		max-width: 100%;
		margin: 14px 0 0 !important;
		position: static !important;
	}
	div.product .summary .yith-wcwl-add-to-wishlist * {
		white-space: normal !important;
		max-width: 100%;
	}
	div.product .summary .yith-wcwl-add-to-wishlist a,
	div.product .summary .yith-wcwl-add-to-wishlist .feedback {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		flex-wrap: wrap;
	}
}

/* ---------- #6 Carousel arrows (related / upsell products) ---------- */
.related .owl-nav > div,
.upsells .owl-nav > div,
.cross-sells .owl-nav > div {
	position: relative;
	width: 34px !important;
	height: 34px !important;
	margin-left: 6px;
	border: 1px solid #d6d6d6 !important;
	border-radius: 50% !important;
	background: #fff !important;
	color: #2b2420 !important;
	font-size: 0 !important;
	cursor: pointer;
	transition: background .2s, color .2s, border-color .2s;
}
.related .owl-nav > div::before,
.related .owl-nav > button::before,
.upsells .owl-nav > div::before,
.cross-sells .owl-nav > div::before {
	content: "" !important;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: translate(-70%, -50%) rotate(45deg);
}
.related .owl-nav > .owl-prev::before,
.related .owl-nav > button.owl-prev::before,
.upsells .owl-nav > .owl-prev::before,
.cross-sells .owl-nav > .owl-prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
/* dark hover only where there is real hover: on phones a tapped arrow kept it */
@media (hover: hover) {
	.related .owl-nav > div:hover,
	.upsells .owl-nav > div:hover,
	.cross-sells .owl-nav > div:hover {
		background: var(--sas-btn) !important;
		border-color: var(--sas-btn) !important;
		color: #fff !important;
	}
}
/* The related-products plugin (WebToffee) can print its own arrow styles
 * (absolute, 30% down, 11px past the right edge, dark hover), which on
 * phones pushed a dark arrow half off the screen. Ours win everywhere. */
.single-product .related .owl-nav > div,
.single-product .related .owl-nav > button,
.single-product .upsells .owl-nav > div {
	position: relative !important;
	top: auto !important;
	right: auto !important;
	left: auto !important;
	margin-top: 0 !important;
	padding: 0 !important;
	background-color: #fff;
	z-index: 2;
}
.single-product .related .owl-nav > button { font-size: 0 !important; width: 34px; height: 34px; border: 1px solid #d6d6d6 !important; border-radius: 50%; }
.single-product .related .owl-nav i,
.single-product .related .owl-nav .dashicons { display: none !important; }
/* phones: arrows centred under the carousel, clear of the heading and the screen edge */
@media (max-width: 767px) {
	.single-product .related .owl-controls,
	.single-product .related .owl-nav,
	.single-product .upsells .owl-controls,
	.single-product .upsells .owl-nav {
		position: static !important;
		display: flex !important;
		justify-content: center;
		gap: 12px;
		margin: 16px 0 0 !important;
		width: 100% !important;
		top: auto !important;
		right: auto !important;
	}
	.single-product .related .owl-nav > div,
	.single-product .related .owl-nav > button,
	.single-product .upsells .owl-nav > div {
		width: 40px !important;
		height: 40px !important;
		margin: 0 !important;
	}
}
.related .owl-nav > div.disabled,
.upsells .owl-nav > div.disabled,
.cross-sells .owl-nav > div.disabled { opacity: .35; cursor: default; }

/* ---------- #7 Category box on shop pages ---------- */
/* custom CSS made the sidebar titles white (left over from an old amber
   background), so "Categories" was invisible — the "empty box" */
#left-sidebar .widget-title,
#right-sidebar .widget-title { color: var(--sas-btn) !important; }
@media (max-width: 767px) {
	#left-sidebar .ts-product-categories-widget .widget-title-wrapper,
	#right-sidebar .ts-product-categories-widget .widget-title-wrapper {
		position: relative;
		margin-bottom: 0;
	}
	#left-sidebar .ts-product-categories-widget .widget-title,
	#right-sidebar .ts-product-categories-widget .widget-title {
		margin: 0;
		padding: 14px 44px 14px 16px;
		font-size: 15px;
		line-height: 1.3;
		letter-spacing: .06em;
		text-transform: uppercase;
	}
	#left-sidebar .widget-container,
	#right-sidebar .widget-container { margin-bottom: 24px; }
}
