/* ── Category page specific styles ── */

/* Two-column layout: content + aside */
main.two_columns {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: calc(2*var(--gap));
  align-items: start;
  padding: var(--gap) var(--gap);
  max-width: var(--wrap);
  margin: 0 auto;
}
main.wrapper.two_columns {
  padding-top: var(--gap);
  padding-bottom: calc(2*var(--gap));
}
.content_place { min-width: 0; }
.content_place > h1 { margin-bottom: 4px; }

/* Category top banner (ccb) — базовые стили перенесены в other.css (работает везде: категория + товар) */

/* Sub-vendors is in other.css */

/* Filter aside */
.filter_aside {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 16px - var(--gap));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  padding: 20px;
  border: 1px solid var(--border-2);
  box-shadow: var(--sh-sm);
}
.filter { display: flex; flex-direction: column; gap: 8px; }
.filter .h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700; color: var(--accent);
  padding-bottom: 10px; margin-bottom: 8px;
  border-bottom: 2px solid var(--accent-soft);
}
.filter .h3::before { content: '\f1de'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 15px; }
/* Мобильный drawer: кнопка закрытия и оверлей по умолчанию скрыты (на десктопе фильтр обычный) */
.filter_close { display: none; }
.filter_overlay { display: none; }
body.filter_open { overflow: hidden; }

/* «Сбросить все фильтры» — красная ссылка, а не кнопка */
.btn-filter.btn-danger {
  width: auto; align-self: center; margin: 2px auto 6px;
  background: none; border: none; padding: 4px 6px;
  color: var(--red); font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px;
}
.btn-filter.btn-danger:hover { background: none; color: var(--red); text-decoration: none; }

/* noUiSlider — в стилистике сайта (.filter_aside для приоритета над дефолтами noUiSlider) */
#slider, .slider_width, .slider_height, .slider_length, .slider_diametr {
  margin: 12px 4px 24px;
}
.filter_aside .noUi-target {
  background: var(--bg-3); border: none; box-shadow: none; border-radius: 999px;
}
.filter_aside .noUi-horizontal { height: 5px; }
.filter_aside .noUi-connect { background: var(--accent); }
.filter_aside .noUi-horizontal .noUi-handle {
  width: 18px; height: 18px; right: -9px; top: -7px;
  border-radius: 50%; background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  cursor: grab; transition: transform var(--tr), box-shadow var(--tr);
}
.filter_aside .noUi-horizontal .noUi-handle:hover { box-shadow: 0 2px 8px rgba(0,113,227,.35); }
.filter_aside .noUi-horizontal .noUi-handle:active { cursor: grabbing; transform: scale(1.08); }
.filter_aside .noUi-handle::before, .filter_aside .noUi-handle::after { display: none; }
.filter_aside .noUi-tooltip {
  -webkit-transform: translate(-50%,0); transform: translate(-50%,0);
  bottom: auto; top: 16px;
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 0; border: none; background: none;
  color: var(--text-2); white-space: nowrap;
}

/* Filter unit (checkbox list) */
.filter_unit { margin-bottom: 4px; }
.filter_unit .h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 700; margin-bottom: 8px; }
.filter_unit ul { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow-y: auto; scrollbar-width: thin; }
.filter_unit__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text); cursor: pointer;
  padding: 3px 4px; border-radius: var(--r-xs);
  transition: background var(--tr);
}
.filter_unit__label:hover { background: var(--border-2); }
.filter_chceckbox {
  width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--accent); cursor: pointer;
}

/* Category search + results */
.cat_search_results .product_listing { margin-top: 0; }

/* Not in sale section */
.not_in_sale { margin-top: calc(2*var(--gap)); padding-top: var(--gap); border-top: 1px solid var(--border-2); }
.not_in_sale > h2 { font-size: 18px; margin-bottom: 12px; color: var(--text-2); }

/* Responsive */
@media screen and (max-width: 960px) {
  main.two_columns { grid-template-columns: 1fr; gap: 12px; }
  main.two_columns, main.wrapper.two_columns { padding-top: 8px; }
  .filter_aside {
    position: static;
    order: -1;
    padding: 0; background: none; border: none;
    max-height: none;
    overflow: visible;
  }
  /* Фильтр — выезжающая справа панель (drawer) */
  .filter_aside .filter {
    display: flex;
    position: fixed; top: 0; right: 0;
    width: min(86vw, 360px); height: 100vh; height: 100dvh;
    z-index: 100020; transform: translateX(100%);
    transition: transform .3s ease;
    background: var(--bg); margin: 0;
    border: none; border-radius: 0;
    padding: 18px 16px 90px;
    overflow-y: auto; overscroll-behavior: contain;
    box-shadow: -8px 0 30px rgba(0,0,0,.2);
  }
  .filter_aside .filter.active { transform: translateX(0); }
  .filter_overlay {
    display: block; position: fixed; inset: 0; z-index: 100019;
    background: rgba(0,0,0,.5);
    opacity: 0; visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
  }
  .filter_overlay.active { opacity: 1; visibility: visible; }
  .filter_close {
    display: flex; align-items: center; justify-content: center;
    align-self: flex-end; width: 34px; height: 34px;
    margin: -4px -4px 2px 0; padding: 0;
    border: none; border-radius: 50%; background: var(--bg-2);
    font-size: 22px; line-height: 1; color: var(--text-2); cursor: pointer;
  }
  .filter_close:hover { background: var(--border-2); }
  .show_hide__aside { display: block !important; }
}
@media screen and (max-width: 600px) {
  main.two_columns, main.wrapper.two_columns { padding: 8px 12px 16px; gap: 12px; }
}
