/* =====================================================================
   ویجت جستجوی سریع و هوشمند سایت.

   برخلاف دکمه‌ی شناور چت‌بات، این ویجت یک عنصر معمولیِ درون‌جریان صفحه
   است (نه یک همپوشان سراسری با position:fixed) — بنابراین اکثر کلاس‌های
   باگ مربوط به تداخل با قالب (transform روی والد، overflow:hidden و…)
   از اساس منتفی است. با این‌حال همان اصول دفاعی رعایت شده: ریست‌های
   هدفمند برای فرار از استایل‌های کلی قالب، box-sizing صریح، و رفع اشکال
   کلاسیک flexbox (min-height:0) برای فهرست نتایج قابل‌اسکرول.
   ===================================================================== */

.noya-search-widget {
	--noya-search-color: #4f46e5;
	--noya-search-color-dark: #4338ca;
	--noya-search-bg: #ffffff;
	--noya-search-bg-soft: #f7f8fc;
	--noya-search-text: #1f2937;
	--noya-search-text-soft: #667085;
	--noya-search-border: #e5e7eb;
	--noya-search-radius: 12px;
	position: relative;
	width: 100%;
	max-width: 100%;
	font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
	direction: rtl;
	box-sizing: border-box;
}
.noya-search-widget,
.noya-search-widget *,
.noya-search-widget *::before,
.noya-search-widget *::after {
	box-sizing: border-box;
}
.noya-search-widget * {
	margin: 0;
	padding: 0;
}
.noya-search-widget button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}
.noya-search-widget input {
	font: inherit;
	color: inherit;
}
.noya-search-widget img { display: block; max-width: 100%; }
.noya-search-widget a { text-decoration: none; color: inherit; }

/* ---------- انواع استایل ---------- */
.noya-search-style-minimal { --noya-search-radius: 6px; }
.noya-search-style-sharp   { --noya-search-radius: 0px; }
.noya-search-style-rounded { --noya-search-radius: 999px; }
.noya-search-style-claymorphism {
	--noya-search-radius: 24px;
	--noya-clay-light: rgba(255, 255, 255, .75);
	--noya-clay-dark: rgba(163, 177, 198, .5);
}

.noya-search-box {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--noya-search-bg);
	border: 1.5px solid var(--noya-search-border);
	border-radius: var(--noya-search-radius);
	padding: 10px 16px;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.noya-search-style-rounded .noya-search-box { padding-inline-start: 18px; }
.noya-search-box:focus-within {
	border-color: var(--noya-search-color);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.noya-search-icon { font-size: 15px; flex-shrink: 0; opacity: .6; line-height: 1; }
.noya-search-input {
	flex: 1;
	min-width: 0;
	width: 100%;
	border: 0;
	outline: none;
	background: transparent;
	font-size: 14px;
	color: var(--noya-search-text);
	direction: rtl;
}
.noya-search-input::placeholder { color: var(--noya-search-text-soft); opacity: .85; }
.noya-search-clear {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	color: var(--noya-search-text-soft);
	background: var(--noya-search-bg-soft);
	transition: background .15s ease, color .15s ease;
}
.noya-search-clear:hover { background: var(--noya-search-border); color: var(--noya-search-text); }

/* ---------- فیلترهای نوع محتوا ---------- */
.noya-search-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}
.noya-search-chip {
	padding: 5px 13px;
	border-radius: 999px;
	border: 1.5px solid var(--noya-search-border);
	background: var(--noya-search-bg);
	color: var(--noya-search-text-soft);
	font-size: 12px;
	font-weight: 600;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
	white-space: nowrap;
}
.noya-search-chip:hover { border-color: var(--noya-search-color); color: var(--noya-search-color); }
.noya-search-chip.is-active {
	background: var(--noya-search-color);
	border-color: var(--noya-search-color);
	color: #fff;
}

/* ---------- کشوی نتایج ---------- */
.noya-search-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	left: 0;
	background: var(--noya-search-bg);
	border: 1px solid var(--noya-search-border);
	border-radius: 14px;
	box-shadow: 0 18px 44px -10px rgba(17, 24, 39, .22), 0 4px 14px rgba(17, 24, 39, .08);
	z-index: 999;
	max-height: 420px;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 8px;
}
.noya-search-dropdown::-webkit-scrollbar { width: 6px; }
.noya-search-dropdown::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .14); border-radius: 10px; }

.noya-search-state {
	padding: 18px 12px;
	text-align: center;
	font-size: 13px;
	color: var(--noya-search-text-soft);
}
.noya-search-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid var(--noya-search-border);
	border-top-color: var(--noya-search-color);
	border-radius: 50%;
	animation: noya-search-spin .7s linear infinite;
	vertical-align: middle;
	margin-inline-end: 6px;
}
@keyframes noya-search-spin { to { transform: rotate(360deg); } }

.noya-search-result {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 8px;
	border-radius: 10px;
	transition: background .12s ease;
	cursor: pointer;
}
.noya-search-result:hover,
.noya-search-result.is-selected {
	background: var(--noya-search-bg-soft);
}
.noya-search-result-thumb {
	width: 46px;
	height: 46px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--noya-search-bg-soft);
}
.noya-search-result-thumb-fallback {
	width: 46px;
	height: 46px;
	border-radius: 8px;
	background: var(--noya-search-bg-soft);
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	opacity: .5;
}
.noya-search-result-body { flex: 1; min-width: 0; }
.noya-search-result-head { display: flex; align-items: center; gap: 6px; }
.noya-search-result-title {
	font-size: 13.5px;
	font-weight: 700;
	color: var(--noya-search-text);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	flex: 1;
	min-width: 0;
}
.noya-search-result-title mark {
	background: rgba(79, 70, 229, .16);
	color: var(--noya-search-color-dark);
	border-radius: 3px;
	padding: 0 1px;
}
.noya-search-result-badge {
	font-size: 10px;
	font-weight: 700;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--noya-search-bg-soft);
	color: var(--noya-search-text-soft);
	flex-shrink: 0;
}
.noya-search-result-excerpt {
	font-size: 11.5px;
	color: var(--noya-search-text-soft);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-top: 2px;
}
.noya-search-result-excerpt mark {
	background: rgba(79, 70, 229, .14);
	color: inherit;
	border-radius: 3px;
}
.noya-search-result-price {
	font-size: 12px;
	font-weight: 700;
	color: var(--noya-search-color);
	flex-shrink: 0;
	white-space: nowrap;
	margin-inline-start: 6px;
}
.noya-search-result-stock { font-size: 9.5px; font-weight: 600; margin-top: 2px; }
.noya-search-result-stock.ok { color: #16a34a; }
.noya-search-result-stock.no { color: #dc2626; }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 480px) {
	.noya-search-dropdown { max-height: 65vh; }
	.noya-search-result-excerpt { display: none; }
}

/* =====================================================================
   تم Claymorphism — ظاهر نرم و برجسته‌ی «رسی» با سایه‌ی دوطرفه (یک سایه‌ی
   روشن برای شبیه‌سازی نور، و یک سایه‌ی تیره‌تر در جهت مخالف) به‌جای خط‌کشی
   با border. بدون border صریح؛ عمق کاملاً از سایه‌ها ساخته می‌شود.
   ===================================================================== */
.noya-search-style-claymorphism .noya-search-box {
	border: none;
	background: var(--noya-search-bg-soft);
	box-shadow: 8px 8px 16px var(--noya-clay-dark), -8px -8px 16px var(--noya-clay-light);
	padding: 13px 20px;
}
.noya-search-style-claymorphism .noya-search-box:focus-within {
	border-color: transparent;
	box-shadow: 6px 6px 12px var(--noya-clay-dark), -6px -6px 12px var(--noya-clay-light), 0 0 0 3px rgba(79, 70, 229, .15);
}
.noya-search-style-claymorphism .noya-search-clear {
	background: var(--noya-search-bg);
	box-shadow: 2px 2px 4px var(--noya-clay-dark), -2px -2px 4px var(--noya-clay-light);
}
.noya-search-style-claymorphism .noya-search-chip {
	border: none;
	background: var(--noya-search-bg-soft);
	box-shadow: 3px 3px 6px var(--noya-clay-dark), -3px -3px 6px var(--noya-clay-light);
}
.noya-search-style-claymorphism .noya-search-chip.is-active {
	background: var(--noya-search-color);
	border-color: transparent;
	box-shadow: inset 2px 2px 5px rgba(0, 0, 0, .22), inset -2px -2px 5px rgba(255, 255, 255, .15);
}
.noya-search-style-claymorphism .noya-search-dropdown {
	border: none;
	border-radius: 22px;
	background: var(--noya-search-bg-soft);
	box-shadow: 12px 12px 28px var(--noya-clay-dark), -12px -12px 28px var(--noya-clay-light);
}
.noya-search-style-claymorphism .noya-search-result {
	background: var(--noya-search-bg);
	box-shadow: 4px 4px 10px var(--noya-clay-dark), -4px -4px 10px var(--noya-clay-light);
	margin-bottom: 8px;
}
.noya-search-style-claymorphism .noya-search-result:last-child { margin-bottom: 0; }
.noya-search-style-claymorphism .noya-search-result:hover,
.noya-search-style-claymorphism .noya-search-result.is-selected {
	background: var(--noya-search-bg);
	box-shadow: inset 3px 3px 7px var(--noya-clay-dark), inset -3px -3px 7px var(--noya-clay-light);
}
.noya-search-style-claymorphism .noya-search-result-thumb,
.noya-search-style-claymorphism .noya-search-result-thumb-fallback {
	box-shadow: 2px 2px 5px var(--noya-clay-dark), -2px -2px 5px var(--noya-clay-light);
}
