/* SA Search — آیکن و پنل جستجوی محصولات هدر (RTL، تم تیره) */

/* فیلد جستجوی هدر — ظاهرِ «فیلد» نه «دکمه»: آیکن + متن راهنمای کم‌رنگ. */
.sa-search-toggle {
	display: inline-flex !important;
	align-items: center;
	justify-content: flex-start;
	gap: 9px;
	width: auto !important;
	min-width: 146px;
	height: 42px !important;
	padding: 0 16px 0 14px !important;
	border: 1px solid rgba(0,0,0,0.10) !important;
	border-radius: 12px !important;
	background: #f6f5ee !important;
	color: #8a8a86 !important;
	cursor: text;
	transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, color .2s ease;
	flex: none;
	text-align: start;
	font-family: var(--sa-font, "Vazirmatn", Tahoma, sans-serif);
}

.sa-search-toggle:hover {
	background: #fff !important;
	border-color: rgba(0,0,0,0.18) !important;
	color: #5f5f5b !important;
}

.sa-search-toggle:focus,
.sa-search-toggle:focus-visible {
	outline: none;
	background: #fff !important;
	border-color: var(--sa-gold,#FFDA00) !important;
	box-shadow: 0 0 0 3px rgba(var(--sa-gold-rgb,255,218,0), 0.28);
	color: #5f5f5b !important;
}

.sa-search-toggle-ico {
	display: inline-flex;
	flex: none;
	color: var(--sa-gold-dark, #b08d00);
}

.sa-search-toggle-ico svg {
	width: 19px;
	height: 19px;
	stroke-width: 2.2;
}

.sa-search-toggle-label {
	flex: 1 1 auto;
	font-size: 14.5px;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* تبلت: فضای کم؛ فیلد به آیکنِ تنها جمع می‌شود (هنوز دکمه‌ی توپر نیست). */
@media (max-width: 1024px) and (min-width: 768px) {
	.sa-search-toggle {
		min-width: 0;
		width: 42px !important;
		justify-content: center;
		padding: 0 !important;
		gap: 0;
	}
	.sa-search-toggle-label {
		display: none;
	}
	.sa-search-toggle-ico svg {
		width: 21px;
		height: 21px;
	}
}

/* پوشش تمام‌صفحه پشت پنل */
.sa-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(6, 6, 8, 0.6);
	backdrop-filter: blur(3px);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility .25s ease;
}

.sa-search-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

/* نوار جستجوی کشویی از بالای صفحه */
.sa-search-panel {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 99999;
	direction: rtl;
	background: var(--sa-bg,#FFFFFF);
	border-bottom: 1px solid rgba(var(--sa-gold-rgb,255,206,0), 0.25);
	box-shadow: 0 12px 40px rgba(29,29,27,0.12);
	transform: translateY(-100%);
	transition: transform .28s cubic-bezier(.2, .8, .2, 1);
	font-family: var(--sa-font, "Vazirmatn", Tahoma, sans-serif);
}

.sa-search-overlay.is-open .sa-search-panel {
	transform: translateY(0);
}

.sa-search-inner {
	max-width: 820px;
	margin: 0 auto;
	padding: 22px 20px 26px;
}

.sa-search-form {
	display: flex;
	align-items: center;
	gap: 12px;
	background: rgba(0,0,0,0.048);
	border: 1px solid rgba(0,0,0,0.096);
	border-radius: 14px;
	padding: 6px 14px;
}

.sa-search-form:focus-within {
	border-color: var(--sa-gold,#FFDA00);
	background: rgba(0,0,0,0.072);
}

.sa-search-form .sa-search-ico {
	color: var(--sa-gold,#FFDA00);
	display: inline-flex;
	flex: none;
}

.sa-search-form .sa-search-ico svg {
	width: 22px;
	height: 22px;
}

.sa-search-input {
	flex: 1 1 auto;
	background: transparent !important;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	color: var(--sa-text,#212121) !important;
	font: inherit;
	font-size: 17px;
	padding: 10px 4px !important;
	height: auto;
}

.sa-search-input::placeholder {
	color: rgba(33, 33, 33, 0.45);
}

/* حذف دکمهٔ ضربدر پیش‌فرض مرورگر در input نوع search */
.sa-search-input::-webkit-search-cancel-button,
.sa-search-input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.sa-search-close {
	flex: none;
	width: 34px;
	height: 34px;
	border: 0;
	border-radius: 50%;
	background: rgba(0,0,0,0.048);
	color: var(--sa-text,#212121);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}

.sa-search-close:hover {
	background: rgba(198,40,40,0.2);
	color: #ff6b6b;
}

/* نتایج */
.sa-search-results {
	margin-top: 16px;
	max-height: min(60vh, 480px);
	overflow-y: auto;
}

.sa-search-status {
	padding: 22px 6px;
	text-align: center;
	color: rgba(33, 33, 33, 0.55);
	font-size: 14px;
}

.sa-search-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 12px;
	border-radius: 12px;
	text-decoration: none;
	color: var(--sa-text,#212121);
	transition: background .18s ease;
}

.sa-search-item:hover,
.sa-search-item.is-active {
	background: rgba(29, 29, 27, 0.05);
}

.sa-search-item img {
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: 10px;
	flex: none;
	background: rgba(0,0,0,0.04);
}

.sa-search-item-body {
	flex: 1 1 auto;
	min-width: 0;
}

.sa-search-item-title {
	display: block;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sa-search-item-price {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: var(--sa-gold,#FFDA00);
}

.sa-search-item-price del {
	color: rgba(33, 33, 33, 0.4);
	margin-left: 6px;
}

.sa-search-viewall {
	display: block;
	margin-top: 8px;
	padding: 12px;
	text-align: center;
	border-radius: 12px;
	background: rgba(var(--sa-gold-rgb,255,206,0), 0.12);
	color: var(--sa-gold,#FFDA00);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background .18s ease;
}

.sa-search-viewall:hover {
	background: rgba(29, 29, 27, 0.09);
}

@media (max-width: 600px) {
	.sa-search-inner {
		padding: 16px 14px 20px;
	}
	.sa-search-input {
		font-size: 16px;
	}
}

/* نوار جستجوی اینلاین موبایل — همیشه‌نمایان، تمام‌عرض، چسبیده به هدر */
.sa-search-inline {
	display: none;
}

@media (max-width: 767px) {
	/* در موبایل آیکن جستجو لازم نیست؛ خود نوار همیشه دیده می‌شود */
	.sa-search-toggle {
		display: none !important;
	}

	.sa-search-inline {
		display: block;
		position: relative;
		width: 100%;
		margin-top: 10px;
		direction: rtl;
		font-family: var(--sa-font, "Vazirmatn", Tahoma, sans-serif);
	}

	.sa-search-inline .sa-search-form {
		padding: 2px 12px;
		border-radius: 12px;
		background: rgba(0,0,0,0.056);
	}

	.sa-search-inline .sa-search-input {
		font-size: 16px;
		padding: 9px 4px !important;
	}

	.sa-search-inline .sa-search-ico svg {
		width: 19px;
		height: 19px;
	}

	.sa-search-inline .sa-search-results {
		display: none;
		position: absolute;
		top: calc(100% + 8px);
		right: 0;
		left: 0;
		margin-top: 0;
		padding: 8px;
		background: var(--sa-bg,#FFFFFF);
		border: 1px solid rgba(0,0,0,0.096);
		border-radius: 14px;
		box-shadow: 0 18px 40px rgba(29,29,27,0.12);
		max-height: min(55vh, 420px);
		overflow-y: auto;
		z-index: 100000;
	}

	.sa-search-inline .sa-search-results.has-items {
		display: block;
	}
}
