/* Tarhee header search: button, panel, results. Loaded only when the search is enabled. */

.tarhee-search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	color: var(--navy);
	transition: background-color .2s;
}
.tarhee-search-toggle:hover,
.tarhee-search-toggle[aria-expanded='true'] { background: var(--gold-soft); }
.site-header.hdr-text .tarhee-search-toggle { color: var(--hdr-text); }

.tarhee-search {
	position: absolute;
	z-index: 3;
	inset-inline: 0;
	inset-block-start: 100%;
	background: var(--hdr-bg, #fff);
	border-bottom: 1px solid var(--border);
	box-shadow: var(--shadow);
}
.tarhee-search[hidden] { display: none; }
.tarhee-search__inner { padding-block: 14px; }
.tarhee-search__box {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 12px;
	transition: border-color .2s, box-shadow .2s;
}
.tarhee-search__box:focus-within {
	border-color: var(--gold);
	box-shadow: 0 0 0 2px var(--gold);
}
.tarhee-search__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 12px;
	background: transparent;
	border: 0;
	color: var(--hdr-text, var(--text));
	font: inherit;
	outline: 0;
	box-shadow: none;
}
.tarhee-search__input::-webkit-search-cancel-button { display: none; }
.tarhee-search__submit,
.tarhee-search__close {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}
.tarhee-search__submit { background: var(--gold); color: var(--navy); }
.tarhee-search__close { background: transparent; color: var(--muted); }
.tarhee-search__submit:hover,
.tarhee-search__submit:focus-visible { filter: brightness(.94); }
.tarhee-search__close:hover,
.tarhee-search__close:focus-visible { background: var(--border); color: var(--navy); }
.tarhee-search__submit:focus-visible,
.tarhee-search__close:focus-visible,
.tarhee-search__results a:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}

.tarhee-search__status {
	margin: 10px 4px 0;
	color: var(--muted);
	font-size: .875rem;
}
.tarhee-search__status:empty { display: none; }
.tarhee-search__results {
	margin: 8px 0 0;
	padding: 0;
	max-height: min(60vh, 420px);
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
}
.tarhee-search__results:empty { display: none; }
.tarhee-search__results a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px;
	border-radius: 10px;
	color: var(--hdr-text, var(--text));
	text-decoration: none;
	transition: background-color .2s;
}
.tarhee-search__results a:hover,
.tarhee-search__results a:focus-visible { background: var(--gold-soft); }
.tarhee-search__thumb {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	background: var(--bg-2);
	border-radius: 8px;
	object-fit: cover;
}
.tarhee-search__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	gap: 2px;
}
.tarhee-search__title { font-weight: var(--fw-label); line-height: 1.5; }
.tarhee-search__meta { color: var(--muted); font-size: .8125rem; }
.tarhee-search__price { color: var(--navy); font-size: .875rem; font-weight: var(--fw-strong); }

@media (prefers-reduced-motion: reduce) {
	.tarhee-search-toggle,
	.tarhee-search__box,
	.tarhee-search__submit,
	.tarhee-search__close,
	.tarhee-search__results a { transition: none; }
}
