/* KS FILTERFMT (Grok Bot, 30.10.2026): единый формат колонки/шторки фильтров на всех витринах
   (Запчасти, Шины, Диски, Колёса в сборе, Масла, Прочее). Эталон — колонка «Шины» (ks_v2_listing.css).
   Только слой поверх brand-классов, всё под #mp-sf-sidebar; разметка и JS не меняются. Откат — удалить файл и строку подключения. */
#mp-sf-sidebar { --ff-text: #1f2328; --ff-muted: #5f6772; --ff-dim: #9aa1aa; --ff-line: #eef0f2; --ff-bd: #dde1e6; --ff-red: #e23737; --ff-red-bg: #fff5f5; }

/* ---------- заголовки разделов: 15/20 SemiBold, без заливки и капса ---------- */
html body #mp-sf-sidebar .mp-sf-switches__title,
html body #mp-sf-sidebar .ap-home-cat-plates__title,
html body #mp-sf-sidebar .ks2-sec__t,
html body #mp-sf-sidebar .sf2-title,
html body #mp-sf-sidebar .ksctx-price__t,
html body #mp-sf-sidebar .ap-home-field:not(.ks2-has-row) > label:not(.visually-hidden),
html body #mp-sf-sidebar .ap-home-field.ks2-segfld > label,
html body #mp-sf-sidebar .om-feed-toolbar__brand > label,
html body #mp-sf-sidebar .om-sort-bar__label,
html body #mp-sf-sidebar .ap-home-oe-inline__label {
    display: block; margin: 0 0 8px !important; padding: 0 !important; min-height: 0 !important; height: auto !important;
    background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
    text-transform: none !important; letter-spacing: 0 !important; text-align: left !important;
    font: 400 15px/20px Inter-SemiBold, Inter, sans-serif !important; color: var(--ff-text) !important;
}
html body #mp-sf-sidebar .om-feed-toolbar__geo-field {
    display: flex !important; flex-direction: column; gap: 8px; margin: 0 !important; padding: 0 !important;
    text-transform: none !important; letter-spacing: 0 !important; font: 400 15px/20px Inter-SemiBold, Inter, sans-serif !important; color: var(--ff-text) !important;
}
/* выключенное поле (Удаленность без города): подпись приглушена, как на «Шинах» */
html body #mp-sf-sidebar .ap-home-field.is-disabled > label:not(.visually-hidden),
html body #mp-sf-sidebar .om-feed-toolbar__geo-field.is-disabled { color: var(--ff-dim) !important; }
/* «Местоположение» / «Параметры» над полями со своими заголовками — лишний уровень (на «Шинах» его нет) */
html body #mp-sf-sidebar .sf2-section:has(.ap-home-field > label:not(.visually-hidden)) > .sf2-title { display: none !important; }

/* ---------- чипсы: белые, с тонкой рамкой; выбранный — красная рамка ---------- */
html body #mp-sf-sidebar .mp-sf-switches__chips,
html body #mp-sf-sidebar .mp-sf-boards-panel__chips,
html body #mp-sf-sidebar .om-sort-chips { display: flex !important; flex-wrap: wrap; gap: 6px !important; }
html body #mp-sf-sidebar .mp-sf-chip,
html body #mp-sf-sidebar .om-sort-chip {
    display: inline-flex !important; align-items: center; gap: 6px; box-sizing: border-box !important;
    width: auto !important; max-width: 100%; min-width: 0 !important; height: auto !important; min-height: 32px !important; margin: 0 !important; padding: 0 12px !important;
    border: 1px solid var(--ff-bd) !important; border-radius: 16px !important; background: #fff !important; box-shadow: none !important;
    font: 400 14px/18px Inter-Regular, Inter, sans-serif !important; color: var(--ff-text) !important; text-transform: none !important; letter-spacing: 0 !important;
    text-decoration: none !important; white-space: nowrap; cursor: pointer; flex: 0 0 auto;
}
html body #mp-sf-sidebar .mp-sf-chip:hover,
html body #mp-sf-sidebar .om-sort-chip:hover { border-color: #b9c0c9 !important; }
html body #mp-sf-sidebar .mp-sf-chip.is-active,
html body #mp-sf-sidebar .om-sort-chip.is-active { border-color: var(--ff-red) !important; background: var(--ff-red-bg) !important; color: var(--ff-red) !important; }

/* ---------- поля: белые, рамка 1px, скругление 10 ---------- */
html body #mp-sf-sidebar .select2-container .select2-selection--single,
html body #mp-sf-sidebar .select2-container .select2-selection--multiple,
html body #mp-sf-sidebar .ksctx-price__in,
html body #mp-sf-sidebar .ap-home-oe-input,
html body #mp-sf-sidebar .ksctx-seller__q {
    box-sizing: border-box !important; border: 1px solid var(--ff-bd) !important; border-radius: 10px !important; background: #fff !important; box-shadow: none !important;
}
html body #mp-sf-sidebar .select2-container .select2-selection--single .select2-selection__rendered { font: 400 15px/38px Inter-Regular, Inter, sans-serif; color: var(--ff-text); padding-left: 12px !important; }
/* CLEARX1031: filterfmt padding-left:12px перекрывал home_vitrine 40px под × слева → текст/placeholder сливались с крестиком (AP + AFYC sidebar) */
html body #mp-sf-sidebar .select2-container--default .select2-selection--single:has(.select2-selection__clear) .select2-selection__rendered {
  padding-left: 40px !important;
}
html body #mp-sf-sidebar .select2-container .select2-selection--single .select2-selection__placeholder { color: var(--ff-muted) !important; }
html body #mp-sf-sidebar .select2-container--disabled .select2-selection--single { background: #fff !important; border-color: #e6e8eb !important; }
html body #mp-sf-sidebar .select2-container--disabled .select2-selection--single .select2-selection__rendered,
html body #mp-sf-sidebar .select2-container--disabled .select2-selection--single .select2-selection__placeholder { color: var(--ff-dim) !important; }
html body #mp-sf-sidebar .select2-container--disabled .select2-selection__clear { display: none !important; }
html body #mp-sf-sidebar .select2-selection--single .select2-selection__arrow b { border-color: var(--ff-dim) transparent transparent transparent !important; }
html body #mp-sf-sidebar .ksctx-price__in, html body #mp-sf-sidebar .ap-home-oe-input { padding: 0 12px !important; font: 400 15px/20px Inter-Regular, Inter, sans-serif !important; color: var(--ff-text) !important; }

/* ---------- сегменты (Состояние, Наличие, Доставка, Продавец) ---------- */
html body #mp-sf-sidebar .ks2-segctl, html body #mp-sf-sidebar .ksctx-seg { gap: 2px !important; padding: 3px !important; border-radius: 10px !important; background: #f2f3f5 !important; border: 0 !important; }
html body #mp-sf-sidebar .ks2-segctl__b, html body #mp-sf-sidebar .ksctx-seg__b { font-size: 14px !important; border-radius: 8px !important; }

/* ================= desktop: колонка ================= */
@media (min-width: 901px) {
    /* «Фильтры» — как на «Шинах» */
    html body #mp-sf-sidebar .ks2-colhead__t { font: 400 18px/24px Inter-Bold, Inter, sans-serif !important; color: var(--ff-text) !important; }
    html body #mp-sf-sidebar .ks2-colhead__reset { font: 400 14px/20px Inter-Regular, Inter, sans-serif !important; color: var(--ff-red) !important; }
    html body #mp-sf-sidebar .select2-container .select2-selection--single { height: 40px !important; }
    html body #mp-sf-sidebar .select2-container .select2-selection--single .select2-selection__rendered { line-height: 38px !important; }
    html body #mp-sf-sidebar .select2-container .select2-selection--single .select2-selection__arrow { height: 38px !important; }
    html body #mp-sf-sidebar .ksctx-price__in, html body #mp-sf-sidebar .ap-home-oe-input { height: 40px !important; }
    html body #mp-sf-sidebar .ks2-segctl__b, html body #mp-sf-sidebar .ksctx-seg__b { height: 32px !important; }
    /* Запчасти / Масла / Прочее: поля колонки 16px, как на «Шинах» */
    html body .mp-sf:is(.ks2-ap, :not(.ks2)) #mp-sf-sidebar { padding-left: 16px !important; padding-right: 16px !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar { padding-top: 14px !important; }
    html body .mp-sf.ks2-ap #mp-sf-sidebar .mp-sf__sidebar-footer { margin-left: -16px !important; margin-right: -16px !important; }
    /* разделы / категории / поля — одинаковые отступы и тонкие разделители */
    html body .mp-sf:is(.ks2-ap, :not(.ks2)) #mp-sf-sidebar .mp-sf-switches { padding: 0 0 12px !important; margin: 0 !important; border-bottom: 1px solid var(--ff-line) !important; background: none !important; }
    html body .mp-sf.ks2-ap #mp-sf-sidebar .mp-sf-switches { padding-top: 14px !important; }
    html body #mp-sf-sidebar .mp-sf-switches__block + .mp-sf-switches__block:not(.ks2-gone) { margin-top: 12px !important; }
    html body .mp-sf.ks2-ap #mp-sf-sidebar .ap-home-cat-plates { padding: 14px 0 12px !important; margin: 0 !important; border: 0 !important; border-bottom: 1px solid var(--ff-line) !important; }
    html body .mp-sf.ks2-ap #mp-sf-sidebar .sf2-section { padding: 0 !important; margin: 0 !important; border: 0 !important; background: none !important; }
    html body .mp-sf.ks2-ap #mp-sf-sidebar .sf2-fields, html body .mp-sf.ks2-ap #mp-sf-sidebar .ap-home-more-filters__grid { display: flex !important; flex-direction: column; gap: 0 !important; padding: 0 !important; margin: 0 !important; }
    html body .mp-sf.ks2-ap #mp-sf-sidebar .sf2-fields > .ap-home-field,
    html body .mp-sf.ks2-ap #mp-sf-sidebar .ap-home-more-filters__grid > .ap-home-field,
    html body .mp-sf.ks2-ap #mp-sf-sidebar .ksctx-price,
    html body .mp-sf.ks2-ap #mp-sf-sidebar .ap-home-oe-inline { width: 100% !important; max-width: none !important; padding: 14px 0 !important; margin: 0 !important; border: 0 !important; border-top: 1px solid var(--ff-line) !important; }
    html body .mp-sf.ks2-ap #mp-sf-sidebar .sf2-section:first-of-type .sf2-fields > .ap-home-field:first-child { border-top: 0 !important; }
    html body .mp-sf.ks2-ap #mp-sf-sidebar .ksctx-price .ks2-sec__t { margin-bottom: 8px !important; }
    /* Масла / Прочее */
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-feed-toolbar__filters, html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-feed-toolbar__geo-fields { display: flex !important; flex-direction: column; gap: 0 !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-feed-toolbar__brand,
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-feed-toolbar__geo-field,
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-sort-bar { width: 100% !important; padding: 14px 0 !important; margin: 0 !important; border: 0 !important; border-top: 1px solid var(--ff-line) !important; background: none !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-feed-toolbar__filters > :first-child { border-top: 0 !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-sort-bar { display: block !important; }
}

/* ================= mobile: шторка ================= */
@media (max-width: 900px) {
    /* шапка шторки как на «Шинах»: × слева, «Фильтры» по центру, «Сбросить» справа */
    html body #mp-sf-sidebar .mp-sf__sidebar-head { display: flex !important; align-items: center; gap: 8px; }
    html body #mp-sf-sidebar .mp-sf__sidebar-close { order: 1; flex: 0 0 40px; width: 40px !important; height: 40px !important; border-radius: 20px !important; }
    html body #mp-sf-sidebar .mp-sf__sidebar-title { order: 2; flex: 1 1 auto; text-align: center !important; font: 400 18px/24px Inter-SemiBold, Inter, sans-serif !important; color: var(--ff-text) !important; margin: 0 !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .mp-sf__sidebar-head::after { content: ""; order: 3; flex: 0 0 40px; height: 40px; }
    html body .mp-sf.ks2-ap.is-drawer-open #mp-sf-sidebar .ks2-colhead { right: 16px !important; left: auto !important; }
    html body .mp-sf.ks2-ap #mp-sf-sidebar .mp-sf__sidebar-head::after { content: ""; order: 3; flex: 0 0 72px; height: 40px; }

    html body #mp-sf-sidebar .mp-sf-chip,
        html body #mp-sf-sidebar .om-sort-chip { min-height: 36px !important; border-radius: 18px !important; }
    html body #mp-sf-sidebar .select2-container .select2-selection--single { height: 44px !important; }
    html body #mp-sf-sidebar .select2-container .select2-selection--single .select2-selection__rendered { line-height: 42px !important; font-size: 16px; }
    html body #mp-sf-sidebar .select2-container .select2-selection--single .select2-selection__arrow { height: 42px !important; }
    html body #mp-sf-sidebar .ksctx-price__in, html body #mp-sf-sidebar .ap-home-oe-input { height: 44px !important; font-size: 16px !important; }
    html body #mp-sf-sidebar .ks2-segctl__b, html body #mp-sf-sidebar .ksctx-seg__b { height: 36px !important; }
    html body #mp-sf-sidebar .mp-sf-switches__title { margin-bottom: 10px !important; }

    /* Масла / Прочее: 16px поля, секции с разделителями */
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .mp-sf-switches,
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .mp-sf__sidebar-body { padding-left: 16px !important; padding-right: 16px !important; margin-left: 0 !important; margin-right: 0 !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar { padding-left: 0 !important; padding-right: 0 !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .mp-sf__sidebar-head { padding-left: 12px !important; padding-right: 12px !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .mp-sf__sidebar-scroll { padding-left: 0 !important; padding-right: 0 !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .mp-sf-switches { padding-top: 12px !important; padding-bottom: 12px !important; border-bottom: 1px solid var(--ff-line) !important; background: none !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-feed-toolbar__filters, html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-feed-toolbar__geo-fields { display: flex !important; flex-direction: column; gap: 0 !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-feed-toolbar__brand,
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-feed-toolbar__geo-field,
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-sort-bar { width: 100% !important; padding: 14px 0 !important; margin: 0 !important; border: 0 !important; border-bottom: 1px solid var(--ff-line) !important; background: none !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-sort-bar { display: block !important; border-bottom: 0 !important; }
    html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-feed-toolbar__brand > label, html body .mp-sf:not(.ks2) #mp-sf-sidebar .om-sort-bar__label { margin-bottom: 10px !important; }
}

/* «Все категории / Свернуть»: виден только один ярлык (как у brand) */
html body #mp-sf-sidebar .ap-home-cat-plates[data-expanded="0"] .ap-home-cat-plates__toggle-less,
html body #mp-sf-sidebar .ap-home-cat-plates[data-expanded="1"] .ap-home-cat-plates__toggle-more,
html body #mp-sf-sidebar .ap-home-cat-plates:not([data-expanded]) .ap-home-cat-plates__toggle-less { display: none !important; }
/* «(Из каталога)» в заголовке OE — обычным шрифтом */
html body #mp-sf-sidebar .ap-home-oe-inline__label a { font: 400 13px/20px Inter-Regular, Inter, sans-serif !important; }
/* стрелка select2 по центру поля (Масла/Прочее) */
html body #mp-sf-sidebar .select2-container .select2-selection--single .select2-selection__arrow { top: 1px !important; right: 6px !important; }
/* Масла/Прочее: brand фиксировал min/max-height 32px — высота полей как на остальных витринах */
html body #mp-sf-sidebar .select2-container .select2-selection--single { min-height: 0 !important; max-height: none !important; }
@media (min-width: 901px) { html body #mp-sf-sidebar .om-feed-toolbar .select2-container .select2-selection--single { height: 40px !important; } }
@media (max-width: 900px) { html body #mp-sf-sidebar .om-feed-toolbar .select2-container .select2-selection--single { height: 44px !important; } }

/* ===== FILTERFMT-2: короткие шторки одного параметра (Сезон, Шипы, Состояние, Сортировка…) — по высоте содержимого, снизу,
   с затемнением; во весь экран — только когда внутри поиск/длинный вложенный список (клавиатура) ===== */
@media (max-width: 900px) {
    html body .ks2-sheet-wrap .ks2-sheet:not(.ks2-host-sub):not(:has(input[type="search"], input[type="text"], .ks2-sub.is-open)) {
        top: auto !important; bottom: 0 !important; height: auto !important;
        max-height: min(85dvh, calc(var(--ksctx-vvh, 100dvh) - 48px)) !important;
        border-radius: 16px 16px 0 0 !important; padding-top: 0 !important; padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, .12) !important;
    }
    html body .ks2-sheet-wrap:not(:has(.ks2-sheet.ks2-host-sub, .ks2-sheet input[type="search"], .ks2-sheet input[type="text"], .ks2-sub.is-open)) { background: transparent !important; }
    html body .ks2-sheet-wrap:not(:has(.ks2-sheet.ks2-host-sub, .ks2-sheet input[type="search"], .ks2-sheet input[type="text"], .ks2-sub.is-open)) .ks2-sheet-bd { display: block !important; }
    html body .ks2-sheet-wrap .ks2-sheet:not(.ks2-host-sub) .ks2-sheet__body { flex: 0 1 auto !important; }
}
/* чипса «Шипы» в строке быстрых фильтров — только при сезоне «Зимние» (как на Avito) */
html body .ks2-chip[hidden] { display: none !important; }

/* ===== FILTERFMT-3: «Категории» Запчастей — строгий список вместо облака тегов:
   название слева, число объявлений справа (серым), без иконок и плашек; выбранная — красным; «Все категории →» — текстовой ссылкой ===== */
html body #mp-sf-sidebar .ap-home-cat-plates { background: none !important; box-shadow: none !important; }
html body #mp-sf-sidebar .ap-home-cat-plates__viewport { margin: 0 !important; padding: 0 !important; overflow: visible !important; max-height: none !important; }
html body #mp-sf-sidebar .ap-home-cat-plates-grid {
    display: block !important; margin: 0 !important; padding: 0 !important; list-style: none !important; grid-template-columns: none !important; gap: 0 !important; columns: auto !important;
}
html body #mp-sf-sidebar .ap-home-cat-plates-grid > li { display: block !important; margin: 0 !important; padding: 0 !important; width: auto !important; }
html body #mp-sf-sidebar .ap-home-cat-plates-grid > li::before, html body #mp-sf-sidebar .ap-home-cat-plates-grid > li::after { content: none !important; }
html body #mp-sf-sidebar .ap-home-cat-plates-grid .ap-home-cat-plate {
    display: flex !important; align-items: center; justify-content: space-between; gap: 12px; box-sizing: border-box !important;
    width: 100% !important; max-width: none !important; min-width: 0 !important; height: auto !important; min-height: 34px !important; margin: 0 !important; padding: 7px 0 !important;
    border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important;
    font: 400 15px/20px Inter-Regular, Inter, sans-serif !important; color: var(--ff-text) !important; text-decoration: none !important; text-align: left !important; white-space: normal;
}
html body #mp-sf-sidebar .ap-home-cat-plates-grid .ap-home-cat-plate:hover { color: var(--ff-red) !important; background: none !important; }
html body #mp-sf-sidebar .ap-home-cat-plates-grid .ap-home-cat-plate.is-active,
html body #mp-sf-sidebar .ap-home-cat-plates-grid .ap-home-cat-plate[aria-current="page"] { color: var(--ff-red) !important; font-family: Inter-Medium, Inter, sans-serif !important; background: none !important; }
html body #mp-sf-sidebar .ap-home-cat-plates-grid .ap-home-cat-plate__icon { display: none !important; }
html body #mp-sf-sidebar .ap-home-cat-plates-grid .ap-home-cat-plate__label {
    flex: 1 1 auto; min-width: 0; margin: 0 !important; padding: 0 !important; font: inherit !important; color: inherit !important;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left !important;
}
html body #mp-sf-sidebar .ap-home-cat-plate .ff-cat-n { flex: 0 0 auto; font: 400 14px/20px Inter-Regular, Inter, sans-serif; color: var(--ff-dim); font-variant-numeric: tabular-nums; }
html body #mp-sf-sidebar .ap-home-cat-plate.ff-cat-zero .ap-home-cat-plate__label { color: var(--ff-dim) !important; }
/* «Все категории →» */
html body #mp-sf-sidebar .ap-home-cat-plate--all, html body #mp-sf-sidebar .ap-home-cat-plates__toggle {
    display: inline-flex !important; align-items: center; gap: 4px; width: auto !important; min-height: 0 !important; height: auto !important; margin: 6px 0 0 !important; padding: 4px 0 !important;
    border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important;
    font: 400 14px/20px Inter-Medium, Inter, sans-serif !important; color: var(--ff-red) !important; cursor: pointer; text-decoration: none !important;
}
html body #mp-sf-sidebar .ap-home-cat-plates__toggle .ap-home-cat-plate__icon { display: none !important; }
html body #mp-sf-sidebar .ap-home-cat-plates__toggle .ap-home-cat-plate__label { font: inherit !important; color: inherit !important; margin: 0 !important; padding: 0 !important; }
html body #mp-sf-sidebar .ap-home-cat-plates__toggle::after { content: "→"; font: inherit; }
html body #mp-sf-sidebar .ap-home-cat-plates[data-expanded="1"] .ap-home-cat-plates__toggle::after { content: "↑"; }
html body #mp-sf-sidebar .ap-home-cat-plates__toggle:hover { text-decoration: underline !important; }
html body #mp-sf-sidebar .ap-home-cat-plates__title { margin-bottom: 4px !important; }

/* ===== FILTERFMT-4: «Разделы» в мобильной шторке на всех витринах (на «Шинах/Дисках/Колёсах» было скрыто) ===== */
html body #mp-sf-sidebar .mp-sf-switches__block--sections.ks2-empty { display: block !important; }
@media (max-width: 900px) {
    html body .mp-sf #mp-sf-sidebar .mp-sf-switches { display: block !important; }
    html body .mp-sf.ks2:not(.ks2-ap) #mp-sf-sidebar .mp-sf-switches { padding: 12px 0 !important; margin: 0 !important; border-bottom: 1px solid var(--ff-line) !important; background: none !important; }
    html body .mp-sf #mp-sf-sidebar .mp-sf-switches__block--sections { display: block !important; }
}
/* заголовки всплывающих списков («Все категории», «Прочее для Вашего автомобиля») — как остальные, без серой плашки и капса */
html body #mp-sf-sidebar .ap-home-cat-plates-flyout__title,
html body #mp-sf-sidebar .mp-sf-boards-panel__title {
    margin: 0 !important; padding: 0 !important; background: none !important; text-transform: none !important; letter-spacing: 0 !important;
    font: 400 15px/20px Inter-SemiBold, Inter, sans-serif !important; color: var(--ff-text) !important;
}

/* ===== FILTERFMT-5 (30.10, Max t293u): мобильные отступы — контент на всю ширину, без «дыры» под поиском ===== */
@media (max-width: 767px) {
  /* было: 20px контейнер + 16px внутри = 36px с каждой стороны; стало 16px (как в шапке/поиске) */
  html body.td-parts-page:not(.afyc-hub-page):not(#ff-x) .new-container.td-wizard-shell {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  /* Запчасти: контент начинался на 70px ниже фиксированной строки поиска/чипсов — выравниваем как в Шинах */
  html body.td-parts-page .new-container.td-wizard-shell:has(.mp-sf.ks2-ap) {
    padding-top: 0 !important;
  }
  html body .mp-sf.ks2.ks2-ap > .mp-sf__main {
    margin-top: -64px !important;
    padding-top: 111px !important;
  }
  html body .mp-sf.ks2.ks2-ap .ks2-ap-titlerow { margin-top: 4px !important; }
  /* Масла / Прочее: контент сразу под строкой поиска (было ~74px пустоты) */
  html body.om-page .om-main:not(#ff-x),
  html body.mb-page .om-main:not(#ff-x),
  html body.mb-page .mb-main:not(#ff-x) {
    padding-top: 14px !important;
  }
  /* сердечко/корзина на одной линии со строкой поиска, а не «висят» под ней */
  html body.om-page #wm-fav-fab, html body.om-page #wm-cart-fab,
  html body.mb-page #wm-fav-fab, html body.mb-page #wm-cart-fab {
    top: 60px !important;
  }
  /* Масла / Прочее: заголовок раздела тем же шрифтом, что в Запчастях/Шинах (не моноширинный) */
  html body .om-main .om-hero h1,
  html body .om-main > h1,
  html body .mb-main .om-hero h1 {
    font-family: 'Inter-SemiBold', Inter, system-ui, sans-serif !important;
    font-weight: 600 !important;
    font-size: 20px !important;
    line-height: 26px !important;
    letter-spacing: 0 !important;
  }
}

/* ===== FILTERFMT-6 (30.10, Max t298u): десктоп — без внутренних прокруток в фильтрах ===== */
@media (min-width: 901px) {
  html body .mp-sf .mp-sf__sidebar-col:not(#ff-x),
  html body .mp-sf #mp-sf-sidebar:not(#ff-x) {
    position: static !important; top: auto !important;
    max-height: none !important; height: auto !important; overflow: visible !important;
  }
  html body .mp-sf #mp-sf-sidebar:not(#ff-x) .mp-sf__sidebar-body,
  html body .mp-sf #mp-sf-sidebar:not(#ff-x) .mp-sf__sidebar-scroll {
    max-height: none !important; height: auto !important; overflow: visible !important; flex: 0 0 auto !important;
  }
  /* «Показать N» / «Найти» — прилипает к низу экрана внутри колонки, без внутреннего скролла */
  html body .mp-sf #mp-sf-sidebar:not(#ff-x) .mp-sf__sidebar-f {
    position: sticky !important; bottom: 0 !important; z-index: 3 !important; background: #fff !important;
  }
  /* поля не вылезают за колонку (Цена от/до, размеры) */
  html body #mp-sf-sidebar input:not([type="hidden"]):not(.select2-search__field), html body #mp-sf-sidebar select:not(.select2-hidden-accessible),
  html body #mp-sf-sidebar .select2-container { box-sizing: border-box !important; max-width: 100% !important; }
  html body #mp-sf-sidebar .ap-home-field, html body #mp-sf-sidebar [class*="range"] > *,
  html body #mp-sf-sidebar [class*="price"] > * { min-width: 0 !important; }
}

/* ===== FILTERFMT-6 (Max t299u): «Разделы» — ровная сетка 2 колонки, одинаковые ячейки, во всех разделах ===== */
html body #mp-sf-sidebar .mp-sf-switches__block--sections .mp-sf-switches__chips {
  display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6px !important;
}
html body #mp-sf-sidebar .mp-sf-switches__block--sections .mp-sf-chip {
  width: 100% !important; justify-content: center !important; text-align: center !important;
  overflow: hidden !important; text-overflow: ellipsis !important;
}

/* ===== FILTERFMT-7: «Ничего не найдено» ===== */
html body .ap-name-serp-empty.ff-empty { margin: 16px 0 24px !important; padding: 24px 16px !important; border: 1px solid #e6e8eb; border-radius: 12px; background: #fff; text-align: center; }
html body .ff-empty__t { margin: 0 0 6px !important; font: 600 18px/24px 'Inter-SemiBold', Inter, sans-serif !important; color: #1f2329 !important; }
html body .ff-empty__d { margin: 0 0 16px !important; font: 400 14px/20px 'Inter-Regular', Inter, sans-serif !important; color: #6b7280 !important; }
html body .ff-empty__a { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
html body .ff-empty__btn { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 10px; background: #e23737; color: #fff !important; font: 500 14px/1 'Inter-Medium', Inter, sans-serif; text-decoration: none !important; }
html body .ff-empty__btn--ghost { background: #fff; color: #1f2329 !important; border: 1px solid #dde1e6; }

/* ===== FILTERFMT-9 (Max t301u): Запчасти с выбранным авто ===== */
/* заголовки блоков — обычный шрифт сайта, не моноширинный */
html body .ap-home-feed-title,
html body .ap-home-section-title,
html body .ap-wheels-fitment-gallery__title,
html body .om-main .om-hero h1, html body .mb-main .om-hero h1 {
  font-family: 'Inter-SemiBold', Inter, system-ui, sans-serif !important; font-weight: 600 !important;
  font-size: 20px !important; line-height: 26px !important; letter-spacing: 0 !important; text-transform: none !important;
}
/* «Шины и диски для вашего авто»: ровная сетка без полосы прокрутки, карточки одной ширины */
html body .ap-wheels-fitment-gallery__track {
  display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 12px !important;
  overflow: visible !important; scroll-snap-type: none !important; padding: 0 !important;
}
html body .ap-wheels-fitment-gallery__track > *:nth-child(n+5) { display: none !important; }
html body .ap-wheels-fitment-card {
  display: flex !important; flex-direction: column !important; width: auto !important; min-width: 0 !important; max-width: none !important; flex: none !important; margin: 0 !important;
}
html body .ap-wheels-fitment-card__body { display: flex !important; flex-direction: column !important; flex: 1 1 auto !important; gap: 4px; }
html body .ap-wheels-fitment-card__headline {
  display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em;
}
html body .ap-wheels-fitment-card__size { min-height: 1.3em; }
html body .ap-wheels-fitment-card__price { margin-top: auto !important; }
@media (max-width: 900px) {
  html body .ap-wheels-fitment-gallery__track { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
/* категории: нулевые числа не показываем; если все нули — без чисел */
html body #mp-sf-sidebar.ff-cat-nocounts .ff-cat-n { display: none !important; }
html body .ks2-ap-found.ff-found-moved { margin: 4px 0 12px !important; }

/* ===== FILTERFMT-10 (Max t305u): компактная шапка разделов — H1 остаётся (SEO), но меньше и без лишних отступов ===== */
html body h1.ks2-h1, html body h1.ap-home-page-h1, html body .om-main .om-hero h1, html body .mb-main .om-hero h1, html body h1.afyc-hub__h1 {
  font-family: 'Inter-SemiBold', Inter, system-ui, sans-serif !important; font-weight: 600 !important;
  font-size: 22px !important; line-height: 28px !important; letter-spacing: 0 !important; margin-top: 0 !important; margin-bottom: 6px !important;
}
html body .om-main .om-hero, html body .mb-main .om-hero { margin-bottom: 8px !important; }
@media (min-width: 901px) {
  html body.td-parts-page .breadcrumb-wrap { min-height: 0 !important; height: auto !important; padding-top: 4px !important; padding-bottom: 4px !important; margin-top: 0 !important; margin-bottom: 2px !important; }
  html body.td-parts-page .breadcrumb-wrap * { margin-top: 0 !important; margin-bottom: 0 !important; }
  html body .ks2-tabsrow { margin-bottom: 8px !important; min-height: 0 !important; }
  html body h1.ks2-h1:not(.ks2-ap-h1) { margin-bottom: 4px !important; }
}
@media (max-width: 900px) {
  html body:not(#ff-x) h1.ks2-h1, html body:not(#ff-x) h1.ap-home-page-h1,
  html body:not(#ff-x) .om-main .om-hero h1, html body:not(#ff-x) .mb-main .om-hero h1 { font-size: 20px !important; line-height: 26px !important; }
}

/* FILTERFMT-10: Гараж / VIN / СТС mini-chips in the parts sidebar — same format as section chips */
html body #mp-sf-sidebar [class*="ap-home-filter-actions--too"]:not(#ff-x){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
html body #mp-sf-sidebar [class*="ap-home-filter-actions--too"] .ap-home-tool-chip:not(#ff-x){width:100%;min-width:0;height:32px;padding:0 6px;font-size:13px;line-height:30px;border-radius:999px;justify-content:center;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box}

/* FILTERFMT-14: hub H1 compact on mobile (one line, tight top) */
@media (max-width:900px){
html body:not(#ff-x) h1.afyc-hub__h1{font-size:20px!important;line-height:26px!important;padding-top:12px!important;margin-bottom:4px!important;letter-spacing:0!important}
}
@media (max-width:380px){
html body:not(#ff-x) h1.afyc-hub__h1{font-size:18px!important;line-height:24px!important}
}

/* FILTERFMT-16 (30.10, QA1030): скрытые select2-select'ы не растягивают страницу по ширине (Масла/Прочее, десктоп 1024–1280).
   Сайдбар снова containing block (relative, не sticky), а сам скрытый select — 1px, как задумано select2. */
@media (min-width: 901px) {
  html body .mp-sf #mp-sf-sidebar:not(#ff-x) { position: relative !important; }
}
/* FILTERFLOAT (31.10, Max t321u): FILTERFMT-16 forced relative !important on top of brand JS (mp_sticky_filters.js, SEARCHANIM1030=brand),
   which keeps setting inline left/top/width/height after ~200px scroll -> the filter column shifted right by left px and hung over cards and H1.
   Our layer keeps the column in flow on desktop (no sticky, no inner scroll): neutralize brand JS inline coordinates on all .mp-sf pages. */
@media (min-width: 901px) {
  html body .mp-sf #mp-sf-sidebar.mp-sf__sidebar:not(#ff-x) { position: relative !important; top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;
    width: auto !important; height: auto !important; max-height: none !important; transform: none !important; }
}
html body #mp-sf-sidebar select.select2-hidden-accessible:not(#ff-x) { width: 1px !important; min-width: 0 !important; max-width: 1px !important; }
/* FILTERFMT-17 (30.10, QA1030): выдача поиска /Automotive_parts/name/ (brand-шаблон без своих 16px внутри) — поля 16px на мобиле,
   FILTERFMT-5 обнулял контейнер на всех страницах запчастей. */
@media (max-width: 767px) {
  html body.td-parts-page:not(.afyc-hub-page):not(#ff-x):has(.ap-serp-toolbar, .ap-name-serp-extras-mount, .ap-name-serp-empty) .new-container.td-wizard-shell:not(:has(.mp-sf.ks2)) {
    padding-left: 16px !important; padding-right: 16px !important;
  }
  /* карточка объявления запчастей (brand-шаблон) — тоже 16px, иначе заголовок/продавец/фото у самого края */
  html body.td-parts-page.mp-ads-offer-public:not(#ff-x) .new-container.td-wizard-shell:not(:has(.mp-sf.ks2)) {
    padding-left: 16px !important; padding-right: 16px !important;
  }
}
/* FILTERFMT-18 (30.10, QA1030, Max t301u): блок «Шины и диски для вашего авто» на мобиле — те же поля 16px, что у ленты ниже (было впритык к краям) */
@media (max-width: 900px) {
  html body .mp-sf.ks2-ap .ap-wheels-fitment-gallery:not(#ff-x) { padding-left: 16px !important; padding-right: 16px !important; box-sizing: border-box !important; }
}

/* SHAREOVF1031 (31.10, regression lk-snap vs prod): ad page on mobile - the hidden share dropdown next to the date/views
   (yandex.share style.css forces left:0 at <=550px) sticks out 120px to the right -> horizontal scroll (scrollWidth 512 at 390). Open it to the left. */
@media (max-width: 550px) {
  .data_and_views .card-fav-share--inline .custom-share-buttons { left: auto !important; right: 0 !important; }
}

/* OILSOVF1031 (31.10): ad page characteristics on mobile - a long unbroken value (e.g. Артикул GPT1012613014510530020 on oils ads)
   did not wrap -> horizontal scroll (scrollWidth 407/401 at 390). Let the value shrink and break. Mobile only, desktop unchanged. */
@media (max-width: 900px) {
  .desc-list__text-list .desc-list__text-add { min-width: 0 !important; overflow-wrap: anywhere !important; word-break: break-word; }
}

/* ===== CHIPWRAP1031 (Max t381u): «Разделы» — длинное название не обрезается: чип на всю строку (класс от JS), перенос до 2 строк ===== */
html body #mp-sf-sidebar .mp-sf-switches__block--sections .mp-sf-chip {
  overflow: visible !important; text-overflow: clip !important; white-space: normal !important;
  padding: 6px 12px !important; line-height: 18px !important; overflow-wrap: break-word;
}
html body #mp-sf-sidebar .mp-sf-switches__block--sections .mp-sf-chip.ks-chip-wide { grid-column: 1 / -1 !important; }
html body #mp-sf-sidebar .mp-sf-boards-panel__chips .mp-sf-chip {
  white-space: normal !important; text-align: center; padding: 6px 12px !important; line-height: 18px !important; overflow-wrap: break-word;
}


/* ===== CHIPWRAP1031b: длинный чип «Разделы» — полноценная 2-строчная кнопка на всю ширину ===== */
html body #mp-sf-sidebar .mp-sf-switches__block--sections .mp-sf-chip.ks-chip-wide {
  grid-column: 1 / -1 !important;
  min-height: 40px !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  white-space: normal !important;
  overflow: visible !important;
}

/* NOCATCOUNTS-20261105: always hide category counters (desktop sidebar + adaptive flyout) */
html body #mp-sf-sidebar .ff-cat-n,
html body .ap-home-cat-plates-flyout .ff-cat-n,
html body .mp-sf-flyout .ff-cat-n { display: none !important; }
