.ecom-events-search-widget {
	--_ecom-es-font: 'Lexend Deca', system-ui, sans-serif;
	--_ecom-es-text: #181d27;
	--_ecom-es-muted: #717680;
	--_ecom-es-border: #d5d7da;
	--_ecom-es-brand: #2759b9;
	--_ecom-es-brand-hover: #1e448d;
	width: 100%;
	font-family: var(--_ecom-es-font);
	position: relative;
}

.ecom-events-search-widget *,
.ecom-events-search-widget *::before,
.ecom-events-search-widget *::after {
	box-sizing: border-box;
}

.ecom-es-bar {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	max-width: 452px;
	position: relative;
}

.ecom-es-fields-row {
	display: flex;
	align-items: center;
	width: 100%;
	background: #fff;
	border: 1px solid var(--_ecom-es-border);
	border-radius: 9999px;
	padding: 4px 4px 4px 20px;
	box-shadow: 0 1px 0.5px 0.05px rgba(24, 24, 27, 0.04);
	gap: 0;
}

.ecom-es-field {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 6px;
}

.ecom-es-field-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 24px;
	height: 24px;
	color: var(--_ecom-es-text);
}

.ecom-es-field-icon svg,
.ecom-es-field-icon i {
	width: 20px;
	height: 20px;
	font-size: 20px;
}

.ecom-es-events-input,
.ecom-es-location-input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	padding: 8px 4px 8px 0 !important;
	font-family: var(--_ecom-es-font);
	font-size: 18px;
	line-height: 28px;
	color: var(--_ecom-es-text);
	outline: none;
	border: 0 none !important;
}

.ecom-es-events-input::placeholder,
.ecom-es-location-input::placeholder {
	color: var(--_ecom-es-muted);
}

/* Use custom clear button; native search cancel is not wired to list refresh. */
.ecom-es-events-input::-webkit-search-cancel-button,
.ecom-es-events-input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
	display: none;
}

.ecom-es-input-clear {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #717680;
	cursor: pointer;
	transition: background 0.12s ease, color 0.12s ease;
}

.ecom-es-input-clear[hidden] {
	display: none !important;
}

.ecom-es-input-clear:hover {
	background: #f0f0f0;
	color: var(--_ecom-es-text);
}

.ecom-es-input-clear svg {
	width: 16px;
	height: 16px;
	display: block;
}

.ecom-es-divider {
	flex-shrink: 0;
	width: 1px;
	height: 24px;
	background: var(--_ecom-es-border);
	margin: 0 4px;
}

.ecom-es-submit {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 9999px;
	background: var(--_ecom-es-brand);
	color: #fff;
	cursor: pointer;
	transition: background 0.15s ease;
	padding: 8px;
}

.ecom-es-submit:hover {
	background: var(--_ecom-es-brand-hover);
}

.ecom-es-submit--inline {
	display: none;
}

.ecom-es-submit-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
}

.ecom-es-submit-icon svg,
.ecom-es-submit-icon i {
	width: 20px;
	height: 20px;
}

.ecom-es-submit-icon svg path {
	stroke: #fff !important;
}

/* Suggestions container */
.ecom-es-suggestions {
	position: absolute;
	top: calc(100% + 10px);
	left: 0;
	right: 0;
	z-index: 100;
	pointer-events: none;
}

.ecom-events-search-widget.is-suggestions-open .ecom-es-suggestions {
	pointer-events: auto;
}

/* Dropdown panels */
.ecom-es-panel {
	min-width: 280px;
	background: #fff;
	border-radius: 28px;
	box-shadow: 0 0 16px rgba(0, 0, 0, 0.12);
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ecom-es-panel[hidden] {
	display: none !important;
}

.ecom-es-panel-item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 8px 12px;
	border: 0;
	background: transparent;
	border-radius: 12px;
	cursor: pointer;
	text-align: left;
	font-family: var(--_ecom-es-font);
	font-size: 18px;
	line-height: 28px;
	color: var(--_ecom-es-text);
	transition: background 0.12s ease;
}

.ecom-es-panel-remove {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 4px;
	margin-left: auto;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #717680;
	cursor: pointer;
	transition: background 0.12s ease, color 0.12s ease;
}

.ecom-es-panel-remove svg {
	width: 16px;
	height: 16px;
	display: block;
	pointer-events: none;
}

.ecom-es-panel-remove:hover {
	background: #eee;
	color: var(--_ecom-es-text);
}

.ecom-es-panel-item:hover,
.ecom-es-panel-item.is-active {
	background: #f5f5f5;
}

.ecom-es-panel-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	color: #717680;
}

.ecom-es-panel-icon.is-accent {
	color: var(--_ecom-es-brand);
}

.ecom-es-panel-icon svg {
	width: 20px;
	height: 20px;
	display: block;
}

.ecom-es-panel-label {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #414651;
}

.ecom-es-panel-label strong {
	font-weight: 600;
	color: var(--_ecom-es-text);
}

.ecom-es-panel-empty {
	padding: 16px 12px;
	text-align: center;
	color: var(--_ecom-es-muted);
	font-size: 16px;
	line-height: 24px;
}

/* Desktop: always show search form, hide mobile chrome */
.ecom-es-mobile-trigger,
.ecom-es-mobile-backdrop {
	display: none;
}

.ecom-es-mobile-sheet {
	display: block;
	width: 100%;
}

body.ecom-es-body-locked {
	overflow: hidden;
}

/* Mobile trigger icon */
.ecom-es-mobile-trigger {
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--_ecom-es-text);
	cursor: pointer;
	flex-shrink: 0;
}

.ecom-es-mobile-trigger-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
}

.ecom-es-mobile-trigger-icon svg,
.ecom-es-mobile-trigger-icon i {
	width: 24px;
	height: 24px;
	font-size: 24px;
}

.ecom-es-mobile-backdrop {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(2px);
}

/* ── Mobile: icon trigger → expand sheet with stacked inputs ── */
@media (max-width: 640px) {
	.ecom-events-search-widget {
		width: auto;
		max-width: none;
		margin-left: auto;
	}

	.ecom-es-mobile-trigger {
		display: inline-flex;
	}

	.ecom-es-mobile-sheet {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 9999;
		background: #fff;
		padding: 8px 16px 16px;
		box-shadow: 0 1px 0.5px 0.05px rgba(24, 24, 27, 0.04);
		max-height: 100vh;
		max-height: 100dvh;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.ecom-events-search-widget.is-mobile-open .ecom-es-mobile-sheet {
		display: block;
	}

	.ecom-events-search-widget.is-mobile-open .ecom-es-mobile-backdrop {
		display: block;
	}

	.ecom-es-bar {
		max-width: 100%;
		gap: 8px;
	}

	.ecom-es-fields-row {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		padding: 0;
		border: 0;
		background: transparent;
		box-shadow: none;
	}

	.ecom-es-field {
		flex: none;
		width: 100%;
		height: 48px;
		padding: 4px 4px 4px 20px;
		background: #fff;
		border: 1px solid var(--_ecom-es-border);
		border-radius: 9999px;
		box-shadow: 0 1px 0.5px 0.05px rgba(24, 24, 27, 0.04);
		transition: border-color 0.15s ease, background 0.15s ease;
	}

	.ecom-events-search-widget.is-events-focus .ecom-es-field--events {
		border-color: var(--_ecom-es-brand);
		background: #fafafa;
	}

	.ecom-events-search-widget.is-location-focus .ecom-es-field--location {
		border-color: var(--_ecom-es-brand);
		background: #fafafa;
	}

	.ecom-es-divider {
		display: none;
	}

	.ecom-es-submit--desktop {
		display: none;
	}

	.ecom-es-submit--inline {
		display: inline-flex;
		width: 40px;
		height: 40px;
		flex-shrink: 0;
	}

	.ecom-es-events-input,
	.ecom-es-location-input {
		font-size: 16px;
		line-height: 24px;
		padding: 10px 4px 10px 0 !important;
	}

	.ecom-es-suggestions {
		position: static;
		top: auto;
		left: auto;
		right: auto;
		width: 100%;
		padding: 0;
		pointer-events: auto;
	}

	.ecom-es-panel {
		min-width: 0;
		width: 100%;
		border-radius: 0;
		box-shadow: none;
		padding: 8px;
		background: #fff;
	}

	.ecom-es-panel-item {
		font-size: 16px;
		line-height: 24px;
		padding: 8px 12px;
		border-radius: 0;
	}

	.ecom-es-panel-item:hover,
	.ecom-es-panel-item.is-active {
		background: transparent;
	}
}
