
/* =========================================================
   HLxHub — Premium Header Search
   File: assets/css/header/search.css

   Mobile:
   - Search box opens directly below the complete header.
   - Full-width premium dropdown panel.
   - Existing navigation and centered logo remain unchanged.
   ========================================================= */


/* =========================================================
   1. SEARCH COMPONENT BASE
   ========================================================= */

.hlxhub-search-component {
	box-sizing: border-box;
	font-family: inherit;
}

.hlxhub-search-component *,
.hlxhub-search-component *::before,
.hlxhub-search-component *::after {
	box-sizing: border-box;
}


/* =========================================================
   2. DESKTOP SEARCH
   ========================================================= */

.hlxhub-search-component--desktop {
	position: relative;
	width: 100%;
	max-width: 570px;
	margin-inline: auto;
}

.hlxhub-search {
	width: 100%;
	margin: 0;
}

.hlxhub-search__field {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 56px;
	padding: 5px;
	gap: 0;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-shadow: 0 3px 12px rgb(15 23 42 / 5%);
	transition:
		border-color 180ms ease,
		box-shadow 180ms ease;
}

.hlxhub-search__field:focus-within {
	border-color: #1769ff;
	box-shadow:
		0 0 0 3px rgb(23 105 255 / 10%),
		0 5px 18px rgb(15 23 42 / 7%);
}

.hlxhub-search__category-wrap {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	min-width: 125px;
	max-width: 170px;
	padding-left: 10px;
}

.hlxhub-search__category {
	width: 100%;
	min-width: 0;
	padding: 10px 24px 10px 4px;
	border: 0;
	outline: 0;
	appearance: none;
	background: transparent;
	color: #334155;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.hlxhub-search__chevron {
	position: absolute;
	right: 5px;
	top: 50%;
	transform: translateY(-50%);
	color: #64748b;
	pointer-events: none;
}

.hlxhub-search__divider {
	align-self: stretch;
	width: 1px;
	margin: 9px 12px;
	background: #e2e8f0;
}

.hlxhub-search__input-wrap {
	flex: 1 1 auto;
	min-width: 0;
}

.hlxhub-search__input {
	display: block;
	width: 100%;
	min-width: 0;
	height: 44px;
	padding: 0 8px;
	border: 0 !important;
	outline: none;
	box-shadow: none !important;
	background: transparent !important;
	color: #0f172a;
	font: inherit;
	font-size: 14px;
}

.hlxhub-search__input::placeholder {
	color: #94a3b8;
	opacity: 1;
}

.hlxhub-search__submit {
	display: inline-flex;
	flex: 0 0 46px;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: #1769ff;
	color: #ffffff;
	cursor: pointer;
	transition:
		background 180ms ease,
		transform 180ms ease,
		box-shadow 180ms ease;
}

.hlxhub-search__submit:hover {
	background: #0757e8;
	box-shadow: 0 4px 12px rgb(23 105 255 / 25%);
}

.hlxhub-search__submit:active {
	transform: scale(.96);
}

.hlxhub-search__submit:focus-visible,
.hlxhub-search-toggle:focus-visible {
	outline: 3px solid rgb(23 105 255 / 35%);
	outline-offset: 3px;
}


/* =========================================================
   3. VALIDATION ERROR
   ========================================================= */

.hlxhub-search__field.is-invalid {
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgb(220 38 38 / 9%);
}

.hlxhub-search__field.is-invalid .hlxhub-search__input {
	color: #b91c1c;
}

.hlxhub-search__error {
	margin: 8px 4px 0;
	color: #dc2626;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.5;
}

.hlxhub-search__error[hidden],
.hlxhub-search-panel[hidden] {
	display: none !important;
}


/* =========================================================
   4. MOBILE SEARCH ICON
   ========================================================= */

.hlxhub-search-component--mobile {
	position: static;
	display: flex;
	align-items: center;
	justify-content: center;
	width: auto;
	max-width: none;
	margin: 0;
}

.hlxhub-search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 14px;
	background: transparent;
	color: #0f172a;
	cursor: pointer;
	transition:
		background 180ms ease,
		color 180ms ease,
		border-color 180ms ease;
}

.hlxhub-search-toggle:hover,
.hlxhub-search-component--mobile.is-search-open
.hlxhub-search-toggle {
	background: #eff6ff;
	border-color: #dbeafe;
	color: #1769ff;
}


/* =========================================================
   5. MOBILE PANEL
   IMPORTANT:
   Position the panel relative to the complete header,
   not relative to the search icon/component.
   ========================================================= */

@media (max-width: 1024px) {

	/*
	 * Replace .hlxhub-header with the actual outermost
	 * header wrapper class if your theme uses another name.
	 */
	.hlxhub-header {
		position: relative;
		z-index: 10000;
		overflow: visible;
	}

	.hlxhub-search-component--mobile .hlxhub-search-panel {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 10001;

		display: block;
		width: 100%;
		max-width: none;
		margin: 0;
		padding: 18px 16px 20px;

		background: #ffffff;
		border: 1px solid #e8edf5;
		border-top: 1px solid #eef2f7;
		border-radius: 0 0 22px 22px;

		box-shadow:
			0 14px 30px rgb(15 23 42 / 10%),
			0 3px 8px rgb(15 23 42 / 4%);

		animation: hlxhub-search-drop-in 200ms ease-out;
	}

	/*
	 * Ensure the search form fills the dropdown panel.
	 */
	.hlxhub-search-component--mobile .hlxhub-search {
		display: block;
		width: 100%;
		max-width: none;
		margin: 0;
	}

	.hlxhub-search-component--mobile .hlxhub-search__field {
		min-height: 58px;
		padding: 6px;
		border: 1px solid #dce5f0;
		border-radius: 17px;
		box-shadow: 0 4px 14px rgb(15 23 42 / 4%);
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__category-wrap {
		min-width: 100px;
		max-width: 125px;
		padding-left: 7px;
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__category {
		padding-left: 2px;
		padding-right: 19px;
		font-size: 12px;
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__chevron {
		right: 2px;
		width: 12px;
		height: 12px;
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__divider {
		margin: 10px 7px;
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__input {
		height: 44px;
		padding-inline: 4px;
		font-size: 13px;
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__input::placeholder {
		color: #94a3b8;
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__submit {
		flex-basis: 44px;
		width: 44px;
		height: 44px;
		border-radius: 13px;
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__error {
		margin: 9px 4px 0;
		font-size: 12px;
	}

}


/* =========================================================
   6. SMALL MOBILE
   ========================================================= */

@media (max-width: 380px) {

	.hlxhub-search-component--mobile
	.hlxhub-search-panel {
		padding: 14px 12px 17px;
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__category-wrap {
		min-width: 86px;
		max-width: 100px;
		padding-left: 4px;
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__category {
		font-size: 11px;
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__divider {
		margin-inline: 5px;
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__input {
		font-size: 12px;
	}

	.hlxhub-search-component--mobile
	.hlxhub-search__submit {
		flex-basis: 40px;
		width: 40px;
		height: 42px;
	}

}


/* =========================================================
   7. DROP-DOWN ANIMATION
   ========================================================= */

@keyframes hlxhub-search-drop-in {
	from {
		opacity: 0;
		transform: translateY(-7px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}


/* =========================================================
   8. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

	.hlxhub-search-component *,
	.hlxhub-search-component *::before,
	.hlxhub-search-component *::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}

}


/* =========================================================
   9. DESKTOP VISIBILITY
   ========================================================= */

@media (min-width: 1025px) {

	.hlxhub-search-component--mobile {
		display: none;
	}

	.hlxhub-search-component--desktop {
		display: block;
	}

}

.hlxhub-search__field.is-invalid {
	border-color: #dc2626 !important;
	box-shadow: 0 0 0 3px rgb(220 38 38 / 9%);
}

.hlxhub-search__field.is-invalid
.hlxhub-search__input::placeholder {
	color: #dc2626 !important;
	opacity: 1;
}

.hlxhub-search__error {
	display: none !important;
}

/* =========================================================
   HLxHub — Search Category Focus Fix
   Remove click/focus shadow from category dropdown
   ========================================================= */

.hlxhub-search__category,
.hlxhub-search__category:hover,
.hlxhub-search__category:focus,
.hlxhub-search__category:focus-visible,
.hlxhub-search__category:active {
    box-shadow: none !important;
    outline: none !important;
}

/* Remove browser-specific focus shadow */
.hlxhub-search__category {
    -webkit-appearance: none;
    appearance: none;
}

/* Keep dropdown options readable */
.hlxhub-search__category option {
    box-shadow: none;
}
