/* ==========================================================================
   Live product search (header)
   ========================================================================== */

.hsearchbox {
	margin-top: 15px;
}

.wbo-search {
	--wbo-s-green: #00893e;
	--wbo-s-green-dark: #006f32;
	--wbo-s-glow: #bfe6cd;
	--wbo-s-navy: #1f3a26;
	--wbo-s-line: #e6e8ec;
	position: relative;
	width: 100%;
	max-width: 560px;
	margin: 0 auto;
	text-align: left;
	font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.wbo-search__form {
	display: flex;
	align-items: stretch;
	margin: 0;
	padding: 3px;
	background: var(--wbo-s-glow);
	border-radius: 12px;
	transition: box-shadow .15s ease;
}

.wbo-search__field {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
}

.hsearchbox .wbo-search input#searchbox,
.wbo-search .wbo-search__input {
	display: block;
	width: 100%;
	max-width: none;
	height: 46px;
	margin: 0;
	padding: 0 42px 0 16px;
	font-size: 16px;
	line-height: 46px;
	color: var(--wbo-s-navy);
	background: #fff;
	border: 0;
	border-radius: 10px 0 0 10px;
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.wbo-search__input::-webkit-search-cancel-button,
.wbo-search__input::-webkit-search-decoration {
	-webkit-appearance: none;
}

.wbo-search__input::placeholder {
	color: #6b6f80;
	opacity: 1;
}

.wbo-search__form:focus-within {
	box-shadow: 0 0 0 2px var(--wbo-s-green);
}

.wbo-search__clear {
	position: absolute;
	top: 50%;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	color: #3b3b3b;
	background: transparent;
	border: 0;
	border-radius: 50%;
	transform: translateY(-50%);
	cursor: pointer;
}

.wbo-search__clear[hidden] {
	display: none;
}

.wbo-search__clear:hover,
.wbo-search__clear:focus-visible {
	background: #f1f2f4;
}

.wbo-search__submit {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 8px;
	height: 46px;
	margin: 0;
	padding: 0 20px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	background: var(--wbo-s-green);
	border: 0;
	border-radius: 0 10px 10px 0;
	cursor: pointer;
	transition: background-color .15s ease;
}

.wbo-search__submit:hover,
.wbo-search__submit:focus-visible {
	background: var(--wbo-s-green-dark);
}

.wbo-search.is-loading .wbo-search__submit svg {
	animation: wbo-search-pulse .8s ease-in-out infinite alternate;
}

@keyframes wbo-search-pulse {
	to { opacity: .35; }
}

/* Dropdown panel */
.wbo-search__panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 50%;
	z-index: 1002;
	width: max(100%, 620px);
	max-width: calc(100vw - 24px);
	max-height: min(75vh, 720px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	border-radius: 0 0 14px 14px;
	box-shadow: 0 18px 40px rgba(20, 20, 40, .22);
	transform: translateX(-50%);
}

.wbo-search__panel[hidden] {
	display: none;
}

.wbo-search__panel ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wbo-search__panel li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wbo-search__panel li::before {
	display: none;
}

.wbo-search__terms {
	padding: 6px 0;
}

.wbo-search__term {
	display: block;
	padding: 13px 22px;
	font-size: 16px;
	color: var(--wbo-s-navy);
	text-decoration: none;
}

.wbo-search__term strong {
	font-weight: 700;
}

.wbo-search__heading {
	margin: 0;
	padding: 12px 22px;
	font-size: 14px;
	color: var(--wbo-s-navy);
	background: #f4f5f7;
}

.wbo-search__product {
	display: grid;
	grid-template-columns: 100px 1fr auto;
	gap: 18px;
	align-items: start;
	padding: 16px 22px 16px 10px;
	color: var(--wbo-s-navy);
	text-decoration: none;
	border-bottom: 1px solid var(--wbo-s-line);
}

.wbo-search__products li:last-child .wbo-search__product {
	border-bottom: 0;
}

.wbo-search__thumb {
	display: block;
	width: 100px;
	aspect-ratio: 1;
	overflow: hidden;
	background: #fff;
	border-radius: 6px;
}

.wbo-search__thumb img,
.col-1-3.logo .wbo-search__thumb img {
	display: block;
	width: 100% !important;
	max-width: none !important;
	height: 100%;
	margin: 0 !important;
	object-fit: contain;
}

.wbo-search__name {
	padding-top: 4px;
	font-size: 15px;
	line-height: 1.45;
}

.wbo-search__name strong {
	font-weight: 700;
}

.wbo-search__price {
	padding-top: 2px;
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
	text-align: right;
}

.wbo-search__price del {
	display: block;
	font-size: 13px;
	font-weight: 400;
	color: #6b6f80;
}

.wbo-search__price ins {
	text-decoration: none;
}

.wbo-search__price .woocommerce-price-suffix,
.wbo-search__price small {
	display: none;
}

.wbo-search__all {
	display: block;
	padding: 15px 22px;
	font-size: 15px;
	font-weight: 700;
	color: var(--wbo-s-green);
	text-align: center;
	text-decoration: none;
	border-top: 1px solid var(--wbo-s-line);
}

.wbo-search__item.is-active,
.wbo-search__item:focus-visible {
	background: #eef7f1;
	outline: none;
}

.wbo-search__empty {
	padding: 20px 22px;
	color: var(--wbo-s-navy);
}

.wbo-search__empty p {
	margin: 0 0 6px;
}

/* Page dim while the search box is in use */
.wbo-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	background: rgba(15, 15, 30, .55);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .15s ease, visibility .15s ease;
}

body.wbo-search-active .wbo-search-overlay {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Only the search box sits above the dim (same stacking context as the
   overlay, so no header z-index is needed). The header grid must not clip
   the dropdown. */
header#masthead .grid,
header#masthead .site-branding,
header#masthead .col-1-3.logo,
header#masthead .hsearchbox {
	overflow: visible !important;
}

body.wbo-search-active .wbo-search {
	z-index: 1001;
}

/* Small screens */
@media (max-width: 767px) {
	.wbo-search__submit span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.wbo-search__submit {
		padding: 0 16px;
	}

	.wbo-search__panel {
		left: 0;
		right: 0;
		width: auto;
		max-width: none;
		max-height: 70vh;
		border-radius: 0 0 12px 12px;
		transform: none;
	}

	.wbo-search__product {
		grid-template-columns: 64px 1fr;
		gap: 12px;
	}

	.wbo-search__thumb {
		width: 64px;
		grid-row: span 2;
	}

	.wbo-search__price {
		font-size: 16px;
		text-align: left;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wbo-search-overlay,
	.wbo-search__form,
	.wbo-search__submit {
		transition: none;
	}

	.wbo-search.is-loading .wbo-search__submit svg {
		animation: none;
	}
}
