/* Quick Media Suite - Live AJAX Search Styles */

/* Header & Navigation Stacking - Always keep Header and Submenus on Top */
header.et-l--header,
.et-l--header,
.et_pb_section_0_tb_header,
.et_pb_section_1_tb_header,
.et_pb_section_2_tb_header,
.et_pb_menu_0_tb_header,
.et_pb_menu_1_tb_header,
.main_primary_menu,
.et_pb_menu .sub-menu,
.et-menu .sub-menu,
.nav li ul.sub-menu,
.et_mobile_menu {
	z-index: 99999999 !important;
	position: relative;
}

.qmt-search-wrapper {
	position: relative;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: inherit;
	z-index: 999;
}

/* Allow search section & rows to overflow dropdown cleanly without clipping */
.et-l--post .et_pb_section:has(.qmt-search-wrapper),
.et-l--post .et_pb_row:has(.qmt-search-wrapper),
.et-l--post .et_pb_column:has(.qmt-search-wrapper),
.et-l--post .et_pb_module:has(.qmt-search-wrapper),
.et_pb_text_inner:has(.qmt-search-wrapper) {
	overflow: visible !important;
}

.qmt-search-wrapper * {
	box-sizing: border-box;
}

.qmt-search-box {
	display: flex;
	align-items: center;
	position: relative;
	background: #ffffff;
	border: 1.5px solid #cbd5e1;
	transition: all 0.2s ease-in-out;
	width: 100%;
}

/* Style: Pirx (Rounded Pill) */
.qmt-style-pirx .qmt-search-box {
	border-radius: 9999px;
	padding: 4px 16px;
}

/* Style: Classic (Framed Box) */
.qmt-style-classic .qmt-search-box {
	border-radius: 8px;
	padding: 4px 14px;
}

.qmt-search-box:focus-within {
	border-color: #0284c7;
	box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.qmt-icon-left {
	display: flex;
	align-items: center;
	color: #64748b;
	margin-right: 10px;
}

.qmt-search-input {
	flex: 1;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	padding: 8px 0 !important;
	font-size: 15px !important;
	color: #1e293b !important;
	line-height: 1.5 !important;
	width: 100% !important;
}

/* Hide Chrome / Safari default cancel button so our custom clear button is clean */
.qmt-search-input::-webkit-search-cancel-button,
.qmt-search-input::-webkit-search-decoration,
.qmt-search-input::-webkit-search-results-button,
.qmt-search-input::-webkit-search-results-decoration {
	-webkit-appearance: none !important;
	display: none !important;
}

.qmt-clear-btn {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 20px;
	color: #94a3b8;
	padding: 0 6px;
	line-height: 1;
	transition: color 0.15s;
}

.qmt-clear-btn:hover {
	color: #ef4444;
}

.qmt-preloader {
	display: flex;
	align-items: center;
	padding-right: 4px;
}

.qmt-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid #e2e8f0;
	border-top: 2px solid #0284c7;
	border-radius: 50%;
	animation: qmt-spin 0.6s linear infinite;
}

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

/* Suggestions Panel Dropdown */
.qmt-suggestions-panel {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	margin-top: 8px;
	background-color: #ffffff !important;
	background: #ffffff !important;
	opacity: 1 !important;
	color: #1e293b !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 12px;
	box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25), 0 5px 15px rgba(0, 0, 0, 0.1) !important;
	z-index: 9999999 !important;
	overflow: hidden;
	max-height: 480px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.qmt-suggestions-list {
	background-color: #ffffff !important;
	background: #ffffff !important;
	opacity: 1 !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	width: 100%;
}

.qmt-section-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #64748b;
	background-color: #f8fafc !important;
	background: #f8fafc !important;
	opacity: 1 !important;
	padding: 8px 16px;
	border-bottom: 1px solid #f1f5f9;
}

.qmt-cat-item,
.qmt-prod-item {
	background-color: #ffffff !important;
	background: #ffffff !important;
	opacity: 1 !important;
}

.qmt-cat-item:hover {
	background-color: #f0f9ff !important;
	background: #f0f9ff !important;
}

.qmt-cat-pill {
	font-size: 11px;
	background: #e0f2fe;
	color: #0369a1;
	padding: 1px 7px;
	border-radius: 9999px;
	margin-left: 6px;
	font-weight: 500;
}

.qmt-arrow-right {
	color: #94a3b8;
	font-weight: bold;
	font-size: 16px;
	margin-left: auto;
}

.qmt-suggestion-item {
	display: flex;
	align-items: center;
	padding: 10px 16px;
	border-bottom: 1px solid #f1f5f9;
	text-decoration: none !important;
	color: inherit !important;
	background-color: #ffffff !important;
	background: #ffffff !important;
	opacity: 1 !important;
	transition: background 0.15s ease;
	gap: 12px;
}

.qmt-suggestion-item:last-child {
	border-bottom: none;
}

.qmt-suggestion-item:hover,
.qmt-suggestion-item.qmt-selected {
	background-color: #f8fafc !important;
	background: #f8fafc !important;
}

.qmt-item-thumb {
	width: 46px;
	height: 46px;
	border-radius: 6px;
	object-fit: cover;
	border: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.qmt-item-details {
	flex: 1;
	min-width: 0;
}

.qmt-item-title {
	font-size: 14px;
	font-weight: 600;
	color: #0f172a;
	margin-bottom: 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.qmt-highlight {
	background: #fef08a;
	color: #854d0e;
	padding: 1px 3px;
	border-radius: 3px;
	font-weight: 700;
}

.qmt-item-meta {
	display: flex;
	gap: 8px;
	font-size: 12px;
	color: #64748b;
	align-items: center;
	flex-wrap: wrap;
}

.qmt-cat-badge {
	background: #e0f2fe;
	color: #0369a1;
	padding: 2px 7px;
	border-radius: 4px;
	font-weight: 500;
}

.qmt-sku-badge {
	background: #f1f5f9;
	color: #475569;
	padding: 2px 7px;
	border-radius: 4px;
	font-family: monospace;
}

.qmt-tab-match-badge {
	background: #ecfdf5;
	color: #047857;
	border: 1px solid #a7f3d0;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 11px;
}

.qmt-suggestions-footer {
	padding: 12px 16px;
	background-color: #f8fafc !important;
	background: #f8fafc !important;
	opacity: 1 !important;
	border-top: 1px solid #e2e8f0;
	text-align: center;
}

.qmt-see-all-link {
	font-size: 13px;
	font-weight: 600;
	color: #0284c7 !important;
	text-decoration: none !important;
}

.qmt-see-all-link:hover {
	text-decoration: underline !important;
}

.qmt-no-results {
	padding: 24px;
	text-align: center;
	color: #64748b;
	font-size: 14px;
	background-color: #ffffff !important;
	background: #ffffff !important;
	opacity: 1 !important;
}

/* Mobile Fullscreen Modal Overlay */
.qmt-mobile-overlay-active {
	overflow: hidden !important;
}

.qmt-mobile-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: #ffffff;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	padding: 16px;
	box-sizing: border-box;
}

.qmt-mobile-modal-header {
	display: flex;
	gap: 10px;
	align-items: center;
	padding-bottom: 12px;
	border-bottom: 1px solid #e2e8f0;
}

.qmt-mobile-close-btn {
	background: #f1f5f9;
	border: none;
	border-radius: 50%;
	width: 38px;
	height: 38px;
	font-size: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #475569;
	cursor: pointer;
}

.qmt-mobile-results {
	flex: 1;
	overflow-y: auto;
	margin-top: 12px;
}

/* Mobile Specific Opacity & Elevation */
@media (max-width: 992px) {
	.et-l--post .et_pb_section_2,
	.et-l--post .et_pb_section:has(.qmt-search-wrapper),
	.et-l--post .et_pb_section.qmt-section-search-active {
		z-index: 30 !important;
		position: relative !important;
	}

	.qmt-suggestions-panel {
		background-color: #ffffff !important;
		background: #ffffff !important;
		opacity: 1 !important;
		box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3) !important;
		border: 1px solid #cbd5e1 !important;
		z-index: 99999 !important;
	}

	.qmt-suggestions-list,
	.qmt-suggestion-item,
	.qmt-cat-item,
	.qmt-prod-item {
		background-color: #ffffff !important;
		background: #ffffff !important;
		opacity: 1 !important;
	}
}
