/* STEP9-SHELF-CARD-1: на телефоне полка шин и дисков — белая карточка под фильтром,
   как на главной. Крошки и заголовок над ней, сортировка и товары под ней.
   Компьютер: обёртка прозрачная для вёрстки, белая карточка фильтра как была.
   Открытая шторка «Фильтр» по-прежнему снизу, страница за ней притемняется.
   Поиск, главная, страница машины и опт не здесь.
   marker: kolesa-shelf-card-1 */

@media (min-width: 801px) {
  body.kolesa-prep-92 .k9c-filter-card {
    display: contents;
  }
}

@media (max-width: 800px) {
  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search) .k9c-filter-card {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 10px;
    padding: 14px 14px 12px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 5;
    overflow: visible;
  }

  /* Шторка забирает фильтр на низ экрана. Карточка на это время не коробка,
     иначе белая подложка остаётся под затемнением. */
  body.kolesa-prep-92.is-k9c-sheet .k9c-filter-card {
    display: contents;
  }

  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search):not(:has(form.smartfilter.is-stagger)) .k9c-filter-card > .m-catalog-switch,
  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search):not(:has(form.smartfilter.is-stagger)) .k9c-filter-card > .m-filterbar,
  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search):not(:has(form.smartfilter.is-stagger)) .k9c-filter-card .k9c-pc-switch,
  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search):not(:has(form.smartfilter.is-stagger)) .k9c-filter-card .k9c-size-fields,
  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search):not(:has(form.smartfilter.is-stagger)) .k9c-filter-card #k9c-sheet-seasons {
    margin: 0;
  }

  /* Шины без второй оси: кнопка и фразы становятся соседями в карточке.
     Разноширокие не распускаем — перед и зад остаются своим блоком. */
  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search):not([data-k9c-section="25741"]):not(:has(form.smartfilter.is-stagger)) .k9c-filter-card > .catalog-filter {
    display: contents;
  }

  /* Старые номера порядка были для всей страницы. В карточке свой порядок,
     поэтому !important: иначе «По размеру» встаёт выше «Шины».
     Разноширокие не трогаем: там перед и зад уже стоят своим порядком. */
  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search) .k9c-filter-card > .m-catalog-switch {
    order: 1 !important;
  }

  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search):not(:has(form.smartfilter.is-stagger)) .k9c-filter-card .k9c-pc-switch {
    order: 2 !important;
  }

  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search):not(:has(form.smartfilter.is-stagger)) .k9c-filter-card .k9c-size-fields {
    order: 3 !important;
  }

  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search):not(:has(form.smartfilter.is-stagger)) .k9c-filter-card #k9c-sheet-seasons {
    order: 4 !important;
  }

  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search) .k9c-filter-card > .m-filterbar {
    order: 5 !important;
  }

  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat:not(.k9c-search):not(:has(form.smartfilter.is-stagger)) .k9c-filter-card .filter-note {
    display: flex !important;
    order: 6 !important;
    margin: 0;
    padding: 0;
    min-height: 0;
    gap: 0 16px;
  }

  /* Диски: та же карточка, «Фильтр» в ряду с вылетом и ЦО, как было. */
  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat[data-k9c-section="25741"]:not(:has(form.smartfilter.is-stagger)) .k9c-filter-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 8px;
    row-gap: 8px;
    align-items: stretch;
  }

  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat[data-k9c-section="25741"]:not(:has(form.smartfilter.is-stagger)) .k9c-filter-card > .m-catalog-switch,
  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat[data-k9c-section="25741"]:not(:has(form.smartfilter.is-stagger)) .k9c-filter-card .k9c-pc-switch,
  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat[data-k9c-section="25741"]:not(:has(form.smartfilter.is-stagger)) .k9c-filter-card .filter-note,
  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat[data-k9c-section="25741"]:not(:has(form.smartfilter.is-stagger)) .k9c-filter-card form.podborFromAuto.shown {
    grid-column: 1 / -1;
  }

  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat[data-k9c-section="25741"]:not(:has(form.smartfilter.is-stagger)) .k9c-filter-card > .m-catalog-switch {
    order: 1;
  }

  body.kolesa-prep-92:not(.is-k9c-sheet) .k9c-cat[data-k9c-section="25741"]:not(:has(form.smartfilter.is-stagger)) .k9c-filter-card .filter-note {
    order: 6;
  }
}
