/**
 * آموزش — استایل پایهٔ ویجت فیلتر.
 * رنگ‌ها/فونت‌ها/فواصل از کنترل‌های استایل المنتور تولید می‌شوند؛
 * این فایل فقط ساختار و رفتار بصری سوییچ‌ها را پوشش می‌دهد.
 */

.amz-filter {
	--amz-mark-size: 22px;
	--amz-mark-radius: 6px;
	--amz-mark-on: #12b76a;
	--amz-mark-off: #d0d5dd;
	--amz-mark-check: #fff;

	display: block;
	width: 100%;
}

.amz-filter__header {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	align-items: center;
}

.amz-filter__icon {
	display: -webkit-inline-box;
	display: -ms-inline-flexbox;
	display: inline-flex;
	width: 1.25em;
	height: 1.25em;
	flex: 0 0 auto;
}

.amz-filter__icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.amz-filter__groups {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-orient: vertical;
	-webkit-box-direction: normal;
	-webkit-flex-direction: column;
	-ms-flex-direction: column;
	flex-direction: column;
}

.amz-filter__group {
	display: block;
}

.amz-filter__group-title {
	display: block;
}

.amz-filter__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-orient: vertical;
	-webkit-box-direction: normal;
	-webkit-flex-direction: column;
	-ms-flex-direction: column;
	flex-direction: column;
	gap: 8px;
}

.amz-filter__item {
	display: block;
}

.amz-filter__item > label {
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	-webkit-box-pack: start;
	-ms-flex-pack: start;
	justify-content: flex-start;
	gap: 10px;
	cursor: pointer;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

/* حذف استایل پیش‌فرض input: خودِ input مخفی است و .amz-filter__mark نمایندهٔ آن است. */
.amz-filter__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.amz-filter__mark {
	position: relative;
	display: -webkit-inline-box;
	display: -ms-inline-flexbox;
	display: inline-flex;
	-webkit-box-align: center;
	-ms-flex-align: center;
	align-items: center;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	justify-content: center;
	width: var(--amz-mark-size);
	height: var(--amz-mark-size);
	min-width: var(--amz-mark-size);
	border: 2px solid var(--amz-mark-off);
	border-radius: var(--amz-mark-radius);
	background-color: transparent;
	-webkit-transition: background-color 0.15s ease, border-color 0.15s ease;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* حالت فعال: تیک سبز با نشان ✓ */
.amz-filter__input:checked ~ .amz-filter__mark {
	background-color: var(--amz-mark-on);
	border-color: var(--amz-mark-on);
}

.amz-filter__input:checked ~ .amz-filter__mark::after {
	content: '';
	width: calc(var(--amz-mark-size) * 0.22);
	height: calc(var(--amz-mark-size) * 0.4);
	border: solid var(--amz-mark-check);
	border-width: 0 2px 2px 0;
	-webkit-transform: rotate(45deg);
	-ms-transform: rotate(45deg);
	transform: rotate(45deg);
}

/* مخفی کردن input از اسکرین‌ریدر نیست؛ فقط بصری. */
.amz-filter__input:focus-visible ~ .amz-filter__mark {
	outline: 2px solid var(--amz-mark-on);
	outline-offset: 2px;
}

.amz-filter__label {
	-webkit-box-flex: 0;
	-ms-flex: 0 0 auto;
	flex: 0 0 auto !important;
}

/* فاصلهٔ CSS قدیمی اگر در کش مانده باشد، نادیده گرفته می‌شود و باکس دقیقاً کنار نام می‌نشیند. */
.amz-filter__item > label {
	-webkit-box-pack: start;
	-ms-flex-pack: start;
	justify-content: flex-start !important;
}

.amz-filter__count {
	opacity: 0.65;
	font-size: 0.85em;
	-webkit-box-flex: 0;
	-ms-flex: 0 0 auto;
	flex: 0 0 auto;
}

.amz-filter__clear {
	display: inline-block;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	font: inherit;
	color: #e31e1e;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.amz-filter__clear:hover {
	text-decoration: underline;
}

/* حالت بارگذاری لوپ‌گرید هنگام رفرش AJAX */
.amz-grid-loading {
	position: relative;
	opacity: 0.45;
	pointer-events: none;
	-webkit-transition: opacity 0.2s ease;
	transition: opacity 0.2s ease;
}

.amz-grid-loading::after {
	content: '';
	position: absolute;
	inset-inline-start: 50%;
	top: 50%;
	width: 28px;
	height: 28px;
	margin-inline-start: -14px;
	margin-top: -14px;
	border: 3px solid rgba(0, 0, 0, 0.15);
	border-top-color: var(--amz-mark-on, #12b76a);
	border-radius: 50%;
	-webkit-animation: amz-spin 0.7s linear infinite;
	animation: amz-spin 0.7s linear infinite;
	z-index: 5;
}

@-webkit-keyframes amz-spin {
	to {
		-webkit-transform: rotate(360deg);
		transform: rotate(360deg);
	}
}

@keyframes amz-spin {
	to {
		-webkit-transform: rotate(360deg);
		-moz-transform: rotate(360deg);
		-ms-transform: rotate(360deg);
		transform: rotate(360deg);
	}
}
