/* ProSearch — ظاهر پیش‌فرض (هم‌اندازه و هم‌رنگ جست‌وجوی دیجی‌کالا). همه‌چیز با متغیرهای CSS روی .ps-root و کنترل‌های ویجت قابل تغییر است. */

.ps-root {
	--ps-accent: #ef394e;
	--ps-accent-soft: #fff0f2;
	--ps-text: #1f1f1f;          /* متن ردیف‌ها */
	--ps-typed: #5c5c5c;         /* بخش تایپ‌شده در ردیف‌ها */
	--ps-chip: #23254e;          /* متن چیپ‌ها */
	--ps-title: #0c0c0c;         /* عنوان بخش‌ها */
	--ps-muted: #81858b;
	--ps-icon: #848484;
	--ps-link: #1672dd;          /* برچسب «در …» کنار ردیف */
	--ps-bg: #f0f0f1;
	--ps-panel: #fff;
	--ps-border: #e0e0e2;
	--ps-divider: #ecedef;
	--ps-hover: #f5f5f6;
	--ps-radius: 9999px;         /* گردی جعبه */
	--ps-panel-radius: 16px;
	--ps-h: 44px;
	position: relative;
	width: 100%;
	color: var(--ps-text);
	font-size: 14px;
	line-height: 1.6;
}
.ps-root *, .ps-root *::before, .ps-root *::after { box-sizing: border-box; }
.ps-root [hidden] { display: none !important; }
/* جعبه‌ی بازشده باید بالاتر از همه‌چیز باشد؛ مقدار از تنظیم افزونه (--ps-z-global) یا کنترل ویجت (--ps-z) می‌آید و جاوااسکریپت والدهای دارای stacking context را هم موقتاً بالا می‌برد */
.ps-root { --ps-z: var(--ps-z-global, 2147483000); }
.ps-root.is-open { z-index: var(--ps-z); }
.ps-svg { display: block; width: 1em; height: 1em; }
.ps-i { display: inline-flex; flex: none; align-items: center; justify-content: center; color: var(--ps-icon); font-size: 18px; line-height: 1; }
.ps-i svg, .ps-i i { width: 1em; height: 1em; font-size: inherit; }
html.ps-lock { overflow: hidden; }

/* قالب‌ها اغلب به همه‌ی لینک‌ها زیرخط می‌دهند؛ داخل پروسرچ خنثی می‌شود */
.ps-root a, .ps-root a:hover, .ps-root a:focus, .ps-root a:visited { text-decoration: none; box-shadow: none; }
.ps-root a.ps-item *, .ps-root a.ps-chip *, .ps-root a.ps-cat *, .ps-root a.ps-viewall * { text-decoration: none; }

/* ---- بازنشانی دکمه‌ها (تا استایل دکمه‌ی قالب روی آن‌ها اثر نگذارد) ---- */
.ps-root button { appearance: none; margin: 0; padding: 0; min-width: 0; min-height: 0; font: inherit; line-height: 1; color: inherit; text-transform: none; letter-spacing: normal; text-shadow: none; background: none; border: 0; border-radius: 0; box-shadow: none; cursor: pointer; }
.ps-root button:hover, .ps-root button:focus { color: inherit; background: none; box-shadow: none; text-decoration: none; }
.ps-root button:focus-visible, .ps-root a:focus-visible { outline: 2px solid var(--ps-accent); outline-offset: 2px; }

/* ---- حالت‌های نمایش: باکس / دکمه (کنترل از المنتور یا کلاس‌های شورتکد) ---- */
.ps-inline { display: var(--ps-box, block); }
.ps-trigger { display: var(--ps-btn, none); align-items: center; justify-content: center; gap: 8px; height: var(--ps-h); padding: 0 14px; color: var(--ps-text); background: var(--ps-bg); border-radius: var(--ps-radius); transition: background-color .15s, color .15s; }
.ps-root .ps-trigger:hover { color: var(--ps-accent); background: var(--ps-bg); }
.ps-trigger__ico { display: inline-flex; font-size: 24px; line-height: 1; }
.ps-trigger__txt { font-size: 14px; white-space: nowrap; }
.ps-sc-d-button { --ps-box: none; --ps-btn: inline-flex; }
.ps-sc-d-box { --ps-box: block; --ps-btn: none; }
@media (max-width: 767.98px) {
	.ps-sc-m-button { --ps-box: none; --ps-btn: inline-flex; }
	.ps-sc-m-box { --ps-box: block; --ps-btn: none; }
}

/* ---- جعبه (کپسول) ---- */
.ps-form { position: relative; margin: 0; }
.ps-head { display: flex; align-items: center; gap: 4px; }
.ps-box { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 0; height: var(--ps-h); padding: 0 12px; background: var(--ps-bg); border: .8px solid transparent; border-radius: var(--ps-radius); transition: background-color .15s, border-color .15s; }
/* هنگام باز بودن، جعبه باید کاملاً مات و سفید بماند (وگرنه لایه‌ی تیره/بلر پشت آن دیده می‌شود)؛ رنگ ملایم با تصویر پس‌زمینه ساخته می‌شود */
.ps-root.is-open .ps-box { background-color: var(--ps-panel); background-image: linear-gradient(rgba(0, 0, 0, .02), rgba(0, 0, 0, .02)); border-color: var(--ps-border); }
.ps-ico, .ps-clear, .ps-voice, .ps-close { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 28px; height: 28px; color: var(--ps-icon); font-size: 24px; }
.ps-root .ps-ico:hover, .ps-root .ps-clear:hover, .ps-root .ps-voice:hover, .ps-root .ps-close:hover { color: var(--ps-accent); }
.ps-back { display: none; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; color: var(--ps-text); font-size: 24px; }
.ps-root:dir(ltr) .ps-back .ps-svg, .ps-root:dir(ltr) .ps-viewall .ps-svg { transform: scaleX(-1); }
.ps-field { position: relative; flex: 1; min-width: 0; height: 100%; }
.ps-root .ps-input, .ps-root .ps-input:focus { display: block; width: 100%; height: 100%; margin: 0; padding: 0 4px; color: var(--ps-text); font: inherit; font-size: 14px; font-weight: 500; background: transparent; border: 0; border-radius: 0; box-shadow: none; outline: 0; -webkit-appearance: none; appearance: none; }
.ps-input::-webkit-search-cancel-button, .ps-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.ps-input::placeholder { color: var(--ps-muted); font-weight: 500; opacity: 1; }
.ps-ph { position: absolute; inset: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; color: var(--ps-muted); font-size: 14px; font-weight: 500; white-space: nowrap; pointer-events: none; }
.ps-ph__logo { display: block; width: auto; max-width: 120px; height: 16px; }
.ps-input:not(:placeholder-shown) ~ .ps-ph { display: none; }
.is-listening .ps-voice { color: var(--ps-accent); animation: ps-pulse 1s ease-in-out infinite; }
@keyframes ps-pulse { 50% { opacity: .35; } }

/* ---- پنل کشویی (دسکتاپ) و حالت پس‌زمینه‌ی صفحه ---- */
.ps-overlay { position: fixed; inset: 0; z-index: 1; background: rgba(0, 0, 0, .4); }
/* حالت پس‌زمینه‌ی صفحه هنگام باز شدن: overlay (پیش‌فرض) | blur | both | none — میزان بلر با --ps-ov-blur */
.ps-ov-blur .ps-overlay { background: transparent; -webkit-backdrop-filter: blur(var(--ps-ov-blur, 8px)); backdrop-filter: blur(var(--ps-ov-blur, 8px)); }
.ps-ov-both .ps-overlay { -webkit-backdrop-filter: blur(var(--ps-ov-blur, 6px)); backdrop-filter: blur(var(--ps-ov-blur, 6px)); }
.ps-ov-none .ps-overlay { background: transparent; }
.ps-form { z-index: 2; }
.ps-panel { position: absolute; inset-inline: 0; top: calc(100% + 8px); z-index: 3; max-height: min(72vh, 560px); overflow-y: auto; overscroll-behavior: contain; background: var(--ps-panel); border: .8px solid var(--ps-border); border-radius: var(--ps-panel-radius); box-shadow: 0 10px 30px rgba(0, 0, 0, .14); }
.ps-body.is-loading { opacity: .55; transition: opacity .15s; }

/* ---- حالت پنجره‌ای (دکمه‌ی بازکننده، دسکتاپ) ---- */
.ps-root.ps-as-modal .ps-inline { display: block; }
.ps-root.ps-as-modal .ps-form { position: fixed; top: 7vh; inset-inline: 0; width: min(720px, 94vw); margin-inline: auto; }
.ps-root.ps-as-modal .ps-box { background: var(--ps-panel); border-color: var(--ps-border); box-shadow: 0 10px 30px rgba(0, 0, 0, .14); }
.ps-root.ps-as-modal .ps-panel { position: static; margin-top: 8px; max-height: 68vh; }

/* ---- تمام‌صفحه (موبایل): پیکان بازگشت + کپسول، مثل دیجی‌کالا ---- */
.ps-root.ps-fs .ps-inline { display: block; }
.ps-root.ps-fs .ps-form { position: fixed; inset: 0; z-index: 2; display: flex; flex-direction: column; width: auto; max-width: none; margin: 0; background: var(--ps-panel); }
.ps-root.ps-fs .ps-head { flex: none; padding: 4px 8px 4px 12px; background: var(--ps-panel); }
.ps-root.ps-fs .ps-box { box-shadow: none; }
.ps-root.ps-fs .ps-panel { position: static; flex: 1; min-height: 0; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.ps-root.ps-fs .ps-back { display: inline-flex; }
.ps-root.ps-fs .ps-close { display: none !important; }
.ps-root.ps-fs .ps-overlay { display: none !important; }

/* ---- بخش‌ها (پنل پیش از تایپ) ---- */
.ps-sec { padding: 16px 0 4px; }
.ps-sec__h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 16px; margin-bottom: 12px; color: var(--ps-title); font-size: 14px; font-weight: 700; }
.ps-notitle .ps-sec--pr .ps-sec__h, .ps-notitle .ps-sec--po .ps-sec__h, .ps-notitle .ps-sec--tm .ps-sec__h { display: none; }
.ps-root .ps-link { color: var(--ps-muted); font-size: 12px; font-weight: 400; }
.ps-root .ps-link:hover { color: var(--ps-accent); }
/* بخش‌های نتایج زنده مثل یک فهرست یکپارچه زیر هم می‌آیند */
.ps-sec--hm, .ps-sec--tm, .ps-sec--ph, .ps-sec--pr, .ps-sec--po { padding: 0; }
.ps-sec--tm .ps-sec__h, .ps-sec--pr .ps-sec__h, .ps-sec--po .ps-sec__h { margin: 0; padding: 12px 16px 4px; }

/* چیپ‌ها: جستجوهای اخیر و پرطرفدار */
.ps-chips, .ps-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 16px 8px; }
.ps-filter { padding-block: 8px; border-bottom: 1px solid var(--ps-divider); }
.ps-root .ps-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; padding-inline-end: 14px; color: var(--ps-chip); font-size: 14px; font-weight: 400; line-height: 1.4; text-decoration: none; background: var(--ps-panel); border: .8px solid var(--ps-border); border-radius: 20px; transition: border-color .12s, color .12s; }
.ps-root .ps-chip:hover, .ps-root .ps-chip:focus, .ps-chip.is-kb { color: var(--ps-chip); background: var(--ps-panel); border-color: var(--ps-accent); }
.ps-root .ps-chip.is-active { color: var(--ps-accent); background: var(--ps-accent-soft); border-color: var(--ps-accent); }
.ps-chip .ps-i { color: var(--ps-icon); font-size: 18px; }
.ps-chip.is-active .ps-i { color: inherit; font-size: 14px; }

/* ---- ردیف‌های فهرست (عبارت، دسته، تاریخچه، محصول، مطلب) ---- */
.ps-row { display: flex; align-items: center; }
.ps-item { position: relative; display: flex; align-items: center; min-width: 0; min-height: 49px; padding: 0; padding-inline-end: 16px; color: var(--ps-text); font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background-color .12s; }
.ps-item::after { content: ""; position: absolute; bottom: 0; inset-inline: 56px 0; border-bottom: .8px solid var(--ps-divider); }
.ps-item > .ps-i { width: 56px; font-size: 24px; }
.ps-root a.ps-item:hover, .ps-root a.ps-item:focus, .ps-item.is-kb { color: var(--ps-text); background: var(--ps-hover); text-decoration: none; }
.ps-hist__t, .ps-phrase__t, .ps-term__t, .ps-post__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-hl { color: var(--ps-typed); font-weight: 500; background: none; }   /* بخش تایپ‌شده کم‌رنگ، ادامه پررنگ (مثل دیجی‌کالا) */
.ps-term__t { flex: 0 1 auto; }
.ps-term__in { flex: 0 1 45%; min-width: 0; margin-inline-start: auto; padding-inline-start: 12px; overflow: hidden; color: var(--ps-link); font-size: 12px; font-weight: 500; text-align: end; text-overflow: ellipsis; white-space: nowrap; }
.ps-post__img { flex: none; width: 40px; height: 40px; margin-inline: 8px; object-fit: cover; border-radius: 8px; }
.ps-post__type { flex: none; margin-inline-start: auto; padding: 0 8px; color: var(--ps-muted); font-size: 11.5px; background: var(--ps-hover); border-radius: 999px; }

/* محصول (اختیاری) */
.ps-prod { align-items: flex-start; padding: 10px 16px; }
.ps-prod::after { inset-inline-start: 16px; }
.ps-prod__img { flex: none; width: 56px; height: 56px; margin-inline-end: 10px; object-fit: contain; background: #fff; border: 1px solid var(--ps-hover); border-radius: 8px; }
.ps-prod__info { display: flex; flex-direction: column; flex: 1; gap: 4px; min-width: 0; }
.ps-prod__t { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; font-size: 13.5px; line-height: 1.7; }
.ps-prod__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.ps-prod__price { font-weight: 700; }
.ps-prod__price del { margin-inline-end: 4px; color: var(--ps-muted); font-size: 12px; font-weight: 400; }
.ps-prod__price ins { text-decoration: none; }
.ps-badge { padding: 0 7px; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.7; background: var(--ps-accent); border-radius: 999px; }
.ps-oos { color: var(--ps-muted); font-size: 12px; }
.ps-item--loop { display: block; min-height: 0; padding: 8px 12px; }
.ps-item--loop::after { display: none; }

/* دسته‌های محبوب (اختیاری) */
.ps-cats { display: flex; gap: 14px; padding: 4px 16px 10px; overflow-x: auto; scrollbar-width: none; }
.ps-cats::-webkit-scrollbar { display: none; }
.ps-cat { display: block; flex: none; width: 72px; color: var(--ps-text); font-size: 12px; text-align: center; text-decoration: none; }
.ps-root a.ps-cat:hover { color: var(--ps-accent); text-decoration: none; }
.ps-cat__img { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin: 0 auto 6px; overflow: hidden; background: var(--ps-bg); border-radius: 50%; }
.ps-cat__img img { width: 100%; height: 100%; object-fit: cover; }
.ps-cat__t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* مشاهده‌ی همه (اختیاری)، پیام‌ها، اسکلت */
.ps-root a.ps-viewall { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 13px 16px; color: var(--ps-accent); font-size: 14px; font-weight: 700; text-decoration: none; }
.ps-root a.ps-viewall:hover, .ps-viewall.is-kb { color: var(--ps-accent); background: var(--ps-hover); text-decoration: none; }
.ps-viewall .ps-i { color: inherit; font-size: 16px; }
.ps-note { padding: 8px 16px; color: var(--ps-muted); font-size: 12.5px; }
.ps-note--err { color: #d92d20; }
.ps-empty { padding: 30px 16px; text-align: center; }
.ps-empty__t { font-size: 15px; font-weight: 700; }
.ps-empty__h { margin-top: 4px; color: var(--ps-muted); font-size: 12.5px; }
.ps-sk { height: 48px; margin: 10px 16px; background: linear-gradient(90deg, var(--ps-hover) 25%, #fafafb 50%, var(--ps-hover) 75%); background-size: 200% 100%; border-radius: 8px; animation: ps-sk 1.2s linear infinite; }
@keyframes ps-sk { to { background-position: -200% 0; } }
.ps-root .screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ps-live { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
	.ps-sk, .is-listening .ps-voice { animation: none; }
	.ps-root * { transition: none !important; }
}
