/**
 * Archive misc overrides — sidebar tree (cat-cards), recommendations,
 * horizontal filters, toolbar, controls row, sidebar polish, underline
 * у заголовков sidebar, active head padding, layout gaps, mobile responsive.
 *
 * Подключается через wp_enqueue_style (handle: bike-archive-misc-overrides)
 * с dependency на 'bike-main'. Только на archive/shop.
 *
 * @package 4Bike
 */

/* ============================================================
   HORIZONTAL FILTERS (Ozon-style dropdowns over grid)
   ============================================================ */
.bike-hfilters {
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid #EAEBEC;
  border-radius: 12px;
  padding: 8px 12px;
}
.bike-hfilters__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Toggle 'Только в наличии' */
.bike-hfilters__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 500;
  color: #0b0d12;
  position: relative;
}
.bike-hfilters__toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bike-hfilters__toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 9999px;
  background: #eaebec;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}
.bike-hfilters__toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
  transition: transform 0.2s ease;
}
.bike-hfilters__toggle input:checked + .bike-hfilters__toggle-track {
  background: #E22A1C;
}
.bike-hfilters__toggle input:checked + .bike-hfilters__toggle-track::after {
  transform: translateX(16px);
}

/* Кнопка-фильтр */
.bike-hfilters__group {
  position: relative;
}
.bike-hfilters__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  background: #f5f5f7;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: 'Onest', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #0b0d12;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.bike-hfilters__btn:hover {
  background: #eaebec;
}
.bike-hfilters__btn.is-active {
  background: #fff;
  border-color: #E22A1C;
  color: #E22A1C;
}
.bike-hfilters__btn strong {
  font-weight: 700;
}
.bike-hfilters__chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.bike-hfilters__chevron.is-open {
  transform: rotate(180deg);
}

/* Popover */
.bike-hfilters__popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  min-width: 240px;
  max-width: 320px;
  background: #fff;
  border: 1px solid #EAEBEC;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.10);
  padding: 12px;
}
.bike-hfilters__price {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.bike-hfilters__price label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f5f5f7;
  border-radius: 8px;
  padding: 6px 10px;
}
.bike-hfilters__price label span {
  font-size: 12px;
  color: #9ca3af;
}
.bike-hfilters__price input {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: #0b0d12;
  outline: none;
  padding: 0;
}

/* Список radio/checkbox */
.bike-hfilters__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.bike-hfilters__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.1s ease;
  position: relative;
}
.bike-hfilters__item:hover {
  background: #f5f5f7;
}
.bike-hfilters__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bike-hfilters__item-box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid #cfcfd2;
  border-radius: 4px;
  position: relative;
  transition: all 0.15s ease;
}
.bike-hfilters__item input[type='radio'] + .bike-hfilters__item-box {
  border-radius: 9999px;
}
.bike-hfilters__item-box::after {
  content: '';
  position: absolute;
  top: 1px;
  left: 5px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}
.bike-hfilters__item input[type='radio'] + .bike-hfilters__item-box::after {
  top: 3.5px;
  left: 3.5px;
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 9999px;
  background: #fff;
  transform: scale(0);
}
.bike-hfilters__item input:checked + .bike-hfilters__item-box {
  background: #E22A1C;
  border-color: #E22A1C;
}
.bike-hfilters__item input:checked + .bike-hfilters__item-box::after {
  transform: rotate(45deg) scale(1);
}
.bike-hfilters__item input[type='radio']:checked + .bike-hfilters__item-box::after {
  transform: scale(1);
}
.bike-hfilters__item-label {
  flex: 1;
  font-size: 13px;
  color: #1f2023;
}
.bike-hfilters__item-count {
  font-size: 11px;
  color: #9ca3af;
}

/* Кнопка Применить внутри popover */
.bike-hfilters__apply {
  width: 100%;
  height: 36px;
  background: #E22A1C;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.bike-hfilters__apply:hover {
  background: #C71F12;
}

/* Reset link */
.bike-hfilters__reset {
  margin-left: auto;
  font-size: 13px;
  color: #6c6d72;
  text-decoration: none;
  padding: 6px 10px;
  transition: color 0.15s ease;
}
.bike-hfilters__reset:hover {
  color: #E22A1C;
}

/* ============================================================
   CATEGORY SIDEBAR (только категории)
   ============================================================ */
.bike-cat-sidebar {
  background: #fff;
  border: 1px solid #EAEBEC;
  border-radius: 12px;
  padding: 16px 12px;
}
.bike-cat-sidebar__title {
  font-family: 'Onest', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #0b0d12;
  margin: 0 0 10px;
  padding: 0 8px;
}
.bike-cat-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bike-cat-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #1f2023;
  font-size: 13px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.bike-cat-sidebar__link:hover {
  background: #f5f5f7;
  color: #0b0d12;
}
.bike-cat-sidebar__item.is-active .bike-cat-sidebar__link {
  background: #fde7e5;
  color: #E22A1C;
  font-weight: 600;
}
.bike-cat-sidebar__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #6c6d72;
}
.bike-cat-sidebar__item.is-active .bike-cat-sidebar__icon {
  color: #E22A1C;
}
.bike-cat-sidebar__name {
  flex: 1;
}
.bike-cat-sidebar__count {
  font-size: 11px;
  color: #9ca3af;
}
.bike-cat-sidebar__item.is-active .bike-cat-sidebar__count {
  color: #E22A1C;
}

/* === Mobile: horizontal-filters → ScrollX, category-sidebar → top === */
@media (max-width: 768px) {
  .bike-hfilters__form {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
}


/* === Reset стоит сразу после Бренд, не уезжает вправо === */
.bike-hfilters__reset {
  margin-left: 0 !important;
  align-self: center;
}

/* === Toolbar (sort) в одну линию с hfilters справа === */
.bike-hfilters {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bike-hfilters__form {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* Спрячем filter-button (Mobile-toggle) на desktop — он внутри toolbar */
.bike-archive-toolbar__filter-btn {
  display: none;
}
@media (max-width: 768px) {
  .bike-archive-toolbar__filter-btn { display: inline-flex; }
}

/* Toolbar в одну строку с hfilters: position-absolute не нужен — двигаем через negative margin */
.bike-archive-toolbar {
  margin-top: -52px;            /* поднять на высоту hfilters */
  margin-bottom: 1rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-right: 12px;
  position: relative;
  z-index: 1;                   /* ниже popover'ов но выше grid */
}
.bike-archive-toolbar__sort {
  position: relative;
}
.bike-archive-toolbar__sort select {
  height: 36px;
  padding: 0 32px 0 14px;
  background: #f5f5f7;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: 'Onest', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #0b0d12;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.bike-archive-toolbar__sort-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c6d72;
  pointer-events: none;
}

@media (max-width: 768px) {
  .bike-archive-toolbar {
    margin-top: 0;
    justify-content: space-between;
    padding-right: 0;
  }
}

/* Спрятать view-mode (grid/list) — юзер попросил убрать */
.bike-archive-toolbar__view {
  display: none !important;
}


/* === Controls row: hfilters | toolbar — 2 независимых блока side-by-side === */
.bike-archive-controls {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 1rem;
}
.bike-archive-controls .bike-hfilters {
  flex: 1;
  margin-bottom: 0;
  min-width: 0;
}
.bike-archive-controls .bike-archive-toolbar {
  /* Свой блок-карточка как у hfilters */
  margin: 0 !important;
  padding: 8px 12px !important;
  background: #fff !important;
  border: 1px solid #EAEBEC !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  flex-shrink: 0;
  position: static !important;
  z-index: auto;
}

/* Mobile: stack верт. */
@media (max-width: 768px) {
  .bike-archive-controls {
    flex-direction: column;
  }
  .bike-archive-controls .bike-archive-toolbar {
    width: 100%;
    justify-content: space-between;
  }
}

/* ФИЛЬТРЫ 2026-07-01 (авто-доработка): единая полоса фильтров+сортировки на всю ширину.
   Было: 2 отдельные белые карточки (фильтры слева + сортировка справа) → серый провал между
   ними на широких мониторах («пустое место»). Стало: одна карта-полоса, фильтры слева,
   сортировка справа, фон общий белый. Только десктоп ≥1024; шторка «Фильтры» на мобиле/планшете
   (≤768) не трогается. */
@media (min-width: 1024px) {
  .bike-archive-controls {
    background: #fff;
    border: 1px solid #EAEBEC;
    border-radius: 12px;
    padding: 6px 10px;
    gap: 8px;
    align-items: center;
    justify-content: space-between !important;   /* фильтры к левому краю, сортировка к правому */
  }
  .bike-archive-controls .bike-hfilters {
    flex: 1 1 auto !important;   /* занять всю ширину слева, чтобы фильтры прижались влево, сорт — вправо */
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
  }
  .bike-archive-controls .bike-archive-toolbar {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-shrink: 0;
  }
}


/* === Toolbar hover: убрать тёмную обводку у select (была от browser default) === */
.bike-archive-toolbar__sort select,
.bike-archive-toolbar__sort select:hover,
.bike-archive-toolbar__sort select:focus {
  border-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}
.bike-archive-controls .bike-archive-toolbar,
.bike-archive-controls .bike-archive-toolbar:hover {
  border-color: #EAEBEC !important;
  box-shadow: none !important;
}

/* === Sidebar wrapper (стек: tree + reco + filters) === */
.bike-archive-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* === Category tree === */
.bike-cat-tree {
  background: #fff;
  border: 1px solid #EAEBEC;
  border-radius: 12px;
  padding: 14px 12px;
}
.bike-cat-tree__title {
  font-family: 'Onest', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #0b0d12;
  margin: 0 0 10px;
  padding: 0 8px;
}
.bike-cat-tree__list,
.bike-cat-tree__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bike-cat-tree__item {
  margin-bottom: 2px;
}
.bike-cat-tree__row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.bike-cat-tree__link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #1f2023;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.bike-cat-tree__link:hover {
  background: #f5f5f7;
  color: #0b0d12;
}
.bike-cat-tree__item.is-current > .bike-cat-tree__row .bike-cat-tree__link,
.bike-cat-tree__sub-item.is-current .bike-cat-tree__sub-link {
  background: #fde7e5;
  color: #E22A1C;
  font-weight: 700;
}
.bike-cat-tree__count,
.bike-cat-tree__sub-count {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 400;
}
.bike-cat-tree__item.is-current .bike-cat-tree__count,
.bike-cat-tree__sub-item.is-current .bike-cat-tree__sub-count {
  color: #E22A1C;
}
.bike-cat-tree__toggle {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.bike-cat-tree__toggle:hover {
  background: #f5f5f7;
  color: #0b0d12;
}
.bike-cat-tree__chevron {
  transition: transform 0.2s ease;
}
.bike-cat-tree__chevron.is-open {
  transform: rotate(180deg);
}
.bike-cat-tree__sub {
  margin-left: 12px;
  padding-left: 6px;
  border-left: 1px solid #EAEBEC;
  margin-top: 4px;
}
.bike-cat-tree__sub-item {
  margin-bottom: 1px;
}
.bike-cat-tree__sub-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: #1f2023;
  font-size: 12.5px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.bike-cat-tree__sub-link:hover {
  background: #f5f5f7;
  color: #0b0d12;
}

/* === Sidebar recommendations === */
.bike-side-reco {
  background: #fff;
  border: 1px solid #EAEBEC;
  border-radius: 12px;
  padding: 14px 12px;
}
.bike-side-reco__title {
  font-family: 'Onest', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #0b0d12;
  margin: 0 0 10px;
  padding: 0 4px;
}
.bike-side-reco__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bike-side-reco__item {}
.bike-side-reco__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.bike-side-reco__link:hover {
  background: #f5f5f7;
}
.bike-side-reco__thumb {
  display: block;
  aspect-ratio: 1;
  width: 100%;
  background: #f5f5f7;
  border-radius: 6px;
  overflow: hidden;
}
.bike-side-reco__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.bike-side-reco__name {
  font-size: 11px;
  line-height: 1.3;
  color: #1f2023;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bike-side-reco__price {
  font-size: 12px;
  font-weight: 700;
  color: #0b0d12;
}
.bike-side-reco__price del { color: #9ca3af; font-weight: 400; font-size: 10px; }
.bike-side-reco__price ins { text-decoration: none; color: #E22A1C; }


/* === Sort dropdown в стилистике hfilters === */
.bike-archive-toolbar {
  padding: 8px 12px !important;
  background: #fff !important;
}
.bike-archive-toolbar__sort-form {
  display: flex;
  align-items: center;
  margin: 0;
}
/* Popover у sort выезжает ВЛЕВО (он справа на экране) */
.bike-hfilters__popover--right {
  left: auto !important;
  right: 0 !important;
}

/* === Border 0.5px для всех cards (легче 1px) === */
.bike-hfilters,
.bike-archive-toolbar,
.bike-cat-tree,
.bike-side-reco,
.bike-filter-sidebar,
.bike-filter-toggle-wrap,
.bike-filter-group {
  border-width: 0.5px !important;
  border-color: #d4d6da !important;  /* чуть темнее чтобы было видно 0.5px на не-retina */
}
.bike-hfilters__popover {
  border-width: 0.5px !important;
  border-color: #d4d6da !important;
}


/* === Border обратно 1px #EAEBEC (отменяем 0.5px) === */
.bike-hfilters,
.bike-archive-toolbar,
.bike-cat-tree,
.bike-side-reco,
.bike-filter-sidebar,
.bike-filter-toggle-wrap,
.bike-filter-group,
.bike-hfilters__popover {
  border-width: 1px !important;
  border-color: #EAEBEC !important;
}

/* === Sidebar tree: больше шрифт + best UX === */
.bike-cat-tree__title {
  font-size: 15px !important;       /* +1px */
  letter-spacing: -0.005em;
}
.bike-cat-tree__link {
  font-size: 14px !important;       /* +1px */
  padding: 9px 10px !important;     /* tap-target 40px+ */
  min-height: 40px;
}
.bike-cat-tree__sub-link {
  font-size: 13.5px !important;     /* +1px */
  padding: 8px 12px !important;
  min-height: 36px;
}
.bike-cat-tree__count,
.bike-cat-tree__sub-count {
  font-size: 12px !important;
}

/* Убрать линию слева у подкатегорий */
.bike-cat-tree__sub {
  margin-left: 12px !important;
  padding-left: 0 !important;
  border-left: 0 !important;
}

/* Subtle visual cue для уровня — небольшой dot перед подкатегорией */
.bike-cat-tree__sub-link::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d4d6da;
  margin-right: 8px;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}
.bike-cat-tree__sub-item.is-current .bike-cat-tree__sub-link::before {
  background: #E22A1C;
}
.bike-cat-tree__sub-link:hover::before {
  background: #6c6d72;
}

/* === Sticky sidebar — видно при скролле длинной страницы === */
.bike-archive-sidebar {
  position: sticky;
  top: 80px;                         /* высота header */
  align-self: flex-start;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #d4d6da transparent;
}
.bike-archive-sidebar::-webkit-scrollbar { width: 6px; }
.bike-archive-sidebar::-webkit-scrollbar-thumb {
  background: #d4d6da;
  border-radius: 3px;
}

/* На mobile sticky отключаем (sidebar стэком над grid) */
@media (max-width: 1024px) {
  .bike-archive-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* === Recommendations — тоже +1px шрифт === */
.bike-side-reco__title {
  font-size: 15px !important;
}
.bike-side-reco__name {
  font-size: 12px !important;
}
.bike-side-reco__price {
  font-size: 13px !important;
}


/* === REVERT: откат правок _fix-sidebar-tree-polish.php === */

/* Снимаем sticky sidebar */
.bike-archive-sidebar {
  position: static !important;
  top: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding-right: 0 !important;
}

/* Убираем subtle dot перед sub-link */
.bike-cat-tree__sub-link::before {
  display: none !important;
  content: none !important;
}

/* Возвращаем размеры шрифта sidebar tree (что были до polish) */
.bike-cat-tree__title { font-size: 14px !important; }
.bike-cat-tree__link { font-size: 13px !important; padding: 7px 10px !important; min-height: auto; }
.bike-cat-tree__sub-link { font-size: 12.5px !important; padding: 6px 10px !important; min-height: auto; }
.bike-cat-tree__count,
.bike-cat-tree__sub-count { font-size: 11px !important; }

/* Возвращаем оригинальный border-left у подкатегорий (он был там до polish) */
.bike-cat-tree__sub {
  margin-left: 12px !important;
  padding-left: 6px !important;
  border-left: 1px solid #EAEBEC !important;
}

/* Recommendations sizes back */
.bike-side-reco__title { font-size: 14px !important; }
.bike-side-reco__name { font-size: 11px !important; }
.bike-side-reco__price { font-size: 12px !important; }


/* === Layout tightening: sidebar wider + gaps 16px === */

/* Sidebar 320px + gap 16px на всех breakpoints */
.bike-archive-layout {
  grid-template-columns: 320px minmax(0, 1fr) !important;
  gap: 16px !important;
}

/* Vertical gap controls→grid = 16px (равный горизонтальному) */
.bike-archive-controls {
  margin-bottom: 16px !important;
}
.bike-active-filters {
  margin-bottom: 16px !important;
}

/* Если active-filters нет — grid сразу после controls с тем же 16px */
.bike-archive-grid {
  margin-top: 0 !important;
}

/* Mobile — sidebar стэком над grid */
@media (max-width: 1024px) {
  .bike-archive-layout {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}


/* === Final gaps: 20px по обеим осям === */

/* Horizontal sidebar↔main */
.bike-archive-layout {
  grid-template-columns: 320px minmax(0, 1fr) !important;
  gap: 20px !important;
}

/* Vertical controls↔grid (без накопления нескольких margin) */
.bike-archive-controls { margin-bottom: 20px !important; }
.bike-active-filters   { margin: 0 0 20px 0 !important; }
.bike-archive-grid     { margin-top: 0 !important; padding-top: 0 !important; }

/* Дополнительно — убрать любые лишние top-отступы у первого ребёнка main */
.bike-archive-main > *:first-child { margin-top: 0 !important; }

@media (max-width: 1024px) {
  .bike-archive-layout {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}


/* === Hide empty plugin blocks between controls and grid === */
.woof_products_top_panel,
.woof_products_top_panel:empty {
  display: none !important;
}
.woocommerce-notices-wrapper {
  margin: 0 !important;
  padding: 0 !important;
}
.woocommerce-notices-wrapper:empty {
  display: none !important;
}


/* === Main flex-gap ВКЛЮЧАЛ дополнительно 1.25rem между controls и grid — убираем === */
.bike-archive-main {
  gap: 0 !important;
}

/* Sidebar↔main = 25px (по DevTools-подсказке юзера) */
.bike-archive-layout {
  grid-template-columns: 320px minmax(0, 1fr) !important;
  gap: 25px !important;
}

/* Vertical controls↔grid тоже 25px для симметрии */
.bike-archive-controls { margin-bottom: 25px !important; }
.bike-active-filters   { margin: 0 0 25px 0 !important; }

@media (max-width: 1024px) {
  .bike-archive-layout {
    grid-template-columns: 1fr !important;
    gap: 25px !important;
  }
}


/* === Sidebar: 3 отдельных карточки категорий (cat-card) === */
.bike-cat-card {
  background: #fff;
  border: 1px solid #EAEBEC;
  border-radius: 12px;
  padding: 10px 12px;
}
.bike-cat-card + .bike-cat-card { margin-top: 0; }
/* gap между ними даёт .bike-archive-sidebar gap:12px */

/* Заголовок-ссылка (top-level) */
.bike-cat-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: #0b0d12;
  font-family: 'Onest', sans-serif;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 0.15s ease;
  margin-bottom: 4px;
}
.bike-cat-card__head:hover {
  background: #f5f5f7;
}
.bike-cat-card__head.is-active {
  background: #f5f5f7;
  color: #E22A1C;                /* активная категория — красная + жирная (по просьбе 2026-06-23) */
}
.bike-cat-card__title {}
.bike-cat-card__count {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 400;
}
.bike-cat-card__head.is-active .bike-cat-card__count {
  color: #6c6d72;
}

/* Подкатегории */
.bike-cat-card__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bike-cat-card__sub-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 18px;       /* левый сдвиг (10 базы + 8 для точки) */
  border-radius: 8px;
  text-decoration: none;
  color: #1f2023;
  font-weight: 700;                 /* названия подкатегорий — жирные (как активная), 2026-06-23 */
  font-size: 13.5px;                /* +1px от прежнего 12.5 */
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Красная точка слева вместо линии (~4px диаметр) */
.bike-cat-card__sub-link::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #E22A1C;
  flex-shrink: 0;
}

.bike-cat-card__sub-link:hover {
  background: #f5f5f7;
  color: #0b0d12;
}
.bike-cat-card__sub-item.is-active .bike-cat-card__sub-link {
  background: #f5f5f7;
  color: #E22A1C;                  /* активная подкатегория — красная + жирная (2026-06-23) */
  font-weight: 700;
}
.bike-cat-card__sub-name {
  flex: 1;
}
.bike-cat-card__sub-count {
  font-size: 11.5px;
  color: #9ca3af;
}
.bike-cat-card__sub-item.is-active .bike-cat-card__sub-count {
  color: #6c6d72;
}

/* Отключаем старые правила .bike-cat-tree (был sing-card) — не используется */
.bike-cat-tree { display: none !important; }

/* T8 (2026-06-23): количество товаров в баннере (число + «товар/товаров») — ЧЁРНЫМ на всех экранах (было красным/серым) */
.bike-archive-header__count,
.bike-archive-header__count-number { color: #0B0D12 !important; }


/* Красная точка подкатегорий: 4px → 2px (половина) */
.bike-cat-card__sub-link::before {
  width: 2px !important;
  height: 2px !important;
}


/* === Recommendations: горизонтальные карточки 4 шт в столбик === */
.bike-side-reco__list {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  grid-template-columns: none !important;
}
.bike-side-reco__link {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 8px !important;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}
.bike-side-reco__link:hover {
  background: #f5f5f7;
}
.bike-side-reco__thumb {
  width: 56px !important;
  height: 56px !important;
  aspect-ratio: auto !important;
  flex-shrink: 0;
  background: #f5f5f7;
  border-radius: 6px;
  overflow: hidden;
}
.bike-side-reco__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.bike-side-reco__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.bike-side-reco__name {
  font-size: 12.5px !important;
  line-height: 1.3;
  color: #1f2023;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bike-side-reco__price {
  font-size: 13px !important;
  font-weight: 700;
  color: #0b0d12;
}
.bike-side-reco__price del { color: #9ca3af; font-weight: 400; font-size: 11px; margin-right: 4px; }
.bike-side-reco__price ins { text-decoration: none; color: #E22A1C; }


/* Точка подкатегорий: 2px → 3px (чуть-чуть больше) */
.bike-cat-card__sub-link::before {
  width: 3px !important;
  height: 3px !important;
}


/* Hero banner: позиция фото — нижний правый угол */
.bike-archive-hero__media img {
  object-position: right bottom !important;
}


/* Revert: object-position обратно на right center */
.bike-archive-hero__media img {
  object-position: right center !important;
}


/* Banner rezina: позиция фото — низ право (по запросу) */
.bike-archive-hero__media img {
  object-position: right bottom !important;
}


/* === Заголовки 3 cat-card: красная линия снизу, выступ +8px за букву === */
.bike-cat-card__title {
  display: inline-block !important;
  position: relative !important;
  padding-bottom: 4px;
}
.bike-cat-card__title::after {
  content: '';
  position: absolute;
  left: 0;
  right: -8px;            /* выступ на 8px за последнюю букву */
  bottom: 0;
  height: 2px;
  background: #E22A1C;
  border-radius: 1px;
}
/* head стал flex'ом — title с inline-block остаётся слева, count справа */
.bike-cat-card__head {
  align-items: flex-end !important;
}


/* Underline: тоньше на 1/3 (2 → 1.5px) + ближе к буквам (4 → 2px gap) */
.bike-cat-card__title {
  padding-bottom: 2px !important;
}
.bike-cat-card__title::after {
  height: 1.5px !important;
}


/* === Универсальный underline для ВСЕХ заголовков sidebar (h2 + cat-card titles) === */
.bike-archive-sidebar h1,
.bike-archive-sidebar h2,
.bike-archive-sidebar h3,
.bike-cat-card__title {
  display: inline-block !important;
  position: relative !important;
  padding-bottom: 1px !important;        /* ещё ближе к букве (было 2) */
}
.bike-archive-sidebar h1::after,
.bike-archive-sidebar h2::after,
.bike-archive-sidebar h3::after,
.bike-cat-card__title::after {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  right: -8px !important;                /* выступ +8px за букву */
  bottom: 0 !important;
  height: 1.5px !important;
  background: #E22A1C !important;
  border-radius: 1px;
}


/* === FINAL underline для заголовков sidebar (border-bottom approach) === */
/* Гасим все прежние ::after правила (универсальный + cat-card вариант) */
.bike-archive-sidebar h1::after,
.bike-archive-sidebar h2::after,
.bike-archive-sidebar h3::after,
.bike-cat-card__title::after,
.bike-side-reco__title::after {
  content: none !important;
  display: none !important;
  background: transparent !important;
  border: 0 !important;
}

/* Title — единая модель: inline-block шириной по тексту, линия снизу через border */
.bike-cat-card__title,
.bike-side-reco__title,
.bike-archive-sidebar h2,
.bike-archive-sidebar h3 {
  display: inline-block !important;
  width: max-content !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 8px 1px 0 !important;   /* 0 слева — линия от первой буквы; 8px справа — выступ за последнюю */
  border-bottom: 1.5px solid #E22A1C !important;
  border-radius: 0 !important;
  position: static !important;       /* убираем relative — больше не нужен */
  box-shadow: none !important;
  text-decoration: none !important;
}

/* Head ссылка не должна навязывать padding-left, иначе span сдвинется от края */
.bike-cat-card__head {
  padding-left: 0 !important;
}


/* Вернуть симметричный padding head'у (overrides предыдущий padding-left:0) */
.bike-cat-card__head {
  padding-left: 10px !important;
  padding-right: 10px !important;
}


