.ims-hps {
	--ims-hps-panel-width: 420px;
	--ims-hps-offset: 10px;
	position: relative;
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	box-sizing: border-box;
}

.ims-hps,
.ims-hps *,
.ims-hps *::before,
.ims-hps *::after {
	box-sizing: border-box;
}

.ims-hps input {
	font: inherit;
}

/*
 * Important:
 * These controls are anchors, not <button>, so Elementor/theme button
 * presets cannot inject default background/color/padding.
 */
.ims-hps__trigger,
.ims-hps__submit,
.ims-hps__close {
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none !important;
	text-shadow: none !important;
	background-image: none !important;
	text-decoration: none !important;
	-webkit-tap-highlight-color: transparent;
}

.ims-hps__trigger,
.ims-hps__submit,
.ims-hps__close {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	margin: 0 !important;
	padding: 0 !important;
	cursor: pointer;
	border: 0;
	outline: 0;
	background-color: transparent;
	background-image: none !important;
	text-decoration: none !important;
	box-shadow: none !important;
	line-height: 1;
}

.ims-hps__trigger {
	width: 42px;
	height: 42px;
	color: #20252b;
}

.ims-hps__trigger-icon,
.ims-hps__submit-icon,
.ims-hps__close-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.ims-hps__trigger-icon {
	font-size: 18px;
}

.ims-hps svg {
	display: block;
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.ims-hps__panel[hidden] {
	display: none !important;
}

.ims-hps__panel {
	position: absolute;
	top: calc(100% + var(--ims-hps-offset));
	z-index: 99999;
	width: min(var(--ims-hps-panel-width), calc(100vw - 24px));
	max-width: calc(100vw - 24px);
	padding: 12px;
	background: #fff;
}

.ims-hps[data-align="right"] .ims-hps__panel {
	right: 0;
	left: auto;
}

.ims-hps[data-align="left"] .ims-hps__panel {
	right: auto;
	left: 0;
}

.ims-hps__form {
	display: flex;
	align-items: center;
	width: 100%;
	min-width: 0;
	min-height: 52px;
	overflow: hidden;
	background: #fff;
	border: 1px solid #dedede;
}

.ims-hps__input {
	width: 100%;
	min-width: 0;
	height: 100%;
	min-height: inherit;
	margin: 0;
	padding: 0 14px;
	color: #20252b;
	background: transparent;
	border: 0 !important;
	border-radius: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
}

.ims-hps__input::-webkit-search-cancel-button {
	display: none;
}

.ims-hps__input::placeholder {
	color: #8a8e93;
	opacity: 1;
}

.ims-hps__submit,
.ims-hps__close {
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
}

.ims-hps__submit {
	color: #20252b;
}

.ims-hps__close {
	color: #70757a;
}

.ims-hps__submit-icon,
.ims-hps__close-icon {
	font-size: 16px;
}

.ims-hps__close {
	border-left: 1px solid rgba(0, 0, 0, .08);
}

.ims-hps__trigger:focus-visible,
.ims-hps__submit:focus-visible,
.ims-hps__close:focus-visible {
	outline: 2px solid currentColor !important;
	outline-offset: 2px;
}

/*
 * Do not draw a focus ring on the input itself.
 * The form has overflow:hidden, so an input outline was clipped and appeared
 * as a black vertical border between the field and the search icon.
 */
.ims-hps__input:focus,
.ims-hps__input:focus-visible,
.ims-hps__input:active {
	border: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
	background-image: none !important;
}

@media (max-width: 767px) {
	.ims-hps__panel {
		position: fixed;
		top: var(--ims-hps-mobile-top, 70px);
		right: 12px !important;
		left: 12px !important;
		width: auto;
		max-width: none;
		margin: 0;
	}

	.ims-hps__form {
		min-height: 50px;
	}

	.ims-hps__input {
		padding-inline: 12px;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.ims-hps__panel {
		animation: ims-hps-panel-in 160ms ease both;
	}
}

@keyframes ims-hps-panel-in {
	from {
		opacity: 0;
		transform: translateY(-5px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}


/* =========================================================
 * 1.0.1 - no Elementor/theme button inheritance
 * ========================================================= */
.ims-hps a.ims-hps__trigger,
.ims-hps a.ims-hps__trigger:visited,
.ims-hps a.ims-hps__submit,
.ims-hps a.ims-hps__submit:visited,
.ims-hps a.ims-hps__close,
.ims-hps a.ims-hps__close:visited {
	text-decoration: none !important;
	box-shadow: none !important;
	background-image: none !important;
}

.ims-hps a.ims-hps__trigger {
	color: inherit;
}

.ims-hps a.ims-hps__submit {
	color: #20252b;
}

.ims-hps a.ims-hps__close {
	color: #70757a;
}

.ims-hps a.ims-hps__trigger:hover,
.ims-hps a.ims-hps__trigger:focus,
.ims-hps a.ims-hps__submit:hover,
.ims-hps a.ims-hps__submit:focus,
.ims-hps a.ims-hps__close:hover,
.ims-hps a.ims-hps__close:focus {
	text-decoration: none !important;
	box-shadow: none !important;
	background-image: none !important;
}


/* =========================================================
 * 1.0.2 - remove inner input focus border
 * ========================================================= */
.ims-hps .ims-hps__form .ims-hps__input,
.ims-hps .ims-hps__form .ims-hps__input:hover,
.ims-hps .ims-hps__form .ims-hps__input:focus,
.ims-hps .ims-hps__form .ims-hps__input:focus-visible,
.ims-hps .ims-hps__form .ims-hps__input:active {
	border-width: 0 !important;
	border-style: none !important;
	border-color: transparent !important;
	outline: none !important;
	box-shadow: none !important;
}
