/* Дополнения v2 к base.css (base.css собран из sass и не правится руками) */

.item-card-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 16px;
}

/* Селектор длиннее, чем .item-card img в base.css: иначе миниатюры растягиваются на мобильных */
.item-card .item-card-gallery img {
    width: 64px;
    height: 64px;
    max-width: none;
    margin: 0;
    object-fit: contain;
    border: 1px solid #e0e0e0;
    cursor: pointer;
}

/* Модели двигателей в карточке идут строкой, а не столбцом, как остальные ссылки блока */
.item-card-usage .item-card-engines a {
    display: inline;
    margin: 0;
}

/* Описание приходит от завода одним куском, в шаблоне оно разбито на абзацы по предложениям.
   Свернуто до 6 строк, разворачивается стрелкой; селектор длиннее .item-card-usage div, иначе блок получит его фон */
.item-card-usage div.item-card-description {
    position: relative;
    /* 6 строк текста плюс отступы между абзацами */
    max-height: calc(9em + 16px);
    max-height: calc(6lh + 16px);
    margin: 16px 0 0;
    padding: 0;
    overflow: hidden;
    line-height: 1.5;
}

.item-card-usage div.item-card-description p {
    margin: 0 0 8px;
    text-align: left;
}

/* Затухание последней строки подсказывает, что текст обрезан */
.item-card-usage div.item-card-description::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1em;
    background: linear-gradient(rgba(237, 242, 247, 0), #edf2f7);
}

.description-more {
    display: block;
    margin: 0 0 16px;
    color: #075095;
    font-size: 22px;
    text-align: center;
    cursor: pointer;
}

.description-more i {
    display: inline-block;
    transform: rotate(-90deg);
    transition: transform 0.15s ease-out;
}

.description-more-toggle:checked + .item-card-description {
    max-height: none;
}

.description-more-toggle:checked + .item-card-description::after,
.item-card-usage div.item-card-description-short::after,
.item-card-description-short + .description-more {
    display: none;
}

.item-card-usage div.item-card-description-short {
    margin-bottom: 8px;
}

.description-more-toggle:checked ~ .description-more i {
    transform: rotate(90deg);
}

/* Логотип бренда в строке «Производитель»: селектор длиннее .item-card img, иначе он растягивается как фото */
.item-card .item-card-props .item-card-brand-logo {
    display: block;
    width: auto;
    height: 20px;
    max-width: 120px;
    margin: 0 0 4px auto;
    border: none;
}

/* Карточки марок на главной: светлые, строки категорий слева, количество бейджем справа.
   Сетку раскладки дает .index-browser-inner из base.css, здесь только сама карточка */
.maker-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-top: 3px solid #1d5f9e;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(31, 42, 54, 0.12);
    overflow: hidden;
}

.maker-card-head {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    padding: 16px 24px 8px;
    text-decoration: none;
}

.maker-card-head img {
    max-width: 100%;
    max-height: 72px;
}

.maker-card-name {
    font-size: 2.6rem;
    font-weight: 600;
    color: #384450;
    letter-spacing: 0.02em;
    text-align: center;
}

.maker-card-total {
    margin: 0 0 8px;
    text-align: center;
    font-size: 1.4rem;
    color: #6b7a8c;
}

.maker-card-list {
    flex-grow: 1;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid #e3e9ef;
}

.maker-card-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid #eef2f6;
    color: #1f2a36;
    font-size: 1.5rem;
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    transition: background 0.1s ease-out;
}

.maker-card-list a:hover {
    background: #eef4fa;
    color: #1d5f9e;
}

.maker-card-count {
    flex-shrink: 0;
    min-width: 32px;
    padding: 2px 8px;
    border-radius: 10px;
    background: #eef2f6;
    color: #384450;
    font-size: 1.3rem;
    text-align: center;
}

.maker-card-all {
    padding: 12px 20px;
    color: #1d5f9e;
    font-size: 1.4rem;
    text-align: right;
    text-decoration: none;
}

.maker-card-all:hover {
    text-decoration: underline;
}

/* Каталог: остальные марки скрыты, пока не нажали «Еще марки» */
.category-more-toggle:not(:checked) + .category-makers .category-makers-extra,
.category-more-toggle:not(:checked) + .category-makers .category-more-hide,
.category-more-toggle:checked + .category-makers .category-more-show {
    display: none;
}

.items .categories .category-more label {
    display: block;
    margin: 0 0 4px;
    padding: 14px 20px;
    background: #fff;
    color: #1d5f9e;
    font-size: 1.5rem;
    text-align: right;
    cursor: pointer;
    box-shadow: -1px -1px 2px 0 rgba(0, 0, 0, 0.09), 2px 2px 1px -2px rgba(0, 0, 0, 0.09), 2px 2px 1px 0 rgba(0, 0, 0, 0.1);
}

.items .categories .category-more label:hover {
    text-decoration: underline;
}

/* Плитки категорий на десктопе: ширина по тексту, подпись в одну строку, лишние плитки уходят в следующий ряд.
   В base.css ширина подписи ограничена 110px под короткие названия классов v1 */
@media (min-width: 992px) {
    .items .category-classes {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 4px;
    }

    .items .category-classes li {
        margin: 0;
    }

    .items .category-classes li a {
        height: 100%;
    }

    .items .category-classes li a span {
        max-width: none;
        padding-right: 16px;
        white-space: nowrap;
    }

    .items .category-classes li a i {
        font-size: 24px;
        margin: 12px 12px 12px 14px;
    }
}

/* Плитки категорий на планшете и телефоне: в v1 у классов были разные иконки и подписи скрывались,
   у категорий завода иконки одинаковые, поэтому подписи нужны. Лента прокручивается вбок */
@media (max-width: 991px) {
    .items .category-classes {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .items .category-classes li {
        flex-shrink: 0;
    }

    .items .category-classes li a span {
        display: inline;
        max-width: none;
        padding-right: 14px;
        white-space: nowrap;
    }

    .items .category-classes li a i {
        font-size: 22px;
        margin: 10px 10px 10px 12px;
    }
}

/* Марки на телефоне: компактные чипы в несколько строк вместо столбца на весь экран */
@media (max-width: 767px) {
    .items .categories > .category-group > .category-makers {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 6px;
    }

    .items .categories > .category-group > .category-makers a {
        margin: 0;
        padding: 0 14px;
    }

    .items .categories > .category-group > .category-makers a div {
        display: none;
    }

    .items .categories > .category-group > .category-makers a span {
        line-height: 36px;
    }

    .items .categories > .category-group > .category-makers a.category-makers-current {
        background: #075095;
        color: #fff;
    }

    .items .categories > .category-group > .category-makers a.category-makers-current:after,
    .items .categories > .category-group > .category-makers a:hover:after {
        display: none;
    }

    .items .categories .category-more label {
        margin: 0;
        padding: 0 14px;
        line-height: 36px;
    }
}

/* Хлебные крошки в одну строку: длинные звенья обрезаются многоточием, полное название во всплывающей подсказке.
   Без этого длинный путь до товара переносился по словам и вылезал из полосы шапки */
#header-bottom .breadcrumbs {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

/* Ссылка на главную не сжимается: иначе она уже значка дома, и первая стрелка наезжает на него */
#header-bottom .breadcrumbs > a:first-child {
    flex-shrink: 0;
    min-width: auto;
}

/* Промежуточные звенья не сжимаются (длинные ограничены шириной ссылки), сжимается последнее: название товара */
#header-bottom .breadcrumbs > span {
    flex: 0 0 auto;
}

#header-bottom .breadcrumbs > span:last-child {
    flex: 1 1 auto;
    min-width: 100px;
}

#header-bottom .breadcrumbs a {
    min-width: 0;
    max-width: 160px;
}

#header-bottom .breadcrumbs .breadcrumbs-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1199px) {
    #header-bottom .breadcrumbs a {
        max-width: 110px;
    }
}

/* Карточка товара: характеристики шире за счет фото, иначе артикул и значения переносятся по слогам */
@media (min-width: 1200px) {
    .item-card {
        grid-template-columns: 300px 380px auto;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .item-card {
        grid-template-columns: 260px 360px auto;
    }
}

/* Фото с галереей в одной обертке, чтобы миниатюры стояли сразу под фото, а не под всей строкой сетки.
   На узких экранах обертка встает в ячейку фото из base.css */
.item-card .item-card-media {
    grid-row: 2;
    grid-column: 1;
}

.item-card .item-card-media img#item-card-image {
    display: block;
    width: 100%;
}

/* Правая колонка (описание, применяемость) растет вниз через строки 2-4, а цена стоит строкой 3
   сразу под характеристиками. Строка 4 гибкая: высоту правой колонки забирает она, а не строки 2-3 */
@media (min-width: 992px) {
    .item-card {
        grid-template-rows: auto auto auto 1fr auto;
        row-gap: 24px;
    }

    .item-card .item-card-media {
        display: block;
        grid-row: 2 / 4;
        grid-column: 1;
    }

    .item-card .item-card-usage {
        grid-row: 2 / 5;
    }

    .item-card .item-card-kit {
        grid-row: 5;
    }

    /* В колонку характеристик три кнопки в ряд не помещаются: цена и наличие строкой, «Подробнее» под ними */
    .item-card .item-card-actions {
        grid-row: 3;
        grid-column: 2;
        grid-template-columns: 1fr 1fr;
        grid-template-areas: 'price instock' 'buy buy';
        gap: 8px;
        align-self: start;
        margin: 0;
    }

    .item-card .item-card-actions span {
        height: 44px;
        border-radius: 5px;
    }

    .item-card .item-card-actions span.item-card-actions-price {
        grid-area: price;
    }

    .item-card .item-card-actions span.item-card-actions-instock {
        grid-area: instock;
        gap: 6px;
    }

    .item-card .item-card-actions span.item-card-actions-buy {
        grid-area: buy;
    }

    /* Растягивание кнопки на всю тройку из base.css в этой раскладке ломает ряд */
    .item-card .item-card-actions span.item-card-actions-buy:hover {
        width: auto;
        padding: 2px 0;
        transform: none;
        background: #174d80;
    }

    .item-card .item-card-usage {
        grid-row: 2 / 5;
    }

    .item-card .item-card-kit {
        grid-row: 5;
    }
}

.item-card .item-card-props li i {
    font-size: 40px;
}

/* base.css ставит каждый ряд в одну ячейку (строка 2), и «Аналоги» с соседним рядом накладываются друг на друга.
   Без явной строки ряды встают в колонке по очереди */
.item .item-related {
    grid-row: auto;
}

/* Ряды «Аналоги» и «Для этого двигателя»: лента карточек одной ширины, листается вбок пальцем и прокруткой.
   Карточки одной высоты, фото и цена на одном уровне во всех карточках */
.item .item-related > .item-related-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 210px;
    gap: 16px;
    padding-bottom: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
    .item .item-related > .item-related-row {
        grid-auto-columns: 62%;
        padding: 0 16px 12px;
        scroll-padding: 0 16px;
        scrollbar-width: none;
    }
}

/* base.css на узких экранах прячет карточки после второй-четвертой, в ленте нужны все */
.item .item-related > .item-related-row > a:nth-child(n) {
    display: block;
    scroll-snap-align: start;
    text-decoration: none;
}

.item .item-related h2 {
    font-size: 2.6rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.item .item-related .item-related-card {
    box-sizing: border-box;
    height: 100%;
    min-width: 0;
    justify-content: flex-start;
}

.item .item-related .item-related-card img {
    width: 100%;
    height: 180px;
    max-height: none;
    margin: 12px 0;
}

/* Категория одной строкой и тише названия: в ряду она обычно у всех одна и та же */
.item .item-related .item-related-card p:first-child {
    height: auto;
    overflow: hidden;
    color: #6b7a8c;
    font-size: 1.3rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Название до трех строк, чтобы длинные названия не растягивали карточку. Обрезка на span внутри абзаца:
   overflow абзаца режет по краю его отступа, и из-под многоточия выглядывала четвертая строка */
.item .item-related .item-related-card p:last-child {
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Селектор длиннее .item-related-card span:last-child из base.css: там цвет и отступы для цены */
.item .item-related .item-related-card .item-related-name {
    display: -webkit-box;
    padding: 0;
    color: inherit;
    font-weight: inherit;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* Окно заявки на звонок (React-виджет Callback). В base.css шапка окна на сетке с жесткой высотой строк:
   длинное название вылезает из строки, а фото на все три строки наезжает на цену и наличие.
   Здесь строки по содержимому: название и фото сверху, цена и наличие на всю ширину под ними */
.overlay .overlay-callback {
    box-sizing: border-box;
    width: calc(100% - 32px);
    max-width: 440px;
    height: auto;
    max-height: calc(100% - 32px);
}

.overlay .overlay-callback-context {
    box-sizing: border-box;
    max-height: 100%;
    margin: 0;
    padding: 24px;
    overflow-y: auto;
}

.overlay .overlay-callback-context-item {
    grid-template-columns: minmax(0, 1fr) 96px;
    grid-template-rows: auto auto auto;
    column-gap: 16px;
    justify-items: stretch;
    align-items: start;
}

.overlay .overlay-callback-context-item h2 {
    display: -webkit-box;
    grid-row: 1;
    grid-column: 1;
    align-self: center;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.3;
}

.overlay .overlay-callback-context-item img {
    box-sizing: border-box;
    grid-row: 1;
    grid-column: 2;
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.overlay .overlay-callback-context-item p:nth-child(2),
.overlay .overlay-callback-context-item p:nth-child(3) {
    box-sizing: border-box;
    grid-column: 1 / 3;
    align-self: stretch;
    margin: 0;
    padding: 10px 0;
    font-size: 1.6rem;
}

.overlay .overlay-callback-context-item p:nth-child(2) {
    margin-top: 16px;
    border-top: 1px solid #c3c3c3;
}

.overlay .overlay-callback-context-item p span {
    padding: 0;
}

.overlay .overlay-callback-context-form p {
    margin: 20px 0 12px;
    font-size: 1.5rem;
}

/* Поля и кнопка во всю ширину, как строки цены и наличия над ними */
.overlay .overlay-callback-context-form div input {
    box-sizing: border-box;
    width: 100%;
    margin: 5px 0;
}

.overlay .overlay-callback-context-form div i {
    right: 16px;
}

.overlay .overlay-callback-context-form-button {
    margin: 5px 0;
}

/* Страница «О нашей продукции»: раздел на каждую верхнюю категорию каталога.
   Сверху фото и ссылки на все подкатегории с товарами, ниже блоки подкатегорий с описанием из админки */
.classes .overview-section {
    grid-column: 2;
    padding: 24px 32px 32px;
    background: #fff;
    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.09), 3px 3px 1px -2px rgba(0, 0, 0, 0.09), 0 1px 5px 0 rgba(0, 0, 0, 0.1);
}

.overview-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid gainsboro;
}

.overview-head h2 {
    margin: 0;
    font-size: 2.6rem;
    font-weight: 400;
}

.overview-head h2 a {
    color: #1f2a36;
    text-decoration: none;
}

.overview-head h2 a:hover {
    color: #1d5f9e;
}

.overview-all {
    flex-shrink: 0;
    color: #1d5f9e;
    font-size: 1.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.overview-all i {
    margin-left: 6px;
    font-size: 1rem;
}

.overview-all:hover {
    text-decoration: underline;
}

.overview-intro,
.overview-feature {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    margin-top: 24px;
}

.overview-intro img,
.overview-feature img {
    width: 100%;
    height: 220px;
    object-fit: contain;
}

/* Без картинки текст и ссылки занимают всю ширину раздела */
.overview-intro > div:only-child,
.overview-feature > div:only-child {
    grid-column: 1 / -1;
}

.overview-feature {
    padding-top: 24px;
    border-top: 1px solid #eef2f6;
}

.overview-feature h3 {
    margin: 0 0 12px;
    font-size: 2rem;
    font-weight: 400;
}

.overview-feature h3 a {
    color: #1f2a36;
    text-decoration: none;
}

.overview-feature h3 a:hover {
    color: #1d5f9e;
}

.overview-about {
    margin: 0 0 16px;
    font-size: 1.5rem;
    line-height: 1.6;
}

.overview-links-title {
    margin: 0 0 10px;
    color: #6b7a8c;
    font-size: 1.4rem;
}

.overview-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.overview-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    background: #eef2f6;
    color: #1f2a36;
    font-size: 1.4rem;
    text-decoration: none;
    transition: background 0.1s ease-out;
}

.overview-links a:hover {
    background: #dde7f1;
    color: #1d5f9e;
}

.overview-links a span {
    padding: 1px 7px;
    border-radius: 10px;
    background: #fff;
    color: #6b7a8c;
    font-size: 1.2rem;
}

@media (max-width: 767px) {
    .classes .overview-section {
        padding: 20px 16px 24px;
    }

    .overview-head {
        flex-direction: column;
        gap: 4px;
    }

    .overview-intro,
    .overview-feature {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .overview-intro img,
    .overview-feature img {
        height: 180px;
    }
}

/* Сброс типа нужен только в ленте на телефоне, на широком экране есть плитка «Показать все» */
.items .category-classes .category-classes-reset {
    display: none;
}

/* Каталог на телефоне: марка и двигатель в шторке снизу, над товарами только панель фильтров
   и лента типов детали, лента прилипает к верху экрана при прокрутке */
.catalog-filters-bar,
.catalog-filters-backdrop,
.catalog-filters-head {
    display: none;
}

@media (max-width: 767px) {
    /* hidden у body делает его контейнером прокрутки, и sticky у ленты не срабатывает; clip режет так же, но без этого */
    html,
    body {
        overflow-x: clip;
    }

    .items .makers-all p,
    .items .items-all {
        display: none;
    }

    /* Без картинки: на узком экране заголовок в две строки ложился на темную часть фото и не читался */
    .items .makers-all {
        height: auto;
        margin: 0;
        background: none;
        box-shadow: none;
    }

    .items .makers-all h1 {
        padding: 4px 16px;
        color: #2b2a28;
        font-size: 18px;
        font-weight: 400;
        line-height: 24px;
    }

    .items .catalog-filters-bar {
        display: flex;
        grid-column: 2/4;
        grid-row: 2;
        background: #fff;
        border: 1px solid #d5dbe2;
    }

    .catalog-filters-field {
        flex: 1;
        min-width: 0;
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        padding: 10px 16px;
        cursor: pointer;
    }

    .catalog-filters-field-caption {
        grid-column: 1;
        color: #8a939c;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .catalog-filters-field-value {
        grid-column: 1;
        overflow: hidden;
        color: #2b2a28;
        font-size: 16px;
        line-height: 22px;
        font-weight: 600;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .catalog-filters-field i {
        grid-column: 2;
        grid-row: 1/3;
        color: #075095;
        font-size: 16px;
        transform: rotate(-90deg);
    }

    .catalog-filters-reset {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        border-left: 1px solid #d5dbe2;
        color: #8a939c;
        font-size: 26px;
    }

    /* Лента типов: таблетки одного стиля с полем выше, выбранная залита синим */
    .items .category-classes {
        grid-column: 2/4;
        grid-row: 3;
        position: sticky;
        top: 0;
        z-index: 5;
        align-self: start;
        gap: 6px;
        padding: 8px 0;
        background: #edf1f5;
        scrollbar-width: none;
    }


    .items .category-classes li,
    .items .category-classes li:hover {
        margin: 0;
        border: 1px solid #d5dbe2;
        border-radius: 18px;
        background: #fff;
        box-shadow: none;
    }

    .items .category-classes li.category-classes-current {
        border-color: #075095;
        background: #075095;
    }

    .items .category-classes li a {
        padding: 0 16px;
        color: #2b2a28;
        line-height: 34px;
    }

    .items .category-classes li.category-classes-current a {
        color: #fff;
    }

    .items .category-classes li a i {
        display: none;
    }

    .items .category-classes .category-classes-reset {
        display: block;
    }

    .items .category-classes li a span {
        padding: 0;
        font-size: 15px;
        line-height: 38px;
    }

    .items .categories {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        max-height: 80vh;
        overflow-y: auto;
        padding: 0 16px 24px;
        background: #f4f4f4;
        transform: translateY(100%);
        transition: transform 0.2s;
    }

    .catalog-filters-toggle:checked ~ .categories {
        transform: none;
    }

    .items .catalog-filters-head {
        display: flex;
        justify-content: space-between;
        position: sticky;
        top: 0;
        margin: 0 -16px 12px;
        padding: 0 16px;
        line-height: 56px;
        background: #fff;
        font-size: 18px;
        font-weight: 600;
    }

    /* Действие, а не выбранный пункт: контурная кнопка, чтобы не путать с подсветкой текущего двигателя */
    .catalog-filters-all {
        display: block;
        margin: 8px 0;
        border: 1px solid #075095;
        background: #fff;
        color: #075095;
        border-radius: 23px;
        line-height: 46px;
        text-align: center;
        font-size: 15px;
    }

    /* В шторке заголовки групп просто подписи, а марки таблетки как у типов детали */
    .items .categories .category-group .category-caption {
        margin: 16px 0 8px;
        padding: 0;
        background: none;
        box-shadow: none;
        color: #8a939c;
        font-size: 13px;
        letter-spacing: 0.04em;
        line-height: 1.4;
        text-align: left;
    }

    .items .categories > .category-group > .category-makers li {
        margin: 0;
        box-shadow: none;
    }

    .items .categories > .category-group > .category-makers a {
        border: 1px solid #d5dbe2;
        border-radius: 18px;
        background: #fff;
        box-shadow: none;
    }

    .items .categories > .category-group > .category-makers a.category-makers-current {
        border-color: #075095;
    }

    .items .categories > .category-group > .category-makers a span {
        line-height: 38px;
        font-size: 15px;
    }

    .items .categories .category-more,
    .items .categories .category-more label {
        background: none;
        box-shadow: none;
    }

    .items .categories .category-more label {
        font-size: 15px;
        line-height: 38px;
    }

    /* Двигатели строками повыше под палец: подпись «Двигатель» вторична, номер главный */
    .items .categories .category-engines li a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 48px;
        padding: 0 16px;
    }

    .items .categories .category-engines li a span {
        font-size: 13px;
        color: #8a939c;
    }

    .items .categories .category-engines li a span:nth-child(2) {
        font-size: 16px;
        color: #2b2a28;
    }

    /* На синей плашке «Выбрано» и темной строке текущего двигателя текст белый */
    .items .categories .category-engines li a.category-engines-current span,
    .items .categories .category-engines li a.category-engines-clear span {
        color: rgba(255, 255, 255, 0.75);
    }

    .items .categories .category-engines li a.category-engines-current span:nth-child(2),
    .items .categories .category-engines li a.category-engines-clear span:nth-child(2) {
        color: #fff;
    }

    .catalog-filters-head label {
        width: 56px;
        margin-right: -16px;
        text-align: center;
        font-size: 30px;
        font-weight: 400;
        color: #5c6670;
        cursor: pointer;
    }

    .catalog-filters-toggle:checked ~ .catalog-filters-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: rgba(0, 0, 0, 0.4);
    }

    .items .list {
        grid-row: 4;
    }
}

/* Шапка на телефоне в одну строку: логотип, телефон, бургер; плитки меню раскрываются бургером.
   Исходная шапка с плитками занимала почти весь первый экран */
.menu-toggle-button {
    display: none;
}

@media (max-width: 767px) {
    header {
        background: #161616;
        grid-template-areas: "c-t" "m-h" "h-b";
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    header .contacts-top {
        flex-direction: row;
        justify-content: space-between;
        gap: 0;
        padding: 8px 4px 8px 16px;
    }

    header .contacts-top .logo-a-odd {
        display: none;
    }

    header .contacts-top .logo-a-xs {
        display: block;
        margin-right: auto;
    }

    /* Логотип без плашки, цветом иконок шапки: глиф-параллелограмм на узкой шапке смотрелся мелко.
       Буквы и поршень из того же глифа, строки сближены, поршень по высоте двух строк */
    header .contacts-top {
        padding: 0 4px 0 16px;
        background: none;
    }

    header .contacts-top .logo-a-xs {
        width: 224px;
        height: 56px;
        background: url("/static/img/elems/logo_mobile.78a3da87f700.svg") left center / auto 28px no-repeat;
    }

    header .contacts-top > a.logo-a-xs i {
        display: none;
    }

    header .contacts-top p {
        flex-shrink: 0;
        margin: 0;
        font-size: 15px;
    }

    header .contacts-top .logo-a-xs {
        min-width: 0;
        overflow: hidden;
    }

    .menu-toggle-button {
        flex-shrink: 0;
    }

    #header-bottom .search input,
    #header-bottom .search input:focus {
        height: 44px;
        font-size: 14px;
    }

    #header-bottom {
        background: #232323;
    }

    #header-bottom .search input::placeholder {
        text-transform: none;
    }

    header .contacts-top p a {
        display: none;
    }

    header .contacts-top p a[href^="tel:"] {
        display: block;
    }

    /* Телефон иконкой: номер целиком не помещается рядом с крупным логотипом, звонок по тапу остается */
    header .contacts-top p a[href^="tel:"] span {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        font-size: 0;
    }

    /* Залитая трубка вместо контурного мобильника из шрифта: тонкие линии на темной шапке не читались */
    header .contacts-top p a[href^="tel:"] span {
        background: url("/static/img/elems/phone_call.2aece9511fe0.svg") center / 24px no-repeat;
    }

    header .contacts-top p a[href^="tel:"] span i {
        display: none;
    }

    .menu-toggle-button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 48px;
        cursor: pointer;
    }

    .menu-toggle-button span,
    .menu-toggle-button span::before,
    .menu-toggle-button span::after {
        display: block;
        position: relative;
        width: 22px;
        height: 2px;
        background: rgba(255, 255, 255, 0.81);
    }

    .menu-toggle-button span::before,
    .menu-toggle-button span::after {
        content: '';
        position: absolute;
    }

    .menu-toggle-button span::before {
        top: -7px;
    }

    .menu-toggle-button span::after {
        top: 7px;
    }

    header .menu-header {
        display: none;
    }

    .menu-toggle:checked + .menu-header {
        display: flex;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.68);
    }

    .menu-toggle:checked + .menu-header a {
        justify-content: flex-start;
        width: 100%;
        padding: 0 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .menu-toggle:checked + .menu-header a div {
        flex-direction: row;
        align-items: center;
        gap: 14px;
        height: 52px;
    }

    .menu-toggle:checked + .menu-header a div span {
        width: auto;
        text-align: left;
    }

    .menu-toggle:checked + .menu-header a div span:nth-child(1) {
        width: 28px;
        margin: 0;
        font-size: 26px;
        text-align: center;
    }

    .menu-toggle:checked + .menu-header a div span:nth-child(2) {
        font-size: 15px;
    }
}

/* Номер двигателя вида 740.11-240 не рвется по дефису */
.nowrap {
    white-space: nowrap;
}

/* Подвал на телефоне: одна колонка во всю ширину, подпись раздела сверху, строки «название — значение».
   В base.css карточки фиксированной высоты 275px в колонке 235px, текст прижат вправо, подписи внизу */
@media (max-width: 767px) {
    footer {
        display: flex;
        flex-direction: column;
        padding: 8px 16px 0;
    }

    footer .footer-info-card {
        display: flex;
        flex-direction: column;
        margin: 0;
        padding: 20px 0;
        border-right: none;
        border-bottom: 1px solid #3a3a3a;
    }

    footer .footer-info-card:nth-child(4) {
        order: 1;
    }

    footer .footer-info-card:nth-child(2) {
        order: 2;
    }

    footer .footer-info-card:nth-child(3) {
        order: 3;
    }

    footer .footer-info-card:nth-child(1) {
        order: 4;
        border-bottom: none;
    }

    footer .footer-info-card span {
        justify-content: space-between;
        padding: 0;
        font-size: 15px;
        line-height: 30px;
    }

    footer .footer-info-card span mark {
        font-size: 15px;
    }

    footer .footer-info-card .footer-info-card-label {
        order: -1;
        margin-bottom: 8px;
        color: #7a7a7a;
        font-size: 12px;
        letter-spacing: 0.06em;
        line-height: 1.4;
    }

    footer .footer-info-card:nth-child(1) a {
        line-height: 36px;
    }

    footer .footer-info-company {
        order: 5;
        margin: 0 -16px;
        padding: 16px;
        font-size: 13px;
        line-height: 1.5;
    }
}

/* Пагинация в стиле фильтров: белые таблетки с рамкой, текущая страница залита синим, кнопки под палец 40px.
   В base.css все страницы были залиты синим, а текущая темной и выглядела неактивной */
.items .pagination {
    flex-wrap: wrap;
    gap: 6px;
    padding: 16px 0;
}

.items .pagination a {
    display: block;
}

.items .pagination span,
.items .pagination span:hover {
    box-sizing: border-box;
    min-width: 40px;
    width: auto;
    height: 40px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid #d5dbe2;
    border-radius: 20px;
    background: #fff;
    color: #2b2a28;
    font-size: 15px;
    line-height: 38px;
    text-align: center;
}

.items .pagination a:hover span {
    border-color: #075095;
    color: #075095;
}

.items .pagination span.pagination-current,
.items .pagination a:hover span.pagination-current {
    border-color: #075095;
    background: #075095;
    color: #fff;
}

.items .pagination i.icon-c-arrow-b {
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    border: 1px solid #d5dbe2;
    border-radius: 50%;
    background: #fff;
    color: #2b2a28;
    font-size: 12px;
    line-height: 38px;
}

.items .pagination a:hover i.icon-c-arrow-b {
    border-color: #075095;
    color: #075095;
}

.items .pagination i.pagination-arrow-inactive {
    opacity: 0.4;
}

.items .pagination > i:not([class]) {
    width: auto;
    color: #8a939c;
}

/* Строка пагинации в base.css фиксирована на 50px, кнопкам 40px с отступами в ней тесно */
.items {
    grid-template-rows: repeat(4, auto);
}

@media (max-width: 767px) {
    .items {
        grid-template-rows: repeat(5, auto);
    }
}

/* Белые таблетки на светлом фоне сливались: рамка темнее и легкая тень */
.items .pagination span,
.items .pagination span:hover,
.items .pagination i.icon-c-arrow-b {
    border-color: #b8c2cc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 767px) {
    .items .category-classes li,
    .items .category-classes li:hover {
        border-color: #b8c2cc;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
}

/* Типы детали на планшете и десктопе тоже таблетками, как на телефоне: темные плитки с иконками были тяжелыми.
   Плитку «Показать все» заменяет первая таблетка ленты */
@media (min-width: 768px) {
    .items .items-all {
        display: none;
    }

    /* Без плитки «Показать все» сайдбар начинается вровень с лентой типов. Лишняя высота длинного сайдбара
       уходит в строку товаров, иначе при паре товаров растягивается строка ленты и все съезжает вниз */
    .items {
        grid-template-rows: auto auto 1fr auto;
    }

    .items .categories {
        grid-row: 2/4;
    }

    .items .category-classes,
    .items .list {
        align-self: start;
    }

    .items .category-classes {
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
    }

    .items .category-classes .category-classes-reset {
        display: block;
    }

    .items .category-classes li,
    .items .category-classes li:hover {
        margin: 0;
        border: 1px solid #b8c2cc;
        border-radius: 20px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .items .category-classes li:hover {
        border-color: #075095;
    }

    .items .category-classes li.category-classes-current {
        border-color: #075095;
        background: #075095;
    }

    .items .category-classes li a {
        height: auto;
        padding: 0 18px;
        color: #2b2a28;
    }

    .items .category-classes li.category-classes-current a {
        color: #fff;
    }

    .items .category-classes li a i {
        display: none;
    }

    .items .category-classes li a span {
        padding: 0;
        font-size: 15px;
        line-height: 40px;
    }
}

/* Якорь прокрутки после выбора фильтра: пустой элемент сетки в строке ленты типов, на телефоне в строке заголовка */
.items .catalog-anchor {
    grid-column: 3;
    grid-row: 2;
    align-self: start;
    scroll-margin-top: 16px;
}

@media (max-width: 767px) {
    .items .catalog-anchor {
        grid-column: 2/4;
        grid-row: 1;
        scroll-margin-top: 8px;
    }
}

/* Первым в сайдбаре стоит скрытая шапка шторки, поэтому правило base.css для первой группы не срабатывает */
.items .categories .catalog-filters-head + .category-group {
    margin-top: 0;
}

/* Выбранные марка и двигатель вверху сайдбара на широком экране, на телефоне их показывает поле фильтров */
.catalog-filters-selected {
    display: none;
}

@media (min-width: 768px) {
    .items .categories .catalog-filters-selected {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin-bottom: 20px;
    }

    .items .categories .catalog-filters-head + .catalog-filters-selected + .category-group {
        margin-top: 0;
    }

    /* Строка «подпись, значение, крестик»: залита синим как выбранное, ширина как у пунктов сайдбара */
    .catalog-filters-selected a {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 42px;
        margin-right: 10px;
        padding: 0 0 0 16px;
        border-radius: 4px;
        background: #075095;
        color: #fff;
        transition: background 0.1s ease-out;
    }

    .catalog-filters-selected a:hover {
        background: #2b2a28;
    }

    .catalog-filters-selected a span {
        color: rgba(255, 255, 255, 0.7);
        font-size: 13px;
    }

    .catalog-filters-selected a strong {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        font-size: 15px;
        font-weight: 600;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .catalog-filters-selected a i {
        width: 44px;
        color: #fff;
        font-size: 18px;
        font-style: normal;
        line-height: 42px;
        text-align: center;
    }
}

/* Светлая полоса под заголовком нарисована на картинке баннера и короче длинных заголовков с номером двигателя */
@media (min-width: 768px) {
    .items .makers-all h1 {
        background: rgba(237, 242, 247, 0.92);
    }
}

/* Поля по краям каталога на телефоне: в base.css боковые колонки сетки схлопываются в ноль */
@media (max-width: 767px) {
    .items {
        grid-template-columns: 16px 0 minmax(0, 1fr) 16px;
        column-gap: 0;
    }

    .items .makers-all h1 {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Карточка товара в списке: фото в окне фиксированной высоты, поэтому цена и наличие на одной линии по ряду.
   В base.css карточка ограничена 434px, длинное название вылезало за нижний край */
.items .list-card {
    justify-content: flex-start;
    max-height: none;
}

.items .list-card img {
    box-sizing: border-box;
    width: 100%;
    height: 240px;
    max-height: none;
    padding: 12px;
    object-fit: contain;
}

.items .list-card h2 {
    display: -webkit-box;
    margin: 12px 0 16px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.items .list-card h2 span {
    display: block;
}

@media (max-width: 767px) {
    .items .list-card img {
        height: 260px;
    }
}

/* Блок цены: цена крупным текстом, наличие спокойной плашкой, заказ основной синей кнопкой.
   В base.css три разноцветных плитки (графит, синий, серо-голубой) спорили друг с другом */
.item-card .item-card-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: 'price instock' 'buy buy';
    align-items: center;
    gap: 12px;
    margin: 0;
    box-shadow: none;
}

.item-card .item-card-actions span,
.item-card .item-card-actions span:hover {
    height: auto;
    border-radius: 6px;
    box-shadow: none;
}

.item-card .item-card-actions span.item-card-actions-price {
    grid-area: price;
    justify-content: flex-start;
    padding: 0;
    background: none;
    color: #2b2a28;
    font-size: 28px;
    font-weight: 600;
}

.item-card .item-card-actions span.item-card-actions-instock {
    grid-area: instock;
    padding: 6px 12px;
    background: #e6f2ea;
    color: #1e6b3d;
    font-size: 14px;
    text-transform: none;
}

.item-card .item-card-actions span.item-card-actions-instock-off {
    background: #eef1f4;
    color: #5c6670;
}

.item-card .item-card-actions span.item-card-actions-buy,
.item-card .item-card-actions span.item-card-actions-buy:hover {
    grid-area: buy;
    width: auto;
    padding: 0;
    transform: none;
    font-size: 15px;
    line-height: 48px;
}

.item-card .item-card-actions span.item-card-actions-buy {
    background: #075095;
}

.item-card .item-card-actions span.item-card-actions-buy:hover {
    background: #2b2a28;
}

/* Фото товара на телефоне: лента, которая листается пальцем, вместо главного фото и миниатюр.
   Край следующего фото виден справа, чтобы было понятно, что ленту можно листать */
@media (max-width: 767px) {
    .item-card .item-card-media:has(.item-card-gallery) #item-card-image {
        display: none;
    }

    .item-card .item-card-gallery {
        flex-wrap: nowrap;
        gap: 8px;
        margin: 0;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .item-card .item-card-gallery::-webkit-scrollbar {
        display: none;
    }

    .item-card .item-card-gallery img {
        flex: 0 0 86%;
        width: auto;
        height: 280px;
        scroll-snap-align: start;
        cursor: default;
    }
}

/* Форма покупки: ошибка телефона красным вместо подсказки, телефон магазина для тех, кто не хочет ждать звонка */
.overlay .overlay-callback-context-form .overlay-callback-context-form-errors.is-error {
    color: #c0392b;
}

.overlay .overlay-callback-context-form .overlay-callback-context-form-call {
    margin: 4px 0 0;
    text-align: center;
    font-size: 15px;
}

.overlay .overlay-callback-context-form .overlay-callback-context-form-call a {
    color: #075095;
    font-weight: 600;
    white-space: nowrap;
}

.overlay .overlay-callback-context-form .overlay-callback-context-form-button {
    background: #075095;
}

.overlay .overlay-callback-context-form .overlay-callback-context-form-button:hover {
    background: #2b2a28;
}

/* Окно покупки целиком: размеры в px, на телефоне базовый rem в base.css ужат до 8px и текст мельчал.
   Цена главная, наличие плашкой как в карточке, поля белые с рамкой, согласие на обработку данных мелким серым */
.overlay .overlay-callback-context {
    border-radius: 8px;
}

.overlay .overlay-callback-context-item h2 {
    color: #2b2a28;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.overlay .overlay-callback-context-item img {
    border: 1px solid #e1e6eb;
    border-radius: 6px;
}

.overlay .overlay-callback-context-item p:nth-child(2),
.overlay .overlay-callback-context-item p:nth-child(3) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e1e6eb;
    color: #5c6670;
    font-size: 15px;
}

.overlay .overlay-callback-context-item p:nth-child(2) {
    border-top: 1px solid #e1e6eb;
}

.overlay .overlay-callback-context-item p:nth-child(2) span:nth-child(2) {
    color: #2b2a28;
    font-size: 22px;
    font-weight: 600;
}

.overlay .overlay-callback-context-item p:nth-child(3) span:nth-child(2) {
    padding: 4px 10px;
    border-radius: 6px;
    background: #e6f2ea;
    color: #1e6b3d;
    font-size: 14px;
    font-weight: 400;
}

.overlay .overlay-callback-context-form p.overlay-callback-context-form-errors {
    min-height: 0;
    margin: 20px 0 12px;
    color: #5c6670;
    font-size: 15px;
    line-height: 1.45;
    text-align: left;
}

.overlay .overlay-callback-context-form div input {
    height: 48px;
    margin: 0 0 10px;
    padding: 0 14px;
    border: 1px solid #b8c2cc;
    border-radius: 6px;
    background: #fff;
    color: #2b2a28;
    font-size: 16px;
}

.overlay .overlay-callback-context-form div input:focus {
    border-color: #075095;
    outline: none;
    box-shadow: 0 0 0 3px rgba(7, 80, 149, 0.15);
}

.overlay .overlay-callback-context-form .overlay-callback-context-form-button {
    width: 100%;
    height: 48px;
    margin: 4px 0 0;
    padding: 0;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.overlay .overlay-callback-context-form .overlay-callback-context-form-call {
    margin: 14px 0 0;
    color: #5c6670;
    font-size: 15px;
}

.overlay .overlay-callback-context-form .overlay-callback-context-form-notice {
    margin: 16px 0 0;
    color: #9aa3ac;
    font-size: 12px;
    line-height: 1.4;
}

.overlay .overlay-callback-context-form .overlay-callback-context-form-notice a {
    color: inherit;
    text-decoration: underline;
}

.overlay .overlay-callback-context-form .overlay-callback-context-form-result {
    position: static;
    display: block;
    height: auto;
    padding: 20px 0 4px;
    background: none;
    color: #1e6b3d;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

/* Корневой размер шрифта на телефоне как на остальных экранах. base.css ужимал его до 8px, и весь текст в rem
   на телефоне выходил на 20% мельче: основной текст 12.8px, подписи 10-11px */
@media (max-width: 575px) {
    html {
        font-size: 10px;
    }
}

/* Заголовки на телефоне после возврата корневых 10px: крупные блоки главной до 30px,
   заголовки страниц 24px, подзаголовки 22px, иначе название из трех слов занимает пол-экрана */
@media (max-width: 575px) {
    .index-md-content h1,
    .index-features-content h2 {
        font-size: 30px;
        line-height: 1.2;
    }

    .index-tips-inner h2,
    .index-tips-inner h2 span {
        font-size: 24px;
        line-height: 1.25;
    }

    .item-card h1,
    .classes-title h1,
    .flatpage-body h1 {
        font-size: 24px;
        line-height: 1.25;
    }

    .flatpage-body h2,
    .flatpage-body caption h2,
    .flatpage-body form h2 {
        font-size: 22px;
        line-height: 1.25;
    }
}

@media (max-width: 575px) {
    main caption h2,
    main form h2 {
        font-size: 22px;
        line-height: 1.25;
    }
}

/* Карточки списка на телефоне: в base.css для узкого экрана увеличенные rem, после возврата корневых 10px
   название выходило 22px жирным, а строки цены 20px */
@media (max-width: 575px) {
    .items .list-card {
        font-size: 16px;
    }

    .items .list-card h2 {
        font-size: 17px;
        line-height: 1.35;
    }
}

/* Быстрый вход в каталог на главной, только на телефоне: кнопка каталога и популярные марки таблетками */
.index-quick {
    display: none;
}

@media (max-width: 767px) {
    .index-quick {
        display: block;
        padding: 16px 16px 20px;
        background: #edf1f5;
    }

    .index-quick-catalog {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 52px;
        padding: 0 20px;
        border-radius: 6px;
        background: #075095;
        color: #fff;
        font-size: 17px;
        font-weight: 600;
    }

    .index-quick-catalog:hover {
        color: #fff;
        background: #2b2a28;
    }

    .index-quick-caption {
        margin: 18px 0 8px;
        color: #8a939c;
        font-size: 13px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .index-quick-makers {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .index-quick-makers a {
        padding: 0 16px;
        border: 1px solid #b8c2cc;
        border-radius: 20px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        color: #2b2a28;
        font-size: 15px;
        line-height: 38px;
    }

    .index-quick-makers a.index-quick-all {
        border-color: transparent;
        background: none;
        box-shadow: none;
        color: #075095;
    }
}

/* Текстовые блоки главной на телефоне: без десктопных рамок 10px и боковых картинок, поля 16px как у остального,
   основной текст обычной толщины, тонкий 200 на маленьком экране читается плохо */
@media (max-width: 767px) {
    .index-md,
    .index-features {
        grid-template-columns: minmax(0, 1fr);
        border: none;
    }

    .index-md-l,
    .index-md-r,
    .index-features-l {
        display: none;
    }

    .index-md .index-md-content,
    .index-features .index-features-content {
        grid-column: 1;
        padding: 28px 16px 32px;
    }

    .index-md .index-md-content h1,
    .index-features .index-features-content h2 {
        font-size: 26px;
        font-weight: 300;
        line-height: 1.2;
    }

    .index-md .index-md-content p,
    .index-features .index-features-content p {
        margin: 16px 0 0;
        font-size: 16px;
        font-weight: 300;
        line-height: 1.55;
    }

    .index-md .index-md-content p:nth-child(2) {
        margin-top: 16px;
    }
}

/* Кнопки прокрутки ленты товаров для мыши. На сенсорных экранах ленту листают пальцем, кнопки не нужны */
.item .item-related {
    position: relative;
}

.item-related-scroll {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #b8c2cc;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #2b2a28;
    font-size: 26px;
    line-height: 40px;
    cursor: pointer;
}

.item-related-scroll:hover {
    border-color: #075095;
    color: #075095;
}

.item-related-scroll[hidden] {
    display: none;
}

.item-related-scroll-prev {
    left: -12px;
}

.item-related-scroll-next {
    right: -12px;
}

@media (hover: none) {
    .item-related-scroll {
        display: none;
    }
}

/* Хлебные крошки на телефоне: base.css их прятал, и из товара назад можно было уйти только через меню.
   Под поиском одна ссылка «← ближайший раздел»: весь путь в узкую строку не помещается и обрезается.
   Если раздела выше нет, остается ссылка на главную */
@media (max-width: 767px) {
    #header-bottom .breadcrumbs {
        display: flex;
        grid-row: 2;
        grid-column: 1 / -1;
        height: 40px;
        padding: 0 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        font-size: 14px;
        text-transform: none;
    }

    #header-bottom .breadcrumbs > span,
    #header-bottom .breadcrumbs > a:first-child:not(:nth-last-child(2)) {
        display: none;
    }

    #header-bottom .breadcrumbs > span:nth-last-child(2) {
        display: flex;
        flex: 1 1 auto;
        min-width: 0;
    }

    #header-bottom .breadcrumbs > span:nth-last-child(2) .icon-c-arrow {
        padding: 0 8px 0 0;
        font-size: 11px;
        transform: rotate(180deg);
    }

    #header-bottom .breadcrumbs > span:nth-last-child(2) a {
        max-width: none;
        min-width: 0;
        color: rgba(255, 255, 255, 0.8);
        text-transform: none;
    }

    #header-bottom .breadcrumbs > span:nth-last-child(2) a .breadcrumbs-text {
        text-transform: none;
    }

    #header-bottom .breadcrumbs .icon-c-address {
        font-size: 20px;
    }
}

@media (max-width: 767px) {
    #header-bottom .breadcrumbs .breadcrumbs-text::first-letter {
        text-transform: uppercase;
    }

    /* Серый блок описания и применяемости до краев экрана: внутри карточки с полями 20px он висел отдельной плашкой */
    .item-card .item-card-usage {
        margin: 0 -20px;
    }

    .item-card .item-card-usage > div {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* Значения под заголовками описания и ссылки «Другие детали» на телефоне по левому краю, как сами заголовки */
@media (max-width: 767px) {
    .item-card .item-card-usage div p,
    .item-card .item-card-usage p.item-card-engines,
    .item-card .item-card-usage > a {
        text-align: left;
        justify-content: flex-start;
        align-self: flex-start;
    }
}

@media (max-width: 767px) {
    .item-card .item-card-usage > a {
        margin-left: 20px;
        margin-right: 20px;
    }
}

/* Комплектация на телефоне: компактные строки «наименование — количество», без шапки таблицы.
   Длинный комплект свернут до трех позиций, остальные раскрывает кнопка под списком */
.item-card-kit-more {
    display: none;
}

@media (max-width: 767px) {
    .item-card .item-card-kit {
        font-size: 15px;
    }

    .item-card .item-card-kit h2 {
        margin: 8px 0 12px;
        font-size: 20px;
        line-height: 1.3;
    }

    .item-card .item-card-kit thead {
        display: none;
    }

    .item-card .item-card-kit tbody tr td {
        padding: 10px 0;
        vertical-align: top;
    }

    .item-card .item-card-kit tbody tr td:nth-child(2) {
        width: 1%;
        padding: 10px 4px 10px 12px;
        text-align: right;
        white-space: nowrap;
        font-weight: 600;
    }

    .item-card .item-card-kit tbody tr td:nth-child(3) {
        width: 1%;
        color: #8a939c;
        white-space: nowrap;
    }

    .item-card .item-card-kit:not(:has(.item-card-kit-toggle:checked)) tbody tr:nth-child(n+4) {
        display: none;
    }

    .item-card .item-card-kit .item-card-kit-more {
        display: table-footer-group;
    }

    .item-card .item-card-kit .item-card-kit-more tr {
        border: none;
    }

    .item-card .item-card-kit .item-card-kit-more td {
        padding: 12px 0 0;
    }

    .item-card-kit-more label {
        display: block;
        padding: 0 16px;
        border: 1px solid #075095;
        border-radius: 6px;
        color: #075095;
        font-size: 15px;
        line-height: 44px;
        text-align: center;
        cursor: pointer;
    }

    .item-card-kit-more .item-card-kit-hide,
    .item-card-kit-more:has(.item-card-kit-toggle:checked) .item-card-kit-show {
        display: none;
    }

    .item-card-kit-more:has(.item-card-kit-toggle:checked) .item-card-kit-hide {
        display: inline;
    }
}

/* Блок описания в карточке: заголовки мелкими серыми подписями, двигатели таблетками со ссылкой в каталог,
   применяемость завода и кросс-коды мелким серым текстом */
.item-card .item-card-usage div h2 {
    margin: 20px 0 8px;
    color: #8a939c;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.item-card .item-card-usage div h2:first-child {
    margin-top: 4px;
}

.item-card .item-card-usage .item-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    background: none;
}

.item-card .item-card-usage .item-card-chips .item-card-chip {
    display: inline-block;
    padding: 0 12px;
    border: 1px solid #b8c2cc;
    border-radius: 16px;
    background: #fff;
    color: #2b2a28;
    font-size: 14px;
    line-height: 30px;
    text-decoration: none;
    white-space: nowrap;
}

.item-card .item-card-usage .item-card-chips a.item-card-chip:hover {
    border-color: #075095;
    color: #075095;
}

.item-card .item-card-usage .item-card-chips-toggle:not(:checked) ~ .item-card-chip-extra,
.item-card .item-card-usage .item-card-chips-toggle:checked ~ .item-card-chips-more {
    display: none;
}

.item-card .item-card-usage .item-card-chips-more {
    color: #075095;
    font-size: 14px;
    line-height: 32px;
    cursor: pointer;
}

.item-card .item-card-usage p.item-card-usage-note {
    margin: 8px 0 0;
    color: #6b7a8c;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

/* Кросс-коды справочно: мелкий серый текст без плашек, чтобы не спорить с двигателями и ценой */
.item-card .item-card-usage .item-card-codes {
    gap: 2px 14px;
}

.item-card .item-card-usage .item-card-codes .item-card-code {
    padding: 0;
    border: none;
    background: none;
    color: #6b7a8c;
    font-size: 13px;
    line-height: 20px;
}

.item-card .item-card-usage .item-card-codes .item-card-chips-more {
    font-size: 13px;
    line-height: 20px;
}

/* Комплектация на широком экране свернута после десяти позиций, кнопка только если позиций больше */
@media (min-width: 768px) {
    .item-card .item-card-kit:not(:has(.item-card-kit-toggle:checked)) tbody tr:nth-child(n+11) {
        display: none;
    }

    .item-card .item-card-kit .item-card-kit-more-wide {
        display: table-footer-group;
    }

    .item-card .item-card-kit .item-card-kit-more tr {
        border: none;
    }

    .item-card .item-card-kit .item-card-kit-more td {
        padding: 16px 0 0;
    }

    .item-card-kit-more label {
        display: inline-block;
        padding: 0 24px;
        border: 1px solid #075095;
        border-radius: 6px;
        color: #075095;
        font-size: 15px;
        line-height: 42px;
        cursor: pointer;
    }

    .item-card-kit-more label:hover {
        background: #075095;
        color: #fff;
    }

    .item-card-kit-more .item-card-kit-hide,
    .item-card-kit-more:has(.item-card-kit-toggle:checked) .item-card-kit-show {
        display: none;
    }

    .item-card-kit-more:has(.item-card-kit-toggle:checked) .item-card-kit-hide {
        display: inline;
    }
}

/* Липкая панель покупки на телефоне: цена, наличие и «Купить» всегда под пальцем на длинной карточке */
.item-buybar {
    display: none;
}

@media (max-width: 767px) {
    .item-buybar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: #fff;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
        visibility: hidden;
        transform: translateY(110%);
        transition: transform 0.2s, visibility 0.2s;
    }

    /* aria-hidden здесь не годится: base.css прячет такие элементы через display: none, и панель не выезжает */
    .item-buybar.item-buybar-visible {
        visibility: visible;
        transform: none;
    }

    .item-buybar-price {
        color: #2b2a28;
        font-size: 20px;
        font-weight: 600;
        white-space: nowrap;
    }

    .item-buybar-instock {
        padding: 3px 8px;
        border-radius: 6px;
        background: #e6f2ea;
        color: #1e6b3d;
        font-size: 12px;
        white-space: nowrap;
    }

    .item-buybar-instock-off {
        background: #eef1f4;
        color: #5c6670;
    }

    .item-buybar-buy {
        flex: 1;
        height: 44px;
        border: none;
        border-radius: 6px;
        background: #075095;
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
    }

    /* Отступ под панель, чтобы она не закрывала низ подвала */
    .item ~ footer,
    body:has(.item-buybar) footer {
        padding-bottom: 64px;
    }
}

/* Блок цены сразу под характеристиками, перед описанием: на узких экранах base.css ставил его после описания,
   и до кнопки «Купить» приходилось листать через весь текст */
@media (min-width: 576px) and (max-width: 991px) {
    .item-card .item-card-actions {
        grid-row: 3;
    }

    .item-card .item-card-usage {
        grid-row: 4;
    }
}

@media (max-width: 575px) {
    .item-card .item-card-actions {
        grid-row: 4;
    }

    .item-card .item-card-usage {
        grid-row: 5;
    }
}
