/* Стили для фильтрации товаров */

.catalog-filters {
	background: #fff;
	padding: 24px;
	border: 1px solid #edf1f4;
	border-radius: 12px;
	margin-bottom: 32px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.catalog-filters__header {
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid #edf1f4;
}

.filter-results-count {
	font-weight: 700;
	font-size: 18px;
	color: #1a1a1a;
}

.js-results-count {
	color: #000;
}

.catalog-filters__body {
	flex-wrap: wrap;
	gap: 24px;
}

.filter-item {
	position: relative;
	flex: 1;
	min-width: 200px;
	margin-bottom: 0 !important;
}

.filter-item__title,
.filter-item > label {
	display: block;
	margin-bottom: 10px;
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #666;
}

.filter-item select,
.filter-item input[type="number"] {
	width: 100%;
	height: 44px;
	border: 2px solid #edf1f4;
	border-radius: 0;
	padding: 0 16px;
	background: #fff;
	font-size: 15px;
	transition: border-color 0.2s, box-shadow 0.2s;
	color: #1a1a1a;
	-webkit-appearance: none;
	appearance: none;
}

.filter-item select:focus,
.filter-item input:focus {
	border-color: #000;
	outline: none;
	box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.filter-dropdown {
	position: relative;
	width: 100%;
}

.filter-dropdown__toggle {
	width: 100%;
	height: 44px;
	border: 2px solid #edf1f4;
	border-radius: 0;
	background: #fff;
	padding: 0 16px;
	color: #1a1a1a;
	font: inherit;
	box-shadow: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	text-align: left;
}

.filter-dropdown.is-open .filter-dropdown__toggle,
.filter-dropdown__toggle:focus {
	border-color: #000;
	outline: none;
	box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.filter-dropdown__current {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.filter-dropdown__current-text {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.filter-dropdown__current-swatch {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
}


.filter-dropdown__arrow {
	flex: 0 0 auto;
	width: 12px;
	height: 12px;
	margin-left: 12px;
	border-right: 2px solid #333;
	border-bottom: 2px solid #333;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.2s ease;
}

.filter-dropdown.is-open .filter-dropdown__arrow {
	transform: translateY(2px) rotate(225deg);
}

.filter-dropdown__panel {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 8px);
	z-index: 20;
	max-height: 320px;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid #edf1f4;
	border-radius: 0;
	background: #fff;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
	padding: 8px;
	display: none;
}

.filter-dropdown.is-open .filter-dropdown__panel {
	display: block;
}

.filter-dropdown__option {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 0;
	font-size: 15px;
	color: #1a1a1a;
	cursor: pointer;
	margin-bottom: 0 !important;
	font-weight: normal;
}

.filter-dropdown__option:hover {
	background: #f7f7f7;
}

.filter-dropdown__option.is-active {
	background: #f2f4f6;
}

.filter-dropdown__option.is-disabled {
	opacity: 0.45;
	pointer-events: none;
}

.filter-dropdown__option input[type="checkbox"] {
	position: absolute;
	left: 12px;
	top: 50%;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-50%);
}

.filter-dropdown__checkbox {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	border: 2px solid #000;
	border-radius: 0;
	background: #fff;
	position: relative;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.filter-dropdown__checkbox:after {
	content: '';
	position: absolute;
	left: 5px;
	top: 2px;
	width: 5px;
	height: 9px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg);
	opacity: 0;
}

.filter-dropdown__option input:checked + .filter-dropdown__checkbox {
	border-color: #000;
	background: #000;
}

.filter-dropdown__option input:checked + .filter-dropdown__checkbox:after {
	opacity: 1;
}

.filter-dropdown__swatch {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
}

.js-filter-current-swatch[aria-hidden="true"] {
	display: none;
}

.filter-dropdown__current-swatch--beige,
.filter-dropdown__swatch--beige { background-color: #f5f5dc; }
.filter-dropdown__current-swatch--white,
.filter-dropdown__swatch--white { background-color: #ffffff; }
.filter-dropdown__current-swatch--burgundy,
.filter-dropdown__swatch--burgundy { background-color: #800020; }
.filter-dropdown__current-swatch--lightblue,
.filter-dropdown__swatch--lightblue { background-color: #add8e6; }
.filter-dropdown__current-swatch--yellow,
.filter-dropdown__swatch--yellow { background-color: #ffff00; }
.filter-dropdown__current-swatch--green,
.filter-dropdown__swatch--green { background-color: #008000; }
.filter-dropdown__current-swatch--brown,
.filter-dropdown__swatch--brown { background-color: #8b4513; }
.filter-dropdown__current-swatch--red,
.filter-dropdown__swatch--red { background-color: #ff0000; }
.filter-dropdown__current-swatch--orange,
.filter-dropdown__swatch--orange { background-color: #ffa500; }
.filter-dropdown__current-swatch--pink,
.filter-dropdown__swatch--pink { background-color: #ffc0cb; }
.filter-dropdown__current-swatch--gray,
.filter-dropdown__swatch--gray { background-color: #808080; }
.filter-dropdown__current-swatch--blue,
.filter-dropdown__swatch--blue { background-color: #0000ff; }
.filter-dropdown__current-swatch--purple,
.filter-dropdown__swatch--purple { background-color: #800080; }
.filter-dropdown__current-swatch--black,
.filter-dropdown__swatch--black { background-color: #000000; }

.filter-dropdown__swatch--white { border: 1px solid #f0f0f0; }

.filter-dropdown__text {
	flex: 1 1 auto;
	min-width: 0;
}

.filter-dropdown__count {
	flex: 0 0 auto;
	margin-left: auto;
	font-size: 13px;
}


/* Цена */
.filter-item--price {
	min-width: 280px;
}

.filter-item--price .price-slider-container {
	padding: 12px 0 4px;
}

.price-inputs {
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.price-inputs input {
	text-align: center;
	font-weight: 600;
}

.price-inputs .sep {
	color: #ccc;
	font-size: 20px;
}

.price-range-wrapper {
	position: relative;
	height: 4px;
	background: #edf1f4;
	border-radius: 0;
	margin: 12px 10px;
}

.slider-track {
	position: absolute;
	height: 4px;
	background: #000;
	border-radius: 2px;
	z-index: 1;
}

.price-range-wrapper input[type="range"] {
	position: absolute;
	width: 100%;
	top: -5px;
	left: 0;
	background: none;
	pointer-events: none;

	-webkit-appearance: none;
	appearance: none;
	z-index: 2;

	height: 14px;
	margin: 0;
}

.price-range-wrapper input[type="range"]::-webkit-slider-thumb {
	height: 20px;
	width: 20px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #000;
	cursor: pointer;
	pointer-events: auto;
	-webkit-appearance: none;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	margin-top: -3px;
}

.price-range-wrapper input[type="range"]::-moz-range-thumb {
	height: 20px;
	width: 20px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #000;
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Адаптив */
.filter-toggle__wr {
	display: none;
}

.js-filter-toggle {
	background: #000;
	color: #fff;
	border: none;
	padding: 10px 20px;
	border-radius: 6px;
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.2s;
}

.js-filter-toggle:hover {
	background: #333;
}

@media (max-width: 768px) {
	.catalog-filters {
		padding: 16px;
	}

	.catalog-filters__header {
		margin-bottom: 0;
		border-bottom: none;
		padding-bottom: 0;
	}

	.catalog-filters.is-open .catalog-filters__header {
		margin-bottom: 24px;
		border-bottom: 1px solid #edf1f4;
		padding-bottom: 16px;
	}

	.filter-toggle__wr {
		display: block;
	}

	.catalog-filters__body {
		display: none;
		flex-direction: column;
	}

	.filter-item {
		min-width: 100%;
	}

	.filter-item+.filter-item {
		margin-top: 20px;
	}

	.filter-results-count {
		font-size: 15px;
	}

}

@media (max-width: 390px) {
	.filter-results-count {
		font-size: 14px;
	}

	.catalog-filters__header {
		flex-direction: column;
		gap: 12px;
		align-items: flex-start;
	}
}


/* Состояние загрузки */
.view-content {
	transition: opacity 0.3s ease;
	position: relative;
}

.view-content.loading:after {
	content: '';
	position: absolute;
	top: 50px;
	left: 50%;
	transform: translateX(-50%);
	width: 40px;
	height: 40px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #000;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	z-index: 10;
}

@keyframes spin {
	0% {
		transform: rotate(0deg) translateX(-50%);
	}

	100% {
		transform: rotate(360deg) translateX(-50%);
	}
}

/* Скрытые опции (фасеты) */
.filter-item option:disabled {
	color: #ccc;
}
