/*!
 * Stylish Categories — ویجت دسته‌بندی تعاملی ووکامرس
 * همه‌ی رنگ‌ها از متغیرهای CSS می‌آیند و از پنل تنظیمات قابل تغییرند.
 */

.sc {
	--sc-accent: #1f4d3a;
	--sc-accent-soft: #e7efe9;
	--sc-surface: #ffffff;
	--sc-canvas: #f7f5f0;
	--sc-ink: #1b1b1b;
	--sc-muted: #6b7280;
	--sc-line: #e8e4da;
	--sc-radius: 16px;
	--sc-cols: 3;
	--sc-rail-w: 88px;
	--sc-h: 70vh;
	--sc-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--sc-ease-out: cubic-bezier(0.16, 1, 0.3, 1);

	position: relative;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	max-width: 100%;
	height: var(--sc-h);
	overflow: hidden;
	/*
	 * چیدمان داخلی به عرضِ خودِ ویجت واکنش نشان می‌دهد، نه عرض پنجره.
	 * قبلاً با @media بود و داخل کشوی ۴۴۰پیکسلی روی دسکتاپ، ۵ ستون کاشی
	 * و ریل ۱۶۸پیکسلی می‌گرفت و به‌هم می‌ریخت.
	 */
	container-type: inline-size;
	container-name: sc;
	color: var(--sc-ink);
	background: var(--sc-surface);
	border-radius: var(--sc-radius);
	font-family: var(--sc-font, inherit);
	line-height: 1.7;
	-webkit-tap-highlight-color: transparent;
}

.sc *,
.sc *::before,
.sc *::after {
	box-sizing: border-box;
}

/*
 * هر قانون display در استایلِ نویسنده، [hidden] مرورگر را خنثی می‌کند.
 * این قانون صفتِ hidden را دوباره معتبر می‌کند تا هر جا در مارک‌آپ
 * hidden گذاشتیم واقعاً پنهان شود.
 */
.sc [hidden],
.sc-overlay [hidden] {
	display: none !important;
}

.sc a {
	color: inherit;
	text-decoration: none;
}

.sc button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

.sc .sc-i {
	width: 20px;
	height: 20px;
	flex: none;
}

.sc-payload {
	display: none;
}

/* ---------------------------------------------------------------- سربرگ */

.sc-drawer__title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px 4px;
	font-weight: 700;
	font-size: 16px;
}

.sc-close {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	color: var(--sc-muted);
	background: var(--sc-canvas);
	transition: background 0.2s var(--sc-ease), color 0.2s var(--sc-ease), transform 0.2s var(--sc-ease);
}

.sc-close:hover {
	color: var(--sc-ink);
	transform: rotate(90deg);
}

.sc-head {
	padding: 12px 14px;
	flex: none;
}

.sc-field {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 46px;
	padding-inline: 14px;
	border-radius: 999px;
	background: var(--sc-canvas);
	border: 1.5px solid var(--sc-line);
	transition: border-color 0.22s var(--sc-ease), background 0.22s var(--sc-ease), box-shadow 0.22s var(--sc-ease);
}

.sc-field:hover {
	border-color: color-mix(in srgb, var(--sc-accent) 35%, var(--sc-line));
}

.sc-field:focus-within {
	background: var(--sc-surface);
	border-color: var(--sc-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--sc-accent) 12%, transparent);
}

.sc-field .sc-i--search {
	flex: none;
	width: 18px;
	height: 18px;
	color: var(--sc-muted);
	transition: color 0.22s var(--sc-ease);
}

.sc-field:focus-within .sc-i--search {
	color: var(--sc-accent);
}

.sc-field__input {
	flex: 1;
	min-width: 0;
	height: 100%;
	font: inherit;
	font-size: 14px;
	line-height: 1;
	color: inherit;
	background: none;
	border: 0;
	outline: none;
	padding: 0;
	/* ظاهر بومیِ input[type=search] در وبکیت یک قاب مربعی می‌سازد. */
	-webkit-appearance: none;
	appearance: none;
	border-radius: 0;
}

/*
 * سپر در برابر استایل قالب.
 * قالب‌ها معمولاً `input[type="search"]` را با قاعده‌هایی مثل
 * `body.woocommerce input[type="search"]` استایل می‌دهند و پس‌زمینه، قاب یا
 * سایه‌ی تیره‌ی خودشان را روی اینپوت می‌نشانند — همان «نوار تیره» روی جست‌وجو.
 *
 * وقتی دو طرف !important دارند، **ویژگی سلکتور** تعیین‌کننده است؛ برای همین
 * این سلکتور عمداً بلند است (0,4,1) تا از قاعده‌های رایج قالب بالاتر بماند.
 * تنها چیزی که هنوز می‌تواند برنده شود قاعده‌ای با شناسه است (مثل
 * `#page input[type="search"]`)، چون هیچ تعداد کلاسی از یک id بالاتر نمی‌رود.
 */
.sc .sc-head .sc-field input.sc-field__input,
.sc .sc-head .sc-field input.sc-field__input:hover,
.sc .sc-head .sc-field input.sc-field__input:focus,
.sc .sc-head .sc-field input.sc-field__input:focus-visible,
.sc .sc-head .sc-field input.sc-field__input:active {
	background: none !important;
	background-image: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: 0 !important;
	filter: none !important;
	text-shadow: none !important;
	margin: 0 !important;
	padding: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	height: 100% !important;
	color: inherit !important;
}

.sc-field__input::placeholder {
	color: var(--sc-muted);
	opacity: 1;
}

/* دکمه‌ی پاک‌کردنِ بومی مرورگر؛ ما دکمه‌ی خودمان را داریم. */
.sc-field__input::-webkit-search-cancel-button,
.sc-field__input::-webkit-search-decoration,
.sc-field__input::-webkit-search-results-button,
.sc-field__input::-webkit-search-results-decoration {
	-webkit-appearance: none;
	appearance: none;
	display: none;
}

.sc-field__clear {
	flex: none;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	color: var(--sc-muted);
	background: color-mix(in srgb, var(--sc-ink) 8%, transparent);
	transition: color 0.18s var(--sc-ease), background 0.18s var(--sc-ease);
	animation: sc-pop 0.22s var(--sc-ease-out);
}

.sc-field__clear:hover,
.sc-field__clear:focus-visible {
	color: var(--sc-surface);
	background: var(--sc-accent);
}

.sc-field__clear .sc-i {
	width: 12px;
	height: 12px;
}

/* ------------------------------------------------------- بازدیدهای اخیر */

.sc-recent {
	flex: none;
	padding: 0 14px 10px;
	animation: sc-fade 0.3s var(--sc-ease);
}

.sc-recent__label {
	display: block;
	font-size: 11px;
	color: var(--sc-muted);
	margin-bottom: 6px;
}

.sc-recent__row {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scrollbar-width: none;
	padding-bottom: 2px;
}

.sc-recent__row::-webkit-scrollbar {
	display: none;
}

.sc-chip {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 30px;
	padding-inline: 10px;
	font-size: 12px;
	border-radius: 999px;
	background: var(--sc-canvas);
	border: 1px solid var(--sc-line);
	white-space: nowrap;
	transition: background 0.2s var(--sc-ease), border-color 0.2s var(--sc-ease), transform 0.2s var(--sc-ease);
}

.sc-chip:hover {
	border-color: var(--sc-accent);
	background: var(--sc-accent-soft);
	transform: translateY(-1px);
}

.sc-chip__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: hsl(var(--hue, 150) 42% 62%);
}

/* -------------------------------------------------------------- بدنه */

.sc-body {
	display: grid;
	grid-template-columns: var(--sc-rail-w) minmax(0, 1fr);
	flex: 1;
	min-height: 0;
	border-top: 1px solid var(--sc-line);
}

/* ریل سطح یک */

.sc-rail {
	position: relative;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--sc-canvas);
	scrollbar-width: none;
	padding-block: 6px;
}

.sc-rail::-webkit-scrollbar {
	display: none;
}

.sc-rail__marker {
	position: absolute;
	inset-inline: 0;
	top: 0;
	height: var(--h, 0px);
	background: var(--sc-surface);
	/* گوشه‌ها فقط سمت بیرونی گرد است تا کارت فعال با پنل یکی شود. */
	border-start-start-radius: 14px;
	border-end-start-radius: 14px;
	transform: translateY(var(--y, 0px));
	transition: transform 0.38s var(--sc-ease-out), height 0.38s var(--sc-ease-out);
	pointer-events: none;
	opacity: 0;
}

.sc--ready .sc-rail__marker {
	opacity: 1;
}

.sc-rail__marker::before {
	content: "";
	position: absolute;
	inset-block: 24%;
	inset-inline-start: 5px;
	width: 3px;
	border-radius: 3px;
	background: var(--sc-accent);
}

.sc-rail__item {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 12px 6px 10px;
	text-align: center;
	transition: color 0.25s var(--sc-ease);
}

.sc-rail__item:not(.is-active) .sc-media {
	filter: grayscale(1);
	opacity: 0.72;
	transition: filter 0.3s var(--sc-ease), opacity 0.3s var(--sc-ease);
}

.sc-rail__item:hover .sc-media {
	filter: none;
	opacity: 1;
}

.sc-rail__label {
	font-size: 11px;
	line-height: 1.5;
	color: var(--sc-muted);
	transition: color 0.25s var(--sc-ease), font-weight 0.25s var(--sc-ease);
	word-break: break-word;
}

.sc-rail__item.is-active .sc-rail__label {
	color: var(--sc-accent);
	font-weight: 700;
}

/* پنل */

.sc-pane {
	position: relative;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 12px 14px 24px;
	scrollbar-width: thin;
}

.sc-pane::-webkit-scrollbar {
	width: 5px;
}

.sc-pane::-webkit-scrollbar-thumb {
	background: var(--sc-line);
	border-radius: 999px;
}

.sc-pane.is-swapping {
	animation: sc-pane-in 0.34s var(--sc-ease-out);
}

/* لینک «همه‌ی محصولات» */

.sc-all {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	margin-bottom: 12px;
	border-radius: 12px;
	background: var(--sc-accent-soft);
	color: var(--sc-accent);
	font-size: 13px;
	font-weight: 600;
	transition: transform 0.2s var(--sc-ease), box-shadow 0.2s var(--sc-ease);
}

.sc-all:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--sc-accent) 55%, transparent);
}

.sc-all__t {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sc-all__c {
	font-size: 11px;
	font-weight: 500;
	opacity: 0.75;
	white-space: nowrap;
}

.sc-all .sc-i {
	width: 16px;
	height: 16px;
	transition: transform 0.2s var(--sc-ease);
}

.sc-all:hover .sc-i {
	transform: translateX(-3px);
}

.sc[dir="ltr"] .sc-all:hover .sc-i {
	transform: translateX(3px) rotate(180deg);
}

.sc[dir="ltr"] .sc-all .sc-i {
	transform: rotate(180deg);
}

/* ------------------------------------------------- گرید سطح دو */

.sc-grid {
	display: grid;
	grid-template-columns: repeat(var(--sc-cols), minmax(0, 1fr));
	gap: 10px;
	align-items: start;
}

.sc-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	min-width: 0;
	will-change: transform;
	animation: sc-rise 0.42s var(--sc-ease-out) backwards;
	animation-delay: calc(var(--i, 0) * 28ms);
}

.sc-tile__label {
	font-size: 12px;
	line-height: 1.5;
	text-align: center;
	color: var(--sc-ink);
	transition: color 0.2s var(--sc-ease);
	word-break: break-word;
}

.sc-tile .sc-media {
	width: 100%;
	aspect-ratio: 1 / 1;
	transition: box-shadow 0.25s var(--sc-ease), border-color 0.25s var(--sc-ease);
	border: 2px solid transparent;
}

.sc-tile:hover .sc-media {
	box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45);
}

.sc-tile:hover .sc-tile__label {
	color: var(--sc-accent);
}

.sc-tile.is-picked .sc-media {
	border-color: var(--sc-accent);
}

.sc-tile.is-picked .sc-tile__label {
	color: var(--sc-accent);
	font-weight: 700;
}

/* حالت نوار افقی: گرید به یک ردیف اسکرول‌شونده تبدیل می‌شود */

.sc-grid[data-state="strip"] {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	padding-bottom: 4px;
	scroll-snap-type: x proximity;
}

.sc-grid[data-state="strip"]::-webkit-scrollbar {
	display: none;
}

.sc-grid[data-state="strip"] .sc-tile {
	flex: none;
	width: 66px;
	animation: none;
	scroll-snap-align: center;
}

.sc-grid[data-state="strip"] .sc-tile__label {
	font-size: 10px;
	line-height: 1.4;
	max-height: 2.8em;
	overflow: hidden;
}

/* در حین انیمیشن FLIP، ترنزیشن‌های جانبی خاموش می‌شوند */

.sc-grid.is-flipping .sc-tile,
.sc-grid.is-flipping .sc-media {
	transition: none;
}

/* ------------------------------------------------- لیست سطح سه */

.sc-third {
	margin-top: 18px;
}

.sc-third[hidden] {
	display: none;
}

.sc-third__all {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--sc-canvas);
	font-size: 13px;
	font-weight: 700;
	animation: sc-rise 0.34s var(--sc-ease-out) backwards;
}

.sc-third__list {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
}

.sc-third__list li {
	animation: sc-slide-in 0.36s var(--sc-ease-out) backwards;
	animation-delay: calc(60ms + var(--i, 0) * 24ms);
}

.sc-third__row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 11px 12px;
	border-bottom: 1px solid var(--sc-line);
	font-size: 13px;
	transition: background 0.18s var(--sc-ease), padding-inline-start 0.18s var(--sc-ease);
}

.sc-third__row:hover {
	background: var(--sc-accent-soft);
	color: var(--sc-accent);
	padding-inline-start: 18px;
}

.sc-third__name {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sc-third__count {
	font-size: 11px;
	color: var(--sc-muted);
	font-variant-numeric: tabular-nums;
}

.sc-third__row .sc-i {
	width: 15px;
	height: 15px;
	color: var(--sc-muted);
	transition: transform 0.2s var(--sc-ease), color 0.2s var(--sc-ease);
}

.sc-third__row:hover .sc-i {
	color: var(--sc-accent);
	transform: translateX(-3px);
}

.sc[dir="ltr"] .sc-third__row .sc-i {
	transform: rotate(180deg);
}

.sc[dir="ltr"] .sc-third__row:hover .sc-i {
	transform: rotate(180deg) translateX(-3px);
}

/* ------------------------------------------------------------- برندها */

.sc-brands {
	margin-top: 26px;
}

.sc-brands__title {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 700;
	color: var(--sc-ink);
}

.sc-brands__title .sc-i {
	width: 16px;
	height: 16px;
	color: var(--sc-accent);
}

.sc-brands__row {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	padding-bottom: 4px;
}

.sc-brands__row::-webkit-scrollbar {
	display: none;
}

.sc-brand {
	flex: none;
	display: grid;
	place-items: center;
	width: 84px;
	height: 52px;
	padding: 6px;
	border: 1px solid var(--sc-line);
	border-radius: 10px;
	background: var(--sc-surface);
	transition: border-color 0.2s var(--sc-ease), transform 0.2s var(--sc-ease);
}

.sc-brand:hover {
	border-color: var(--sc-accent);
	transform: translateY(-2px);
}

.sc-brand img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.sc-brand__txt {
	font-size: 11px;
	text-align: center;
	color: var(--sc-muted);
	line-height: 1.3;
}

/* ------------------------------------------------- تصویر / جایگزین حرف */

.sc-media {
	position: relative;
	display: grid;
	place-items: center;
	overflow: hidden;
	border-radius: 12px;
	background: var(--sc-canvas);
	flex: none;
}

.sc-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sc-media--rail {
	width: 34px;
	height: 34px;
	border-radius: 10px;
}

.sc-media--result {
	width: 40px;
	height: 40px;
	border-radius: 10px;
}

.sc-media--ph {
	background: linear-gradient(
		145deg,
		hsl(var(--hue, 150) 38% 92%),
		hsl(var(--hue, 150) 34% 84%)
	);
}

.sc-media__ch {
	font-size: 0.9em;
	font-weight: 700;
	color: hsl(var(--hue, 150) 40% 32%);
}

.sc-media--tile .sc-media__ch {
	font-size: 28px;
}

.sc-media--rail .sc-media__ch {
	font-size: 15px;
}

/* -------------------------------------------------------- نتایج جست‌وجو */

.sc-results {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--sc-surface);
	border-top: 1px solid var(--sc-line);
	padding: 8px 14px 24px;
	animation: sc-fade 0.2s var(--sc-ease);
}

.sc-results[hidden] {
	display: none;
}

.sc--searching .sc-body,
.sc--searching .sc-recent {
	display: none;
}

.sc-result {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 8px;
	border-radius: 10px;
	border-bottom: 1px solid var(--sc-line);
	animation: sc-slide-in 0.3s var(--sc-ease-out) backwards;
	animation-delay: calc(var(--i, 0) * 18ms);
	transition: background 0.16s var(--sc-ease);
}

.sc-result:hover {
	background: var(--sc-accent-soft);
}

.sc-result .sc-media {
	width: 40px;
	height: 40px;
	border-radius: 10px;
}

.sc-result__body {
	flex: 1;
	min-width: 0;
}

.sc-result__name {
	display: block;
	font-size: 13px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sc-result__name mark {
	background: color-mix(in srgb, var(--sc-accent) 22%, transparent);
	color: inherit;
	border-radius: 3px;
	padding: 0 1px;
}

.sc-result__path {
	display: block;
	font-size: 11px;
	color: var(--sc-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sc-result__count {
	font-size: 11px;
	color: var(--sc-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.sc-results__head {
	font-size: 11px;
	color: var(--sc-muted);
	padding: 6px 4px 10px;
}

.sc-empty-state {
	display: grid;
	place-items: center;
	gap: 6px;
	padding: 48px 16px;
	text-align: center;
}

.sc-empty-state strong {
	font-size: 14px;
}

.sc-empty-state span {
	font-size: 12px;
	color: var(--sc-muted);
}

.sc-empty {
	padding: 16px;
	border: 1px dashed #d9d3c6;
	border-radius: 12px;
	font-size: 13px;
	color: #6b7280;
	text-align: center;
}

/* ------------------------------------------------------ کشوی تمام‌صفحه */

.sc-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
}

.sc-overlay[hidden] {
	display: none;
}

.sc-overlay__scrim {
	position: absolute;
	inset: 0;
	background: rgba(20, 22, 20, 0.42);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity 0.28s var(--sc-ease, ease);
}

.sc-overlay.is-open .sc-overlay__scrim {
	opacity: 1;
}

.sc-overlay__sheet {
	position: relative;
	margin-block: auto;
	background: #fff;
	box-shadow: 0 -10px 60px -20px rgba(0, 0, 0, 0.5);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
	will-change: transform;
}

.sc-overlay__sheet .sc {
	height: 100%;
	border-radius: 0;
	flex: 1;
	min-height: 0;
}

.sc-overlay__grip {
	display: none;
}

/* کشوی کناری — جهت اسلاید بر اساس dir محاسبه می‌شود */

.sc-overlay--end .sc-overlay__sheet,
.sc-overlay--start .sc-overlay__sheet {
	width: min(440px, 92vw);
	height: 100%;
	margin-block: 0;
	opacity: 0;
}

/*
 * روی دسکتاپ کشو مثل یک «مگا پنل» پهن باز می‌شود تا سه سطح دسته‌بندی
 * واقعاً جا شوند. زیر ۶۴۰px قوانین شیت پایینیِ موبایل (که ویژگی سلکتور
 * بالاتری دارند) دست‌نخورده باقی می‌مانند.
 */
@media (min-width: 1000px) {
	.sc-overlay--end .sc-overlay__sheet,
	.sc-overlay--start .sc-overlay__sheet {
		width: min(1060px, 92vw);
	}
}

@media (min-width: 760px) and (max-width: 999px) {
	.sc-overlay--end .sc-overlay__sheet,
	.sc-overlay--start .sc-overlay__sheet {
		width: min(680px, 92vw);
	}
}

.sc-overlay--end .sc-overlay__sheet {
	margin-inline-start: auto;
}

.sc-overlay--start .sc-overlay__sheet {
	margin-inline-end: auto;
}

/* لبه‌ی پایانی: در RTL سمت چپ، در LTR سمت راست. */
.sc-overlay--end[dir="rtl"] .sc-overlay__sheet {
	transform: translateX(-100%);
}

.sc-overlay--end[dir="ltr"] .sc-overlay__sheet {
	transform: translateX(100%);
}

/* لبه‌ی آغازین: برعکس. */
.sc-overlay--start[dir="rtl"] .sc-overlay__sheet {
	transform: translateX(100%);
}

.sc-overlay--start[dir="ltr"] .sc-overlay__sheet {
	transform: translateX(-100%);
}

.sc-overlay.is-open .sc-overlay__sheet {
	transform: none;
	opacity: 1;
}

/* حالت تمام‌صفحه */

.sc-overlay--full .sc-overlay__sheet {
	width: 100%;
	height: 100%;
	margin: 0;
	transform: scale(0.97);
	opacity: 0;
}

/* روی موبایل همیشه ورق پایین‌کشویی */

@media (max-width: 640px) {
	/* ویژگی سلکتور عمداً برابر قوانین جهت‌دار بالاست تا با ترتیب منبع برنده شود. */
	.sc-overlay[dir] .sc-overlay__sheet {
		width: 100%;
		height: min(88dvh, 88vh);
		margin-block: auto 0;
		margin-inline: 0;
		border-start-start-radius: 20px;
		border-start-end-radius: 20px;
		transform: translateY(100%);
		opacity: 1;
	}

	.sc-overlay[dir].is-open .sc-overlay__sheet {
		transform: none;
	}

	.sc-overlay__grip {
		display: block;
		width: 40px;
		height: 4px;
		border-radius: 999px;
		background: #d8d3c8;
		margin: 8px auto 0;
		flex: none;
	}
}

/* --------------------------------------------------------- دکمه‌ی شناور */

.sc-fab {
	position: fixed;
	z-index: 999990;
	bottom: max(18px, env(safe-area-inset-bottom));
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 46px;
	padding-inline: 16px;
	border-radius: 999px;
	color: #fff;
	background: #1f4d3a;
	box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.55);
	font-size: 13px;
	font-weight: 700;
	/* از خصوصیت مستقل scale استفاده می‌کنیم تا با translateX مرکز‌چین تداخل نکند. */
	transition: translate 0.24s cubic-bezier(0.16, 1, 0.3, 1), scale 0.18s ease, box-shadow 0.24s ease;
	animation: sc-fab-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* وقتی کشو باز است، دکمه‌ی شناور خودمان هم کنار می‌رود. */
body.sc-locked .sc-fab {
	opacity: 0;
	scale: 0.85;
	pointer-events: none;
	transition: opacity 0.18s ease, scale 0.18s ease;
}

.sc-fab:hover {
	translate: 0 -3px;
	box-shadow: 0 18px 38px -12px rgba(0, 0, 0, 0.6);
}

.sc-fab:active {
	scale: 0.96;
}

.sc-fab--bottom-start {
	inset-inline-start: 18px;
}

.sc-fab--bottom-end {
	inset-inline-end: 18px;
}

.sc-fab--bottom-center {
	inset-inline-start: 50%;
	transform: translateX(-50%);
}

.sc-fab .sc-i {
	width: 18px;
	height: 18px;
}

body.sc-locked {
	overflow: hidden;
}

/* ------------------------------------------------------------ دسکتاپ */

/*
 * از اینجا به بعد بر اساس عرضِ خودِ ویجت است، نه عرض پنجره.
 * مرورگرهای بدون پشتیبانی @container همان چیدمان موبایل را می‌گیرند که
 * در هر عرضی سالم است.
 */

/* ویجت جا دارد: ریل افقی می‌شود. */
@container sc (min-width: 560px) {
	/* توجه: کانتینر نمی‌تواند خودش را استایل کند، پس متغیرها روی .sc-body می‌نشینند. */
	.sc-body {
		--sc-rail-w: 176px;
		--sc-cols: 4;
	}

	.sc-rail__item {
		flex-direction: row;
		justify-content: flex-start;
		gap: 10px;
		padding: 10px 14px;
		text-align: start;
	}

	.sc-rail__label {
		font-size: 13px;
	}

	.sc-media--rail {
		width: 30px;
		height: 30px;
	}

	.sc-tile__label {
		font-size: 13px;
	}

	.sc-grid[data-state="strip"] .sc-tile {
		width: 78px;
	}
}

/* ------------------------------------------- چیدمان پهنِ دسکتاپ */

@container sc (min-width: 820px) {
	.sc-body {
		--sc-rail-w: 248px;
		--sc-cols: 4;
	}

	.sc-drawer__title {
		padding: 20px 26px 6px;
		font-size: 19px;
	}

	.sc-head {
		padding: 14px 26px 16px;
	}

	/* روی عرض زیاد، فیلد کشیده و بدقواره می‌شود. */
	.sc-field {
		max-width: 460px;
		height: 48px;
	}

	.sc-rail {
		padding-block: 10px;
	}

	.sc-rail__item {
		gap: 12px;
		padding: 12px 18px;
	}

	.sc-rail__label {
		font-size: 14px;
		/* در این عرض دیگر لازم نیست نام دسته دو خط شود. */
		word-break: normal;
	}

	.sc-media--rail {
		width: 38px;
		height: 38px;
	}

	.sc-pane {
		padding: 18px 26px 32px;
	}

	.sc-all {
		padding: 14px 16px;
		margin-bottom: 18px;
		font-size: 14px;
		border-radius: 14px;
	}

	.sc-tile__label {
		font-size: 14px;
	}

	.sc-grid[data-state="strip"] .sc-tile {
		width: 96px;
	}

	/*
	 * لیست سطح‌سه در یک ستون، پایینِ صفحه را خالی می‌گذاشت.
	 * دو ستونه می‌شود تا فضای عمودی پر شود.
	 */
	.sc-third__list {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 28px;
	}

	.sc-third__all {
		padding: 13px 16px;
		font-size: 14px;
	}

	.sc-third__row {
		font-size: 14px;
		padding: 12px 12px;
	}

	/* نوار افقی برندها لبه‌ی پنل را می‌بُرید؛ اینجا جا هست پس می‌پیچد. */
	.sc-brands__row {
		flex-wrap: wrap;
		overflow-x: visible;
	}

	.sc-brands__title {
		font-size: 13px;
	}
}

@container sc (min-width: 1000px) {
	.sc-body {
		--sc-cols: 5;
	}

	.sc-third__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* -------------------------------------------------------- انیمیشن‌ها */

@keyframes sc-rise {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.96);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes sc-slide-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes sc-fade {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes sc-pop {
	from {
		opacity: 0;
		transform: scale(0.8);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes sc-fab-in {
	from {
		opacity: 0;
		scale: 0.8;
	}

	to {
		opacity: 1;
		scale: 1;
	}
}

@keyframes sc-pane-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* احترام به تنظیم «کاهش حرکت» سیستم‌عامل */

@media (prefers-reduced-motion: reduce) {
	.sc *,
	.sc-overlay *,
	.sc-fab {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
