/* ===========================================
   Mr Amniat - Ajax Search Widget Styles
   =========================================== */

.mae-search-wrap {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	background-color: #F5F6F8;
	border: 1px solid #E3E5E9;
	border-radius: 50px;
	padding: 6px 8px;
	box-sizing: border-box;
	direction: ltr; /* جهت خنثی - ترتیب واقعی با order مشخص می‌شود */
}

/* ترتیب فیزیکی ثابت طبق عکس مرجع، مستقل از rtl/ltr مرورگر:
   آیکون ذره‌بین (چپ‌ترین) -> دسته‌بندی -> ورودی متن -> لوگو (راست‌ترین) */
.mae-search-wrap .mae-search-icon  { order: 1; }
.mae-search-wrap .mae-categories   { order: 2; }
.mae-search-wrap .mae-search-input { order: 3; }
.mae-search-wrap .mae-logo         { order: 4; }

/* آیکون ذره‌بین */
.mae-search-wrap .mae-search-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	color: #6E7280;
	padding-right: 6px;
}

.mae-search-wrap .mae-search-icon svg {
	width: 20px;
	height: 20px;
	display: block;
}

.mae-search-wrap .mae-search-icon i {
	font-size: 20px;
	line-height: 1;
	color: #6E7280;
}

/* باکس دسته‌بندی */
.mae-search-wrap .mae-categories {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	border-right: 1px solid #D8DADE;
	padding-right: 10px;
	margin-right: 2px;
	white-space: nowrap;
}

.mae-search-wrap .mae-cat-select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background: transparent;
	border: none;
	outline: none;
	font-size: 14px;
	color: #2B2F38;
	cursor: pointer;
	padding-left: 18px;
	max-width: 110px;
	text-overflow: ellipsis;
}

.mae-search-wrap .mae-cat-arrow {
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	display: flex;
}

.mae-search-wrap .mae-cat-arrow svg {
	width: 12px;
	height: 12px;
	fill: #6E7280;
}

.mae-search-wrap .mae-cat-arrow svg path {
	fill: #6E7280;
}

/* ورودی متن جستجو */
.mae-search-wrap .mae-search-input {
	flex: 1 1 auto;
	min-width: 0;
	border: none;
	outline: none;
	background: transparent;
	font-size: 14px;
	color: #2B2F38;
	height: 100%;
	text-align: right;
	direction: rtl;
}

.mae-search-wrap .mae-search-input::placeholder {
	color: #A7ABB3;
}

/* باکس لوگو */
.mae-search-wrap .mae-logo {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #FFFFFF;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	overflow: hidden;
}

.mae-search-wrap .mae-logo img {
	height: 36px;
	width: auto;
	max-width: 100%;
	display: block;
	object-fit: contain;
}

.mae-search-wrap .mae-logo a {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* باکس نتایج آجاکس */
.mae-results {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	left: 0;
	background-color: #FFFFFF;
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
	max-height: 420px;
	overflow-y: auto;
	z-index: 9999;
	padding: 6px;
	direction: rtl;
}

.mae-results.mae-active {
	display: block !important;
}

.mae-result-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: 10px;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.mae-result-item:hover {
	background-color: #F5F6F8;
}

.mae-result-item img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 8px;
	flex: 0 0 auto;
}

.mae-result-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.mae-result-title {
	font-size: 13px;
	color: #2B2F38;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mae-result-price {
	font-size: 12px;
	color: #C8A24E;
}

.mae-results-empty,
.mae-results-loading {
	padding: 16px;
	text-align: center;
	font-size: 13px;
	color: #A7ABB3;
}

.mae-results-outofstock {
	font-size: 11px;
	color: #D9534F;
}

/* ===========================================
   موبایل: حذف باکس دسته‌بندی
   =========================================== */
@media (max-width: 767px) {
	.mae-search-wrap .mae-categories {
		display: none !important;
	}
}
