/* Шапка раздела каталога (Иван 11.11.2026: подразделы — вариант 8 «таблетки», фильтры — вариант 3; образец preview-cathead.html,
   потом макет Ивана): «Найдено: N» рядом с H1, таблетки подразделов строкой под заголовком; «Также часто ищут» + вкладки
   слева в строке над товарами, «В наличии / дешевле» справа. Плашки открываются по клику на вкладку
   (category.html catHead, Builder.php closedOft). */

.cathead { display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin: 0 0 22px; }
.cathead__l { max-width: none; }
.cathead__t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.cathead .page__title { margin: 0; line-height: 1.15; }
/* «в Москве» / «во Владивостоке» в заголовке раздела — не разрывать предлог и город (Иван 23.11) */
.page__title .h1-city { white-space: nowrap; }
.cathead #count { color: var(--muted); font-size: 14px; white-space: nowrap; }

/* подразделы — серые таблетки, число в белом бейдже */
.cht { display: flex; flex-wrap: wrap; gap: 8px; }
.cht:empty { display: none; }
.cht a { display: inline-flex; align-items: center; max-width: 100%; padding: 9px 10px 9px 18px; background: var(--grey); border-radius: 24px;
  color: var(--blue); text-decoration: none; transition: background .15s; }
.cht span { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.cht b { font-size: 14px; font-weight: 500; }
.cht small { background: #fff; color: var(--pink); font-weight: 600; font-size: 12px; padding: 2px 9px; border-radius: 12px; }
.cht a:hover { background: #EFEAEA; }
.cht a.is-active { background: var(--pink); color: #fff; }

/* строка над товарами: «Также часто ищут» + вкладки слева, «В наличии / дешевле» справа */
.listing__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; position: relative; }
.listing__bar .listing-controls { order: 2; margin-left: auto; }
.listing__bar .often { display: contents; }
.listing__bar .often[hidden], .listing__bar .often:empty { display: none; }
.listing__bar .oft { display: contents; }
.listing__bar .oft__head { order: 1; flex: 1 1 0; min-width: 0; border: 0; padding: 0; justify-content: flex-start; gap: 4px 10px; font-size: 13px; }
.listing__bar.is-wrap .oft__head { order: 3; flex-basis: 100%; }
.listing__bar.is-wrap .oft__tabs { flex-wrap: wrap; overflow: visible; }
.listing__bar .listing-sort select { field-sizing: content; }   /* ширина по выбранному «дешевле», без пустоты */
.listing > div { min-width: 0; }   /* колонка товаров не растягивается под ряд вкладок */.listing__bar .often { display: contents; }
.listing__bar .often[hidden], .listing__bar .often:empty { display: none; }
.listing__bar .oft { display: contents; }
.listing__bar .oft__tabs { gap: 3px; }
.listing__bar .oft__t { border: 1px solid var(--line); border-radius: 20px; padding: 6px 7px 6px 10px; margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.listing__bar .oft__t:hover { border-color: var(--blue); }
.listing__bar .oft__t::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); }
/* !important: старое правило #oftN:checked ~ .oft__head [for] в brand-mo.css красит текст в коричневый */
.listing__bar .oft__t.is-on { background: var(--blue); border-color: var(--blue) !important; color: #fff !important; }
.listing__bar .oft__t.is-on::after { transform: rotate(-135deg) translate(-2px, 0); }
.listing__bar .oft__p { order: 4; flex: 1 0 100%; flex-wrap: wrap; overflow: visible; margin: 4px 0 0; padding: 14px; background: var(--grey); border-radius: 14px; }
@media (max-width: 1500px) { .listing__bar .oft__head > b { display: none; } }

@media (max-width: 900px) {
  .cathead { gap: 12px; }
  .cht a { padding: 7px 8px 7px 14px; }
  .cht span { white-space: normal; }
  .cht b { font-size: 13px; }
  .listing__bar .oft__head { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .listing__bar.is-wrap .oft__tabs { flex-wrap: nowrap; overflow-x: auto; }   /* телефон: вкладки листаются пальцем */
  .listing__bar .oft__p { padding: 12px; }
}
