/*
 * AI Hybrid Search
 * 1. Search form   2. Suggestions dropdown   3. Results page
 *
 * Everything visual on the form is a CSS variable, so the Elementor controls
 * (or your own CSS) can restyle it without touching the markup:
 *   .hsfm { --hsfm-btn-bg: #e63946; --hsfm-radius: 30px; }
 */

/* ---------- 1. Search form ---------- */

.hsfm {
	--hsfm-w: 100%;
	--hsfm-maxw: 470px;
	--hsfm-h: 58px;
	--hsfm-radius: 6px;
	--hsfm-pad: 0px;
	--hsfm-bg: #f5f5f5;
	--hsfm-text: #111;
	--hsfm-ph: #1c1c1c;
	--hsfm-icon: 24px;
	--hsfm-icon-c: #111;
	--hsfm-btn-bg: #6ab611;
	--hsfm-btn-bg-h: #5da30c;
	--hsfm-btn-c: #0c0c0c;
	--hsfm-btn-c-h: #0c0c0c;
	--hsfm-btn-pad: 0 14px;
	--hsfm-focus: #4a8c00; /* 3:1 or better against both white and black page backgrounds */
	--hsfm-panel-bg: #fff;
	--hsfm-panel-text: #161616;
	--hsfm-panel-muted: #5f6368;
	--hsfm-panel-active: #eef6e2;
	--hsfm-panel-radius: 10px;
	--hsfm-dir: row;
	--hsfm-btn-w: var(--hsfm-btn-width, auto);

	position: relative;
	box-sizing: border-box;
	width: var(--hsfm-w);
	max-width: var(--hsfm-maxw);
	font-size: 17px;
	line-height: 1.3;
	text-align: left;
}

.hsfm *,
.hsfm *::before,
.hsfm *::after {
	box-sizing: border-box;
}

.hsfm .hsfm-form {
	display: flex;
	flex-direction: var(--hsfm-dir);
	align-items: stretch;
	margin: 0;
	padding: var(--hsfm-pad);
	background: var(--hsfm-bg);
	border: 0 solid transparent;
	border-radius: var(--hsfm-radius);
	overflow: hidden;
	transition: box-shadow .15s ease;
}

.hsfm .hsfm-form:focus-within {
	outline: 2px solid var(--hsfm-focus);
	outline-offset: 2px;
}

.hsfm .hsfm-field {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	min-width: 0;
	min-height: var(--hsfm-h);
	padding-left: 24px;
}

.hsfm .hsfm-icon {
	flex: 0 0 auto;
	width: var(--hsfm-icon);
	height: var(--hsfm-icon);
	color: var(--hsfm-icon-c);
}

/* Long selectors on purpose: themes and the Elementor kit style inputs and buttons aggressively. */
.hsfm .hsfm-form .hsfm-field input.hsfm-input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: var(--hsfm-h);
	margin: 0;
	padding: 0 12px 0 22px;
	border: 0;
	border-radius: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: var(--hsfm-text);
	font: inherit;
	text-overflow: ellipsis;
	-webkit-appearance: none;
	appearance: none;
}

.hsfm .hsfm-form .hsfm-field input.hsfm-input::placeholder {
	color: var(--hsfm-ph);
	opacity: 1;
}

.hsfm .hsfm-input::-webkit-search-cancel-button,
.hsfm .hsfm-input::-webkit-search-decoration {
	-webkit-appearance: none;
}

.hsfm .hsfm-form button.hsfm-btn {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: var(--hsfm-btn-w);
	min-height: var(--hsfm-h);
	margin: 0;
	padding: var(--hsfm-btn-pad);
	border: 0;
	border-radius: var(--hsfm-btn-radius, 0);
	background: var(--hsfm-btn-bg);
	box-shadow: none;
	color: var(--hsfm-btn-c);
	font: inherit;
	font-weight: 500;
	letter-spacing: .01em;
	text-transform: uppercase;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

.hsfm .hsfm-form button.hsfm-btn:hover,
.hsfm .hsfm-form button.hsfm-btn:focus-visible {
	background: var(--hsfm-btn-bg-h);
	color: var(--hsfm-btn-c-h);
}

.hsfm .hsfm-form button.hsfm-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -5px;
}

.hsfm .hsfm-btn-icon {
	display: inline-flex;
}

.hsfm .hsfm-btn-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* Loading indicator (inside the field, right-hand side) */
.hsfm .hsfm-spin {
	display: none;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin-right: 14px;
	border: 2px solid rgba(0, 0, 0, .18);
	border-top-color: var(--hsfm-text);
	border-radius: 50%;
	animation: hsfm-spin .6s linear infinite;
}

.hsfm.is-loading .hsfm-spin {
	display: block;
}

/* Validation message */
.hsfm .hsfm-msg {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 9998;
	margin: 0;
	padding: 9px 14px;
	border-radius: 6px;
	background: #1d1d1d;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
}

.hsfm [hidden] {
	display: none !important;
}

.hsfm-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Phones: input on top, full-width button underneath, same container. */
@media (max-width: 600px) {
	.hsfm {
		--hsfm-dir: column;
		--hsfm-btn-w: 100%;
		font-size: 16px; /* 16px stops iOS zooming into the field */
	}
}

/* ---------- 2. Suggestions dropdown ---------- */

.hsfm .hsfm-panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	left: 0;
	z-index: 9999;
	max-height: min(70vh, 460px);
	padding: 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: var(--hsfm-panel-radius);
	background: var(--hsfm-panel-bg);
	box-shadow: 0 14px 36px rgba(0, 0, 0, .22), 0 0 0 1px rgba(0, 0, 0, .06);
	color: var(--hsfm-panel-text);
	font-size: 15px;
	animation: hsfm-in .14s ease-out;
}

.hsfm .hsfm-group-label {
	padding: 10px 12px 4px;
	color: var(--hsfm-panel-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.hsfm .hsfm-panel a.hsfm-option {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 12px;
	border-radius: 6px;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}

.hsfm .hsfm-panel a.hsfm-option:hover,
.hsfm .hsfm-panel a.hsfm-option.is-active {
	background: var(--hsfm-panel-active);
}

.hsfm .hsfm-option img {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 4px;
	object-fit: cover;
	background: #f1f1f1;
}

.hsfm .hsfm-option-text {
	display: block;
	min-width: 0;
}

/* Titles may wrap to two lines: the model number is often at the end. */
.hsfm .hsfm-option-title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.hsfm .hsfm-option-meta {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hsfm .hsfm-option-meta {
	color: var(--hsfm-panel-muted);
	font-size: 13px;
}

.hsfm mark,
.hsfm-results mark {
	padding: 0;
	background: none;
	color: inherit;
	font-weight: 700;
}

.hsfm .hsfm-panel a.hsfm-all {
	justify-content: center;
	margin-top: 4px;
	border-top: 1px solid rgba(0, 0, 0, .08);
	border-radius: 0 0 6px 6px;
	font-weight: 600;
}

.hsfm .hsfm-panel-note {
	margin: 0;
	padding: 10px 12px;
	color: var(--hsfm-panel-muted);
}

.hsfm .hsfm-panel-note strong {
	color: var(--hsfm-panel-text);
}

@keyframes hsfm-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes hsfm-in {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hsfm .hsfm-panel {
		animation: none;
	}

	.hsfm .hsfm-spin {
		animation-duration: 1.6s;
	}

	.hsfm .hsfm-form,
	.hsfm .hsfm-form button.hsfm-btn {
		transition: none;
	}
}

/* ---------- 3. Results page ---------- */

.hsfm-results {
	--hsfm-accent: #6ab611;
	--hsfm-line: rgba(0, 0, 0, .12);
	--hsfm-muted: #5f6368;
}

.hsfm-results,
.hsfm-results *,
.hsfm-results *::before,
.hsfm-results *::after {
	box-sizing: border-box;
}

/* Follow the theme's text colour, so the page also works on dark themes. */
@supports (color: color-mix(in srgb, red, blue)) {
	.hsfm-results {
		--hsfm-line: color-mix(in srgb, currentColor 16%, transparent);
		--hsfm-muted: color-mix(in srgb, currentColor 68%, transparent);
	}
}

.hsfm-results > .hsfm {
	--hsfm-maxw: 560px;
	margin-bottom: 28px;
}

.hsfm-results > .hsfm .hsfm-form {
	border: 1px solid var(--hsfm-line);
}

.hsfm-results .hsfm-head {
	margin-bottom: 20px;
}

.hsfm-results .hsfm-title {
	margin: 0 0 4px;
	font-size: clamp(22px, 3vw, 30px);
	line-height: 1.2;
}

.hsfm-results .hsfm-count,
.hsfm-results .hsfm-note {
	margin: 0 0 4px;
	color: var(--hsfm-muted);
}

.hsfm-results .hsfm-empty {
	max-width: 560px;
	padding: 24px;
	border: 1px solid var(--hsfm-line);
	border-radius: 8px;
}

.hsfm-results .hsfm-empty p {
	margin: 0 0 8px;
}

.hsfm-results .hsfm-empty ul {
	margin: 0;
	padding-left: 20px;
	color: var(--hsfm-muted);
}

.hsfm-results .hsfm-chips ul,
.hsfm-results .hsfm-grid,
.hsfm-results .hsfm-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hsfm-results .hsfm-chips ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.hsfm-results .hsfm-chip {
	display: inline-flex;
	align-items: baseline;
	gap: 8px;
	padding: 7px 14px;
	border: 1px solid var(--hsfm-line);
	border-radius: 999px;
	color: inherit;
	font-size: 15px;
	text-decoration: none;
}

.hsfm-results .hsfm-chip:hover,
.hsfm-results .hsfm-chip:focus-visible {
	border-color: currentColor;
}

.hsfm-results .hsfm-chip small,
.hsfm-results .hsfm-type {
	color: var(--hsfm-muted);
	font-size: 12px;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.hsfm-results .hsfm-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--hsfm-line);
}

.hsfm-results .hsfm-tabs a {
	margin-bottom: -1px;
	padding: 10px 14px;
	border-bottom: 2px solid transparent;
	color: inherit;
	text-decoration: none;
}

.hsfm-results .hsfm-tabs a[aria-current] {
	border-bottom-color: var(--hsfm-accent);
	font-weight: 600;
}

.hsfm-results .hsfm-tabs span {
	color: var(--hsfm-muted);
	font-size: .85em;
}

.hsfm-results .hsfm-section {
	margin-bottom: 40px;
}

.hsfm-results .hsfm-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.hsfm-results .hsfm-bar h3 {
	margin: 0;
	font-size: 20px;
}

.hsfm-results .hsfm-bar h3 span {
	color: var(--hsfm-muted);
	font-weight: 400;
}

.hsfm-results .hsfm-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0;
}

.hsfm-results .hsfm-toolbar label {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 14px;
}

.hsfm-results .hsfm-toolbar select {
	width: auto;
	max-width: 220px;
	min-height: 40px;
	padding: 6px 30px 6px 10px;
	font-size: 14px;
}

.hsfm-results .hsfm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 20px;
}

.hsfm-results .hsfm-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--hsfm-line);
	border-radius: 8px;
	background: #fff;
	color: #161616;
	transition: box-shadow .15s ease, transform .15s ease;
}

.hsfm-results .hsfm-card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
	transform: translateY(-2px);
}

.hsfm-results .hsfm-card-img {
	display: block;
	background: #f4f4f4;
}

.hsfm-results .hsfm-card-img img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.hsfm-results .hsfm-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
	padding: 14px 16px 16px;
}

.hsfm-results .hsfm-card h4,
.hsfm-results .hsfm-item h4 {
	margin: 0;
	font-size: 17px;
	font-weight: 500;
	line-height: 1.3;
}

.hsfm-results .hsfm-card h4 a,
.hsfm-results .hsfm-item h4 a {
	color: inherit;
	text-decoration: none;
}

.hsfm-results .hsfm-card h4 a:hover,
.hsfm-results .hsfm-item h4 a:hover {
	text-decoration: underline;
}

.hsfm-results .hsfm-facts {
	margin: 0;
	font-size: 13px;
}

.hsfm-results .hsfm-facts div {
	display: flex;
	gap: 6px;
}

.hsfm-results .hsfm-facts dt {
	margin: 0;
	color: var(--hsfm-muted);
	font-weight: 400;
}

.hsfm-results .hsfm-facts dt::after {
	content: ":";
}

.hsfm-results .hsfm-facts dd {
	margin: 0;
}

.hsfm-results .hsfm-excerpt {
	margin: 0;
	color: var(--hsfm-muted);
	font-size: 14px;
	line-height: 1.5;
}

.hsfm-results .hsfm-card-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-top: auto;
	padding-top: 8px;
}

.hsfm-results .hsfm-price {
	font-weight: 600;
}

.hsfm-results .hsfm-stock {
	color: #b3261e;
	font-size: 13px;
}

.hsfm-results a.hsfm-view {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	margin-left: auto;
	padding: 0 16px;
	border-radius: 6px;
	background: var(--hsfm-accent);
	color: #0c0c0c;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: filter .15s ease;
}

.hsfm-results a.hsfm-view:hover {
	filter: brightness(.93);
}

.hsfm-results a:focus-visible,
.hsfm-results select:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.hsfm-results .hsfm-item {
	display: flex;
	gap: 16px;
	padding: 16px 0;
	border-top: 1px solid var(--hsfm-line);
}

.hsfm-results .hsfm-item > div {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	min-width: 0;
}

.hsfm-results .hsfm-item-img img {
	display: block;
	width: 88px;
	height: 88px;
	border-radius: 6px;
	object-fit: cover;
}

.hsfm-results .hsfm-item a.hsfm-view {
	margin-left: 0;
}

.hsfm-results .hsfm-more {
	font-weight: 600;
}

.hsfm-results .hsfm-pages {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: 28px;
}

.hsfm-results .hsfm-pages .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	min-height: 40px;
	padding: 0 12px;
	border: 1px solid var(--hsfm-line);
	border-radius: 6px;
	color: inherit;
	text-decoration: none;
}

.hsfm-results .hsfm-pages .page-numbers.current {
	border-color: var(--hsfm-accent);
	background: var(--hsfm-accent);
	color: #0c0c0c;
	font-weight: 600;
}

.hsfm-results .hsfm-pages .page-numbers.dots {
	border: 0;
}

@media (max-width: 600px) {
	.hsfm-results .hsfm-grid {
		grid-template-columns: 1fr 1fr;
		gap: 12px;
	}

	.hsfm-results .hsfm-card-body {
		padding: 12px;
	}

	.hsfm-results a.hsfm-view {
		width: 100%;
		justify-content: center;
		margin-left: 0;
	}

	.hsfm-results .hsfm-toolbar,
	.hsfm-results .hsfm-toolbar label {
		width: 100%;
	}

	.hsfm-results .hsfm-toolbar select {
		flex: 1;
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hsfm-results .hsfm-card,
	.hsfm-results a.hsfm-view {
		transition: none;
	}

	.hsfm-results .hsfm-card:hover {
		transform: none;
	}
}