/* Мобильная шапка и меню (ТЗ «Навигация по сайту», стр. 1). Только < 992px. */
@media (max-width: 991.98px) {
    /* Одна строка: меню, логотип, поиск, профиль, избранное, корзина */
    #topLine .topLine__info-row {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 2px;
        min-height: 56px;
        padding: 6px 0;
    }

    #topLine .topLine__info-row > .col {
        display: contents;
    }

    #topLine .topLine__contacts,
    #topLine .topLine__name {
        display: none !important;
    }

    #topLine .topLine__logo {
        order: 1;
        margin: 0 auto 0 6px;
        display: inline-flex;
        align-items: center;
    }

    #topLine .topLine__logo img {
        height: 30px;
        width: auto;
    }

    /* Бывшая нижняя панель — теперь иконки в шапке */
    #topLine .topLine__navbar {
        position: static !important;
        display: contents !important;
        box-shadow: none !important;
    }

    #topLine .topLine__navbar-item {
        order: 3;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 40px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    #topLine .topLine__navbar-item--menu { order: 0; justify-content: flex-start; }
    #topLine .topLine__navbar-item--search { order: 2; }
    #topLine .topLine__navbar-item--profile { order: 3; }
    #topLine .topLine__navbar-item--heart { order: 4; }
    #topLine .topLine__navbar-item--basket { order: 5; }

    #topLine .topLine__navbar-item--location,
    #topLine .topLine__navbar-item--truck {
        display: none !important;
    }

    #topLine .topLine__navbar-item--search .mobile-search-open {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 40px;
        padding: 0;
        border: 0;
        background: none;
        color: inherit;
    }

    /* Мини-корзина при наведении на телефоне не нужна */
    #topLine .topLine__navbar-item--basket .basket-popup,
    #topLine .topLine__navbar-item--basket #items {
        display: none !important;
    }

    /* Строка «Каталог товаров» + поиск больше не нужна */
    .top-nav .top-nav__row > .col-auto:first-child,
    .top-nav .top-nav__mobile-search-btns {
        display: none !important;
    }

    .top-nav .container--top-nav,
    .top-nav .top-nav__container,
    .top-nav .top-nav__row {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        min-height: 0 !important;
        height: 0;
    }

    .top-nav {
        padding: 0 !important;
        margin: 0 !important;
        min-height: 0 !important;
    }

    /* Поиск выпадает под шапкой */
    .top-nav .search-block {
        position: fixed !important;
        top: 62px !important;
        left: 12px !important;
        right: 12px !important;
        bottom: auto !important;
        width: auto !important;
        min-width: 0 !important;
        height: 46px !important;
        margin: 0 !important;
        background: #fff;
        border-radius: 5px;
        z-index: 1001;
        opacity: 0;
        pointer-events: none;
    }

    .top-nav .search-block.active {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .top-nav .search-block input {
        height: 100% !important;
    }

    /* Выдвижное меню слева на всю высоту */
    .menu-mobile.menu-mobile--js {
        left: 0 !important;
        right: auto !important;
        top: 0 !important;
        width: min(82vw, 320px) !important;
        height: 100vh !important;
        height: 100dvh !important;
        transform: translateX(-100%) !important;
        transition: transform .25s ease, box-shadow .25s ease;
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0);
        z-index: 1012 !important;
        overflow-y: auto;
        padding: 0 !important;
    }

    .menu-mobile.menu-mobile--js.active {
        transform: none !important;
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45);
    }

    .menu-mobile--js .menu-mobile__inner > nav,
    .menu-mobile--js .menu-mobile__inner > .topLine__menu-row {
        display: none !important;
    }

    .menu-mobile--js .menu-mobile__inner {
        padding: 0 !important;
    }

    .mm__list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mm__item {
        border-bottom: 1px solid #ececec;
    }

    .menu-mobile--js .mm__link {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        font-size: 14px;
        font-weight: 600;
        color: #222;
        text-decoration: none;
    }

    .mm__link.is-active {
        color: #0a6ed1;
    }

    .mm__link--arrow::after {
        content: "";
        width: 0;
        height: 0;
        border: 4px solid transparent;
        border-left-color: currentColor;
        border-right: 0;
    }

    .mm__bottom {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 28px 20px 24px;
    }

    .mm__opt {
        display: inline-block;
        padding: 7px 12px;
        border-radius: 3px;
        background: #d4e157;
        color: #222;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        text-decoration: none;
    }

    .mm__write {
        font-size: 14px;
        font-weight: 600;
        color: #222;
        text-decoration: none;
    }

    /* Нижней панели больше нет — убираем отступ под неё */
    footer.footer,
    .footer {
        padding-bottom: 24px !important;
    }
}
