/* ========================================================
   КАТАЛОГ — LAYOUT
   Реальная структура: #main(grid) > #secondary + .ast-woocommerce-container > #primary
   Поэтому grid-колонки назначаем #secondary и .ast-woocommerce-container
   ======================================================== */
body.woocommerce #main.site-main,
body.post-type-archive-product #main.site-main,
body.tax-product_cat #main.site-main,
body.tax-product_tag #main.site-main {
  display: grid !important;
  grid-template-columns: 260px minmax(0, 1fr) !important;
  gap: 32px !important;
  align-items: start !important;
  max-width: 1320px !important;
  margin: 0 auto !important;
  padding: 24px !important;
  box-sizing: border-box !important;
}

/* Сайдбар — колонка 1 */
body.woocommerce #main > #secondary,
body.post-type-archive-product #main > #secondary,
body.tax-product_cat #main > #secondary {
  grid-column: 1 !important;
  width: 100% !important; max-width: 260px !important; min-width: 0 !important;
  margin: 0 !important; padding: 0 !important; float: none !important;
}

/* Контейнер контента — колонка 2 (ЭТО .ast-woocommerce-container, а не #primary!) */
body.woocommerce #main > .ast-woocommerce-container,
body.post-type-archive-product #main > .ast-woocommerce-container,
body.tax-product_cat #main > .ast-woocommerce-container,
body.woocommerce #main > #primary,
body.post-type-archive-product #main > #primary {
  grid-column: 2 !important;
  width: 100% !important; max-width: 100% !important; min-width: 0 !important;
  margin: 0 !important; padding: 0 !important; float: none !important;
  display: block !important;
}

/* Всё внутри контейнера контента — на полную ширину */
body.woocommerce #main > .ast-woocommerce-container > *,
body.woocommerce #primary,
body.woocommerce #primary > * {
  width: 100% !important; max-width: 100% !important; min-width: 0 !important;
}

/* Служебные обёртки — на всю ширину сетки */
body.woocommerce #main > .hfe-before-footer-wrap,
body.woocommerce #main > #ast-mobile-popup-wrapper,
body.woocommerce #main > .woocommerce-breadcrumb {
  grid-column: 1 / -1 !important;
}

/* ----- Сетка товаров: 4 колонки, явная ширина ----- */
.woocommerce ul.products,
.woocommerce-page ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 24px !important;
  width: 100% !important; max-width: 100% !important;
  margin: 0 0 48px !important; padding: 0 !important; list-style: none !important;
}
/* перебить Astra columns-3/columns-4 инлайн-сетку */
.woocommerce ul.products.columns-3,
.woocommerce ul.products.columns-4,
.woocommerce ul.products.columns-2 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
.woocommerce ul.products li.product {
  width: auto !important; min-width: 0 !important; margin: 0 !important; float: none !important;
}

/* ========================================================
   ХЛЕБНЫЕ КРОШКИ (только стиль, разметку не трогаем)
   ======================================================== */
.woocommerce-breadcrumb {
  font-family: 'Manrope', sans-serif !important;
  font-size: 13px !important; color: var(--color-text-muted, #6B5D52) !important;
  margin: 0 0 16px !important;
}
.woocommerce-breadcrumb a { color: var(--color-text-muted, #6B5D52) !important; text-decoration: none !important; }
.woocommerce-breadcrumb a:hover { color: var(--color-primary, #E22B2B) !important; }

/* ========================================================
   HERO КАТЕГОРИИ
   ======================================================== */
.bb-cat-hero {
  display: grid; grid-template-columns: 1fr minmax(0, 480px); gap: 40px;
  align-items: center; background: var(--color-cream, #FBF7F0);
  border: 1px solid var(--color-border, #E5DCC9); border-radius: 16px;
  padding: 40px; margin: 0 0 28px;
}
.bb-cat-hero__eyebrow {
  font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--color-primary, #E22B2B);
  display: block; margin: 0 0 12px;
}
.bb-cat-hero__title {
  font-family: 'Geologica', sans-serif; font-weight: 800; font-size: 44px; line-height: 1.1;
  color: var(--color-text, #2A1F1A); margin: 0 0 16px; letter-spacing: -.015em;
}
.bb-cat-hero__desc {
  font-family: 'Manrope', sans-serif; font-size: 16px; line-height: 1.6;
  color: var(--color-text-muted, #6B5D52); max-width: 540px; margin: 0 0 24px;
}
.bb-cat-hero__badges { display: flex; gap: 12px; flex-wrap: wrap; }
.bb-badge {
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--color-text, #2A1F1A); background: #fff;
  border: 1px solid var(--color-border, #E5DCC9); border-radius: 999px; padding: 8px 18px;
}
.bb-cat-hero__media img { width: 100%; height: 280px; object-fit: cover; border-radius: 12px; display: block; }

/* ========================================================
   ЧИПСЫ (метки товара) — один ряд, карусель
   ======================================================== */
.bb-chips {
  position: relative;
  margin: 0 0 28px;
  overflow: hidden;
}
.bb-chips__track {
  display: flex;
  flex-wrap: nowrap;            /* строго один ряд */
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 6px;          /* место под скроллбар */
  -ms-overflow-style: none;
  scrollbar-width: thin;
}
.bb-chips__track::-webkit-scrollbar { height: 6px; }
.bb-chips__track::-webkit-scrollbar-thumb { background: var(--color-border, #E5DCC9); border-radius: 999px; }
.bb-chip {
  font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--color-text, #2A1F1A) !important; background: #fff;
  border: 1.5px solid var(--color-border, #E5DCC9); border-radius: 999px;
  padding: 9px 18px; text-decoration: none !important;
  transition: all .2s ease; flex: 0 0 auto; white-space: nowrap;
}
/* мягкое затухание справа — намёк на скролл */
.bb-chips::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 6px; width: 48px;
  background: linear-gradient(to right, transparent, var(--color-cream, #FBF7F0));
  pointer-events: none;
}
.bb-chip:hover { border-color: var(--color-primary, #E22B2B); color: var(--color-primary, #E22B2B) !important; }
.bb-chip--active {
  background: var(--color-primary, #E22B2B); border-color: var(--color-primary, #E22B2B);
  color: #fff !important;
}


/* ========================================================
   САЙДБАР «ПРОИЗВОДИТЕЛИ» — аккордеон с защитой ширины
   ======================================================== */

/* Виджет-контейнер не распирается контентом */
#secondary, #secondary .widget_block, #secondary .ast-woo-sidebar-widget {
  max-width: 260px !important; min-width: 0 !important; overflow: hidden !important;
}
#secondary .widget_block,
#secondary .ast-woo-sidebar-widget {
  background: var(--color-cream, #FBF7F0) !important;
  border: 1px solid var(--color-border, #E5DCC9) !important;
  border-radius: 14px !important; padding: 0 !important; margin: 0 0 16px !important;
}
#secondary .widget-title {
  font-family: 'Geologica', sans-serif !important; font-weight: 800 !important; font-size: 13px !important;
  text-transform: uppercase !important; letter-spacing: .08em !important; color: var(--color-text, #2A1F1A) !important;
  margin: 0 !important; padding: 16px 18px !important; border-bottom: 1px solid var(--color-border, #E5DCC9) !important;
}

/* Список и вложенные списки — не выходят за ширину */
.wc-block-product-categories-list,
.wc-block-product-categories-list--depth-1 {
  max-width: 100% !important; min-width: 0 !important; box-sizing: border-box !important;
}
.wc-block-product-categories-list { list-style: none !important; padding: 8px 0 !important; margin: 0 !important; }
.wc-block-product-categories-list--depth-1 {
  padding: 2px 0 6px 12px !important; margin: 2px 0 6px !important;
  border-left: 2px solid var(--color-border, #E5DCC9) !important;
}

/* Пункт: имя | счётчик | + — в одну строку, без распирания */
li.wc-block-product-categories-list-item {
  display: flex !important; align-items: center !important; gap: 6px !important;
  flex-wrap: nowrap !important; margin: 0 !important; padding: 4px 16px !important;
  min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important;
}
li.wc-block-product-categories-list-item > a {
  flex: 1 1 auto !important; min-width: 0 !important;
  font-family: 'Manrope', sans-serif !important; font-size: 14px !important; font-weight: 500 !important;
  color: var(--color-text, #2A1F1A) !important; text-decoration: none !important;
  line-height: 1.3 !important; padding: 4px 0 !important;
  white-space: normal !important;            /* перенос по словам, НЕ по буквам */
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  white-space: normal !important;
  hyphens: none !important;
  transition: color .2s ease !important;
}
li.wc-block-product-categories-list-item > a:hover { color: var(--color-primary, #E22B2B) !important; }
.wc-block-product-categories-list-item__name { font: inherit !important; color: inherit !important; min-width: 0 !important; }

.wc-block-product-categories-list-item-count {
  flex: 0 0 auto !important; order: 2 !important;
  font-family: 'Manrope', sans-serif !important; font-size: 12px !important; font-weight: 500 !important;
  color: var(--color-text-muted, #6B5D52) !important; background: transparent !important;
  padding: 0 !important; margin: 0 !important; white-space: nowrap !important;
}
.wc-block-product-categories-list-item-count .screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
}
.bb-cat-toggle {
  flex: 0 0 auto !important; order: 3 !important; cursor: pointer;
  color: var(--color-primary, #E22B2B); font-size: 18px; line-height: 1;
  width: 18px; text-align: center; user-select: none;
}

/* Аккордеон */
li.wc-block-product-categories-list-item.bb-has-children > .wc-block-product-categories-list--depth-1,
li.wc-block-product-categories-list-item.bb-has-children > ul { display: none !important; }
li.wc-block-product-categories-list-item.bb-open > .wc-block-product-categories-list--depth-1,
li.wc-block-product-categories-list-item.bb-open > ul { display: block !important; }

/* ========================================================
   КАРТОЧКА: плашка производителя + кнопка «Подробнее»
   ======================================================== */
.woocommerce ul.products li.product .bb-card-producer {
  display: block !important; font-family: 'Manrope', sans-serif !important;
  font-size: 12px !important; font-weight: 500 !important; color: var(--color-text-muted, #6B5D52) !important;
  padding: 14px 18px 0 !important; margin: 0 !important;
}
.woocommerce ul.products li.product .bb-card-more {
  display: inline-flex !important; align-items: center; gap: 6px;
  font-family: 'Geologica', sans-serif !important; font-weight: 700 !important; font-size: 14px !important;
  color: var(--color-primary, #E22B2B) !important; background: transparent !important;
  margin: 8px 18px 18px !important; padding: 0 !important; text-decoration: none !important;
  opacity: 0; transform: translateX(-4px); transition: opacity .2s ease, transform .2s ease;
}
.woocommerce ul.products li.product:hover .bb-card-more { opacity: 1; transform: translateX(0); }
@media (hover: none) { .woocommerce ul.products li.product .bb-card-more { opacity: 1; transform: none; } }

/* ========================================================
   АДАПТИВ
   ======================================================== */
@media (max-width: 1100px) {
  .bb-cat-hero { grid-template-columns: 1fr; }
  .bb-cat-hero__media img { height: 220px; }
}
@media (max-width: 900px) {
  body.woocommerce #main.site-main { grid-template-columns: 1fr !important; }
  body.woocommerce #main > #secondary { max-width: 100% !important; }
}
@media (max-width: 768px) {
  .bb-cat-hero { padding: 28px 20px; }
  .bb-cat-hero__title { font-size: 32px; }
}

/* ========================================================
   #15.3 — HERO / ЧИПСЫ НА ВСЮ ШИРИНУ + ФИКС ОТСТУПА СЕТКИ
   ======================================================== */

/* 1. Hero и чипсы — прямые grid-дети #main, тянем на обе колонки */
body.woocommerce #main > .bb-cat-hero,
body.woocommerce #main > .bb-chips,
body.post-type-archive-product #main > .bb-cat-hero,
body.post-type-archive-product #main > .bb-chips,
body.tax-product_cat #main > .bb-cat-hero,
body.tax-product_cat #main > .bb-chips,
body.tax-product_tag #main > .bb-cat-hero,
body.tax-product_tag #main > .bb-chips {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* 2. Footer случайно попал в сетку #main (col:auto, w:260) — растянуть */
body.woocommerce #main > #colophon,
body.woocommerce #main > footer.site-footer {
  grid-column: 1 / -1 !important;
}

/* 3. Убрать левый отступ Astra внутри #primary */
body.woocommerce #primary,
body.woocommerce #primary .ast-woocommerce-container,
body.woocommerce #primary .site-main,
body.woocommerce #primary > .woocommerce {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* 4. Сетка товаров строго на всю ширину #primary, 4 колонки */
.woocommerce ul.products,
.woocommerce ul.products.columns-1,
.woocommerce ul.products.columns-2,
.woocommerce ul.products.columns-3,
.woocommerce ul.products.columns-4 {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 24px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 48px 0 !important;
  padding: 0 !important;
}

/* ========================================================
   #15.4 — Сайдбар: перенос ТОЛЬКО по словам, не по буквам
   ======================================================== */
body.woocommerce #main > #secondary {
  min-width: 260px !important;   /* фикс ширины, чтобы слова помещались */
}
.wc-block-product-categories-list-item__name {
  overflow-wrap: normal !important;
  word-break: keep-all !important;
  white-space: normal !important;
  display: inline !important;
}
/* На случай если родитель всё ещё жмёт — даём ссылке дышать */
li.wc-block-product-categories-list-item > a {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

/* Скрываем нативный дубль-заголовок Woo, если remove_action не сработал */
.woocommerce-products-header__title,
.woocommerce .woocommerce-products-header > h1.page-title {
  display: none !important;
}
/* Крошки и result-count оставляем видимыми */
.woocommerce-breadcrumb,
.woocommerce-result-count { display: block !important; }

/* ========================================================
   #15.5 — ПОДКАТЕГОРИИ НА ВСЮ ШИРИНУ САЙДБАРА
   ======================================================== */

/* Вложенный список: убрать большой отступ, растянуть на всю ширину */
.wc-block-product-categories-list--depth-1,
li.wc-block-product-categories-list-item > ul {
  margin: 0 !important;
  padding: 0 !important;
  border-left: none !important;     /* убираем линию-ограничитель слева */
  width: 100% !important;
  max-width: 100% !important;
  list-style: none !important;
}

/* Пункт подкатегории: имя слева, счётчик сразу за ним, тоггл справа — БЕЗ провала */
.wc-block-product-categories-list--depth-1 li.wc-block-product-categories-list-item {
  display: flex !important;
  align-items: baseline !important;
  justify-content: flex-start !important;   /* прижать к левому краю, не space-between */
  gap: 6px !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  padding: 4px 16px 4px 28px !important;     /* лёгкий отступ вложенности 28px */
  box-sizing: border-box !important;
}

/* Имя подкатегории — занимает доступное место, но НЕ распирает строку */
.wc-block-product-categories-list--depth-1 li.wc-block-product-categories-list-item > a {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
}

/* Счётчик встаёт СРАЗУ после названия (а не у правого края) */
.wc-block-product-categories-list--depth-1 .wc-block-product-categories-list-item-count {
  flex: 0 0 auto !important;
  order: 0 !important;            /* не отлетает вправо */
  margin: 0 !important;
  color: var(--color-text-muted, #6B5D52) !important;
}

/* ========================================================
   #15.5 — ФИКС ЛЕВОГО ОТСТУПА КОНТЕНТА (крошки / result-count / сетка)
   ======================================================== */
body.woocommerce #primary,
body.woocommerce #primary .woocommerce-breadcrumb,
body.woocommerce #primary .woocommerce-products-header,
body.woocommerce #primary .woocommerce-result-count,
body.woocommerce #primary .woocommerce-ordering,
body.woocommerce #primary ul.products {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* Сам #primary прижат к началу своей колонки */
body.woocommerce #main > #primary {
  justify-self: stretch !important;
  align-self: start !important;
}

/* ========================================================
   #15.6 — ПРИЖАТЬ СПИСОК САЙДБАРА К ЛЕВОМУ КРАЮ (один столбец)
   ======================================================== */

/* Верхнеуровневый список: убрать дефолтный padding/маркеры ul */
.wc-block-product-categories .wc-block-product-categories-list,
ul.wc-block-product-categories-list,
ul.wc-block-product-categories-list--depth-0 {
  list-style: none !important;
  margin: 0 !important;
  padding: 8px 0 !important;     /* только верт. отступы, ноль слева */
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Пункт верхнего уровня (depth-0): прижат влево, имя | счётчик | тоггл */
ul.wc-block-product-categories-list--depth-0 > li.wc-block-product-categories-list-item {
  display: flex !important;
  align-items: baseline !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 6px 16px 6px 16px !important;   /* единый отступ 16px слева */
  box-sizing: border-box !important;
  text-indent: 0 !important;
}

ul.wc-block-product-categories-list--depth-0 > li.wc-block-product-categories-list-item > a {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-indent: 0 !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: keep-all !important;
}

/* Счётчик depth-0 — сразу после имени */
ul.wc-block-product-categories-list--depth-0 > li > .wc-block-product-categories-list-item-count {
  order: 0 !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
}

/* Тоггл +/- depth-0 — к правому краю */
ul.wc-block-product-categories-list--depth-0 > li > .bb-cat-toggle {
  order: 5 !important;
  margin-left: auto !important;   /* прижать тоггл вправо */
}

/* Вложенный список depth-1: лёгкий отступ вложенности, влево */
.wc-block-product-categories-list--depth-1 {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
}
.wc-block-product-categories-list--depth-1 > li.wc-block-product-categories-list-item {
  padding: 4px 16px 4px 30px !important;   /* 30px = отступ вложенности */
  justify-content: flex-start !important;
  text-indent: 0 !important;
}
.wc-block-product-categories-list--depth-1 > li > .bb-cat-toggle {
  margin-left: auto !important;
}

/* Карточка-обёртка сайдбара: контент без лишнего внутр. отступа слева */
#secondary .wc-block-product-categories,
#secondary .widget_block,
#secondary .ast-woo-sidebar-widget {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ========================================================
   #15.7 — ВЛОЖЕННЫЙ СПИСОК ПОД РОДИТЕЛЕМ (а не сбоку)
   Причина: ul(depth-1) — flex-ребёнок строки nowrap.
   Решение: родителю flex-wrap:wrap, вложенному ul — flex-basis:100%.
   ======================================================== */

/* Родительский пункт, у которого есть дети — разрешаем перенос на 2-ю строку */
li.wc-block-product-categories-list-item.bb-has-children {
  flex-wrap: wrap !important;
}

/* Вложенный список — занимает всю ширину строки и уходит ПОД родителя */
li.wc-block-product-categories-list-item > .wc-block-product-categories-list--depth-1,
li.wc-block-product-categories-list-item > ul.wc-block-product-categories-list {
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  order: 10 !important;          /* всегда последним, под a/count/toggle */
  margin: 6px 0 4px 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* a / count / toggle родителя остаются в первой строке */
li.wc-block-product-categories-list-item.bb-has-children > a { order: 0 !important; }
li.wc-block-product-categories-list-item.bb-has-children > .wc-block-product-categories-list-item-count { order: 1 !important; }
li.wc-block-product-categories-list-item.bb-has-children > .bb-cat-toggle { order: 2 !important; margin-left: auto !important; }

/* Пункт подкатегории внутри depth-1: своя flex-строка, прижат влево, отступ вложенности */
.wc-block-product-categories-list--depth-1 > li.wc-block-product-categories-list-item {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: baseline !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  width: 100% !important;
  padding: 4px 16px 4px 28px !important;   /* 28px вложенность */
  box-sizing: border-box !important;
}
.wc-block-product-categories-list--depth-1 > li > a {
  flex: 0 1 auto !important; min-width: 0 !important;
  white-space: normal !important; overflow-wrap: normal !important; word-break: keep-all !important;
}
.wc-block-product-categories-list--depth-1 > li > .wc-block-product-categories-list-item-count {
  order: 1 !important; flex: 0 0 auto !important; margin: 0 !important;
}
.wc-block-product-categories-list--depth-1 > li > .bb-cat-toggle {
  order: 2 !important; margin-left: auto !important;
}

/* ========================================================
   #15.8 — УБРАТЬ ЛЕВЫЙ PADDING КОНТЕНТА (Astra обёртки)
   ======================================================== */

/* Все возможные обёртки Astra внутри #primary — сброс гориз. отступов */
body.woocommerce #primary,
body.woocommerce #primary .ast-container,
body.woocommerce #primary .ast-separate-container,
body.woocommerce #primary .ast-article-single,
body.woocommerce #primary .ast-article-post,
body.woocommerce #primary .entry-content,
body.woocommerce #primary .site-content,
body.woocommerce #primary .ast-woocommerce-container,
body.woocommerce #primary > *,
body.woocommerce #primary .woocommerce {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Сетка товаров — гарантированно от левого края #primary */
body.woocommerce #primary ul.products {
  margin-left: 0 !important;
  padding-left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* ========================================================
   #15.8 — ВЛОЖЕННЫЙ СПИСОК СТРОГО ПОД РОДИТЕЛЕМ (усиленно)
   Применяем ко ВСЕМ li с вложенным ul, не только .bb-has-children
   ======================================================== */
li.wc-block-product-categories-list-item:has(> .wc-block-product-categories-list--depth-1),
li.wc-block-product-categories-list-item:has(> ul.wc-block-product-categories-list),
li.wc-block-product-categories-list-item.bb-has-children {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: baseline !important;
}

/* Вложенный ul — на всю ширину, последним, под родителя */
li.wc-block-product-categories-list-item > .wc-block-product-categories-list--depth-1,
li.wc-block-product-categories-list-item > ul {
  flex: 1 1 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  order: 99 !important;
  margin: 4px 0 6px 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* Имя/счётчик/тоггл родителя — первая строка */
li.wc-block-product-categories-list-item > a { order: 0 !important; flex: 0 1 auto !important; }
li.wc-block-product-categories-list-item > .wc-block-product-categories-list-item-count { order: 1 !important; flex: 0 0 auto !important; }
li.wc-block-product-categories-list-item > .bb-cat-toggle { order: 2 !important; margin-left: auto !important; flex: 0 0 auto !important; }

/* ========================================================
   #15.9 — ФИКС .ast-woocommerce-container (Astra дублирует sidebar-сдвиг)
   ======================================================== */
body.woocommerce #primary .ast-woocommerce-container,
body.post-type-archive-product #primary .ast-woocommerce-container,
body.tax-product_cat #primary .ast-woocommerce-container,
body.tax-product_tag #primary .ast-woocommerce-container {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  left: 0 !important;
  transform: none !important;
  float: none !important;
  display: block !important;
  grid-template-columns: none !important;   /* на случай если это grid */
}

/* Если Astra держит сетку sidebar+content внутри самого #primary — отключаем её */
body.woocommerce #primary {
  display: block !important;
  grid-template-columns: none !important;
}

/* ========================================================
   #15.10 — ОБЕЗВРЕДИТЬ ВЛОЖЕННЫЙ ДУБЛЬ #main внутри #primary
   (он наследовал grid 260px+1fr и сдвигал контент вправо)
   ======================================================== */
body.woocommerce #primary #main.site-main,
body.woocommerce #primary main#main,
body.post-type-archive-product #primary #main.site-main,
body.tax-product_cat #primary #main.site-main,
body.tax-product_tag #primary #main.site-main {
  display: block !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  gap: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Контейнер и сетка внутри вложенного #main — на всю ширину */
body.woocommerce #primary #main .ast-woocommerce-container,
body.woocommerce #primary #main ul.products {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* ========================================================
   #16 — КАРТОЧКА ТОВАРА (B2B: без цены и корзины)
   ======================================================== */

/* 0. Скрыть цену и кнопку добавления в корзину (B2B) */
.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .add_to_cart_button,
.woocommerce ul.products li.product .button.product_type_simple,
.woocommerce ul.products li.product .added_to_cart {
  display: none !important;
}

/* 1. Сама карточка: рамка, скругление, флекс-колонка, hover */
.woocommerce ul.products li.product {
  display: flex !important;
  flex-direction: column !important;
  background: #fff !important;
  border: 1px solid var(--color-border, #E5DCC9) !important;
  border-radius: 14px !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  transition: transform .18s ease, box-shadow .18s ease !important;
}
.woocommerce ul.products li.product:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 28px rgba(28,22,18,.10) !important;
}

/* 2. Фото: фиксированная высота-окно, объект по центру, без растяжки */
.woocommerce ul.products li.product a img {
  display: block !important;
  width: 100% !important;
  height: 220px !important;
  object-fit: contain !important;
  background: var(--color-cream, #FBF7F0) !important;
  padding: 16px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

/* 3. Текстовая зона карточки: компактные отступы, прижата к фото */
.woocommerce ul.products li.product > a:not(.button),
.woocommerce ul.products li.product .woocommerce-loop-product__link {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  padding: 14px 16px 16px 16px !important;
  text-decoration: none !important;
}

/* 4. Производитель (мета сверху) — приглушённый, мелкий, ОДИН раз */
.woocommerce ul.products li.product .bb-brand,
.woocommerce ul.products li.product .posted_in,
.woocommerce ul.products li.product .product_meta {
  font-family: 'Manrope', system-ui, sans-serif !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--color-text-muted, #6B5D52) !important;
  text-transform: uppercase !important;
  letter-spacing: .3px !important;
  margin: 0 !important;
}

/* 5. Название товара — Geologica, тёмное, 2 строки максимум */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: 'Geologica', system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  line-height: 1.3 !important;
  color: var(--color-text, #2A1F1A) !important;
  padding: 0 !important;
  margin: 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

/* 6. Убрать дубль производителя если он выводится дважды
   (оставляем только первый .bb-brand, скрываем повторный внутри title-зоны) */
.woocommerce ul.products li.product .woocommerce-loop-product__title + .bb-brand,
.woocommerce ul.products li.product .bb-brand ~ .bb-brand {
  display: none !important;
}

/* ========================================================
   #16 — АДАПТИВ КАРТОЧЕК
   ======================================================== */
@media (max-width: 1100px) {
  .woocommerce ul.products { grid-template-columns: repeat(3, minmax(0,1fr)) !important; }
}
@media (max-width: 768px) {
  .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0,1fr)) !important; }
  .woocommerce ul.products li.product a img { height: 180px !important; }
}
@media (max-width: 480px) {
  .woocommerce ul.products { grid-template-columns: 1fr !important; }
}

/* ========================================================
   #16.1 — ФОН / ЧИПСЫ / КАРТОЧКА / ПОДЛОЖКА ФОТО
   ======================================================== */

/* 1. Фон страницы каталога — белый (перебиваем серый из темы) */
body.woocommerce,
body.post-type-archive-product,
body.tax-product_cat,
body.tax-product_tag,
body.woocommerce #page,
body.woocommerce #content,
body.woocommerce #main.site-main {
  background-color: #fff !important;
}

/* 2. Чипсы: кремовая заливка / тёмный текст; hover+active — красные */
.bb-chips .bb-chip,
.bb-chips a {
  background: var(--color-cream, #FBF7F0) !important;
  color: var(--color-text, #2A1F1A) !important;
  border: 1px solid var(--color-border, #E5DCC9) !important;
  transition: background .15s ease, color .15s ease, border-color .15s ease !important;
}
.bb-chips .bb-chip:hover,
.bb-chips a:hover,
.bb-chips .bb-chip.is-active,
.bb-chips a.is-active,
.bb-chips .current-cat a {
  background: var(--color-primary, #E22B2B) !important;
  color: #fff !important;
  border-color: var(--color-primary, #E22B2B) !important;
}

/* 3. Карточка — компактнее: фото-окно ниже, отступы плотнее */
.woocommerce ul.products li.product a img {
  height: 160px !important;
  background: #fff !important;
  padding: 10px !important;
}
.woocommerce ul.products li.product > a:not(.button),
.woocommerce ul.products li.product .woocommerce-loop-product__link {
  padding: 12px 14px 14px 14px !important;
  gap: 4px !important;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 15px !important;
  line-height: 1.25 !important;
}

/* Убрать остаточную мин-высоту карточки от темы */
.woocommerce ul.products li.product {
  min-height: 0 !important;
  height: auto !important;
}

/* ========================================================
   #16.2 — «ПОДРОБНЕЕ» ПОВЕРХ ФОТО НА HOVER (как в Figma)
   ======================================================== */

/* Фото-зона = контейнер для абсолютной плашки */
.woocommerce ul.products li.product {
  position: relative !important;
}

/* Обёртка фото (ссылка с картинкой) — точка отсчёта для плашки */
.woocommerce ul.products li.product > a:first-of-type,
.woocommerce ul.products li.product .woocommerce-LoopProduct-link:first-of-type {
  position: relative !important;
  display: block !important;
}

/* Кнопка «Подробнее» — вынуть из потока, прижать к низу фото */
.woocommerce ul.products li.product .bb-card-more {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  /* верх плашки = низ фото-окна (img height 160 + padding 10*2 = 180);
     ставим по низу области фото */
  top: 180px !important;
  transform: translateY(-100%) !important;   /* плашка ложится НА низ фото */
  z-index: 3 !important;

  margin: 0 !important;
  padding: 12px 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;

  background: var(--color-primary, #E22B2B) !important;
  color: #fff !important;
  font-family: 'Geologica', system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  text-align: center !important;
  text-decoration: none !important;

  opacity: 0 !important;                 /* скрыта по умолчанию */
  visibility: hidden !important;
  transition: opacity .18s ease, visibility .18s ease !important;
}

/* Показ на hover карточки */
.woocommerce ul.products li.product:hover .bb-card-more {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Стрелка → уже в тексте; если нужен отступ перед ней — не трогаем */

/* Гарантируем, что фото обрезается по радиусу карточки и плашка не торчит */
.woocommerce ul.products li.product .woocommerce-loop-product__link,
.woocommerce ul.products li.product > a:first-of-type {
  overflow: visible !important;
}

/* Touch-устройства: показываем плашку всегда (нет hover) */
@media (hover: none) {
  .woocommerce ul.products li.product .bb-card-more {
    opacity: 1 !important;
    visibility: visible !important;
  }
}

/* ========================================================
   #16.3 — ЖЁСТКАЯ ВЫСОТА ФОТО + «ПОДРОБНЕЕ» ПО НИЗУ ФОТО
   ======================================================== */

/* A. Фото-ссылка = окно фикс. высоты 170px, фон белый, фото внутри contain */
.woocommerce ul.products li.product > a:first-of-type,
.woocommerce ul.products li.product .woocommerce-LoopProduct-link,
.woocommerce ul.products li.product .woocommerce-loop-product__link {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 170px !important;
  min-height: 170px !important;
  max-height: 170px !important;
  overflow: hidden !important;
  background: #fff !important;
  padding: 10px !important;
  box-sizing: border-box !important;
}

/* Картинка вписывается в окно, НЕ растягивает его */
.woocommerce ul.products li.product > a:first-of-type img,
.woocommerce ul.products li.product .woocommerce-loop-product__link img,
.woocommerce ul.products li.product img {
  width: auto !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 150px !important;
  object-fit: contain !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
}

/* Сама карточка — высота по контенту, без раздувания */
.woocommerce ul.products li.product {
  height: auto !important;
  min-height: 0 !important;
  position: relative !important;
}

.woocommerce ul.products li.product .bb-card-more {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: 154px !important;
  bottom: auto !important;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  transform: none !important;          /* КЛЮЧ: убить translateY(-100%) */
  -webkit-transform: none !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.woocommerce ul.products li.product:hover .bb-card-more {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ========================================================
   #16.4 — ФИНАЛ КАРТОЧКИ (по реальному DOM)
   ======================================================== */

/* Якорь для оверлея = обёртка фото */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap {
  position: relative !important;
  height: 170px !important;
  overflow: hidden !important;
}

/* Фото-ссылка внутри обёртки — на всю обёртку, фото по центру */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap > a.woocommerce-loop-product__link {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 170px !important;
  overflow: visible !important;
  background: #fff !important;
  padding: 10px !important;
  box-sizing: border-box !important;
}
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img {
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 150px !important;
  object-fit: contain !important;
  margin: 0 !important;
}

/* БАГ 1: bb-card-more — вынуть из потока, положить ПОВЕРХ низа фото */
.woocommerce ul.products li.product a.bb-card-more {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 5 !important;

  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 11px 14px !important;
  box-sizing: border-box !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  background: var(--color-primary, #E22B2B) !important;
  color: #fff !important;
  font: 700 14px 'Geologica', system-ui, sans-serif !important;
  text-align: center !important;
  text-decoration: none !important;

  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity .18s ease, visibility .18s ease !important;
}
/* якорь на li.product; bb-card-more = сосед thumbnail-wrap → top от верха li = h фото-обёртки */
.woocommerce ul.products li.product {
  position: relative !important;
  height: auto !important;
  min-height: 0 !important;
}
.woocommerce ul.products li.product a.bb-card-more {
  top: 154px !important;
  bottom: auto !important;
  height: 52px !important;
  min-height: 0 !important;
  max-height: 52px !important;
}
.woocommerce ul.products li.product:hover a.bb-card-more {
  opacity: 1 !important;
  visibility: visible !important;
}

/* БАГ 2: производитель — absolute поверх фото слева-сверху (больше не обрезается ovf:hidden фото-ссылки) */
.woocommerce ul.products li.product .bb-card-producer {
  position: absolute !important;
  top: 10px !important;
  left: 10px !important;
  z-index: 4 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 3px 8px !important;
  background: rgba(255,255,255,.9) !important;
  border-radius: 6px !important;
  font: 500 11px 'Manrope', system-ui, sans-serif !important;
  color: var(--color-text-muted, #6B5D52) !important;
  text-transform: uppercase !important;
  letter-spacing: .3px !important;
}

/* Summary-зона: компактно, категория + название */
.woocommerce ul.products li.product .astra-shop-summary-wrap {
  padding: 12px 14px 14px 14px !important;
  height: auto !important;
}
.woocommerce ul.products li.product .ast-woo-product-category {
  font: 500 11px 'Manrope', system-ui, sans-serif !important;
  text-transform: uppercase !important;
  opacity: 1 !important;
  color: var(--color-text-muted, #6B5D52) !important;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font: 700 15px/1.25 'Geologica', system-ui, sans-serif !important;
  color: var(--color-text, #2A1F1A) !important;
  height: auto !important;
  margin: 4px 0 0 0 !important;
  padding: 0 !important;
}


/* ========================================================
   #18 — СЕТКА 3 СТОЛБЦА (товары + категории)
   ======================================================== */
.woocommerce ul.products,
.woocommerce ul.products.columns-4,
.woocommerce ul.products.columns-3 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
}

/* Фото-окно крупнее под 3 колонки (товары и категории) */
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap,
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap > a.woocommerce-loop-product__link {
  height: 220px !important;
  max-height: 220px !important;
}
.woocommerce ul.products li.product .astra-shop-thumbnail-wrap img {
  max-height: 190px !important;
}
/* «Подробнее» — уже задано через top/height в БАГ 1 */

/* Адаптив */
@media (max-width: 1100px) {
  .woocommerce ul.products,
  .woocommerce ul.products.columns-4,
  .woocommerce ul.products.columns-3 {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
  }
}
@media (max-width: 600px) {
  .woocommerce ul.products,
  .woocommerce ul.products.columns-4,
  .woocommerce ul.products.columns-3 {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================================
   #19 — МОБАЙЛ (≤921px): сайдбар ПОД товары,
         main НЕ grid, сетка 2 колонки
   ======================================================== */
@media (max-width: 921px) {
  /* 1. Снимаем grid с main — переходим на normal flow */
  body.woocommerce #main.site-main,
  body.post-type-archive-product #main.site-main,
  body.tax-product_cat #main.site-main,
  body.tax-product_tag #main.site-main {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
  }

  /* 2. Сайдбар и контент — flex column, сайдбар вниз */
  body.woocommerce .site-content,
  body.post-type-archive-product .site-content,
  body.tax-product_cat .site-content {
    display: flex !important;
    flex-direction: column !important;
  }

  body.woocommerce #primary,
  body.post-type-archive-product #primary,
  body.tax-product_cat #primary {
    width: 100% !important;
    max-width: 100% !important;
    order: 1 !important;
  }

  body.woocommerce #secondary,
  body.post-type-archive-product #secondary,
  body.tax-product_cat #secondary,
  body.woocommerce .widget-area.secondary {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    order: 2 !important;
    margin-top: 24px !important;
  }

  /* 3. Сетка товаров: 2 колонки на мобайле */
  .woocommerce ul.products,
  .woocommerce ul.products.columns-3,
  .woocommerce ul.products.columns-4 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .woocommerce ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
  }

  /* 4. Названия товаров не обрезать */
  .woocommerce ul.products li.product .woocommerce-loop-product__title {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 14px !important;
  }
}

/* Картинка категории в hero-карточке — как на живом сайте */
.bb-cat-hero__image { margin-top: 24px; border-radius: 12px; overflow: hidden; background: #fff; }
.bb-cat-hero__image img { display: block; width: 100%; height: auto; }

/* Вкладка «Описание» без маркера списка, как в Astra */
.woocommerce-tabs ul.tabs { list-style: none !important; margin: 0 0 20px !important; padding: 0 !important; }
.woocommerce-tabs ul.tabs li { list-style: none !important; }

/* На карточке товара хлебные крошки на живом сайте не показываются */
.single-product .woocommerce-breadcrumb { display: none !important; }

/* Сортировка каталога: на живом сайте форма занимает всю ширину, селект слева */
.woocommerce .woocommerce-ordering,
.woocommerce-page .woocommerce-ordering { width: 100% !important; margin: 0 0 35px !important; float: none !important; }

/* Заголовок обычной страницы (политика и т.п.) — как на живом Astra */
.ast-article-single .entry-title,
.ast-single-post .entry-title { font-size: 30px !important; line-height: 1.4 !important; }

/* Форма сортировки — отдельной строкой под счётчиком, как на живом */
.woocommerce .woocommerce-ordering,
.woocommerce-page .woocommerce-ordering { clear: both !important; display: block !important; }

/* Блокировка прокрутки, пока открыт попап прайс-листа */
body.price-popup-open { overflow: hidden; }

/* Кнопки-триггеры попапа: сброс шрифта кнопки к шрифту темы */
button.btn,
button.hero__cta-primary,
button.price-cta__btn { font-family: 'Manrope', sans-serif; }
button.btn { font-size: 14px; line-height: 1.2; }

/* Кнопка отправки формы прайса (страница /price/ и попап) */
.lead-form .btn {
  background: var(--color-primary, #E22B2B) !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 10px !important;
  padding: 14px 24px !important;
  justify-content: center !important;
  font-family: 'Manrope', sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  cursor: pointer;
}
.lead-form .btn:hover { background: var(--color-primary-hover, #C62020) !important; }
.lead-form .btn:disabled { opacity: .6; cursor: not-allowed; }
.lead-form .btn--wide { width: 100% !important; }

/* Кнопки шапки/попапа не должны становиться КАПСОМ */
button.btn { text-transform: none !important; letter-spacing: normal !important; }

/* Первая кнопка на странице прайса */
.price-page .lead-actions .btn:first-child {
  background: var(--color-primary, #E22B2B);
  color: #fff;
  padding: 14px 24px;
  border-radius: 10px;
  font-weight: 600;
}
.price-page .lead-actions .btn:first-child:hover { background: var(--color-primary-hover, #C62020); }
