/* Elementor shrink-wraps the shortcode widget around its content, which left
   the search pill stuck at ~490px. Give the widget itself the room. */
.elementor-widget:has(> .elementor-widget-container > .elementor-shortcode > .lb-hero-search),
.elementor-widget:has(.lb-hero-search) {
	width: min(980px, calc(100vw - 32px)) !important;
	max-width: 100% !important;
	margin-left: auto;
	margin-right: auto;
}

.lb-hero-search {
	width: 100%;
	max-width: 980px;
	margin: 0 auto;
	container-type: inline-size;
	container-name: lb-hero-search;
}

.lb-hero-search__form {
	display: flex;
	align-items: stretch;
	background: #fff;
	border-radius: 999px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
	padding: 6px;
	gap: 0;
}

.lb-hero-search__field {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	position: relative;
}

.lb-hero-search__field--text {
	flex: 6 1 300px;
	min-width: 220px;
}

.lb-hero-search__field--select {
	flex: 0 0 auto;
	min-width: 170px;
	cursor: default;
	color: #45505f;
}

.lb-hero-search__label {
	font-size: 14px;
	font-weight: 600;
	color: #17233c;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lb-hero-search__icon {
	color: #8890a0;
	flex-shrink: 0;
}

.lb-hero-search__input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	padding: 0;
	border-radius: 0;
	border: none;
	outline: none;
	font-size: 15px;
	color: #17233c;
	background: transparent;
}

.lb-hero-search__input::placeholder {
	color: #8890a0;
}

.lb-hero-search__sep {
	width: 1px;
	background: #e2e5ea;
	margin: 8px 0;
	flex-shrink: 0;
}

.lb-hero-search__submit {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	border-radius: 999px !important;
	background: #e8930f;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	padding: 0 34px;
	min-width: 150px;
	margin-left: 4px;
	cursor: pointer;
	transition: background .15s ease;
}

.lb-hero-search__submit:hover {
	background: #17233c;
}

/* ---- Suggestions dropdown ---- */

.lb-hero-search__suggestions {
	position: absolute;
	top: calc(100% + 14px);
	left: -18px;
	right: -18px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 16px 40px rgba(23, 35, 60, .18);
	padding: 10px;
	z-index: 30;
	max-height: 380px;
	overflow-y: auto;
	text-align: left;
}

.lb-hero-search__suggestions[hidden] {
	display: none;
}

.lb-hero-search__suggestions-label {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #8890a0;
	padding: 8px 10px 4px;
}

.lb-hero-search__suggestion {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 10px;
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
}

.lb-hero-search__suggestion:hover,
.lb-hero-search__suggestion.is-active {
	background: #f7f8fa;
}

.lb-hero-search__suggestion-thumb {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	overflow: hidden;
	background: #e9ecf1;
	flex-shrink: 0;
}

.lb-hero-search__suggestion-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.lb-hero-search__suggestion-text {
	min-width: 0;
}

.lb-hero-search__suggestion-title {
	font-size: 14px;
	font-weight: 700;
	color: #17233c;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lb-hero-search__suggestion-subtitle {
	font-size: 12px;
	color: #8890a0;
}

.lb-hero-search__empty {
	padding: 14px 10px;
	font-size: 13px;
	color: #8890a0;
}

@media (max-width: 640px) {
	.lb-hero-search__form {
		flex-wrap: wrap;
		border-radius: 20px;
	}
	.lb-hero-search__field--select {
		flex: 1 1 50%;
		justify-content: center;
	}
	.lb-hero-search__sep {
		display: none;
	}
	.lb-hero-search__submit {
		width: 100%;
		justify-content: center;
		margin-top: 6px;
		padding: 12px;
	}
	.lb-hero-search__suggestions {
		left: 0;
		right: 0;
	}
}

/* Respond to the actual width of whatever column/section this shortcode is
   dropped into (Elementor layouts vary a lot), not just the viewport — a
   narrow container on a wide screen has the exact same space problem. */
@container lb-hero-search (max-width: 480px) {
	.lb-hero-search__form {
		flex-wrap: wrap;
		border-radius: 20px;
	}
	.lb-hero-search__field--text {
		flex: 1 1 100%;
		order: -1;
	}
	.lb-hero-search__sep {
		display: none;
	}
	.lb-hero-search__field--select {
		flex: 1 1 auto;
		justify-content: center;
	}
	.lb-hero-search__submit {
		flex: 1 1 100%;
		justify-content: center;
		margin-top: 6px;
		padding: 12px;
		min-width: 0;
		margin-left: 0;
	}
	.lb-hero-search__suggestions {
		left: 0;
		right: 0;
	}
}

/* The theme paints a grey box and padding on text inputs; keep the field flush
   with the pill so the placeholder has the full width. */
.lb-hero-search .lb-hero-search__input {
	background: transparent !important;
	box-shadow: none !important;
	padding: 0 !important;
	height: auto;
	border: 0 !important;
}
