/*!
 * MiningHelp — каталог: шапка раздела с подкатегориями, фильтры, панель сортировки и вида,
 * чипы активных фильтров, «Ничего не найдено», «Показать ещё», пагинация.
 */

.mh-shop__top { padding-top: 16px; display: flex; flex-direction: column; gap: var(--mh-gap); }

/* ---------------------------------------------------------------- Шапка раздела */
.mh-cat-hero { display: flex; flex-direction: column; gap: var(--mh-pad-card); padding: var(--mh-pad-card) var(--mh-pad-card) var(--mh-pad-panel); border-radius: var(--mh-r-xl); overflow: hidden; background: var(--mh-hero-dark); color: var(--mh-on-dark); }
.mh-cat-hero__row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px var(--mh-gap-lg); }
.mh-cat-hero__head { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.mh-cat-hero__count { align-self: flex-start; padding: 7px 16px; border-radius: var(--mh-r-pill); border: 1px solid rgba(255,255,255,.16); font-size: var(--mh-fs-13); color: var(--mh-on-dark-2); }
.mh-cat-hero__title { margin: 0; font-size: var(--mh-h-hero); line-height: .92; font-weight: 400; letter-spacing: -0.02em; text-transform: uppercase; overflow-wrap: break-word; hyphens: auto; }
.mh-cat-hero__silver { background: linear-gradient(180deg, #F4F5F6 30%, #A9B1B9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mh-cat-hero__accent { background: linear-gradient(90deg, var(--mh-accent-pale), var(--mh-accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mh-cat-hero__lead { margin: 0; max-width: 46ch; font-size: var(--mh-fs-15); line-height: 1.55; color: var(--mh-on-dark-2); }
.mh-cat-hero__more { margin-left: 4px; color: var(--mh-accent-soft); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.mh-cat-hero__more:hover { color: #fff; }

/* Подкатегории */
.mh-subcats { display: flex; flex-direction: column; gap: 10px; }
.mh-subcats__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 176px), 1fr)); gap: 8px; }
.mh-subcats__group { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: var(--mh-r-md); background: rgba(60,70,80,.22); border: 1px solid rgba(255,255,255,.1); }
.mh-subcats__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--mh-r-sm); font-size: var(--mh-fs-14); font-weight: 500; color: var(--mh-on-dark); }
.mh-subcats__head:hover { background: rgba(255,255,255,.08); color: #fff; }
.mh-subcats__head .mh-subcats__num { font-size: var(--mh-fs-12); font-weight: 400; opacity: .7; }
.mh-subcats__item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: var(--mh-r-xs); font-size: var(--mh-fs-13); color: var(--mh-on-dark-2); }
.mh-subcats__item:hover { background: rgba(255,255,255,.06); color: #fff; }
.mh-subcats__item .mh-subcats__num { font-size: var(--mh-fs-12); color: var(--mh-text-3); }
.mh-subcats__num { font-variant-numeric: tabular-nums; }
.mh-subcats__hidden { padding: 4px 10px 2px; font-size: var(--mh-fs-12); color: var(--mh-text-3); }
.mh-has-js .mh-subcats:not(.is-open) .mh-subcats__item.is-extra { display: none; }
.mh-subcats.is-open .mh-subcats__hidden, html:not(.mh-has-js) .mh-subcats__hidden, html:not(.mh-has-js) .mh-subcats__toggle { display: none; }
.mh-subcats__toggle { align-self: flex-start; height: var(--mh-btn-h-sm); padding: 0 6px 0 18px; border-radius: var(--mh-r-pill); display: flex; align-items: center; gap: 14px; border: 1px solid rgba(255,255,255,.16); background: transparent; color: var(--mh-on-dark); font: inherit; font-size: var(--mh-fs-14); cursor: pointer; transition: background .15s; }
.mh-subcats__toggle:hover { background: rgba(255,255,255,.08); }
@media (min-width: 769px) { .mh-subcats__toggle--mobile { display: none; } }
.mh-subcats__sign { width: var(--mh-pill-h); height: var(--mh-pill-h); border-radius: 50%; background: var(--mh-on-dark); color: var(--mh-ink); display: flex; align-items: center; justify-content: center; font-size: var(--mh-fs-17); line-height: 1; }

/* ---------------------------------------------------------------- Раскладка */
.mh-shop__body { padding-top: var(--mh-gap); }
.mh-shop__layout { display: flex; flex-wrap: wrap; gap: var(--mh-gap); align-items: flex-start; }

/* ---------------------------------------------------------------- Фильтры */
.mh-facets { flex: 1 1 280px; max-width: 100%; display: flex; flex-direction: column; gap: 24px; padding: var(--mh-pad-panel); border-radius: var(--mh-r-lg); background: var(--mh-surface); }
.mh-facets__form { display: flex; flex-direction: column; gap: 24px; }
.mh-facets__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mh-facets__title { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font: inherit; font-size: var(--mh-fs-15); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--mh-ink); cursor: default; }
.mh-facets__chev, .mh-facets__badge { display: none; }
.mh-facets__reset { height: var(--mh-pill-h); padding: 0 14px; border-radius: var(--mh-r-pill); border: 1px solid var(--mh-line-strong); display: flex; align-items: center; font-size: var(--mh-fs-13); color: var(--mh-ink); }
.mh-facets__reset:hover { background: var(--mh-ink); color: #fff; }
.mh-facets__body { display: flex; flex-direction: column; gap: 24px; }
.mh-facets__group { min-width: 0; margin: 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--mh-line); }
.mh-facets__label { float: left; width: 100%; margin: 0 0 10px; padding: 0; font-size: var(--mh-fs-12); text-transform: uppercase; letter-spacing: .04em; color: var(--mh-text-2); }
.mh-facets__label + * { clear: both; }

/* Группы по атрибутам товаров раздела: сворачиваются, длинные списки — «Показать все» */
.mh-facets__fold > summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 24px; font-size: var(--mh-fs-12); text-transform: uppercase; letter-spacing: .04em; color: var(--mh-text-2); cursor: pointer; }
.mh-facets__fold > summary::-webkit-details-marker { display: none; }
.mh-facets__fold > summary:hover { color: var(--mh-ink); }
.mh-facets__fold > summary:focus-visible { outline: 2px solid var(--mh-accent); outline-offset: 2px; border-radius: 6px; }
.mh-facets__fold-chev { flex: none; transition: transform .2s; }
.mh-facets__fold[open] .mh-facets__fold-chev { transform: rotate(180deg); }
.mh-facets__fold-body { min-width: 0; margin: 10px 0 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.mh-facets__fold .mh-facets__checks { gap: 4px; }
.mh-facets__fold .mh-check { min-height: 40px; font-size: var(--mh-fs-14); line-height: 1.25; }
.mh-has-js [data-mh-facet-group]:not(.is-expanded) .mh-check--extra { display: none; }
.mh-facets__more { display: none; align-self: flex-start; height: var(--mh-pill-h); padding: 0 14px; border-radius: var(--mh-r-pill); border: 1px solid var(--mh-line-strong); background: none; font: inherit; font-size: var(--mh-fs-13); color: var(--mh-ink); cursor: pointer; }
.mh-has-js .mh-facets__more { display: inline-flex; align-items: center; }
.mh-facets__more:hover { background: var(--mh-ink); border-color: var(--mh-ink); color: #fff; }

/* Чекбоксы: строки 44px */
.mh-facets__checks { display: flex; flex-direction: column; gap: 10px; }
.mh-check { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px 0 10px; border-radius: var(--mh-r-sm); font-size: var(--mh-fs-15); color: var(--mh-ink); cursor: pointer; transition: background .15s, opacity .15s; }
.mh-check:hover, .mh-check:has(input:checked) { background: var(--mh-white); }
.mh-check input, .mh-chip-check input, .mh-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mh-check__box { width: 22px; height: 22px; flex: none; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: var(--mh-white); border: 1.5px solid rgba(28,31,34,.25); color: var(--mh-ink-900); }
.mh-check__box svg { opacity: 0; }
.mh-check input:checked + .mh-check__box { background: var(--mh-accent); border-color: var(--mh-accent); }
.mh-check input:checked + .mh-check__box svg { opacity: 1; }
.mh-check input:focus-visible + .mh-check__box { outline: 2px solid var(--mh-accent); outline-offset: 2px; }
.mh-check__name { flex: 1; }
.mh-check__count { font-size: var(--mh-fs-13); color: var(--mh-text-3); font-variant-numeric: tabular-nums; }
.mh-check.is-empty, .mh-chip-check.is-empty { opacity: .45; }

/* Алгоритм: пилюли-переключатели */
.mh-facets__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mh-chip-check { position: relative; }
.mh-chip-check span { height: var(--mh-ctl-h); padding: 0 16px; border-radius: var(--mh-r-pill); display: flex; align-items: center; background: var(--mh-white); color: var(--mh-ink); font-size: var(--mh-fs-14); cursor: pointer; transition: opacity .15s; }
.mh-chip-check span:hover { opacity: .85; }
.mh-chip-check input:checked + span { background: var(--mh-ink); color: #fff; }
.mh-chip-check input:focus-visible + span { outline: 2px solid var(--mh-accent); outline-offset: 2px; }

/* Цена */
.mh-facets__price { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.mh-facets__input { height: var(--mh-btn-h-sm); padding: 0 16px; }

/* Переключатель «Только в наличии» */
.mh-switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: var(--mh-fs-15); color: var(--mh-ink); cursor: pointer; }
.mh-switch__track { width: 52px; height: var(--mh-badge-h); flex: none; padding: 3px; border-radius: var(--mh-r-pill); background: rgba(28,31,34,.2); display: flex; transition: background .15s; }
.mh-switch__thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.mh-switch input:checked ~ .mh-switch__track { background: var(--mh-accent); }
.mh-switch input:checked ~ .mh-switch__track .mh-switch__thumb { transform: translateX(22px); }
.mh-switch input:focus-visible ~ .mh-switch__track { outline: 2px solid var(--mh-accent); outline-offset: 2px; }

.mh-facets__apply { align-self: flex-start; }
.mh-has-js .mh-facets__apply { display: none; }

/* «Не знаете, что выбрать?» */
.mh-facets__help { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--mh-r-md); background: var(--mh-ink); color: var(--mh-on-dark); font-size: var(--mh-fs-15); line-height: 1.4; }
.mh-facets__help-btn { height: var(--mh-btn-h); padding: 0 6px 0 20px; border-radius: var(--mh-r-pill); border: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--mh-accent); color: var(--mh-ink-900); font: inherit; font-size: var(--mh-fs-15); cursor: pointer; transition: background .15s; }
.mh-facets__help-btn:hover { background: var(--mh-accent-hover); }
.mh-facets__help-icon { width: var(--mh-btn-icon-sm); height: var(--mh-btn-icon-sm); border-radius: 50%; background: var(--mh-ink-900); color: #fff; display: flex; align-items: center; justify-content: center; }

/* ---------------------------------------------------------------- Результаты */
.mh-shop__results { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: var(--mh-gap); transition: opacity .15s; }
.mh-shop__results[aria-busy="true"] { opacity: .5; pointer-events: none; }

.mh-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 20px; border-radius: var(--mh-r-lg); background: var(--mh-surface); }
.mh-toolbar__found { font-size: var(--mh-fs-15); color: var(--mh-text-2); }
.mh-toolbar__found b { font-weight: 500; color: var(--mh-ink); font-variant-numeric: tabular-nums; }
.mh-toolbar__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mh-toolbar .mh-seg__opt { display: inline-flex; align-items: center; color: var(--mh-ink); transition: opacity .15s; }
.mh-toolbar .mh-seg__opt:hover { opacity: .85; color: var(--mh-ink); }
.mh-toolbar .mh-seg__opt.is-active { color: #fff; }
.mh-toolbar__view { flex-wrap: nowrap; }
.mh-toolbar__view-btn { width: var(--mh-ctl-h); height: var(--mh-ctl-h); border-radius: 50%; border: 0; background: transparent; color: var(--mh-ink); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mh-toolbar__view-btn.is-active { background: var(--mh-ink); color: #fff; }

.mh-active-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px; }
.mh-active-chip { height: var(--mh-pill-h); padding: 0 8px 0 14px; border-radius: var(--mh-r-pill); display: inline-flex; align-items: center; gap: 8px; background: var(--mh-ink); color: #fff; font-size: var(--mh-fs-13); }
.mh-active-chip:hover { background: var(--mh-accent-hover); color: #fff; }

.mh-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: var(--mh-pad-card); border-radius: var(--mh-r-lg); background: var(--mh-surface); }
.mh-empty__title { font-size: var(--mh-h2); line-height: 1.1; text-transform: uppercase; letter-spacing: -0.02em; }
.mh-empty__text { font-size: var(--mh-fs-15); color: var(--mh-text-2); }
.mh-empty__reset { height: var(--mh-btn-h); padding: 0 22px; border-radius: var(--mh-r-pill); display: inline-flex; align-items: center; background: var(--mh-ink); color: #fff; font-size: var(--mh-fs-15); }
.mh-empty__reset:hover { background: var(--mh-accent); color: var(--mh-ink-900); }


/* Обычная пагинация — для поисковиков и без JS */

/* ---------------------------------------------------------------- Мобильные: фильтры свёрнуты */
@media (max-width: 768px) {
  .mh-facets { gap: 16px; }
  .mh-facets__title { cursor: pointer; }
  .mh-facets__chev { display: block; transition: transform .15s; }
  .mh-facets__badge:not(:empty) { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--mh-r-pill); align-items: center; justify-content: center; background: var(--mh-accent); color: var(--mh-ink-900); font-size: var(--mh-fs-12); letter-spacing: 0; }
  .mh-facets.is-open .mh-facets__chev { transform: rotate(180deg); }
  .mh-has-js .mh-facets:not(.is-open) .mh-facets__body,
  .mh-has-js .mh-facets:not(.is-open) .mh-facets__help { display: none; }
  /* Панель: «Найдено» и вид — первая строка, сортировка — вторая на всю ширину */
  .mh-toolbar { padding: 6px; row-gap: 8px; }
  .mh-toolbar__found { order: 1; padding-left: 10px; }
  .mh-toolbar__controls { display: contents; }
  .mh-toolbar__view { order: 2; }
  .mh-toolbar__sort { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .mh-toolbar__sort::-webkit-scrollbar { display: none; }
  .mh-toolbar__sort .mh-seg__opt { flex: 1 0 auto; justify-content: center; padding: 0 12px; }

  /* Подкатегории: только группы в 2 колонки, пункты — по кнопке «Все подкатегории» */
  .mh-subcats__grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); }
  .mh-has-js .mh-subcats:not(.is-open) .mh-subcats__item,
  .mh-has-js .mh-subcats:not(.is-open) .mh-subcats__hidden { display: none; }
  .mh-has-js .mh-subcats:not(.is-open) .mh-subcats__group { padding: 4px; }
  .mh-has-js .mh-subcats:not(.is-open) .mh-subcats__head { font-size: var(--mh-fs-15); }
}
@media (max-width: 420px) {
  .mh-toolbar__sort { gap: 2px; }
  .mh-toolbar__sort .mh-seg__opt { padding: 0 8px; font-size: var(--mh-fs-13); }
}

/* ---------------------------------------------------------------- Избранное */
.mh-favs { padding-top: 16px; display: flex; flex-direction: column; gap: var(--mh-gap); }

/* ---------------------------------------------------------------- «О разделе»: полное описание категории */
.mh-cat-about { margin-top: var(--mh-section-y); display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr); gap: 20px var(--mh-pad-card); padding: var(--mh-pad-card); border-radius: var(--mh-r-xl); background: var(--mh-surface); scroll-margin-top: 96px; }
.mh-cat-about__title { margin: 0; font-size: var(--mh-h2); line-height: 1.05; font-weight: 400; text-transform: uppercase; letter-spacing: -0.01em; }
.mh-cat-about__text { max-width: 72ch; font-size: var(--mh-fs-15); line-height: 1.65; color: var(--mh-text-2); }
.mh-cat-about__text > :first-child { margin-top: 0; }
.mh-cat-about__text > :last-child { margin-bottom: 0; }
.mh-cat-about__text a { color: var(--mh-accent-ink); text-decoration: underline; }
@media (max-width: 760px) { .mh-cat-about { grid-template-columns: 1fr; } }
