/* LGM product search — autocomplete dropdown. */

/* Make any host search form a positioning context for the dropdown. */
.lgm-search,
form.elementor-search-form,
form.woocommerce-product-search {
	position: relative;
}

.lgm-search__results {
	position: absolute;
	left: 0;
	top: 100%;
	z-index: 1000;
	background: #fff;
	border: 1px solid #d8d8d8;
	border-top: none;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	max-height: 70vh;
	overflow-y: auto;
	/* Default desktop layout: 2× the search field's width, clamped to
	   the viewport. JS recomputes left/width to keep the dropdown
	   inside the viewport on overflow and switches to a full-screen
	   layout (10 px gutter) on screens ≤ 768 px. */
	width: 200%;
	max-width: calc(100vw - 20px);
}

.lgm-search__msg {
	padding: 0.75em 1em;
	color: #666;
	font-size: 0.9em;
}

.lgm-search__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lgm-search__item {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid #f0f0f0;
}

.lgm-search__item:last-child {
	border-bottom: none;
}

.lgm-search__item.is-active,
.lgm-search__item:hover {
	background: #f6f7f9;
}

.lgm-search__link {
	display: flex;
	align-items: center;
	gap: 0.75em;
	padding: 0.5em 0.75em;
	text-decoration: none;
	color: inherit;
}

.lgm-search__link:hover,
.lgm-search__link:focus {
	text-decoration: none;
	color: inherit;
}

.lgm-search__img {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	object-fit: contain;
	background: #fafafa;
	border: 1px solid #eee;
}

.lgm-search__img--placeholder {
	display: inline-block;
}

.lgm-search__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.1em;
}

.lgm-search__title {
	font-size: 0.92em;
	line-height: 1.3;
	color: #222;
	/* Allow parent name + variation to wrap onto a 2nd line instead of
	   being truncated with an ellipsis. */
	white-space: normal;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.lgm-search__sku {
	font-size: 0.78em;
	color: #888;
}

.lgm-search__price {
	font-size: 0.85em;
	font-weight: 600;
	color: #1a1a1a;
}

