/**
 * Фильтры каталога: панель слева (на телефоне — снизу на весь экран),
 * панель над сеткой, чипы выбранных фильтров, скелетон при подгрузке.
 * Цвета только из palettes.css. Разметка: inc/filters.php, поведение: assets/js/filters.js.
 * Стили, завязанные на JS (выезжающая панель, скрытие «Применить»), — под html.sf-js.
 */

/* -------------------------------------------------------------------------
   1. Колонки: сайдбар 300 px, сетка — остальное
   ---------------------------------------------------------------------- */

@media (min-width: 922px) {
	/* 340 px: карточка 312 px, чтобы «Копчёная и солёная рыба» и счётчик со стрелкой шли в одну строку */
	.sf.sf-has-filters.ast-left-sidebar #secondary {
		flex: 0 0 340px;
		width: 340px;
		margin: 48px 0 40px;
		padding: 0 28px 0 0;
		border-right: 0;
	}

	.sf.sf-has-filters.ast-left-sidebar #primary {
		width: calc(100% - 340px);
		margin: 48px 0;
		padding: 0;
		border-left: 0; /* линия Astra между колонками */
	}

	/* Липкий, только если панель помещается в экран (класс ставит filters.js) */
	.sf.sf-has-filters #secondary .sidebar-main.is-sticky {
		position: sticky;
		top: 88px;
	}
}

.sf.sf-has-filters #secondary .ast-filter-wrap:empty,
.sf.sf-has-filters #secondary .widget {
	display: none;
}

/* -------------------------------------------------------------------------
   2. Панель
   ---------------------------------------------------------------------- */

/* Панель — карточка с внутренними отступами; строки подсвечиваются внутри карточки */
.sf .sf-filters {
	display: block;
	margin: 0;
	padding: 6px 18px 18px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--paper);
	outline: none;
	font-size: 0.95rem;
	color: var(--ink);
}

.sf .sf-filters__head {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	margin: 0 0 4px;
}

.sf .sf-filters__title {
	font-family: var(--font-text);
	font-weight: 700;
	font-size: 1.1rem;
	color: var(--ink);
}

.sf .sf-filters__reset {
	margin-left: auto;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--muted);
	text-decoration: none;
	border-bottom: 1px dashed currentColor;
}

.sf .sf-filters__reset:hover {
	color: var(--coral);
}

.sf .sf-filters__close {
	display: none;
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	margin-left: auto;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--frost);
	cursor: pointer;
	position: relative;
}

.sf .sf-filters__close::before,
.sf .sf-filters__close::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 2px;
	background: var(--ink);
	transform: translate(-50%, -50%) rotate(45deg);
}

.sf .sf-filters__close::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

/* Переключатель «Только в наличии» */
/* Строка списка: подпись слева, переключатель справа, как у остальных блоков */
.sf .sf-switch {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--line);
	cursor: pointer;
	user-select: none;
}

.sf .sf-switch__track {
	order: 2;
	margin-left: auto;
}

.sf .sf-switch input,
.sf .sf-check input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	clip: rect(0 0 0 0);
	overflow: hidden;
}

.sf .sf-switch__track {
	flex: 0 0 38px;
	width: 38px;
	height: 22px;
	border-radius: 11px;
	background: var(--line);
	position: relative;
	transition: background 0.15s;
}

.sf .sf-switch__track::after {
	content: '';
	position: absolute;
	top: 3px;
	left: 3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--paper);
	box-shadow: 0 1px 3px rgba(var(--ink-rgb), 0.3);
	transition: transform 0.15s;
}

.sf .sf-switch input:checked + .sf-switch__track {
	background: var(--sea);
}

.sf .sf-switch input:checked + .sf-switch__track::after {
	transform: translateX(16px);
}

.sf .sf-switch input:focus-visible + .sf-switch__track {
	box-shadow: 0 0 0 3px rgba(var(--ocean-rgb), 0.3);
}

.sf .sf-switch__label {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--ink);
}

/* Аккордеон: заголовок со стрелкой справа, раскрытие 200 мс */
.sf .sf-fgroup {
	border-bottom: 1px solid var(--line);
}

.sf .sf-fgroup__head {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	font-family: var(--font-text);
	font-weight: 700;
	font-size: 0.95rem;
	line-height: 1.2;
	color: var(--ink);
	text-align: left;
	cursor: pointer;
}

/* Стрелка одна на весь сайдбар: 7 px, серая, при наведении ink; вниз — свёрнуто, вверх — раскрыто */
.sf .sf-fgroup__head::after {
	content: '';
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	margin-left: auto;
	margin-right: 4px; /* центр стрелки в той же колонке, что стрелки разделов */
	border-right: 2px solid var(--muted);
	border-bottom: 2px solid var(--muted);
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.2s, border-color 0.12s;
}

.sf .sf-fgroup__head:hover::after {
	border-color: var(--ink);
}

.sf .sf-fgroup.is-open .sf-fgroup__head::after {
	transform: translateY(2px) rotate(-135deg);
}

.sf .sf-fgroup__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: var(--coral);
	color: var(--paper);
	font-family: var(--font-text);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
}

.sf .sf-fgroup__body {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.2s ease;
}

.sf .sf-fgroup__inner {
	min-height: 0;
	margin: 0 -6px;
	padding: 0 6px; /* запас, чтобы overflow не резал тени и подсветку бегунков */
	overflow: hidden;
	visibility: hidden;
	transition: visibility 0s 0.2s;
}

.sf .sf-fgroup.is-open .sf-fgroup__body {
	grid-template-rows: 1fr;
}

.sf .sf-fgroup.is-open .sf-fgroup__inner {
	visibility: visible;
	transition-delay: 0s;
	padding-bottom: 12px;
}

/* Разделы: дерево; у родителя стрелка справа раскрывает подразделы (200 мс),
   клик по названию ведёт в раздел. Текущая ветка раскрыта и подсвечена. */
.sf .sf-fcats,
.sf .sf-fcats ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sf .sf-fcats li {
	margin: 0;
	padding: 0;
}

.sf .sf-fcats__row {
	display: flex;
	align-items: stretch;
	margin: 0 -10px;
	border-radius: 8px;
	transition: background 0.12s;
}

.sf .sf-fcats__row:hover {
	background: var(--frost);
}

.sf .sf-fcats a.sf-fcats__link,
.sf #secondary .sf-fcats a.sf-fcats__link {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	min-height: 34px;
	padding: 3px 10px;
	color: var(--ink);
	font-size: 0.92rem;
	text-decoration: none;
	line-height: 1.25;
	transition: color 0.12s;
}

.sf .sf-fcats a.sf-fcats__link:hover,
.sf #secondary .sf-fcats a.sf-fcats__link:hover {
	color: var(--ocean);
}

.sf .sf-fcats__name {
	flex: 1 1 auto;
	min-width: 0;
}

.sf .sf-fcats__count {
	flex: 0 0 auto;
	margin-left: auto;
	min-width: 28px;
	font-size: 0.78rem;
	color: var(--muted);
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* Стрелка — та же, что у блоков фильтров: вниз свёрнуто, вверх раскрыто */
.sf .sf-fcats button.sf-fcats__toggle {
	flex: 0 0 32px;
	width: 32px;
	min-width: 0;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	position: relative;
}

.sf .sf-fcats button.sf-fcats__toggle:hover,
.sf .sf-fcats button.sf-fcats__toggle:focus {
	background: transparent;
	box-shadow: none;
}

/* У строк без подразделов — пустое место той же ширины, чтобы счётчики стояли в одной колонке */
.sf .sf-fcats__item:not(.has-children) > .sf-fcats__row::after {
	content: '';
	flex: 0 0 32px;
}

.sf .sf-fcats__toggle::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 7px;
	height: 7px;
	margin: -5px 0 0 -4px;
	border-right: 2px solid var(--muted);
	border-bottom: 2px solid var(--muted);
	transform: rotate(45deg);
	transition: transform 0.2s, border-color 0.12s;
}

.sf .sf-fcats__item.is-open > .sf-fcats__row > .sf-fcats__toggle::after {
	margin-top: -2px;
	transform: rotate(-135deg);
}

.sf .sf-fcats__toggle:hover::after {
	border-color: var(--ink);
}

.sf .sf-fcats__toggle:focus-visible {
	outline: 2px solid var(--ocean);
	outline-offset: -2px;
}

.sf .sf-fcats__item.is-current > .sf-fcats__row {
	background: var(--aqua);
}

.sf .sf-fcats__item.is-current > .sf-fcats__row .sf-fcats__link {
	color: var(--ink);
	font-weight: 700;
}

.sf .sf-fcats__item.is-active > .sf-fcats__row .sf-fcats__link {
	font-weight: 600;
}

/* Подразделы: плавное раскрытие через grid-template-rows */
.sf .sf-fcats__sub {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.2s ease;
}

.sf .sf-fcats__sub-inner {
	min-height: 0;
	overflow: hidden;
	visibility: hidden;
	transition: visibility 0s 0.2s;
}

.sf .sf-fcats__item.is-open > .sf-fcats__sub {
	grid-template-rows: 1fr;
}

.sf .sf-fcats__item.is-open > .sf-fcats__sub > .sf-fcats__sub-inner {
	visibility: visible;
	transition-delay: 0s;
}

.sf .sf-fcats ul.sf-fcats--2 {
	padding: 2px 0 6px 16px;
}

.sf .sf-fcats ul.sf-fcats--3 {
	padding: 0 0 4px 16px;
}

.sf .sf-fcats--2 .sf-fcats__link,
.sf .sf-fcats--3 .sf-fcats__link,
.sf .sf-fcats ul.sf-fcats--2 a.sf-fcats__link,
.sf .sf-fcats ul.sf-fcats--3 a.sf-fcats__link {
	font-size: 0.88rem;
}

/* Чекбоксы: 18 px, скругление 4, выбранный — coral с белой галочкой, строка 36 px */
.sf .sf-fterms {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sf .sf-fterms li {
	margin: 0;
	padding: 0;
}

.sf .sf-fterms li.is-extra {
	display: none;
}

.sf .sf-fgroup.is-expanded .sf-fterms li.is-extra {
	display: block;
}

.sf .sf-check {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 36px;
	margin: 0 -10px;
	padding: 0 10px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 0.92rem;
	line-height: 1.2;
	transition: background 0.12s;
}

.sf .sf-check:hover {
	background: var(--frost);
}

.sf .sf-check__box {
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border: 2px solid var(--line);
	border-radius: 4px;
	background: var(--paper);
	position: relative;
	transition: border-color 0.12s, background 0.12s;
}

.sf .sf-check__box::after {
	content: '';
	position: absolute;
	left: 4px;
	top: 0;
	width: 5px;
	height: 9px;
	border-right: 2px solid var(--paper);
	border-bottom: 2px solid var(--paper);
	transform: rotate(45deg) scale(0);
	transition: transform 0.12s;
}

.sf .sf-check:hover .sf-check__box {
	border-color: var(--coral);
}

.sf .sf-check input:checked + .sf-check__box {
	border-color: var(--coral);
	background: var(--coral);
}

.sf .sf-check input:checked + .sf-check__box::after {
	transform: rotate(45deg) scale(1);
}

.sf .sf-check input:focus-visible + .sf-check__box {
	box-shadow: 0 0 0 3px rgba(var(--coral-rgb), 0.3);
}

.sf .sf-check__label {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--ink);
}

.sf .sf-check__count {
	flex: 0 0 auto;
	min-width: 28px;
	margin-right: 32px; /* та же колонка, что счётчики разделов (справа место стрелки) */
	font-size: 0.78rem;
	color: var(--muted);
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.sf .sf-fgroup__more {
	display: inline-block;
	min-height: 0;
	margin: 6px 0 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ocean);
	font-family: var(--font-text);
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	border-bottom: 1px dashed currentColor;
}

.sf .sf-fgroup__more:hover {
	color: var(--ocean-dark);
}

/* Цена: поля «от» и «до», ползунок под ними */
.sf .sf-price {
	padding: 4px 0 0;
}

.sf .sf-price__inputs {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
}

.sf .sf-price__field {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--paper);
	font-size: 0.8rem;
	color: var(--muted);
}

.sf .sf-price__field > span {
	flex: 0 0 auto;
	white-space: nowrap;
}

/* Знак валюты внутри каждого поля, а не отдельно у края */
.sf .sf-price__field::after {
	content: '₽';
	flex: 0 0 auto;
	font-size: 0.85rem;
	color: var(--muted);
}

.sf .sf-price__cur {
	display: none;
}

.sf .sf-price__field:focus-within {
	border-color: var(--ocean);
	box-shadow: 0 0 0 3px rgba(var(--ocean-rgb), 0.2);
}

.sf .sf-filters .sf-price__field input[type="number"] {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--ink);
	-moz-appearance: textfield;
	appearance: textfield;
}

.sf .sf-price__field input::-webkit-outer-spin-button,
.sf .sf-price__field input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.sf .sf-price__cur {
	flex: 0 0 auto;
	font-weight: 600;
	color: var(--muted);
}

/* Ползунки целиком внутри блока (обёртка аккордеона режет всё, что выходит за край):
   дорожка короче на радиус бегунка с каждой стороны, поля ползунков — на всю ширину. */
.sf .sf-range {
	position: relative;
	height: 28px;
	margin: 0;
}

.sf .sf-range__track {
	position: absolute;
	left: 9px;
	right: 9px;
	top: 50%;
	height: 4px;
	margin-top: -2px;
	border-radius: 2px;
	background: var(--line);
}

.sf .sf-range__fill {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	border-radius: 2px;
	background: var(--ocean);
}

.sf .sf-range input[type="range"] {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
	z-index: 2;
}

.sf .sf-range input[type="range"]::-webkit-slider-runnable-track {
	height: 28px;
	background: transparent;
	border: 0;
}

.sf .sf-range input[type="range"]::-moz-range-track {
	height: 28px;
	background: transparent;
	border: 0;
}

.sf .sf-range input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	margin-top: 5px;
	border: 2px solid var(--ocean);
	border-radius: 50%;
	background: var(--paper);
	box-shadow: 0 1px 3px rgba(var(--ink-rgb), 0.25);
	cursor: grab;
	pointer-events: auto;
	transition: box-shadow 0.12s;
}

.sf .sf-range input[type="range"]::-moz-range-thumb {
	width: 14px;
	height: 14px;
	border: 2px solid var(--ocean);
	border-radius: 50%;
	background: var(--paper);
	box-shadow: 0 1px 3px rgba(var(--ink-rgb), 0.25);
	cursor: grab;
	pointer-events: auto;
}

.sf .sf-range input[type="range"]::-webkit-slider-thumb:hover {
	box-shadow: 0 0 0 4px rgba(var(--ocean-rgb), 0.18);
}

.sf .sf-range input[type="range"]:focus {
	outline: none;
}

.sf .sf-range input[type="range"]:focus-visible::-webkit-slider-thumb {
	box-shadow: 0 0 0 3px rgba(var(--ocean-rgb), 0.3);
}

/* Низ панели: с JS — только на телефоне («Показать N товаров»), без JS — «Применить» везде */
.sf .sf-filters__foot {
	padding: 16px 0 0;
}

.sf-js .sf .sf-filters__foot {
	display: none;
}

.sf .sf-filters__apply {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 48px;
	padding: 0 16px;
	border: 2px solid var(--coral);
	border-radius: 10px;
	background: var(--coral);
	color: var(--paper);
	font-family: var(--font-text);
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
}

.sf .sf-filters__apply:hover {
	background: var(--coral-dark);
	border-color: var(--coral-dark);
}

.sf .sf-filters__apply-js,
.sf-js .sf .sf-filters__apply-nojs {
	display: none;
}

.sf-js .sf .sf-filters__apply-js {
	display: inline;
}

/* -------------------------------------------------------------------------
   3. Панель над сеткой: число товаров, «Фильтры», сортировка
   ---------------------------------------------------------------------- */

.sf .sf-toolbar {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 16px;
}

.sf .sf-toolbar__count {
	margin: 0;
	font-size: 0.95rem;
	color: var(--muted);
}

.sf .sf-toolbar__filters {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	padding: 0 14px;
	border: 2px solid var(--ink);
	border-radius: 10px;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-text);
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}

.sf .sf-toolbar__filters::before {
	content: '';
	width: 16px;
	height: 14px;
	background: linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 2px no-repeat,
		linear-gradient(var(--ink), var(--ink)) 2px 6px / 12px 2px no-repeat,
		linear-gradient(var(--ink), var(--ink)) 4px 12px / 8px 2px no-repeat;
}

.sf .sf-toolbar__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: var(--coral);
	color: var(--paper);
	font-size: 0.75rem;
	line-height: 1;
}

.sf .sf-toolbar__sort {
	position: relative;
	margin-left: auto;
}

.sf .sf-toolbar__sort .woocommerce-ordering {
	float: none;
	margin: 0;
}

.sf .sf-toolbar__sort::after {
	content: '';
	position: absolute;
	right: 16px;
	top: 50%;
	width: 7px;
	height: 7px;
	margin-top: -5px;
	border-right: 2px solid var(--ink);
	border-bottom: 2px solid var(--ink);
	transform: rotate(45deg);
	pointer-events: none;
}

.sf .sf-toolbar__sort select.orderby,
.sf .woocommerce .sf-toolbar__sort select.orderby {
	height: 40px;
	margin: 0;
	padding: 0 38px 0 14px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--paper);
	box-shadow: none;
	font-family: var(--font-text);
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--ink);
	line-height: 38px;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.sf .sf-toolbar__sort select.orderby:hover {
	border-color: var(--ink);
}

.sf .sf-toolbar__sort select.orderby:focus {
	border-color: var(--ocean);
	box-shadow: 0 0 0 3px rgba(var(--ocean-rgb), 0.2);
	outline: none;
}

/* Чипы выбранных фильтров */
.sf .sf-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: -4px 0 16px;
}

.sf .sf-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 32px;
	padding: 0 12px;
	border-radius: 16px;
	background: var(--aqua);
	color: var(--ink);
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background 0.12s;
}

.sf .sf-chip:hover {
	background: var(--ink);
	color: var(--paper);
}

.sf .sf-chip__x {
	position: relative;
	width: 10px;
	height: 10px;
}

.sf .sf-chip__x::before,
.sf .sf-chip__x::after {
	content: '';
	position: absolute;
	left: -1px;
	top: 4px;
	width: 12px;
	height: 2px;
	background: currentColor;
	transform: rotate(45deg);
}

.sf .sf-chip__x::after {
	transform: rotate(-45deg);
}

.sf .sf-chip--reset {
	background: transparent;
	color: var(--muted);
	border: 1px dashed var(--line);
}

.sf .sf-chip--reset:hover {
	background: transparent;
	border-color: var(--coral);
	color: var(--coral);
}

/* Пустая выдача */
.sf .sf-empty {
	padding: 48px 24px;
	border-radius: var(--sf-radius);
	background: var(--frost);
	text-align: center;
}

.sf .sf-empty__title {
	margin: 0 0 8px;
	font-family: var(--font-heading);
	font-size: 1.4rem;
	font-weight: 600;
	color: var(--ink);
}

.sf .sf-empty__text {
	margin: 0 0 20px;
	color: var(--muted);
}

/* -------------------------------------------------------------------------
   4. Подгрузка: скелетон карточек на месте сетки, полоса сверху
   ---------------------------------------------------------------------- */

.sf #primary.is-loading::after {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	z-index: 10002;
	background: linear-gradient(90deg, var(--ocean), var(--coral), var(--ocean));
	background-size: 200% 100%;
	animation: sf-loading 1s linear infinite;
}

@keyframes sf-loading {
	from { background-position: 200% 0; }
	to { background-position: 0 0; }
}

.sf ul.products li.sf-card--skeleton {
	padding: 0 0 16px;
	box-shadow: var(--sf-shadow);
	pointer-events: none;
}

.sf .sf-skeleton__media,
.sf .sf-skeleton__line {
	display: block;
	background: linear-gradient(90deg, var(--frost) 25%, var(--line) 50%, var(--frost) 75%);
	background-size: 400% 100%;
	animation: sf-shimmer 1.2s ease infinite;
}

.sf .sf-skeleton__media {
	aspect-ratio: 1 / 1;
	width: 100%;
	margin: 0 0 16px;
}

.sf .sf-skeleton__line {
	height: 14px;
	margin: 0 16px 10px;
	border-radius: 7px;
}

.sf .sf-skeleton__line--title {
	width: 70%;
}

.sf .sf-skeleton__line--price {
	width: 45%;
	height: 20px;
}

.sf .sf-skeleton__line--btn {
	height: 40px;
	margin-top: 18px;
	border-radius: 10px;
}

@keyframes sf-shimmer {
	from { background-position: 100% 0; }
	to { background-position: 0 0; }
}

/* -------------------------------------------------------------------------
   5. Телефон и планшет: кнопка «Фильтры», панель снизу на весь экран
   ---------------------------------------------------------------------- */

@media (max-width: 921px) {
	.sf .sf-toolbar {
		flex-wrap: wrap;
	}

	.sf .sf-toolbar__count {
		flex: 1 1 100%;
		order: 3;
		font-size: 0.85rem;
	}

	.sf .sf-toolbar__filters {
		display: inline-flex;
		order: 1;
	}

	.sf .sf-toolbar__sort {
		order: 2;
		flex: 1 1 auto;
		min-width: 0;
	}

	.sf .sf-toolbar__sort select.orderby,
	.sf .woocommerce .sf-toolbar__sort select.orderby {
		width: 100%;
	}

	/* Без JS сайдбар остаётся в потоке под сеткой; с JS — панель снизу */
	.sf-js .sf.sf-has-filters #secondary {
		position: fixed;
		inset: 0;
		z-index: 10001;
		width: 100%;
		margin: 0;
		padding: 0;
		overflow: hidden;
		background: var(--paper);
		transform: translateY(100%);
		transition: transform 0.25s ease, visibility 0s 0.25s;
		visibility: hidden;
	}

	.sf-js .sf.sf-filters-open #secondary {
		transform: none;
		visibility: visible;
		transition: transform 0.25s ease;
	}

	.sf-js .sf.sf-has-filters #secondary .sidebar-main {
		height: 100%;
	}

	.sf-js .sf.sf-has-filters #secondary .sf-filters {
		display: flex;
		flex-direction: column;
		height: 100%;
		min-height: 0;
		padding: 0;
		border: 0;
		border-radius: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	.sf-js .sf .sf-filters__head {
		position: sticky;
		top: 0;
		z-index: 1;
		flex: 0 0 auto;
		margin: 0;
		padding: 12px 20px;
		background: var(--paper);
		border-bottom: 1px solid var(--line);
	}

	.sf-js .sf .sf-filters__close {
		display: block;
	}

	.sf-js .sf .sf-filters__reset {
		margin-left: 0;
	}

	.sf-js .sf .sf-switch {
		margin: 16px 20px 8px;
	}

	.sf-js .sf .sf-fgroup {
		margin: 0 20px;
	}

	.sf-js .sf .sf-filters__foot {
		display: block;
		position: sticky;
		bottom: 0;
		z-index: 1;
		margin-top: auto;
		padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
		background: var(--paper);
		border-top: 1px solid var(--line);
	}

	.sf-js .sf.sf-filters-open {
		overflow: hidden;
	}

	.sf-filters-overlay {
		position: fixed;
		inset: 0;
		z-index: 10000;
		background: rgba(var(--ink-rgb), 0.45);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.25s ease, visibility 0.25s;
	}

	.sf.sf-filters-open .sf-filters-overlay {
		opacity: 1;
		visibility: visible;
	}

	/* Строки не меньше 40 px под палец */
	.sf .sf-check,
	.sf .sf-fcats__link {
		min-height: 40px;
	}

	.sf .sf-fcats button.sf-fcats__toggle,
	.sf .sf-fcats__item:not(.has-children) > .sf-fcats__row::after {
		flex-basis: 40px;
		width: 40px;
	}
}

/* -------------------------------------------------------------------------
   6. Состояние без перезагрузки: приглушённые нули, ошибка загрузки
   ---------------------------------------------------------------------- */

/* Значение с нулём не прячем (иначе пропадает из-под курсора), а приглушаем */
.sf .sf-fterms li.is-empty .sf-check__label,
.sf .sf-fterms li.is-empty .sf-check__count {
	opacity: 0.45;
}

.sf .sf-fterms li.is-empty .sf-check__box {
	opacity: 0.6;
}

.sf .sf-results {
	min-height: 200px;
}

.sf .sf-load-error {
	padding: 40px 24px;
	border-radius: var(--sf-radius);
	background: var(--frost);
	text-align: center;
}

.sf .sf-load-error__text {
	margin: 0 0 16px;
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--ink);
}

.sf .sf-load-error__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	padding: 0 24px;
	border: 2px solid var(--ink);
	border-radius: 10px;
	background: transparent;
	color: var(--ink);
	font-family: var(--font-text);
	font-weight: 700;
	cursor: pointer;
}

.sf .sf-load-error__btn:hover {
	background: var(--ink);
	color: var(--paper);
}


/* СИФУД 05.11 — иконки корневых разделов совпадают с меню «Каталог». */
.sf .sf-fcats__icon {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 21px; width: 21px; height: 21px; color: var(--ocean);
}
.sf .sf-fcats__icon > .sf-icon {
  display: block; width: 21px; height: 21px; stroke: currentColor;
}
.sf .sf-fcats__item.is-current > .sf-fcats__row .sf-fcats__icon,
.sf .sf-fcats a.sf-fcats__link:hover .sf-fcats__icon { color: var(--coral); }
