/*
 * GS Salon - Sidebar & Filter Controls
 */

.gs-archive-sidebar__inner {
	position: sticky;
	top: 24px;
	padding: 22px;
	border-radius: 28px;
	direction: rtl;
}

.gs-archive-sidebar__top h2 {
	margin: 0 0 8px;
	color: var(--gs-primary);
	font-size: 1.2rem;
	font-weight: 900;
}

.gs-archive-sidebar__top p {
	margin: 0 0 18px;
	color: var(--gs-text-muted);
	font-size: .95rem;
	line-height: 1.9;
}

.gs-archive-filter {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.gs-archive-filter__section {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.gs-archive-filter__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.gs-archive-filter__head h3 {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	color: var(--gs-primary);
	font-size: .98rem;
	font-weight: 800;
}

.gs-filter-clear-inline {
	border: none;
	background: transparent;
	padding: 0;
	color: var(--gs-accent-strong);
	font-size: .84rem;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	font-family: var(--gs-font-family, Vazirmatn, sans-serif);
}

.gs-filter-clear-inline:hover {
	color: var(--gs-primary);
}

.gs-archive-filter__list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.gs-filter-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	background: rgba(255, 255, 255, 0.5);
	border: 1px solid rgba(191, 156, 96, 0.15);
	border-radius: 14px;
	cursor: pointer;
	transition: all 0.28s ease;
}

.gs-filter-row:hover {
	background: rgba(255, 255, 255, 0.9);
	border-color: var(--gs-accent);
	transform: translateY(-1px);
}

.gs-filter-row input {
	width: 20px;
	height: 20px;
	accent-color: var(--gs-accent);
	flex: 0 0 20px;
}

.gs-filter-row span {
	font-size: .95rem;
	font-weight: 700;
	color: var(--gs-primary);
}

.gs-filter-row:has(input:checked) {
	background: linear-gradient(
		180deg,
		rgba(255, 252, 246, .95),
		rgba(247, 238, 224, .90)
	);
	border-color: rgba(191, 156, 96, .38);
	box-shadow: 0 10px 20px rgba(159, 124, 68, .10);
}

.gs-archive-filter__select-wrap,
.gs-archive-sort {
	position: relative;
}

.gs-archive-filter__select {
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	border-radius: 16px;
	border: 1px solid rgba(191, 156, 96, .18);
	background: rgba(255, 255, 255, .8);
	color: var(--gs-primary);
	font-weight: 700;
	outline: none;
	font-family: var(--gs-font-family, Vazirmatn, sans-serif);
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
}

.gs-archive-filter__select option {
	font-family: var(--gs-font-family, Vazirmatn, sans-serif);
	color: var(--gs-primary);
	background: #fffdf9;
}

.gs-archive-filter__actions {
	display: grid;
	gap: 10px;
}

.gs-btn-block {
	width: 100%;
}

/* Generic Hierarchical Filter */
.gs-tree-filter {
	--gs-tree-line: rgba(191, 156, 96, .28);
}

.gs-filter-tree {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/*
 * کنترل واحد باز و بسته‌کردن همه شاخه‌ها
 */
.gs-filter-tree-actions {
	display: inline-flex;
	align-items: center;
	margin-inline-start: 10px;
	padding-inline: 5px;
	color: var(--gs-accent-strong);
	font-size: .76rem;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
}

.gs-filter-tree-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 24px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--gs-accent-strong);
	font-family: var(--gs-font-family, Vazirmatn, sans-serif);
	font-size: .76rem;
	font-weight: 700;
	line-height: 1.4;
	cursor: pointer;
	transition:
		color .2s ease,
		opacity .2s ease;
}

.gs-filter-tree-action:hover,
.gs-filter-tree-action:focus-visible {
	color: var(--gs-primary);
	text-decoration: underline;
}

.gs-filter-tree-action:focus-visible {
	outline: 2px solid var(--gs-accent);
	outline-offset: 3px;
	border-radius: 4px;
}

.gs-filter-tree-action__label {
	display: inline-block;
}

.gs-tree-row {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	margin-inline-start: var(--gs-depth);
	background: rgba(255, 255, 255, .5);
	border: 1px solid rgba(191, 156, 96, .15);
	border-radius: 14px;
	cursor: pointer;
	transition: all .2s ease;
}

.gs-tree-row:hover {
	background: rgba(255, 255, 255, .9);
	border-color: var(--gs-accent);
}

.gs-tree-row.is-parent {
	background: linear-gradient(
		180deg,
		rgba(255, 255, 255, .8),
		rgba(249, 242, 229, .5)
	);
	font-weight: 800;
}

.gs-tree-row.is-selected {
	background: linear-gradient(
		180deg,
		#fffcf6,
		#f7eee0
	) !important;
	border-color: var(--gs-accent) !important;
	box-shadow: 0 4px 12px rgba(159, 124, 68, .08);
}

.gs-tree-row__main {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	min-width: 0;
}

.gs-tree-row__main input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 0;
	flex: 0 0 18px;
	accent-color: var(--gs-accent);
	cursor: pointer;
}

.gs-tree-child-count {
	padding: 2px 6px;
	border-radius: 6px;
	background: rgba(191, 156, 96, .1);
	color: var(--gs-accent-strong);
	font-size: .75rem;
	font-weight: 700;
}

.gs-tree-row__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	flex: 0 0 24px;
	border: 0;
	border-radius: 6px;
	background: rgba(191, 156, 96, .05);
	cursor: pointer;
}

.gs-tree-row__toggle::before {
	content: "\2212";
	color: var(--gs-accent-strong);
	font-weight: 700;
}

.gs-tree-row:not(.is-open) .gs-tree-row__toggle::before {
	content: "\002B";
}

.gs-tree-row.is-child {
	display: none;
	font-size: .9rem;
	opacity: .9;
}

.gs-tree-row.is-child.is-visible {
	display: flex;
}

/*
 * نمایش مناسب کنترل در عرض‌های کم
 */
@media (max-width: 575.98px) {
	.gs-archive-filter__head {
		align-items: flex-start;
	}

	.gs-archive-filter__head h3 {
		gap: 4px;
		font-size: .92rem;
	}

	.gs-filter-tree-actions {
		margin-inline-start: 6px;
		padding-inline: 2px;
		font-size: .7rem;
	}

	.gs-filter-tree-action {
		min-height: 22px;
		font-size: .7rem;
	}

	.gs-filter-tree-action__label {
		white-space: normal;
	}
}
