/* Мобильная версия B, каталог и поиск: заголовок страницы и общие части шторок («Фильтр и сортировка», «Все разделы»).
   Узлы шторок и кнопки создаёт page-title-mobile.js; html.et-js ставят скрипты страницы, пока экран узкий. Цвета и высоты
   (--et-red, --et-gray, --et-ink, --et-line, --et-edge, --et-ease, --et-row, --et-bar) объявлены в search-mobile.css.
   Всё под max-width: 991px — десктоп не меняется; созданные узлы на широком экране скрыты страховкой ниже. */
@media screen and (min-width: 992px) {
  .et-scrim, .et-sheet, .et-filter-btn, .et-allsec, .et-chip--all, .et-chip--more, .et-progress { display: none !important; }
}
@media screen and (max-width: 991px) {
  html.et-js { -webkit-tap-highlight-color: transparent; }
  html.et-lock, html.et-lock body { overflow: hidden; }
  html.et-lock .sale-widget { display: none; }
  .et-js .catalog a:focus-visible, .et-js .catalog button:focus-visible,
  .et-js .catalog-search a:focus-visible, .et-js .catalog-search button:focus-visible,
  .et-js .page-title button:focus-visible, .et-js .search__form-group .et-filter-btn:focus-visible,
  .et-sheet a:focus-visible, .et-sheet button:focus-visible, .et-sheet input:focus-visible {
    outline: 2px solid var(--et-red); outline-offset: 2px;
  }

  /* строка заголовка: название, счётчик, «Все разделы» */
  .et-js .page-title { margin-top: 16px; align-items: baseline; flex-wrap: wrap; }
  .et-js .page-title__name { margin-right: 0; }
  .et-js .page-title__counter { padding-top: 0; color: var(--et-gray); font-size: 13px; }
  .et-search-page .page-title__counter { display: none; }
  .et-allsec {
    margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
    padding: 0 0 0 12px; border: 0; background: none; color: var(--et-ink); font: 500 14px/1.2 "Gotham Pro", sans-serif;
    cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; transition: transform 160ms var(--et-ease);
  }
  .et-allsec .fas { font-size: 14px; color: var(--et-red); }

  /* кнопка «Фильтр» в строке поиска шапки (место и скрытие «Найти» — search-mobile.css) */
  .et-filter-btn {
    flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; min-width: 44px; padding: 0 14px; background: var(--et-red); border: 0; border-radius: 0; color: #fff;
    font: 700 14px/1 "Gotham Pro", sans-serif; cursor: pointer; touch-action: manipulation;
    -webkit-user-select: none; user-select: none; transition: transform 160ms var(--et-ease);
  }
  .et-filter-btn .fas { font-size: 14px; }
  .et-filter-btn__count {
    min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 10px; background: #fff;
    color: var(--et-red); font-size: 12px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
  }
  .et-filter-btn__count:empty { display: none; }

  /* шторка: снизу, открытие 240 мс, закрытие 200 мс */
  .et-scrim {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 200; background: rgba(24, 24, 24, .48);
    opacity: 0; visibility: hidden; transition: opacity 200ms var(--et-ease), visibility 0s linear 200ms;
  }
  .et-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 201; display: flex; flex-direction: column;
    max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); background: #fff; box-shadow: 0 -8px 24px rgba(24, 24, 24, .18);
    transform: translateY(100%); visibility: hidden;
    transition: transform 200ms var(--et-ease), visibility 0s linear 200ms;
  }
  .et-scrim.is-open { opacity: 1; visibility: visible; transition: opacity 240ms var(--et-ease); }
  .et-sheet.is-open { transform: none; visibility: visible; transition: transform 240ms var(--et-ease); }
  .et-sheet:focus { outline: none; }
  .et-sheet__head {
    flex: none; display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 4px 16px;
    border-bottom: 1px solid var(--et-line);
  }
  .et-sheet__title { font: 700 18px/1.3 "Gotham Pro", sans-serif; color: var(--et-ink); }
  .et-sheet__close {
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0;
    background: none; color: var(--et-gray); font-size: 20px; cursor: pointer; touch-action: manipulation;
    transition: transform 160ms var(--et-ease);
  }
  .et-sheet form { display: flex !important; flex-direction: column; min-height: 0; flex: 1 1 auto; margin: 0; padding: 0; }
  .et-sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 16px 8px; }
  .et-sheet__foot {
    flex: none; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--et-line); background: #fff;
  }
  .et-sheet form > div:empty, .et-sheet .field-search-filter-text { display: none; }
  .et-sheet .help-block { display: none; }
  .et-sheet .form-group { max-height: none; overflow: visible; margin: 0; }

  /* подписи групп */
  .et-sheet__label {
    display: block; margin: 0 0 10px; padding: 0; font: 700 14px/1.3 "Gotham Pro", sans-serif; color: var(--et-ink);
  }

  /* цена: ползунок jQuery UI с ручкой под палец (зона 44×44 вокруг ручки 28) */
  .et-sheet .ui-slider-handle {
    width: 28px; height: 28px; top: -12px; margin-left: -14px; border-width: 3px; touch-action: none;
  }
  .et-sheet .ui-slider-handle::before { content: ''; position: absolute; top: -11px; right: -11px; bottom: -11px; left: -11px; }

  /* select2: выпадающий список открывается внутри шторки */
  .et-sheet .select2-container { width: 100% !important; }
  .et-sheet .select2-selection--multiple { min-height: 48px; border-color: var(--et-edge) !important; padding: 4px 8px; border-radius: 0; }
  .et-sheet .select2-selection__rendered { display: block !important; padding: 0 !important; }
  .et-sheet .select2-search--inline { display: block; width: 100%; }
  .et-sheet .select2-search__field {
    width: 100% !important; min-height: 38px; margin: 0 !important; font-size: 16px; font-family: "Gotham Pro", sans-serif;
  }
  .et-sheet .select2-dropdown { border-color: var(--et-edge); border-radius: 0; }
  .et-sheet .select2-results__option { min-height: 44px; padding: 12px 8px; box-sizing: border-box; }

  /* свёрнутый длинный список галочек */
  .et-rest-toggle {
    display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0; border: 0; background: none;
    color: var(--et-red); font: 700 14px/1.2 "Gotham Pro", sans-serif; text-decoration: underline;
    text-underline-offset: 3px; cursor: pointer; touch-action: manipulation;
  }

  /* кнопка внизу шторки */
  .et-sheet__foot input[type=submit] {
    display: block; width: 100%; min-height: 48px; margin: 0; padding: 0 16px; border: 0; border-radius: 0;
    background: var(--et-red); color: #fff; font: 700 14px/1 "Gotham Pro", sans-serif; cursor: pointer;
    -webkit-appearance: none; appearance: none; touch-action: manipulation; transition: transform 160ms var(--et-ease);
  }

  .et-filter-btn:active, .et-allsec:active, .et-sheet__close:active, .et-sheet__foot input[type=submit]:active { transform: scale(.97); }
  @media (prefers-reduced-motion: reduce) {
    .et-sheet, .et-sheet.is-open, .et-scrim, .et-scrim.is-open { transition: none; }
    .et-sheet, .et-sheet.is-open { transform: none; opacity: 0; }
    .et-sheet.is-open { opacity: 1; }
    .et-filter-btn, .et-allsec, .et-sheet__close, .et-sheet__foot input[type=submit] { transition: none; }
    .et-filter-btn:active, .et-allsec:active, .et-sheet__close:active, .et-sheet__foot input[type=submit]:active { transform: none; }
  }
}
