/* MPLAYOUT1031 (31.10, Макс t353u–t357u): Шины / Диски / Колёса в сборе / Масла / Прочее (доски) — раскладка как в Запчастях
 * (/Automotive_parts/): слева колонка фильтров с самого верха, справа поиск -> крошки -> H1 + «Тип техники / Выбрать авто» -> выдача.
 * Только страницы с .ks-mpl-head (разметку двигают views этих разделов). Разделы авто (каталог, ком.транспорт, мото, спецтехника) не затронуты. */

/* ---------- общие ---------- */
.ks-mpl-head { display: block; min-width: 0; }
.ks-mpl-head > link { display: none; }
.ks-mpl-head .wm-page-title-row--crumb { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 !important; padding: 0 !important; min-height: 0 !important; height: 24px; overflow: visible; }
.ks-mpl-head .breadcrumb-wrap { margin: 0 !important; }
html body .ks-mpl-head .ks-mpl-titlerow { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: nowrap; margin: 4px 0 10px !important; padding: 0 !important; background: none !important; border: 0 !important; min-height: 0 !important; }
html body .ks-mpl-head .ks-mpl-titlerow h1.ks-mpl-h1, html body .ks-mpl-head .ks-mpl-titlerow > h1 {
    flex: 1 1 auto; min-width: 0; margin: 0 !important; padding: 0 !important;
    font: 600 22px/28px Inter-SemiBold, Inter, system-ui, sans-serif !important; color: #1f2328 !important; letter-spacing: 0 !important; text-transform: none !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html body .ks-mpl-head .ks-mpl-titlerow .ks2-tabsrow { display: flex !important; flex-direction: row !important; align-items: center; gap: 12px; flex: 0 0 auto; margin: 0 !important; padding: 0 !important; width: auto !important; min-height: 0 !important; border: 0 !important; }
html body .ks-mpl-head .ks-mpl-titlerow .ks2-tabsrow .ksctx { margin: 0 !important; }
html body .ks-mpl-head .ks-mpl-titlerow .ksctx__pick { color: #e23737 !important; border-color: #e23737 !important; background: #fff !important; font: 400 14px/20px Inter-Medium, Inter, sans-serif !important; }
html body .ks-mpl-head .ks-mpl-titlerow .ksctx__vtbtn { font-size: 14px !important; }
/* «Специальные предложения» — как в Запчастях */
html body .mp-sf:has(.ks-mpl-head) .ap-home-feed-title { margin-top: 0 !important; margin-bottom: 12px !important; }
html body .mp-sf:has(.ks-mpl-head) .wm-special-offers, html body .mp-sf:has(.ks-mpl-head) .om-section.wm-special-offers { margin-top: 0 !important; }

/* ---------- desktop ---------- */
@media (min-width: 901px) {
    /* контейнер как в Запчастях: оболочка 1220 (поля 20) -> колонка 1180, сверху 24 */
    html body.wm-page .new-container.td-wizard-shell:has(.ks-mpl-head) { max-width: 1220px !important; margin-left: auto !important; margin-right: auto !important; padding: 24px 20px 28px !important; }
    html body.wm-page .wm-wrap:has(.ks-mpl-head) { max-width: 1180px !important; }
    html body.om-page .new-container.td-wizard-shell:has(.ks-mpl-head), html body.mb-page .new-container.td-wizard-shell:has(.ks-mpl-head) { max-width: 1220px !important; padding: 24px 20px 28px !important; }
    html body main.om-main.ks-mpl { max-width: none !important; width: auto !important; margin: 0 !important; padding: 0 !important; }
    html body .mp-sf:has(.ks-mpl-head) { grid-template-columns: 280px minmax(0, 1fr) !important; column-gap: 16px !important; margin-top: 0 !important; }
    /* колонка фильтров: те же поля, рамка и скругление, что в Запчастях */
    html body .mp-sf:has(.ks-mpl-head) #mp-sf-sidebar.mp-sf__sidebar { padding: 10px 16px 12px !important; border: 1px solid #e6e8eb !important; border-radius: 14px !important; background: #fff !important; box-shadow: none !important; }
    html body .ks-mpl-head .ks-mpl-titlerow { min-height: 44px !important; }
    html body .ks-mpl-head .ks-mpl-titlerow h1.ks-mpl-h1, html body .ks-mpl-head .ks-mpl-titlerow > h1 { margin: 0 0 6px !important; }
    html body .mp-sf:has(.ks-mpl-head) #mp-sf-sidebar .mp-sf-switches { padding: 14px 0 12px !important; margin: 0 !important; }
    html body .mp-sf:has(.ks-mpl-head) #mp-sf-sidebar .ks2-colhead { margin: 12px 0 4px !important; padding: 12px 0 0 !important; border-top: 1px solid #e6e8eb !important; }
    /* поля фильтров Шин/Дисков/Колёс — по краю колонки, как в Запчастях (раньше компенсировали узкие поля колонки) */
    html body .mp-sf:has(.ks-mpl-head) #mp-sf-sidebar .ap-home-search-panel__form { padding-left: 0 !important; padding-right: 0 !important; }
    /* «Показать N объявлений» — липкий низ колонки, как в Запчастях */
    html body .mp-sf:has(.ks-mpl-head) #mp-sf-sidebar .mp-sf__sidebar-footer { position: sticky !important; bottom: 0 !important; z-index: 5; display: flex !important; gap: 8px; margin: 0 -16px !important; padding: 12px 16px !important; width: auto !important; background: #fff !important; border-top: 1px solid #e6e8eb !important; border-radius: 0 0 14px 14px; box-shadow: 0 -6px 12px -10px rgba(15,23,42,.25); }
    html body.wm-page .mp-sf:has(.ks-mpl-head) #mp-sf-sidebar .mp-sf__sidebar-footer .ap-home-search-find, html body.wm-page .mp-sf:has(.ks-mpl-head) #mp-sf-sidebar .mp-sf__sidebar-footer button[type=submit] { flex: 1 1 auto; height: 44px !important; border: 0 !important; border-radius: 12px !important; background: #e23737 !important; color: #fff !important; font: 400 14px/1 Inter-Medium, Inter, sans-serif !important; white-space: nowrap !important; padding: 0 12px !important; }
    /* «Найти» в строке поиска — как в Запчастях (контурная) */
    html body .mp-sf:has(.ks-mpl-head) .mp-sf__sticky-submit { height: 40px !important; padding: 0 16px !important; border: 1px solid #e23737 !important; border-radius: 12px !important; background: transparent !important; color: #e23737 !important; font: 400 13.5px/normal Inter-Regular, sans-serif !important; box-shadow: none !important; }
    /* выдача: 4 колонки, зазор 14 — как в Запчастях */
    html body .mp-sf:has(.ks-mpl-head) .mp-sf__content .ap-home-feed-grid { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 14px !important; margin-left: 0 !important; margin-right: 0 !important; padding: 0 !important; }
    html body .mp-sf:has(.ks-mpl-head) .mp-sf__content .ap-home-feed-grid > li { width: auto !important; min-width: 0 !important; margin: 0 !important; }
}

/* ---------- mobile ---------- */
@media (max-width: 900px) {
    .ks-mpl-head .wm-page-title-row--crumb, .ks-mpl-head > .breadcrumb-wrap { display: none !important; }
    html body .ks-mpl-head .ks-mpl-titlerow { margin: 6px 0 0 !important; padding: 0 16px !important; }
    html body .ks-mpl-head .ks-mpl-titlerow h1.ks-mpl-h1, html body .ks-mpl-head .ks-mpl-titlerow > h1 { font: 400 16px/22px Inter-SemiBold, Inter, sans-serif !important; }
    html body .ks-mpl-head .ks-mpl-titlerow .ks2-tabsrow { display: none !important; }
}
@media (max-width: 900px) {
    /* H1 как в Запчастях на телефоне */
    html body main .ks-mpl-head .ks-mpl-titlerow h1.ks-mpl-h1, html body main .ks-mpl-head .ks-mpl-titlerow > h1, html body .wm-wrap .ks-mpl-head .ks-mpl-titlerow h1.ks-mpl-h1 { font: 600 20px/26px Inter-SemiBold, Inter, system-ui, sans-serif !important; }
    html body .wm-wrap .ks2-found--h1 h1.ks-mpl-h1 { font-weight: 600 !important; font-family: Inter-SemiBold, Inter, system-ui, sans-serif !important; }
    /* масла / доски: у main уже поля 16px */
    html body main.om-main.ks-mpl .ks-mpl-head .ks-mpl-titlerow { padding: 0 !important; margin: 6px 0 8px !important; }
}
@media (max-width: 900px) {
    /* Шины: у колонки уже поля 16px (крупные H1 пустых разделов не уезжают на 32px) */
    html body.wm-page .wm-wrap .ks-mpl-head .ks-mpl-titlerow { padding: 0 !important; }
    /* поиск/каталог масел и досок: те же поля, что на главной раздела (было 16+16) */
    html body .container-page .new-container.td-wizard-shell:has(main.om-main.ks-mpl):not(#ks-mpl-x):not(#ks-mpl-y) { padding-left: 0 !important; padding-right: 0 !important; }
}
