/* Search form — Figma node 4026:1089 */
.search-form {
	display: flex;
	align-items: center;
	gap: var(--sp-8);
	height: 50px;
	padding-inline: var(--sp-16);
	border-radius: var(--r-16);
	background: var(--n-97);
	transition: box-shadow .15s;
}
.search-form:focus-within { box-shadow: 0 0 0 1px var(--n-90); } /* subtle focus cue */

.search-form__submit {
	display: grid;
	place-items: center;
	flex: none;
	padding: 0;
	border: 0;
	color: var(--n-20);
	background: none;
	cursor: pointer;
}
.search-form__submit:hover { color: var(--blue); }
.search-form__submit .icon { font-size: 18px; }

.search-form__input {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0;
	border: 0;
	outline: 0;
	background: none;
	font-size: var(--fs-body-s);
	line-height: var(--lh-body-s);
}
.search-form__input::placeholder { color: var(--n-50); }
.search-form__input::-webkit-search-cancel-button { display: none; }

/* Clear (X) button: visible only while the field has text. */
.search-form__clear {
	display: grid;
	place-items: center;
	flex: none;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: var(--r-pill);
	color: var(--n-50);
	background: none;
	cursor: pointer;
	transition: color .15s, background-color .15s;
}
.search-form__clear:hover,
.search-form__clear:focus-visible { color: var(--n-10); background: var(--n-90); }
.search-form__clear .icon { font-size: 16px; }
.search-form__input:placeholder-shown + .search-form__clear { display: none; }

/* Live results (inc/search.php): a white panel under the field, the account dropdown's look. Groups: categories,
   products (48px photo, title with the typed words marked, price), then «مشاهده همه نتایج». */
.search-form[data-live-search] { position: relative; }
.search-form.has-results { box-shadow: 0 0 0 1px var(--n-90); }
.live-search {
	position: absolute;
	top: calc(100% + var(--sp-8));
	inset-inline: 0;
	z-index: 970;
	display: grid;
	gap: 2px;
	max-height: min(520px, 70vh);
	padding: var(--sp-8);
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: var(--r-16);
	background: var(--n-100);
	box-shadow: 0 16px 40px rgb(0 0 0 / .12);
	scrollbar-width: thin;
	transition: opacity .15s;
}
.live-search[hidden] { display: none; }
.live-search.is-loading { opacity: .6; }
.live-search__label { margin: var(--sp-8) var(--sp-8) 4px; color: var(--n-50); font-size: var(--fs-body-s); font-weight: 700; }
.live-search__label:first-child { margin-top: 4px; }
.live-search__list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.live-search__cat, .live-search__product, .live-search__all { display: flex; align-items: center; gap: var(--sp-12); padding: var(--sp-8); border-radius: var(--r-12); color: var(--n-20); font-size: var(--fs-body-m); transition: background-color .15s, color .15s; }
.live-search__cat .icon { flex: none; color: var(--orange); font-size: 20px; }
.live-search__cat > span { flex: 1; min-width: 0; font-weight: 600; }
.live-search__cat small { color: var(--n-50); font-size: var(--fs-body-s); font-weight: 500; }
.live-search__img { flex: none; width: 48px; height: 48px; border-radius: var(--r-8); object-fit: contain; background: var(--n-97); mix-blend-mode: multiply; }
.live-search__title { flex: 1; min-width: 0; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: var(--lh-body-m); }
.live-search__price { flex: none; display: grid; justify-items: end; text-align: end; white-space: nowrap; }
.live-search__price del { color: var(--n-60); font-size: var(--fs-label-m); }
.live-search__price ins { color: var(--n-10); font-weight: 800; text-decoration: none; }
.live-search__price small { color: var(--n-50); font-size: var(--fs-label-m); font-weight: 500; }
.live-search__stock { color: var(--n-50); font-size: var(--fs-body-s); }
.live-search mark { color: inherit; background: none; font-weight: 800; }
.live-search__cat:hover, .live-search__product:hover, .live-search .is-active { color: var(--n-10); background: var(--n-97); }
.live-search__all { justify-content: center; gap: 6px; margin-top: 4px; border-top: 1px solid var(--n-95); border-radius: 0 0 var(--r-12) var(--r-12); color: var(--blue); font-weight: 700; }
.live-search__all .icon { font-size: 18px; }
.live-search__all:hover, .live-search__all.is-active { color: var(--blue); background: var(--blue-light); }
.live-search__empty { margin: 0; padding: var(--sp-16); color: var(--n-50); font-size: var(--fs-body-m); text-align: center; }

@media (max-width: 769px) {
	.live-search { max-height: min(440px, 60vh); }
	.live-search__product { gap: var(--sp-8); }
	.live-search__title { font-size: var(--fs-body-s); line-height: var(--lh-body-s); }
}
