/* aa-search-form — header product search with auto-suggest dropdown. */

.aa-search {
	position: relative;
	width: 100%;

	--aa-search-font-size: 15px;
	--aa-search-font-size-sm: 14px;
	--aa-search-font-weight: 700;

	--aa-search-row-height: 68px;
}

/* The dropdown is absolutely positioned deep inside the Divi header, where the
   Max Mega Menu's column sits at z-index 1000 in the same stacking context and
   would paint over it. Lift the search module's whole ancestor chain above that
   — but only while the dropdown is open, so the mega menu's own stacking is
   untouched the rest of the time. */
.aa-search.is-open,
.et_pb_module:has(.aa-search.is-open),
.et_pb_column:has(.aa-search.is-open),
.et_pb_row:has(.aa-search.is-open),
.et_pb_section:has(.aa-search.is-open) {
	position: relative;
	z-index: 10000;
}

/* ---- Field ---- */
.aa-search__form {
	position: relative;
}

.aa-search .aa-search__form input.aa-search__input {
	height: 40px;
	width: 63%;
	padding: 0 10px;
	border: #070d3d solid 3px;
	border-radius: 10px;
	background-color: #ffffff;
	font-size: 17px;
}

.aa-search .aa-search__form input.aa-search__submit {
	height: 40px;
	border: #070d3d solid 3px;
	border-radius: 10px;
	background: #070d3d;
	color: #fff;
	font-size: 17px;
	font-weight: bold;
	cursor: pointer;
}

.aa-search__status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---- Dropdown ---- */
.aa-search__panel {
	position: absolute;
	z-index: 1000;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	min-width: min(440px, 92vw);
	background: #ffffff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 12px 32px rgba(7, 13, 61, 0.22);
}

.aa-search [x-cloak] {
	display: none !important;
}

.aa-search__results {
	max-height: calc(var(--aa-search-row-height) * 6);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0;
}

.aa-search__footer {
	display: flex;
	flex-direction: column;
}

/* ---- Result row ---- */
.aa-search__result {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 18px;
	color: #070d3d;
	text-decoration: none;
}

.aa-search__result:hover,
.aa-search__result.is-active {
	background: #f4f6fa;
}

.aa-search__result-image {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	overflow: hidden;
	background: #f8f9fa;
	border-radius: 6px;
}

.aa-search__result-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.aa-search__result-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.aa-search__result-title {
	font-size: var(--aa-search-font-size);
	font-weight: 400;
	line-height: 1.3;
}

.aa-search__result-title mark {
	background: #fff2a8;
	color: inherit;
	font-weight: var(--aa-search-font-weight);
	padding: 0;
}

.aa-search__result-meta {
	color: #6b7280;
	font-size: 12px;
	line-height: 1.3;
}

/* ---- Footer ---- */
.aa-search__all {
	display: block;
	padding: 12px 18px;
	border-top: 1px solid #e0e0e0;
	color: #107fb4;
	font-size: var(--aa-search-font-size-sm);
	font-weight: var(--aa-search-font-weight);
	text-decoration: none;
}

.aa-search__all + .aa-search__all {
	color: #6b7280;
	font-weight: 400;
}

.aa-search__all:hover {
	background: #f4f6fa;
}

/* ---- Loading ---- */
.aa-search.is-loading .aa-search__form::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	height: 2px;
	width: 40%;
	background: #2ea3f2;
	animation: aa-search-loading 1s linear infinite;
}

@keyframes aa-search-loading {
	from {
		transform: translateX(-100%);
	}
	to {
		transform: translateX(250%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.aa-search.is-loading .aa-search__form::after {
		animation: none;
	}
}

@media (max-width: 767px) {
	.aa-search__panel {
		min-width: 0;
	}
}
