/* MP Smart Search widget styles */

.mp-search {
	position: relative;
	width: 100%;
	max-width: 780px;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: inherit;
}

.mp-search *,
.mp-search *::before,
.mp-search *::after {
	box-sizing: border-box;
}

/* ---- Search bar ---- */
.mp-search__bar {
	display: flex;
	align-items: center;
	gap: 0;
	background: #fff;
	border: 1px solid #e6e6e6;
	border-radius: 40px;
	padding: 6px 6px 6px 22px;
	min-height: 60px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	margin: 0;
}

/* ---- Category selector ---- */
.mp-search__cat {
	position: relative;
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

/* ---- Custom category dropdown ---- */
.mp-search .mp-search__cat-trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 0;
	background: transparent;
	box-shadow: none;
	font-size: 16px;
	font-weight: 600;
	color: #1a1a1a;
	padding: 6px 4px 6px 0;
	margin: 0;
	cursor: pointer;
	line-height: 1.2;
	outline: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.mp-search__cat-label {
	max-width: 190px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mp-search__chevron {
	display: inline-flex;
	color: #444;
	transition: transform 0.18s ease;
}

.mp-search__cat[data-open="1"] .mp-search__chevron {
	transform: rotate(180deg);
}

/* Keep the panel hidden when the [hidden] attribute is set — must beat the
   display:flex below (author display:flex would otherwise override [hidden]). */
.mp-search__cat-panel[hidden] {
	display: none;
}

.mp-search__cat-panel {
	position: absolute;
	top: calc(100% + 12px);
	left: 0;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	min-width: 220px;
	max-height: 320px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 14px;
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.12);
	padding: 6px;
}

.mp-search__cat-option {
	display: block;
	width: 100%;
	text-align: left;
	border: 0;
	background: transparent;
	color: #1a1a1a;
	font-size: 15px;
	line-height: 1.3;
	padding: 10px 16px;
	margin: 0;
	border-radius: 10px;
	cursor: pointer;
	transition: background-color 0.12s ease, color 0.12s ease;
}

.mp-search__cat-option:hover {
	background: #f6f6f6;
}

.mp-search__cat-option.is-active {
	background: #fff6e9;
	font-weight: 600;
}

.mp-search__divider {
	width: 1px;
	height: 26px;
	background: #dcdcdc;
	margin: 0 14px 0 6px;
	flex-shrink: 0;
}

/* ---- Text input ---- */
.mp-search .mp-search__input {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	height: auto;
	border: 0;
	border-radius: 0;
	background: transparent;
	font-size: 16px;
	color: #1a1a1a;
	padding: 10px 12px;
	margin: 0;
	outline: none;
	box-shadow: none;
}

.mp-search .mp-search__input:focus {
	border: 0;
	box-shadow: none;
	outline: none;
}

.mp-search__input::placeholder {
	color: #9aa0a6;
	opacity: 1;
}

/* Kill the native search-clear icon inconsistencies */
.mp-search__input::-webkit-search-decoration,
.mp-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

/* ---- Button ---- */
.mp-search .mp-search__button {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 76px;
	align-self: stretch;
	min-height: 0;
	height: auto;
	border: 0;
	border-radius: 34px;
	background: #E9A23B;
	color: #1a1a1a;
	cursor: pointer;
	transition: background-color 0.15s ease;
	padding: 0;
	box-shadow: none;
	text-shadow: none;
}

/* When button text is enabled, the button grows to fit text + icon. */
.mp-search .mp-search__button--has-text {
	width: auto;
	min-width: 0;
	padding: 0 24px;
}

.mp-search__button-text {
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}

.mp-search__button-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

/* Icon before the text */
.mp-search__button--icon-left .mp-search__button-icon {
	order: -1;
}

.mp-search .mp-search__button:hover {
	background: #d8912c;
}

.mp-search__button:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 2px;
}

/* Icon size fallback for font-icons / uploaded SVGs. */
.mp-search__button-icon svg,
.mp-search__button-icon img {
	width: 22px;
	height: 22px;
}

/* ---- Live preview panel ---- */
.mp-search__preview {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 10px);
	background: #fff;
	border: 1px solid #ececec;
	border-radius: 16px;
	box-shadow: 0 12px 34px rgba(0, 0, 0, 0.12);
	padding: 8px;
	z-index: 999;
	max-height: 420px;
	overflow-y: auto;
}

.mp-search__preview-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

/* Total results header */
.mp-search__preview-head {
	padding: 10px 14px 10px;
	margin-bottom: 4px;
	font-size: 13px;
	font-weight: 500;
	color: #6b7280;
	border-bottom: 1px solid #f0f0f0;
}

.mp-search__preview-head b {
	color: #1a1a1a;
	font-weight: 700;
}

.mp-search__result {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 12px;
	border-radius: 12px;
	text-decoration: none;
	color: inherit;
	transition: background-color 0.12s ease;
}

.mp-search__result:hover,
.mp-search__result:focus {
	background: #f6f6f6;
	outline: none;
}

/* Custom JetEngine Listing result wrapper */
.mp-search__result--custom {
	display: block;
	padding: 6px;
	border-radius: 12px;
}

.mp-search__result--custom:hover {
	background: #f6f6f6;
}

.mp-search__result-thumb {
	width: 52px;
	height: 52px;
	flex-shrink: 0;
	border-radius: 10px;
	object-fit: cover;
	background: #f2f2f2;
	border: 1px solid #eee;
}

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

.mp-search__result-cat {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	color: #9aa0a6;
	line-height: 1.2;
}

.mp-search__result-title {
	font-size: 15px;
	font-weight: 600;
	color: #1a1a1a;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
}

.mp-search__result-price {
	font-size: 14px;
	font-weight: 600;
	color: #d8912c;
}

.mp-search__result-price del {
	color: #9aa0a6;
	font-weight: 400;
	margin-right: 6px;
}

/* States */
.mp-search__state {
	padding: 16px 14px;
	font-size: 14px;
	color: #6b7280;
	text-align: center;
}

.mp-search__viewall {
	display: block;
	text-align: center;
	padding: 12px;
	margin-top: 4px;
	border-top: 1px solid #f0f0f0;
	font-size: 14px;
	font-weight: 600;
	color: #1a1a1a;
	text-decoration: none;
}

.mp-search__viewall:hover {
	color: #d8912c;
}

/* Loading spinner */
.mp-search__spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #e0e0e0;
	border-top-color: #E9A23B;
	border-radius: 50%;
	animation: mp-search-spin 0.7s linear infinite;
	vertical-align: middle;
	margin-right: 8px;
}

@keyframes mp-search-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ---- Skeleton loading ---- */
.mp-search__loading {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 4px;
}

.mp-search__skel-row {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 12px;
}

.mp-search__skel-body {
	display: flex;
	flex-direction: column;
	gap: 9px;
	flex: 1 1 auto;
	min-width: 0;
}

.mp-search__skel {
	position: relative;
	overflow: hidden;
	background: #ececec;
	border-radius: 6px;
}

.mp-search__skel-thumb {
	width: 52px;
	height: 52px;
	flex-shrink: 0;
	border-radius: 10px;
}

.mp-search__skel-line {
	height: 12px;
}

.mp-search__skel::after {
	content: '';
	position: absolute;
	inset: 0;
	transform: translateX(-100%);
	background: linear-gradient( 90deg, transparent, rgba( 255, 255, 255, 0.65 ), transparent );
	animation: mp-search-shimmer 1.2s infinite;
}

@keyframes mp-search-shimmer {
	100% {
		transform: translateX( 100% );
	}
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
	.mp-search__bar {
		padding-left: 16px;
		min-height: 54px;
	}
	.mp-search__select {
		max-width: 120px;
		font-size: 14px;
	}
	.mp-search__input {
		font-size: 14px;
	}
	.mp-search__button {
		width: 60px;
	}
}

/* Hidden JSF search filter used only as the live-filter engine on the shop page
   (driven by the header MP Search). Add the class `mp-jsf-search-bridge` to a
   JetSmartFilters Search filter connected to the grid to hide it visually while
   keeping it functional. */
.mp-jsf-search-bridge { display: none !important; }

/* Live-filter loading indicator (same-page shop search) */
.mp-search--loading .mp-search__button {
	position: relative;
	color: transparent !important;
}
.mp-search--loading .mp-search__button::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	border: 2px solid rgba(255, 255, 255, 0.5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: mp-search-spin 0.6s linear infinite;
}
@keyframes mp-search-spin {
	to { transform: rotate(360deg); }
}

/* Recent searches (history) */
.mp-search__assist-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 14px 4px;
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}
.mp-search__history-clear {
	border: 0;
	background: none;
	color: #E9A23B;
	font: inherit;
	font-size: 12px;
	cursor: pointer;
	padding: 0;
}
.mp-search__history-list { display: flex; flex-direction: column; }
.mp-search__hist-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 14px;
	cursor: pointer;
	border-radius: 8px;
}
.mp-search__hist-item:hover { background: #f6f6f6; }
.mp-search__hist-term {
	flex: 1;
	color: #1a1a1a;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.mp-search__hist-term::before { content: "\21BA"; margin-right: 8px; color: #9ca3af; }
.mp-search__hist-remove {
	border: 0;
	background: none;
	color: #9ca3af;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}
.mp-search__hist-remove:hover { color: #b32d2e; }
