/* ==========================================================================
   Site search panel + results page (preview, 2026-10-19 round 2).
   Markup: assets/js/features/site-search.js (panel), inc/features/site-search.php (results page).
   Look: like the new header/menu: #3f573e headings, small grey caps labels, line icons, no Font Awesome.
   ========================================================================== */

/* 1. Panel frame */
.swp-sp-form {
	position: relative;
}
/* Desktop: never taller than the window (max-height set by the script from the box position); only the
   columns scroll, the "See all results" bar stays put. The page behind never scrolls (overscroll contained). */
.swp-sp {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 140px);
	overflow: hidden;
	overscroll-behavior: contain;
	background: #fff;
	border: 1px solid #e1e6df;
	box-shadow: 0 12px 32px rgba(47, 63, 46, .14);
	text-align: left;
}
.swp-sp[hidden] {
	display: none;
}
/* Desktop: Products wide on the left (first), Suggestions / Categories / Pages & guides on the right */
.swp-sp-cols {
	display: grid;
	flex: 1 1 auto;
	min-height: 0;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	grid-template-rows: minmax(0, 1fr);
}
.swp-sp-cols.is-single {
	grid-template-columns: minmax(0, 1fr);
}
.swp-sp-main,
.swp-sp-side {
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: #c9d2c6 transparent;
}
.swp-sp-main::-webkit-scrollbar,
.swp-sp-side::-webkit-scrollbar {
	width: 6px;
}
.swp-sp-main::-webkit-scrollbar-thumb,
.swp-sp-side::-webkit-scrollbar-thumb {
	background: #c9d2c6;
	border-radius: 3px;
}
.swp-sp-main {
	position: relative;
	padding: 18px 20px 0;
}
.swp-sp-side {
	padding: 18px 20px 10px;
	border-left: 1px solid #eef1ec;
	background: #fafbf9;
}
/* Soft fade at the bottom of the products column while there is more below */
.swp-sp-fade {
	position: sticky;
	bottom: 0;
	height: 36px;
	margin: -36px -20px 0;
	background: linear-gradient(rgba(255, 255, 255, 0), #fff);
	pointer-events: none;
	opacity: 0;
	transition: opacity .15s;
}
.swp-sp-fade.is-on {
	opacity: 1;
}
.swp-sp-count {
	letter-spacing: normal;
}
.swp-sp-item.is-later {
	display: none;
}
/* End of the products list: "See all N results" (desktop) / "Show more products" (phones) */
.swp-sp-endall {
	margin: 14px -8px 14px;
	padding: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #3f573e;
}
.swp-sp-more {
	justify-content: center;
	margin: 14px 0 6px;
	padding: 10px 12px;
	border: 1px solid #3f573e;
	font-size: 15px;
	font-weight: 600;
	color: #3f573e;
}
.swp-sp-endall:hover,
.swp-sp-endall.is-active,
.swp-sp-more:hover,
.swp-sp-more.is-active {
	background: #eef3ec;
}
.swp-sp-cols.is-single .swp-sp-side {
	border-left: 0;
	background: #fff;
}
/* Phones: one column (Products first; a best bet goes above them) */
.swp-sp-stack {
	padding: 14px 14px 4px;
}

/* 2. Sections and labels */
.swp-sp-sec {
	margin-bottom: 14px;
}
.swp-sp-label {
	margin: 0 0 6px;
	font-size: 11px;
	line-height: 1.3;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: #8a9387;
}
.swp-sp-item {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #2f3f2e;
	text-decoration: none;
	outline: none;
}
.swp-sp-item svg {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	fill: none;
	stroke: #3f573e;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.swp-sp-item strong {
	font-weight: 700;
	color: #3f573e;
}

/* Suggestions + pages: rows */
.swp-sp-row {
	padding: 7px 8px;
	margin: 0 -8px;
	font-size: 15px;
	line-height: 1.3;
}
.swp-sp-sug .swp-sp-row {
	font-weight: 600;
	color: #3f573e;
}
.swp-sp-row em {
	margin-left: auto;
	font-style: normal;
	font-size: 10px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #8a9387;
}

/* Categories: chips */
.swp-sp-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.swp-sp-chip {
	display: inline-flex;
	padding: 6px 11px;
	border: 1px solid #c9d2c6;
	font-size: 14px;
	line-height: 1.2;
}
.swp-sp-chip small {
	color: #8a9387;
	font-size: 12px;
}

/* Products: 4×2 grid of small thumbnails */
.swp-sp-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px 10px;
}
.swp-sp-prod {
	flex-direction: column;
	align-items: stretch;
	gap: 5px;
	padding: 4px;
	margin: -4px;
}
.swp-sp-prod img,
.swp-sp-noimg {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 5 / 6;
	object-fit: cover;
	background: #eef1ec;
}
.swp-sp-name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.3;
}
/* Product tile names in the product cards' colour (base.css section 28; Jay, 2026-10-20): #555555 7.46:1 on white;
   hovered or arrow-key selected: underline only. The matched words (strong) follow the name's colour. */
.swp-sp-prod .swp-sp-name,
.swp-sp-prod .swp-sp-name strong {
	color: #555555;
}
.swp-sp-prod:hover .swp-sp-name,
.swp-sp-prod.is-active .swp-sp-name {
	text-decoration: underline;
	text-underline-offset: 2px;
}
.swp-sp-price {
	font-size: 12px;
	color: #6f7a6c;
}
.swp-sp-price .amount {
	color: #6f7a6c;
}

/* Footer: see all results */
.swp-sp-foot {
	flex: none;
	padding: 10px 20px 12px;
	border-top: 1px solid #eef1ec;
}
.swp-sp-all {
	font-size: 14px;
	font-weight: 600;
	color: #3f573e;
}
.swp-sp-empty {
	margin: 0;
	padding: 16px 20px 6px;
	color: #6f7a6c;
}

/* 3. Hover / keyboard focus */
.swp-sp-row:hover,
.swp-sp-row.is-active,
.swp-sp-all:hover,
.swp-sp-all.is-active {
	background: #eef3ec;
}
.swp-sp-chip:hover,
.swp-sp-chip.is-active {
	border-color: #3f573e;
	background: #eef3ec;
}
.swp-sp-prod:hover,
.swp-sp-prod.is-active {
	background: #fff;
	box-shadow: 0 0 0 2px #3f573e;
}
.swp-sp-loading .search-field {
	background-image: none;
}

/* 4. Phones: in the menu's flow, sections stacked, products in two columns */
@media (max-width: 849px) {
	.swp-sp {
		position: static;
		display: block;
		width: auto;
		max-height: none;
		overflow: visible;
		margin-top: 8px;
		box-shadow: none;
	}
	.swp-sp-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.swp-sp-foot {
		padding: 10px 14px 12px;
	}
}

/* 5. Results page: a best bet above the products; categories and pages under them */
.swp-ss-results {
	padding-top: 20px;
}
.swp-ss-results--after {
	padding-top: 10px;
	padding-bottom: 20px;
	border-top: 1px solid #eef1ec;
}
.swp-ss-sug,
.swp-sp-chips,
.swp-ss-pages {
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
}
.swp-ss-results .swp-sp-chips li {
	margin: 0;
}
.swp-ss-results .swp-sp-chips a {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #c9d2c6;
	color: #2f3f2e;
}
.swp-ss-results .swp-sp-chips a span,
.swp-ss-pages span {
	color: #8a9387;
	font-size: .85em;
}
.swp-ss-sug li,
.swp-ss-pages li {
	margin: 0 0 6px;
}
.swp-ss-sug a {
	font-weight: 600;
	color: #3f573e;
}
.swp-ss-pages a {
	color: #2f3f2e;
	text-decoration: underline;
}

