/* AJAX product search suggestions */

.af-search-suggest-host {
	position: relative;
}

.af-search-suggest {
	position: absolute;
	z-index: 1200;
	top: calc(100% + 8px);
	right: 0;
	left: 0;
	max-height: min(70vh, 420px);
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	padding: 8px;
	border-radius: 16px;
	background: #fff;
	border: 1px solid rgba(15, 23, 42, 0.08);
	box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
	text-align: right;
}

.af-search-suggest[hidden] {
	display: none !important;
}

.af-search-suggest__label {
	padding: 8px 10px 4px;
	font-size: 0.72rem;
	font-weight: 800;
	color: #64748b;
}

.af-search-suggest__status {
	padding: 16px 12px;
	font-size: 0.9rem;
	font-weight: 700;
	color: #64748b;
	text-align: center;
}

.af-search-suggest__query {
	display: block;
	width: 100%;
	appearance: none;
	border: 0;
	background: transparent;
	text-align: right;
	font: inherit;
	font-size: 0.88rem;
	font-weight: 700;
	color: #0f172a;
	padding: 10px 12px;
	border-radius: 12px;
	cursor: pointer;
}

.af-search-suggest__query:hover,
.af-search-suggest__query:focus-visible {
	background: #f1f5f9;
	outline: none;
}

.af-search-suggest__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
}

.af-search-suggest__item:hover,
.af-search-suggest__item:focus-visible {
	background: #f0fdfa;
	outline: none;
}

.af-search-suggest__img {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: 10px;
	object-fit: cover;
	background: #f8fafc;
}

.af-search-suggest__img--empty {
	display: inline-block;
	background: linear-gradient(135deg, #e2e8f0, #f8fafc);
}

.af-search-suggest__body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.af-search-suggest__title {
	font-size: 0.86rem;
	font-weight: 800;
	line-height: 1.45;
	color: #0f172a;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.af-search-suggest__price {
	font-size: 0.78rem;
	font-weight: 800;
	color: #0f766e;
}

.af-search-suggest__price del {
	color: #94a3b8;
	font-weight: 600;
	margin-inline-start: 4px;
}

.af-search-suggest__all {
	display: block;
	margin-top: 6px;
	padding: 12px;
	border-radius: 12px;
	text-align: center;
	font-size: 0.86rem;
	font-weight: 900;
	text-decoration: none;
	color: #0f766e;
	background: #f0fdfa;
}

.af-search-suggest__all:hover {
	background: #ccfbf1;
}

/* ── Mobile drawer: fixed sheet, scroll only the results list ── */
.af-search-drawer__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

.af-search-drawer__body .af-search-suggest-host {
	flex-shrink: 0;
	position: static;
}

.af-search-drawer__hint {
	flex-shrink: 0;
}

.af-search-drawer__results,
.af-search-drawer__results.af-search-suggest {
	position: relative !important;
	top: auto !important;
	right: auto !important;
	left: auto !important;
	bottom: auto !important;
	z-index: 1;
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	height: auto;
	margin-top: 10px;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 6px 4px 10px;
	border-radius: 16px;
	background: #f8fafc;
	border: 1px solid rgba(15, 23, 42, 0.06);
	box-shadow: none;
}

.af-search-drawer__results[hidden],
.af-search-drawer__results.af-search-suggest[hidden] {
	display: none !important;
}

.af-search-drawer__results .af-search-suggest__label {
	position: sticky;
	top: 0;
	z-index: 1;
	background: #f8fafc;
	padding-top: 6px;
	padding-bottom: 4px;
}

.af-search-drawer__results .af-search-suggest__item {
	padding: 10px;
	margin: 0 2px 6px;
	background: #fff;
	border: 1px solid rgba(15, 23, 42, 0.05);
	border-radius: 14px;
}

.af-search-drawer__results .af-search-suggest__all {
	margin: 8px 4px 2px;
}

/* Only hide hint — do NOT change sheet height */
.af-search-drawer.is-suggesting .af-search-drawer__hint {
	display: none;
}

@media (max-width: 767px) {
	.shop-header__search-wrap .af-search-suggest,
	.shop-header__search .af-search-suggest {
		display: none !important;
	}
}
