/* Мобильная панель фильтров: только ≤900px (см. @media ниже) */
.catalog-mobile-filter-bar {
  display: none;
}

.catalog-filter-backdrop {
  display: none;
}

/* Каталог: вёрстка страницы */
.catalog-page-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: auto;
  min-height: calc(100vh - 280px);
  padding: 8px 20px 48px;
  gap: 24px;
  width: 100%;
  box-sizing: border-box;
  background-color: transparent;
}

.catalog-page__content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  align-items: flex-start;
  gap: 40px;
  position: relative;
  flex: 0 0 auto;
  border: none;
  box-shadow: none;
  background: transparent;
}

.catalog-page__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  align-self: stretch;
  width: 100%;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.catalog-page__heading {
  margin: 0;
  position: relative;
  width: fit-content;
  font-family: "Bebas Neue-Bold", Helvetica;
  font-weight: 500;
  color: var(--neutral-200);
  font-size: 48px;
  letter-spacing: 0;
  line-height: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Активный поисковый запрос: одна линия, текст и кнопка сброса выровнены по центру по вертикали */
.catalog-active-search {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.catalog-active-search__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 130, 0, 0.42);
  background: rgba(255, 130, 0, 0.09);
  box-sizing: border-box;
}

.catalog-active-search__line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 0.4em;
  row-gap: 4px;
  margin: 0;
  padding: 0;
  min-width: 0;
  flex: 1 1 auto;
}

.catalog-active-search__label {
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  font-family: "Manrope-SemiBold", Helvetica, system-ui, sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: rgba(26, 26, 26, 0.55);
}

.catalog-active-search__label::after {
  content: ':';
  font-weight: 500;
}

.catalog-active-search__query {
  margin: 0;
  padding: 0;
  min-width: 0;
  flex: 1 1 12rem;
  font-family: "Manrope-Bold", Helvetica, system-ui, sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--neutral-200);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.catalog-active-search__clear {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(26, 26, 26, 0.07);
  color: var(--neutral-200);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.catalog-active-search__clear:hover {
  background: rgba(26, 26, 26, 0.12);
}

.catalog-active-search__clear:focus-visible {
  outline: 2px solid var(--colors-100);
  outline-offset: 2px;
}

.catalog-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  position: relative;
  align-self: stretch;
  width: 100%;
  flex: 0 0 auto;
}

.catalog-layout__sidebar {
  display: flex;
  flex-direction: column;
  width: 322px;
  align-items: flex-start;
  /* Не center: при переполнении (мобильная шторка) центрирование
     обрезает верх списка и до него нельзя доскроллить */
  justify-content: flex-start;
  gap: 16px;
  position: relative;
}

.catalog-filter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  position: relative;
  align-self: stretch;
  width: 100%;
  flex: 0 0 auto;
  background-color: var(--neutral-100);
  border-radius: 16px;
  border: 1px solid var(--neutralgray);
}

.catalog-page-screen .catalog-filter {
  padding: 20px 22px 22px;
  box-sizing: border-box;
}

/* Hide empty colour controls; JavaScript removes hidden when real colours exist. */
.catalog-filter--colors[hidden],
#catalog-mf-colors[hidden] {
  display: none !important;
}

.catalog-filter__stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  position: relative;
  align-self: stretch;
  width: 100%;
  flex: 0 0 auto;
}

.catalog-page-screen .catalog-filter .catalog-filter__stack {
  gap: 16px;
  width: 100%;
  align-items: stretch;
}

.catalog-filter__heading {
  position: relative;
  width: fit-content;
  margin-top: -1px;
  font-family: "Manrope-Bold", Helvetica;
  font-weight: 500;
  color: var(--neutral-200);
  font-size: 18px;
  letter-spacing: 0.18px;
  line-height: 23.4px;
  white-space: nowrap;
}

.catalog-filter__divider {
  height: 1px;
  object-fit: cover;
  position: relative;
  align-self: stretch;
  width: 100%;
}

.catalog-filter__brand-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 10px;
}

.catalog-filter__brand-search-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.catalog-filter__brand-search-input,
.catalog-filter__brand-sort-select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--neutralgray);
  border-radius: 10px;
  background: var(--neutral-100);
  font-family: "Manrope-SemiBold", Helvetica, sans-serif;
  font-size: 13px;
  color: var(--neutral-200);
  box-sizing: border-box;
}

.catalog-filter__brand-search-input:focus,
.catalog-filter__brand-sort-select:focus {
  outline: 2px solid var(--colors-100);
  outline-offset: 1px;
}

.catalog-active-search__found,
.catalog-results-count {
  margin: 0;
  font-family: "Manrope-SemiBold", Helvetica, sans-serif;
  font-size: 14px;
  color: rgba(26, 26, 26, 0.6);
}

.catalog-results-count {
  padding: 2px 0 6px;
}

.catalog-results-count[hidden] {
  display: none;
}

.catalog-pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 0 28px;
}

.catalog-pagination[hidden] {
  display: none;
}

.catalog-pagination__meta {
  margin: 0;
  font-family: "Manrope-SemiBold", Helvetica, sans-serif;
  font-size: 13px;
  color: rgba(26, 26, 26, 0.5);
  text-align: center;
}

.catalog-pagination__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.catalog-pagination__pages {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.catalog-pagination__btn {
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(26, 26, 26, 0.12);
  border-radius: 12px;
  background: var(--neutral-100, #fff);
  color: var(--not-quite-black, #1a1a1a);
  font-family: "Manrope-SemiBold", Helvetica, sans-serif;
  font-size: 14px;
  cursor: pointer;
}

.catalog-pagination__btn:hover:not(:disabled) {
  border-color: var(--colors-500);
  color: var(--colors-500);
}

.catalog-pagination__btn--active,
.catalog-pagination__btn--active:hover {
  background: var(--colors-500);
  border-color: var(--colors-500);
  color: var(--neutral-100, #fff);
  cursor: default;
}

.catalog-pagination__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.catalog-pagination__gap {
  padding: 0 2px;
  color: rgba(26, 26, 26, 0.45);
  font-family: "Manrope-SemiBold", Helvetica, sans-serif;
}

.catalog-filter__tree-node {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.catalog-filter__tree-head {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}

.catalog-filter__tree-head .catalog-filter__row {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.catalog-filter__tree-toggle {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  z-index: 2;
  border-radius: 6px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease;
}

@media (hover: hover) {
  .catalog-filter__tree-toggle:hover {
    background: rgba(26, 26, 26, 0.06);
  }
}

.catalog-filter__tree-toggle::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  margin: 0;
  border-style: solid;
  border-width: 5px 0 5px 7px;
  border-color: transparent transparent transparent var(--neutral-200);
  opacity: 0.55;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.catalog-filter__tree-toggle[aria-expanded='true']::before {
  transform: rotate(90deg);
}

.catalog-filter__tree-toggle--spacer {
  cursor: default;
  pointer-events: none;
  visibility: hidden;
}

.catalog-filter__tree-toggle--spacer::before {
  display: none;
}

.catalog-filter__tree-children {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Отступ + направляющая линия под центром стрелки родителя */
  margin: 2px 0 4px 13px;
  padding-left: 14px;
  border-left: 1px solid rgba(26, 26, 26, 0.12);
  width: auto;
  box-sizing: border-box;
}

.catalog-filter__tree-children[hidden] {
  display: none !important;
}

.catalog-filter__row {
  gap: 12px;
  align-self: stretch;
  width: calc(100% + 16px);
  margin: 0 -8px;
  padding: 7px 8px;
  border-radius: 8px;
  box-sizing: border-box;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease;
}

@media (hover: hover) {
  .catalog-filter__row:hover {
    background: rgba(26, 26, 26, 0.045);
  }

  .catalog-filter__row--empty:hover {
    background: transparent;
  }
}

.catalog-filter__row--empty {
  cursor: default;
}

.catalog-filter__row:focus-visible {
  outline: 2px solid var(--colors-100);
  outline-offset: 2px;
  border-radius: 6px;
}

.catalog-filter__tick {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  aspect-ratio: 1;
  box-sizing: border-box;
  margin-top: 2px;
}

.catalog-filter__tick--unchecked {
  background-color: var(--gray-0210);
  border: 1px solid #c2c2c2;
}

.catalog-filter__tick--checked {
  background-color: var(--colors-500);
  background-image: url(/images/catalog/check.svg);
  background-size: 100% 100%;
  border: none;
}

.catalog-filter__option-label {
  position: relative;
  min-width: 0;
  flex: 1 1 auto;
  margin-top: -1px;
  font-family: "Manrope-SemiBold", Helvetica;
  font-weight: 500;
  color: var(--neutral-200);
  font-size: 14px;
  letter-spacing: 0.28px;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.catalog-filter__option-count {
  margin-top: -1px;
  margin-left: auto;
  padding-left: 8px;
  flex-shrink: 0;
  opacity: 0.5;
  font-family: "Manrope-SemiBold", Helvetica;
  font-weight: 500;
  color: var(--neutral-200);
  font-size: 14px;
  letter-spacing: 0.28px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  position: relative;
  width: fit-content;
  line-height: normal;
}

.catalog-filter__message {
  position: relative;
  width: fit-content;
  margin-top: -1px;
  font-family: "Manrope-SemiBold", Helvetica;
  font-weight: 500;
  color: var(--neutral-200);
  font-size: 14px;
  letter-spacing: 0.28px;
  line-height: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* Шапка шторки фильтра (мобилка): заголовок + ×; на десктопе скрыто */
.catalog-filter__sheet-top,
.catalog-filter__sheet-rule {
  display: none;
}

.catalog-filter__sheet-title {
  margin: 0;
  font-family: "Manrope-Bold", Helvetica, system-ui, sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--neutral-200);
  line-height: 1.2;
}

.catalog-filter__sheet-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(26, 26, 26, 0.06);
  color: var(--neutral-200);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-sizing: border-box;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.catalog-filter__sheet-close:focus-visible {
  outline: 2px solid var(--colors-100);
  outline-offset: 2px;
}

.catalog-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  align-self: stretch;
  width: 100%;
  flex: 0 0 auto;
}

.catalog-spec-ranges {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.catalog-spec-range__title {
  margin: 0 0 8px;
  font-family: "Manrope-Bold", Helvetica;
  font-weight: 600;
  font-size: 13px;
  color: var(--neutral-200);
  opacity: 0.85;
}

.catalog-mf-btn--active {
  border-color: var(--colors-100, #1a1a1a);
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.18);
}

.catalog-price-field__label {
  position: relative;
  width: fit-content;
  opacity: 0.5;
  font-family: "Manrope-Bold", Helvetica;
  font-weight: 500;
  color: var(--neutral-200);
  font-size: 14px;
  letter-spacing: 0;
  line-height: normal;
}

.catalog-price-field {
  height: 48px;
  gap: 12px;
  padding: 8px 16px;
  flex: 1;
  flex-grow: 1;
  background-color: #f5f5f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  position: relative;
  box-sizing: border-box;
}

.catalog-filter__chevron-wrap {
  position: relative;
  width: 20px;
  height: 20px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.catalog-filter__head .catalog-filter__chevron-img {
  position: static;
  width: 20px;
  height: 20px;
  top: auto;
  left: auto;
  object-fit: contain;
  display: block;
}

.catalog-main-wrapper {
  width: 100%;
}

/* Сворачивание блоков фильтров */
.catalog-filter__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: inherit;
  box-sizing: border-box;
}

.catalog-filter__head:focus-visible {
  outline: 2px solid var(--colors-100);
  outline-offset: 3px;
  border-radius: 8px;
}

.catalog-filter__head .catalog-filter__chevron-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.catalog-filter__chevron {
  transition: transform 0.2s ease;
  display: block;
}

.catalog-filter--collapsed .catalog-filter__chevron {
  transform: rotate(-90deg);
}

.catalog-filter--collapsed .catalog-filter__panel {
  display: none;
}

.catalog-filter__panel {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: 100%;
  gap: 0;
}

/* Long desktop filter lists scroll inside the sidebar instead of stretching
   the whole catalog page when category branches are expanded. */
@media (min-width: 901px) {
  .catalog-filter--categories .catalog-filter__options,
  .catalog-filter--brands .catalog-filter__options {
    max-height: min(52vh, 520px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-right: 8px;
  }

  .catalog-filter--categories .catalog-filter__options {
    max-height: min(58vh, 580px);
  }

  .catalog-filter--categories .catalog-filter__options::-webkit-scrollbar,
  .catalog-filter--brands .catalog-filter__options::-webkit-scrollbar {
    width: 6px;
  }

  .catalog-filter--categories .catalog-filter__options::-webkit-scrollbar-thumb,
  .catalog-filter--brands .catalog-filter__options::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(26, 26, 26, 0.18);
  }
}

.catalog-page-screen .catalog-filter__panel > .catalog-filter__divider {
  margin: 0 0 10px;
  display: block;
  align-self: stretch;
}

/* У списков строки теперь имеют собственный вертикальный отступ —
   компенсируем, чтобы первая строка не отъезжала от разделителя */
.catalog-page-screen
  .catalog-filter__panel
  > .catalog-filter__divider
  + .catalog-filter__options {
  margin-top: -4px;
}

/* Сортировка */
.catalog-sort__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Обёртка без своего фона — серый только у кнопки, ширина по содержимому */
.catalog-sort-wrap {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0;
  margin-left: 12px;
  overflow: visible;
  background: transparent;
  height: auto;
}

/* Ширина задаётся в JS по самому длинному варианту — не прыгает при смене */
.catalog-sort__trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 52px;
  padding: 10px 42px 10px 22px;
  margin: 0;
  border: none;
  border-radius: 10px;
  background-color: #f5f5f5;
  font: inherit;
  font-family: "Manrope-Bold", Helvetica, system-ui, sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--neutral-200);
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
}

.catalog-sort__trigger:focus-visible {
  outline: 2px solid var(--colors-100);
  outline-offset: 2px;
}

.catalog-sort__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.catalog-sort-wrap--open .catalog-sort__chevron {
  transform: translateY(-50%) rotate(180deg);
}

/* Стрелка справа, текст по центру кнопки */
.catalog-sort__chevron {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.catalog-sort__chevron-img {
  position: static;
  width: 13px;
  height: 9px;
  object-fit: contain;
  display: block;
}

.catalog-sort__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  margin: 0;
  list-style: none;
  background: var(--neutral-100);
  border: 1px solid rgba(26, 26, 26, 0.1);
  border-radius: 12px;
  box-shadow:
    0 4px 6px -2px rgba(26, 26, 26, 0.06),
    0 12px 28px -8px rgba(26, 26, 26, 0.14);
  box-sizing: border-box;
  min-width: 100%;
  width: max-content;
  max-width: min(calc(100vw - 24px), 24rem);
  max-height: min(280px, 70vh);
  overflow-y: auto;
}

.catalog-sort__menu[hidden] {
  display: none !important;
}

.catalog-sort__option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-family: "Manrope-Bold", Helvetica, system-ui, sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--neutral-200);
  text-align: center;
  cursor: pointer;
  line-height: 1.35;
  transition: background 0.12s ease;
}

.catalog-sort__option:hover {
  background: var(--neutralgray);
}

.catalog-sort__option:focus-visible {
  outline: 2px solid var(--colors-100);
  outline-offset: 0;
}

.catalog-sort__option[aria-selected="true"] {
  background: rgba(255, 233, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 130, 0, 0.25);
}

/* Поля цены */
.catalog-price-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: "Manrope-Bold", Helvetica, system-ui, sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--neutral-200);
  opacity: 0.88;
  outline: none;
  padding: 0;
  min-width: 0;
  box-sizing: border-box;
}

.catalog-price-input:focus {
  opacity: 1;
}

.catalog-price-input::placeholder {
  color: rgba(26, 26, 26, 0.35);
}

/* Интерактивный диапазон цен */
.catalog-range-slider {
  position: relative;
  width: 100%;
  height: 32px;
  margin: 4px 0 12px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.catalog-range-slider__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: var(--neutralgray);
  border-radius: 2px;
  pointer-events: none;
  z-index: 0;
}

.catalog-range-slider__fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 2px;
  background: var(--colors-500);
  pointer-events: none;
  z-index: 1;
  min-width: 0;
  left: 0;
  width: 100%;
}

.catalog-range-slider__input {
  position: absolute;
  width: 100%;
  left: 0;
  top: 0;
  height: 32px;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  z-index: 2;
}

.catalog-range-slider__input--max {
  z-index: 3;
}

.catalog-range-slider__input::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border: none;
}

.catalog-range-slider__input::-moz-range-track {
  height: 4px;
  background: transparent;
  border: none;
}

.catalog-range-slider__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--neutral-100);
  border: 2px solid var(--colors-500);
  cursor: grab;
  pointer-events: auto;
  box-sizing: border-box;
}

.catalog-range-slider__input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--neutral-100);
  border: 2px solid var(--colors-500);
  cursor: grab;
  pointer-events: auto;
  box-sizing: border-box;
}

.catalog-range-slider__input:active::-webkit-slider-thumb {
  cursor: grabbing;
}

.catalog-range-slider__input:active::-moz-range-thumb {
  cursor: grabbing;
}

/* Сетка каталога: фильтры слева, товары справа */
.catalog-page-screen .catalog-layout__main {
  flex: 1;
  min-width: 0;
  align-self: stretch;
}

.catalog-products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  align-items: stretch;
  justify-items: stretch;
}

.catalog-products__loading,
.catalog-products__empty,
.catalog-products__error {
  grid-column: 1 / -1;
  font-family: "Manrope-SemiBold", Helvetica, sans-serif;
  font-size: 15px;
  color: var(--not-quite-black, #1a1a1a);
  opacity: 0.65;
  padding: 24px 8px;
}

.catalog-product-card {
  display: flex;
  flex-direction: column;
  background: var(--neutral-100);
  border: 1px solid var(--neutralgray);
  border-radius: 16px;
  padding: 16px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  align-self: stretch;
}

.catalog-product-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.catalog-product-card__media-link {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.catalog-product-card__media-placeholder {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Manrope-SemiBold", Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.3;
  color: rgba(26, 26, 26, 0.35);
  pointer-events: none;
}

.catalog-product-card__media-placeholder[hidden] {
  display: none;
}

.catalog-product-card__media-link img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #ffffff;
}

.catalog-product-card__media-link img.is-loaded {
  background: #ffffff;
}

.catalog-product-card__media-link {
  touch-action: pan-y;
}

.catalog-product-card__gallery-progress {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  gap: 4px;
  pointer-events: none;
}

.catalog-product-card__gallery-segment {
  flex: 1 1 0;
  height: 3px;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.18);
  transition: background 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

.catalog-product-card__gallery-segment--active {
  background: var(--colors-500);
}

.catalog-product-card__favorite {
  display: none;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 10px rgba(26, 26, 26, 0.12);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--neutral-200);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.catalog-product-card__favorite:hover {
  transform: scale(1.06);
  background: #fff;
}

.catalog-product-card__favorite:focus-visible {
  outline: 2px solid var(--colors-100);
  outline-offset: 2px;
}

.catalog-product-card__favorite-icon {
  font-size: 20px;
  line-height: 1;
  display: block;
  font-family: "Manrope-Bold", Helvetica, sans-serif;
}

.catalog-product-card__favorite--active {
  color: #c62828;
}

.catalog-product-card__title-link {
  text-decoration: none;
  color: inherit;
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  max-height: calc(1.35em * 3);
  min-height: calc(1.35em * 3);
  font-size: 16px;
  line-height: 1.35;
  box-sizing: border-box;
}

.catalog-product-card__title-link:hover .catalog-product-card__name {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.catalog-product-card__title-link:focus-visible {
  outline: 2px solid var(--colors-100);
  outline-offset: 3px;
  border-radius: 6px;
}

.catalog-product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #ffffff;
}

.catalog-product-card__badges {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
  max-width: calc(100% - 20px);
}

.catalog-product-card__badge {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 8px;
  font-family: "Manrope-Bold", Helvetica, sans-serif;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #1a1a1a;
  box-sizing: border-box;
}

.catalog-product-card__badge--new {
  background: #ffe900;
}

.catalog-product-card__badge--hit {
  background: #c4e400;
}

.catalog-product-card__badge--promo {
  background: #ff6a3d;
  color: #fff;
}

.catalog-product-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.catalog-product-card__label {
  font-family: "Manrope-SemiBold", Helvetica, sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.catalog-product-card__sku {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-family: "Manrope-SemiBold", Helvetica, sans-serif;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(26, 26, 26, 0.45);
}

.catalog-product-card__sku-text {
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-product-card__name {
  font-family: "Manrope-Bold", Helvetica, sans-serif;
  font-weight: 500;
  font-size: inherit;
  line-height: inherit;
  color: var(--neutral-200);
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-height: 0;
  max-height: 100%;
}

.catalog-product-card__stock {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 7px;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 130, 0, 0.22);
  border-radius: 8px;
  background: rgba(255, 130, 0, 0.08);
  color: #a65300;
  box-sizing: border-box;
}

.catalog-product-card__stock-mark {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--colors-500, #ff8200);
}

.catalog-product-card__stock-text {
  font-family: var(--store-font, "Onest", "Manrope", system-ui, sans-serif);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.catalog-product-card__stock--out {
  border-color: rgba(180, 35, 24, 0.18);
  background: rgba(180, 35, 24, 0.06);
  color: var(--store-danger, #b42318);
}

.catalog-product-card__stock--out .catalog-product-card__stock-mark {
  background: currentColor;
}

.catalog-product-card__rating {
  display: none;
}

.catalog-product-card__stars-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.catalog-product-card__stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  line-height: 1;
  flex-shrink: 0;
}

.catalog-product-card__stars--fg {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  width: 0;
  pointer-events: none;
}

.catalog-product-card__star {
  display: block;
  font-size: 14px;
  flex-shrink: 0;
}

.catalog-product-card__star--bg {
  color: rgba(26, 26, 26, 0.18);
}

.catalog-product-card__star--fg {
  color: #ffc400;
}

.catalog-product-card__rating-caption {
  display: none;
}

.catalog-product-card__grow {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.catalog-product-card__retail {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 12px;
  background: rgba(26, 26, 26, 0.06);
  border: 1px solid var(--neutralgray);
  border-radius: 10px;
  box-sizing: border-box;
}

.catalog-product-card__retail .catalog-product-card__label {
  flex-shrink: 0;
  font-weight: 500 !important;
  color: #1a1a1a;
}

.catalog-product-card__price {
  font-family: "Manrope-Bold", Helvetica, sans-serif;
  font-weight: 500;
  font-size: 17px;
  color: #ff8200;
}

.catalog-product-card__wholesale-hint {
  font-family: "Manrope-SemiBold", Helvetica, sans-serif;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(26, 26, 26, 0.5);
  margin: 0;
  flex-shrink: 0;
  padding: 8px 10px;
  background: rgba(26, 26, 26, 0.06);
  border: 1px solid var(--neutralgray);
  border-radius: 8px;
  box-sizing: border-box;
}

.catalog-product-card__wholesale-admin {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 12px;
  background: rgba(26, 26, 26, 0.06);
  border: 1px solid var(--neutralgray);
  border-radius: 10px;
  box-sizing: border-box;
}

.catalog-product-card__wholesale-line,
.catalog-product-card__moq-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 0;
  font-family: "Manrope-SemiBold", Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.45;
}

.catalog-product-card__wholesale-admin .catalog-product-card__label {
  flex-shrink: 0;
  font-weight: 500 !important;
  color: #1a1a1a;
}

/* Размер опта на карточке: меняй font-size здесь и ниже у __moq-val */
.catalog-product-card__wholesale-val {
  font-family: "Manrope-Bold", Helvetica, sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #ff8200;
}

.catalog-product-card__moq-val {
  font-family: "Manrope-Bold", Helvetica, sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #ff8200;
  word-break: break-word;
}

.catalog-product-card__auth-link {
  color: #1a1a1a;
  font-weight: 500 !important;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.catalog-product-card__auth-link:hover {
  color: #000;
}

.catalog-product-card__auth-link:focus-visible {
  outline: 2px solid var(--colors-100);
  outline-offset: 2px;
  border-radius: 2px;
}

.catalog-product-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding-top: 16px;
}

.catalog-product-card__purchase-actions {
  display: flex;
  flex: 1 1 120px;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.catalog-product-card__qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--neutralgray);
  border-radius: 10px;
  overflow: hidden;
  background: var(--neutral-100);
}

.catalog-product-card__qty button {
  width: 36px;
  height: 40px;
  border: none;
  background: #f5f5f5;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--neutral-200);
  font-family: "Manrope-Bold", Helvetica, sans-serif;
  padding: 0;
  box-sizing: border-box;
}

.catalog-product-card__qty button:hover:not(:disabled) {
  background: #ebebeb;
}

.catalog-product-card__qty button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.catalog-product-card__qty button:focus-visible {
  outline: 2px solid var(--colors-100);
  outline-offset: 2px;
  z-index: 1;
}

.catalog-product-card__qty-val {
  min-width: 36px;
  text-align: center;
  font-family: "Manrope-Bold", Helvetica, sans-serif;
  font-size: 15px;
  color: var(--neutral-200);
  padding: 0 6px;
  box-sizing: border-box;
}

.catalog-product-card__cart {
  flex: 1;
  min-width: 120px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: var(--colors-500);
  color: var(--neutral-100);
  font-family: "Manrope-Bold", Helvetica, sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  padding: 0 14px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.catalog-product-card__cart-text {
  flex: 0 0 auto;
  text-align: center;
}

.catalog-product-card__cart-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.catalog-product-card__cart:hover:not(:disabled) {
  filter: brightness(1.05);
}

.catalog-product-card__cart {
  transition: background-color 0.25s cubic-bezier(0.32, 0.72, 0, 1), transform 0.15s ease;
}

.catalog-product-card__cart:active:not(:disabled) {
  transform: scale(0.98);
}

.catalog-product-card__cart.is-in-cart {
  background: #1e8a4f;
  color: #fff;
}

.catalog-product-card__cart.is-in-cart:hover:not(:disabled) {
  background: #187543;
  filter: none;
}

.catalog-product-card__cart-check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
}

.catalog-product-card__cart-check svg {
  width: 100%;
  height: 100%;
}

.catalog-product-card__cart-count {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.catalog-product-card__actions {
  container-type: inline-size;
}

@container (max-width: 220px) {
  .catalog-product-card__cart {
    padding-left: 8px;
    padding-right: 8px;
  }

  .catalog-product-card__cart:not(.is-in-cart) .catalog-product-card__cart-text {
    display: none;
  }
}

@media (max-width: 600px) {
  .catalog-product-card__cart.is-in-cart {
    padding-left: 10px;
    padding-right: 10px;
    gap: 6px;
  }

  .catalog-product-card__cart.is-in-cart .catalog-product-card__cart-text {
    display: none;
  }

  .catalog-product-card__cart.is-in-cart .catalog-product-card__cart-count {
    background: none;
    padding: 0;
    font-size: 14px;
  }
}

.catalog-product-card__cart [hidden],
.catalog-product-card__cart-check[hidden],
.catalog-product-card__cart-count[hidden] {
  display: none !important;
}

.catalog-product-card__cart:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.catalog-product-card__cart:focus-visible {
  outline: 2px solid var(--colors-100);
  outline-offset: 3px;
}

@media (max-width: 1200px) {
  .catalog-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .catalog-page-screen .catalog-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .catalog-page-screen .catalog-layout__sidebar {
    width: 100%;
    max-width: 100%;
  }

  .catalog-page-screen .catalog-page__heading {
    font-size: 36px;
    white-space: normal;
  }

  .catalog-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .catalog-product-card__favorite {
    position: static;
    display: flex;
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    border: 1px solid var(--neutralgray);
    border-radius: 12px;
    background: var(--neutral-100);
    box-shadow: none;
  }

  .catalog-product-card__purchase-actions {
    width: 100%;
  }

  .catalog-product-card__qty {
    display: none !important;
  }

  /* Мобильный каталог: панель фильтров, сетка 2×N, компактные карточки */
  .page .main-area.catalog-main-wrapper {
    padding-right: 8px;
    padding-left: 8px;
  }

  .catalog-page-screen {
    padding: 8px 10px 40px;
  }

  .catalog-page-screen .catalog-page__content {
    gap: 16px;
  }

  .catalog-page-screen .catalog-page__title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .catalog-page-screen .catalog-page__heading {
    font-size: 28px;
    line-height: 1.05;
    width: 100%;
  }

  .catalog-active-search__inner {
    min-height: 0;
    padding: 12px 10px 12px 14px;
    gap: 10px;
  }

  .catalog-active-search__label,
  .catalog-active-search__query {
    font-size: 14px;
    line-height: 1.45;
  }

  .catalog-active-search__clear {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .catalog-mobile-filter-bar {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    overflow: visible;
    padding: 4px 0 8px;
    box-sizing: border-box;
    position: relative;
    z-index: 10035;
  }

  .catalog-mobile-filter-bar__chips {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    box-sizing: border-box;
  }

  .catalog-mobile-filter-bar__chips::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .catalog-mf-btn--all {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: 1px solid var(--neutralgray);
    border-radius: 10px;
    background: var(--neutral-100);
    color: var(--neutral-200);
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }

  .catalog-mf-btn--all:focus-visible {
    outline: 2px solid var(--colors-100);
    outline-offset: 2px;
  }

  .catalog-mf-btn__icon--img {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
  }

  .catalog-mf-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    min-height: 44px;
    height: auto;
    border: 1px solid var(--neutralgray);
    border-radius: 10px;
    background: #f5f5f5;
    font-family: "Manrope-Bold", Helvetica, system-ui, sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: var(--neutral-200);
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }

  .catalog-mf-chip--active {
    background: #ff8200 !important;
    border-color: #e67300 !important;
    color: #fff !important;
  }

  .catalog-mf-chip--active .catalog-mf-chip__label {
    color: #fff;
  }

  .catalog-mf-chip__badge:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-family: "Manrope-Bold", Helvetica, system-ui, sans-serif;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    background: rgba(255, 255, 255, 0.34);
    color: #fff;
    flex-shrink: 0;
  }

  .catalog-mf-chip:focus-visible {
    outline: 2px solid var(--colors-100);
    outline-offset: 2px;
  }

  /* Сортировка только на десктопе; на мобилке — порядок по умолчанию (hidden #catalog-sort). */
  .catalog-page-screen .catalog-page__title-row .catalog-sort-wrap {
    display: none !important;
  }

  .catalog-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10036;
    background: rgba(26, 26, 26, 0.45);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }

  .catalog-filter-backdrop[hidden] {
    display: none !important;
  }

  .catalog-page-screen .catalog-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .catalog-page-screen .catalog-layout__sidebar {
    --catalog-bottom-nav-h: calc(60px + env(safe-area-inset-bottom, 0px));
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--catalog-bottom-nav-h);
    width: 100%;
    max-width: 100%;
    height: min(78dvh, calc(100dvh - var(--catalog-bottom-nav-h) - 12px));
    max-height: min(78dvh, calc(100dvh - var(--catalog-bottom-nav-h) - 12px));
    z-index: 10037;
    margin: 0;
    padding: 0 16px 16px;
    gap: 12px;
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--neutral-100);
    border-radius: 16px 16px 0 0;
    border: 1px solid var(--neutralgray);
    border-bottom: none;
    box-sizing: border-box;
    transform: translateY(105%);
    transition:
      transform 0.28s cubic-bezier(0.32, 0.72, 0, 1),
      visibility 0.28s;
    pointer-events: none;
    visibility: hidden;
  }

  body.catalog-filter-sheet-open .catalog-page-screen .catalog-layout__sidebar {
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
  }

  body.catalog-filter-sheet-open .catalog-mobile-filter-bar {
    z-index: 1;
  }

  body.catalog-filter-sheet-open[data-catalog-sheet-mode='categories']
    .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter:not(.catalog-filter--categories),
  body.catalog-filter-sheet-open[data-catalog-sheet-mode='brands']
    .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter:not(.catalog-filter--brands),
  body.catalog-filter-sheet-open[data-catalog-sheet-mode='price']
    .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter:not(.catalog-filter--price),
  body.catalog-filter-sheet-open[data-catalog-sheet-mode='availability']
    .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter:not(.catalog-filter--availability),
  body.catalog-filter-sheet-open[data-catalog-sheet-mode='colors']
    .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter:not(.catalog-filter--colors),
  body.catalog-filter-sheet-open[data-catalog-sheet-mode='countries']
    .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter:not(.catalog-filter--countries),
  body.catalog-filter-sheet-open[data-catalog-sheet-mode='manufacturers']
    .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter:not(.catalog-filter--manufacturers),
  body.catalog-filter-sheet-open[data-catalog-sheet-mode='densities']
    .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter:not(.catalog-filter--densities),
  body.catalog-filter-sheet-open[data-catalog-sheet-mode='pack']
    .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter:not(.catalog-filter--pack),
  body.catalog-filter-sheet-open[data-catalog-sheet-mode='dimensions']
    .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter:not(.catalog-filter--dimensions) {
    display: none !important;
  }

  body.catalog-filter-sheet-open[data-catalog-sheet-mode='price']
    .catalog-page-screen
    .catalog-layout__sidebar {
    height: auto;
    max-height: min(78dvh, calc(100dvh - var(--catalog-bottom-nav-h) - 12px));
  }

  .catalog-page-screen .catalog-filter__sheet-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0 0 10px;
    padding: 14px 0 10px;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--neutral-100);
  }

  .catalog-page-screen .catalog-filter__sheet-rule {
    display: block;
    width: 100%;
    height: 1px;
    margin: 0 0 12px;
    padding: 0;
    border: none;
    background: rgba(26, 26, 26, 0.14);
    flex-shrink: 0;
  }

  .catalog-page-screen .catalog-filter .catalog-filter__divider {
    display: none !important;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 0 20px;
    box-sizing: border-box;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter__head {
    display: none !important;
  }

  .catalog-page-screen .catalog-filter--collapsed .catalog-filter__panel {
    display: flex !important;
    flex-direction: column;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter__stack {
    gap: 0;
    width: 100%;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter__options {
    gap: 0;
    width: 100%;
    margin-top: 0;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter__tick {
    display: none !important;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter__tree-toggle {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter__tree-head .catalog-filter__row {
    width: auto;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter__tree-children {
    margin: 0 0 0 10px;
    padding-left: 8px;
    border-left: 1px solid rgba(26, 26, 26, 0.1);
    gap: 0;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter__row {
    width: 100%;
    padding: 14px 6px;
    margin: 0;
    border-radius: 0;
    box-sizing: border-box;
  }

  /* Разделители: у плоских списков (бренды) — на строках,
     у дерева категорий — на шапках узлов, иначе :last-child внутри
     .catalog-filter__tree-head снимал границу у всех строк дерева */
  .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter__options
    > .catalog-filter__row:not(.catalog-filter__row--empty) {
    border-bottom: 1px solid rgba(26, 26, 26, 0.1);
  }

  .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter__options
    > .catalog-filter__row:last-child {
    border-bottom: none;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter__tree-head {
    border-bottom: 1px solid rgba(26, 26, 26, 0.1);
  }

  .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter__tree-node:last-child
    > .catalog-filter__tree-head {
    border-bottom: none;
  }

  .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter__tree-head:has(.catalog-filter__row[aria-checked='true']) {
    border-bottom-color: transparent;
  }

  .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter__row[aria-checked='true'] {
    background: rgba(255, 130, 0, 0.16);
    border-bottom-color: transparent;
    border-radius: 10px;
    width: calc(100% + 8px);
    margin: 0 -4px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .catalog-page-screen
    .catalog-layout__sidebar
    .catalog-filter__tree-head
    .catalog-filter__row[aria-checked='true'] {
    width: auto;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter__row--empty {
    border-bottom: none;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter__option-label {
    flex: 1;
    min-width: 0;
  }

  .catalog-page-screen .catalog-layout__sidebar .catalog-filter__option-count {
    margin-left: auto;
  }

  .catalog-page-screen .catalog-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 18px;
  }

  .catalog-page-screen .catalog-product-card {
    padding: 8px;
    border-radius: 12px;
    height: 100%;
  }

  .catalog-page-screen .catalog-product-card__media {
    margin-bottom: 8px;
    border-radius: 10px;
  }

  .catalog-page-screen .catalog-product-card__favorite {
    width: 48px;
    height: 48px;
  }

  .catalog-page-screen .catalog-product-card__favorite-icon {
    font-size: 17px;
  }

  .catalog-page-screen .catalog-product-card__body {
    gap: 6px;
  }

  .catalog-page-screen .catalog-product-card__sku {
    font-size: 11px;
  }

  .catalog-page-screen .catalog-product-card__title-link {
    font-size: 13px;
    line-height: 1.32;
    max-height: calc(1.32em * 2);
    min-height: calc(1.32em * 2);
    flex-shrink: 0;
  }

  .catalog-page-screen .catalog-product-card__name {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    font-size: 13px;
    line-height: 1.32;
  }

  .catalog-page-screen .catalog-product-card__stock {
    min-height: 24px;
    gap: 5px;
    padding: 4px 7px;
  }

  .catalog-page-screen .catalog-product-card__stock-text {
    font-size: 10px;
  }

  .catalog-page-screen .catalog-product-card__star {
    font-size: 12px;
  }

  .catalog-page-screen .catalog-product-card__rating-caption {
    font-size: 11px;
  }

  .catalog-page-screen .catalog-product-card__retail {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 8px;
  }

  .catalog-page-screen .catalog-product-card__retail .catalog-product-card__label {
    font-size: 10px;
    line-height: 1.25;
  }

  .catalog-page-screen .catalog-product-card__price {
    font-size: 14px;
  }

  .catalog-page-screen .catalog-product-card__wholesale-admin {
    padding: 8px 8px;
    gap: 6px;
  }

  .catalog-page-screen .catalog-product-card__wholesale-line,
  .catalog-page-screen .catalog-product-card__moq-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    font-size: 10px;
    line-height: 1.25;
  }

  .catalog-page-screen .catalog-product-card__wholesale-val,
  .catalog-page-screen .catalog-product-card__moq-val {
    font-size: 13px;
  }

  .catalog-page-screen .catalog-product-card__wholesale-hint {
    font-size: 10px;
    padding: 6px 8px;
    line-height: 1.35;
  }

  .catalog-page-screen .catalog-product-card__actions {
    padding-top: 4px;
    gap: 10px;
    margin-top: auto;
    flex-shrink: 0;
  }

  .catalog-page-screen .catalog-product-card__cart {
    min-width: 0;
    min-height: 48px;
    height: auto;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 14px;
    border-radius: 12px;
  }

  .catalog-page-screen .catalog-product-card__cart-icon {
    width: 22px;
    height: 22px;
  }
}

@media (min-width: 901px) {
  .catalog-mobile-filter-bar {
    display: none !important;
  }

  .catalog-filter-backdrop {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .catalog-product-card__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .catalog-product-card__purchase-actions {
    flex: none;
  }

  .catalog-product-card__cart {
    width: 100%;
  }
}

/* Catalog density and responsive grid audit. */
.page .main-area.catalog-main-wrapper {
  width: min(calc(100% - (2 * var(--layout-gutter))), var(--layout-max));
  max-width: var(--layout-max);
  padding-inline: 0;
}
.catalog-page-screen {
  min-height: 0;
  padding: 16px 0 48px;
  gap: 0;
}
.catalog-page__content { max-width: none; gap: 22px; }
.catalog-page__title-row { gap: 12px 20px; }
.catalog-page__heading { font-size: clamp(38px, 4vw, 52px); }
.catalog-layout { gap: 20px; }
.catalog-layout__sidebar { width: clamp(230px, 18vw, 260px); flex: 0 0 clamp(230px, 18vw, 260px); gap: 14px; }
.catalog-page-screen .catalog-filter { padding: 18px; }
.catalog-page-screen .catalog-filter .catalog-filter__stack { gap: 12px; }
.catalog-products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* The brand directory is intentionally denser than the product catalogue. */
.catalog-products.catalog-products--brands {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}
.catalog-products--brands .brand-tile {
  width: 100%; min-width: 0; max-width: none; aspect-ratio: 4 / 3;
}
.catalog-products--brands .brand-tile--captioned { aspect-ratio: auto; }

@media (min-width: 1440px) {
  .catalog-products { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 1800px) {
  .catalog-products { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .catalog-products.catalog-products--brands { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 1200px) and (min-width: 901px) {
  .catalog-products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 901px) {
  .catalog-page-screen .catalog-products:not(.catalog-products--brands) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .page .main-area.catalog-main-wrapper { width: calc(100% - 32px); padding-inline: 0; }
  .catalog-page-screen { padding: 12px 0 40px; }
  .catalog-page-screen .catalog-page__content { gap: 16px; }
  .catalog-products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .catalog-products.catalog-products--brands { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; }
}
@media (max-width: 640px) {
  .catalog-products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .catalog-products.catalog-products--brands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 340px) {
  .catalog-products:not(.catalog-products--brands) { grid-template-columns: 1fr; }
}

.catalog-subcats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 18px;
}

.catalog-subcats[hidden] {
    display: none;
}

.catalog-subcats__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(47, 47, 187, 0.18);
    border-radius: 999px;
    background: #fff;
    color: #2f2fbb;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.catalog-subcats__link:hover {
    border-color: #2f2fbb;
    background: rgba(47, 47, 187, 0.06);
}

.catalog-subcats__link:active {
    transform: scale(0.98);
}

.catalog-subcats__count {
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(47, 47, 187, 0.08);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
    .catalog-subcats {
        flex-wrap: nowrap;
        overflow-x: auto;
        min-width: 0;
        max-width: calc(100% + 16px);
        margin-right: -16px;
        padding-right: 16px;
        scrollbar-width: none;
    }

    .catalog-subcats::-webkit-scrollbar {
        display: none;
    }

    .catalog-subcats__link {
        flex: 0 0 auto;
    }
}
