/* فیلتر قیمت هوشمند TTBOL — هماهنگ با فیلترهای قالب (وودمارت) */

.ttbol-pf {
	/* رنگ‌ها و اندازه‌ها از خود قالب گرفته می‌شوند تا با بقیهٔ فیلترها یکی باشد. */
	--pf-accent: var(--wd-primary-color, #D9B554);
	--pf-text: var(--wd-text-color, #3F3F3F);
	--pf-muted: #BBBBBB;
	--pf-line: var(--wd-form-brd-color, rgba(0, 0, 0, .1));
	--pf-radius: var(--wd-form-brd-radius, 5px);
	--pf-height: var(--wd-form-height, 42px);

	direction: rtl;
}

.ttbol-pf *,
.ttbol-pf *::before,
.ttbol-pf *::after {
	box-sizing: border-box;
}

.ttbol-pf .ttbol-pf__form {
	margin: 0;
	padding: 0;
}

/* ---------- لیست بازه‌ها ----------
   کلاس‌های لیست همان کلاس‌های فیلترهای ووکامرس است، پس فونت، فاصله و رنگ
   را خود قالب می‌دهد. اینجا فقط حالت انتخاب‌شده و برچسب پرفروش اضافه می‌شود. */

.ttbol-pf .ttbol-pf__ranges {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* قالب این قاعده را فقط به ویجت‌های خودش می‌دهد، پس اینجا تکرارش می‌کنیم. */
.ttbol-pf .ttbol-pf__item {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	margin-bottom: 15px;
	padding: 0;
	list-style: none;
}

.ttbol-pf .ttbol-pf__item:last-child {
	margin-bottom: 0;
}

.ttbol-pf .ttbol-pf__item .count {
	display: block;
	flex: none;
	margin-inline-start: 5px;
	white-space: nowrap;
}

.ttbol-pf .ttbol-pf__item > a {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	min-width: 0;
}

/* مربع انتخاب، دقیقاً مثل فیلترهای ویژگی‌های قالب */
.ttbol-pf .ttbol-pf__item > a::before {
	content: "";
	flex: none;
	width: 14px;
	height: 14px;
	margin-inline-end: 8px;
	border: 2px solid var(--pf-line);
	background: transparent;
	transition: background-color .15s ease, border-color .15s ease;
}

.ttbol-pf .ttbol-pf__item.chosen > a::before {
	border-color: var(--pf-accent);
	background: var(--pf-accent);
	box-shadow: inset 0 0 0 2px #fff;
}

.ttbol-pf .ttbol-pf__item.chosen > a {
	color: var(--pf-accent);
	font-weight: 500;
}

/* پرفروش‌ترین بازه فقط کمی پررنگ‌تر است، بدون برچسب. */
.ttbol-pf .ttbol-pf__item--hot > a,
.ttbol-pf .ttbol-pf__item--hot > .count {
	font-weight: 600;
}

.ttbol-pf .ttbol-pf__item--hot > a {
	color: var(--pf-text);
}

/* ---------- انتخاب دستی ---------- */

.ttbol-pf .ttbol-pf__manual {
	margin-top: 20px;
}

.ttbol-pf .ttbol-pf__slider {
	padding: 0 8px;
	margin-bottom: 14px;
}

.ttbol-pf .ttbol-pf__track-wrap {
	position: relative;
	height: 22px;
	display: flex;
	align-items: center;
}

.ttbol-pf .ttbol-pf__track {
	position: absolute;
	inset-inline: 0;
	height: 3px;
	border-radius: 99px;
	background: var(--pf-line);
}

.ttbol-pf .ttbol-pf__fill {
	position: absolute;
	height: 3px;
	border-radius: 99px;
	background: var(--pf-accent);
}

.ttbol-pf input[type="range"].ttbol-pf__r {
	position: absolute;
	inset-inline: 0;
	width: 100%;
	height: 22px;
	min-height: 0;
	margin: 0;
	padding: 0;
	direction: rtl;
	background: none;
	border: 0;
	box-shadow: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}

.ttbol-pf input[type="range"].ttbol-pf__r::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	pointer-events: auto;
	width: 15px;
	height: 15px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--pf-accent);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
	cursor: pointer;
}

.ttbol-pf input[type="range"].ttbol-pf__r::-moz-range-thumb {
	pointer-events: auto;
	width: 13px;
	height: 13px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var(--pf-accent);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
	cursor: pointer;
}

.ttbol-pf input[type="range"].ttbol-pf__r::-moz-range-track {
	background: none;
	border: none;
}

/* ---------- فیلدهای قیمت ---------- */

.ttbol-pf .ttbol-pf__fields {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ttbol-pf .ttbol-pf__field {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 5px;
	height: var(--pf-height);
	padding: 0 10px;
	background: var(--wd-form-bg, transparent);
	border: 1px solid var(--pf-line);
	border-radius: var(--pf-radius);
}

.ttbol-pf .ttbol-pf__field:focus-within {
	border-color: var(--pf-accent);
}

.ttbol-pf .ttbol-pf__field > span {
	flex: none;
	font-size: 12px;
	color: var(--pf-muted);
}

.ttbol-pf input[type="text"].ttbol-pf__price {
	width: 100%;
	min-width: 0;
	height: auto;
	min-height: 0;
	padding: 0;
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--pf-text);
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	outline: none;
	font-variant-numeric: tabular-nums;
}

.ttbol-pf .ttbol-pf__dash {
	flex: none;
	font-size: 13px;
	color: var(--pf-muted);
}

/* ---------- دکمهٔ اعمال ---------- */

.ttbol-pf .ttbol-pf__apply {
	width: 100%;
	margin-top: 10px;
}

/* ---------- حالت انتظار آجاکس ---------- */

.ttbol-pf.is-loading {
	opacity: .6;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.ttbol-pf * {
		transition: none !important;
	}
}
