/* Archive Filter Sidebar — frontend styles */

.sm-archive-sidebar {
	position: relative;
}

/* ── Mobile toggle (hidden on desktop) ── */

.sm-archive-sidebar__mobile-toggle {
	display: none;
	align-items: center;
	gap: 0.5rem;
	padding: 0.65rem 1.2rem;
	background: #fff;
	border: 1px solid #d7cfc3;
	border-radius: 6px;
	font-family: 'Avenir Next', sans-serif;
	font-weight: 700;
	font-size: 0.92rem;
	color: #083d8f;
	cursor: pointer;
	width: 100%;
	justify-content: center;
	margin-bottom: 1rem;
}

.sm-archive-sidebar__active-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	background: #083d8f;
	color: #fff;
	border-radius: 10px;
	font-size: 0.72rem;
	font-weight: 800;
}

/* ── Panels container ── */

.sm-archive-sidebar__panels {
	position: sticky;
	top: 100px;
	max-height: calc(100vh - 120px);
	overflow-y: auto;
	padding-right: 4px;
}

.sm-archive-sidebar__panels::-webkit-scrollbar {
	width: 4px;
}

.sm-archive-sidebar__panels::-webkit-scrollbar-thumb {
	background: #d7cfc3;
	border-radius: 2px;
}

/* ── Close button (mobile only) ── */

.sm-archive-sidebar__close {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.5rem;
	color: #555;
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
}

/* ── Header ── */

.sm-archive-sidebar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 0.75rem;
	margin-bottom: 0.25rem;
	border-bottom: 2px solid #083d8f;
}

.sm-archive-sidebar__title {
	margin: 0;
	font-family: 'Avenir Next', sans-serif;
	font-size: 1.1rem;
	font-weight: 800;
	color: #1a1a1a;
}

.sm-archive-sidebar__clear {
	font-family: 'Avenir Next', sans-serif;
	font-size: 0.82rem;
	font-weight: 700;
	color: #083d8f;
	text-decoration: none;
	white-space: nowrap;
}

.sm-archive-sidebar__clear:hover {
	text-decoration: underline;
}

/* ── Panel (collapsible) ── */

.sm-archive-sidebar__panel {
	border-bottom: 1px solid #e8e4de;
	padding: 0;
}

.sm-archive-sidebar__panel:last-child {
	border-bottom: none;
}

.sm-archive-sidebar__panel-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.85rem 0;
	font-family: 'Avenir Next', sans-serif;
	font-size: 0.9rem;
	font-weight: 700;
	color: #1a1a1a;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.sm-archive-sidebar__panel-title::-webkit-details-marker {
	display: none;
}

.sm-archive-sidebar__panel-title::after {
	content: '+';
	font-size: 1.2rem;
	font-weight: 400;
	color: #888;
	transition: transform 0.2s;
}

.sm-archive-sidebar__panel[open] > .sm-archive-sidebar__panel-title::after {
	content: '−';
}

.sm-archive-sidebar__panel-body {
	padding: 0 0 0.75rem;
}

/* ── Checkbox options ── */

.sm-archive-sidebar__option-list,
.sm-archive-sidebar__color-list {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.sm-archive-sidebar__option,
.sm-archive-sidebar__color-option {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.2rem 0;
	cursor: pointer;
	font-family: 'Avenir Next', sans-serif;
	font-size: 0.85rem;
	color: #333;
}

.sm-archive-sidebar__option:hover,
.sm-archive-sidebar__color-option:hover {
	color: #083d8f;
}

.sm-archive-sidebar__option.is-active,
.sm-archive-sidebar__color-option.is-active {
	font-weight: 700;
	color: #083d8f;
}

.sm-archive-sidebar__checkbox {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: #083d8f;
	flex-shrink: 0;
}

.sm-archive-sidebar__option-label,
.sm-archive-sidebar__color-label {
	flex: 1;
}

.sm-archive-sidebar__count {
	color: #999;
	font-size: 0.78rem;
}

/* ── Color swatches ── */

.sm-archive-sidebar__color-swatch {
	display: inline-block;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 2px solid #d7cfc3;
	overflow: hidden;
	flex-shrink: 0;
	background: #f5f5f5;
}

.sm-archive-sidebar__color-option.is-active .sm-archive-sidebar__color-swatch {
	border-color: #083d8f;
	box-shadow: 0 0 0 2px rgba(8, 61, 143, 0.2);
}

.sm-archive-sidebar__color-swatch img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ── Price row ── */

.sm-archive-sidebar__price-row {
	display: flex;
	align-items: flex-end;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.sm-archive-sidebar__price-label {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	font-family: 'Avenir Next', sans-serif;
	font-size: 0.78rem;
	color: #666;
	flex: 1;
	min-width: 60px;
}

.sm-archive-sidebar__price-input {
	width: 100%;
	padding: 0.45rem 0.5rem;
	border: 1px solid #d7cfc3;
	border-radius: 4px;
	font-size: 0.85rem;
	font-family: 'Avenir Next', sans-serif;
}

.sm-archive-sidebar__price-input:focus {
	border-color: #083d8f;
	outline: none;
	box-shadow: 0 0 0 2px rgba(8, 61, 143, 0.15);
}

.sm-archive-sidebar__price-sep {
	padding-bottom: 0.5rem;
	color: #999;
}

.sm-archive-sidebar__price-apply {
	padding: 0.45rem 1rem;
	background: #083d8f;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-family: 'Avenir Next', sans-serif;
	font-size: 0.82rem;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
}

.sm-archive-sidebar__price-apply:hover {
	background: #052b66;
}

/* ── Mobile overlay ── */

@media (max-width: 960px) {
	.sm-archive-sidebar__mobile-toggle {
		display: flex;
	}

	.sm-archive-sidebar__panels {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		width: 85%;
		max-width: 360px;
		height: 100vh;
		max-height: 100vh;
		background: #fff;
		z-index: 10000;
		padding: 1rem 1.25rem;
		box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform 0.3s ease;
	}

	.sm-archive-sidebar__panels.is-open {
		display: block;
		transform: translateX(0);
	}

	.sm-archive-sidebar__close {
		display: block;
	}

	/* Backdrop */
	.sm-archive-sidebar__overlay {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.4);
		z-index: 9999;
	}

	.sm-archive-sidebar__overlay.is-open {
		display: block;
	}
}
