/* Нижнее мобильное меню (mbn) и шторка «Ещё» — по образцу dselektric.ru, в цветах СТАЛЬТОРГ.
   Меню видно на телефонах (до 767px) и на мобильных/планшетах до 991px.
   Все отступы под меню включаются классом html.mbn-on, который ставит js/mobile-nav.js,
   только когда меню действительно показано. */
:root {
    --mbn-h: 62px;
    --mbn-safe: env(safe-area-inset-bottom, 0px);
    --mbn-ink: #0b3655;
    --mbn-text: #1c2430;
    --mbn-muted: #6b7280;
    --mbn-line: #eceef1;
    --mbn-accent: #ed7421;
    --mbn-green: #37b13d;
}

.mbn { display: none; }

@media (max-width: 767px) {
    .mbn { display: flex; }
}
@media (max-width: 991px) {
    .mbn.mbn--ua { display: flex; }
}

.mbn {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99990;
    align-items: stretch;
    height: calc(var(--mbn-h) + var(--mbn-safe));
    padding: 0 4px var(--mbn-safe);
    background: #fff;
    border-top: 1px solid var(--mbn-line);
    box-shadow: 0 -4px 18px rgba(11, 54, 85, .08);
    font-family: inherit;
}

.mbn__item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin: 0;
    padding: 0 2px 9px;
    border: 0;
    background: none;
    color: var(--mbn-muted);
    font: inherit;
    font-size: 11px;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s ease;
}
.mbn__item:hover,
.mbn__item:focus-visible { color: var(--mbn-ink); }
.mbn__item:focus-visible { outline: 2px solid var(--mbn-accent); outline-offset: -4px; border-radius: 10px; }

.mbn__label {
    flex: 0 0 auto;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.mbn__icon {
    position: relative;
    flex: 0 0 auto; /* в колонке не сжимаем: круг корзины должен оставаться 50px и выступать над панелью */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: transform .15s ease;
}
.mbn__icon svg { width: 24px; height: 24px; display: block; }
.mbn__item:active .mbn__icon { transform: scale(.9); }

.mbn__item.is-active { color: var(--mbn-ink); font-weight: 400; }
.mbn__item.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 22px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--mbn-accent);
    transform: translateX(-50%);
}

/* Корзина — круглая кнопка в цветах логотипа */
.mbn__item--cart { color: var(--mbn-ink); font-weight: 400; }
.mbn__item--cart.is-active::before { display: none; }
.mbn__item--cart .mbn__icon {
    width: 50px;
    height: 50px;
    margin-bottom: -2px;
    border-radius: 50%;
    background: var(--mbn-ink);
    color: #fff;
    box-shadow: 0 6px 16px rgba(11, 54, 85, .28), 0 0 0 4px #fff;
}
.mbn__item--cart .mbn__icon svg { width: 25px; height: 25px; }
.mbn__item--cart.is-active .mbn__icon { box-shadow: 0 6px 16px rgba(11, 54, 85, .28), 0 0 0 4px #fff, 0 0 0 6px var(--mbn-accent); }

.mbn__badge {
    position: absolute;
    top: -6px;
    right: -11px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--mbn-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 400;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}
.mbn__badge:empty { display: none; }
.mbn__item--cart .mbn__badge { top: -2px; right: -4px; background: var(--mbn-green); }

/* Шторка «Ещё» */
.mbn-overlay {
    position: fixed;
    inset: 0;
    z-index: 100005;
    background: rgba(11, 22, 34, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.mbn-overlay.is-open { opacity: 1; visibility: visible; }

.mbn-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100010;
    max-width: 560px;
    max-height: 86vh;
    max-height: 86dvh;
    margin: 0 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 6px 16px calc(18px + var(--mbn-safe));
    border-radius: 18px 18px 0 0;
    background: #fff;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility .28s;
    font-size: 15px;
    color: var(--mbn-text);
}
.mbn-sheet.is-open { transform: none; visibility: visible; }

.mbn-sheet__grip {
    width: 40px;
    height: 4px;
    margin: 4px auto 8px;
    border-radius: 2px;
    background: #d9dce1;
}
.mbn-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.mbn-sheet__title { margin: 0; font-size: 18px; font-weight: 400; line-height: 1.3; color: var(--mbn-ink); }
.mbn-sheet__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: -8px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--mbn-text);
    cursor: pointer;
}
.mbn-sheet__close:hover { background: #f3f4f6; }

.mbn-sheet__list { margin: 0 0 12px; padding: 0; list-style: none; }
.mbn-sheet__list li { margin: 0; padding: 0; }
.mbn-sheet__link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 8px 2px;
    border-bottom: 1px solid var(--mbn-line);
    color: var(--mbn-text);
    text-decoration: none;
}
.mbn-sheet__link:hover { color: var(--mbn-ink); }
.mbn-sheet__link svg { flex: 0 0 22px; width: 22px; height: 22px; color: var(--mbn-muted); }
.mbn-sheet__link span { flex: 1 1 auto; min-width: 0; }
.mbn-sheet__link::after {
    content: "";
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    border-top: 2px solid #b8bdc6;
    border-right: 2px solid #b8bdc6;
    transform: rotate(45deg);
}
.mbn-sheet__link--account { font-weight: 400; }
/* «Каталог товаров» — кнопка (открывает меню каталога), выглядит как пункт списка, выделена фирменным цветом */
button.mbn-sheet__link {
    width: 100%;
    margin: 0;
    border-width: 0 0 1px;
    border-style: solid;
    border-color: var(--mbn-line);
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.mbn-sheet__link--catalog {
    margin: 2px 0 6px !important;
    padding: 8px 12px !important;
    border: 0 !important;
    border-radius: 12px;
    background: var(--mbn-accent) !important;
    color: #fff !important;
    font-weight: 400 !important;
}
.mbn-sheet__link--catalog svg { color: #fff; }
.mbn-sheet__link--catalog::after { border-color: #fff; }

/* Каталог на весь экран (узкое окно компьютера, где нет мобильного меню каталога) */
.mbn-cat {
    position: fixed;
    inset: 0;
    z-index: 100020;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: var(--mbn-text);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), visibility .25s;
}
.mbn-cat.is-open { transform: none; visibility: visible; }
.mbn-cat__head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    padding: 0 8px 0 16px;
    background: var(--mbn-ink);
    color: #fff;
}
.mbn-cat__title { margin: 0; font-size: 18px; font-weight: 400; }
.mbn-cat__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #fff;
    cursor: pointer;
}
.mbn-cat__close:hover { background: rgba(255, 255, 255, .12); }
.mbn-cat__list {
    flex: 1 1 auto;
    margin: 0;
    padding: 0 0 calc(16px + var(--mbn-safe));
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.mbn-cat__item { margin: 0; border-bottom: 1px solid var(--mbn-line); }
.mbn-cat__row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 56px;
    margin: 0;
    padding: 8px 16px;
    border: 0;
    background: none;
    color: var(--mbn-text);
    font: inherit;
    font-size: 15px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.mbn-cat__row:hover { background: #f6f8fa; }
.mbn-cat__img { flex: 0 0 32px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
.mbn-cat__img img { max-width: 32px; max-height: 32px; object-fit: contain; }
.mbn-cat__name { flex: 1 1 auto; min-width: 0; }
.mbn-cat__row::after {
    content: "";
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-right: 4px;
    border-top: 2px solid #b8bdc6;
    border-right: 2px solid #b8bdc6;
    transform: rotate(45deg);
    transition: transform .2s ease;
}
.mbn-cat__toggle::after { transform: rotate(135deg); }
.mbn-cat__toggle[aria-expanded="true"] { color: var(--mbn-ink); font-weight: 400; }
.mbn-cat__toggle[aria-expanded="true"]::after { transform: rotate(-45deg); border-color: var(--mbn-accent); }
.mbn-cat__row--sale { color: var(--mbn-accent); font-weight: 400; }
.mbn-cat__sub { margin: 0; padding: 0 16px 10px 62px; list-style: none; }
.mbn-cat__sub[hidden] { display: none; }
.mbn-cat__sub a {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--mbn-line);
    color: var(--mbn-text);
    text-decoration: none;
}
.mbn-cat__sub li:last-child a { border-bottom: 0; }
.mbn-cat__sub a:hover { color: var(--mbn-ink); }
.mbn-cat__all { color: var(--mbn-accent) !important; font-weight: 400; }

.mbn-sheet__contacts {
    padding: 14px;
    border-radius: 14px;
    background: #f4f7fa;
}
.mbn-sheet__phones { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.mbn-sheet__phone { color: var(--mbn-ink); font-size: 18px; font-weight: 400; text-decoration: none; }
/* три кнопки в ряд; на узком телефоне третья переносится на вторую строку во всю ширину */
.mbn-sheet__messengers { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.mbn-sheet__msg {
    flex: 1 1 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 8px;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    text-decoration: none;
}
.mbn-sheet__msg svg, .mbn-sheet__msg img { flex: 0 0 18px; width: 18px; height: 18px; }
.mbn-sheet__msg--wa { background: #25d366; }
.mbn-sheet__msg--tg { background: #2aa3df; }
.mbn-sheet__msg--max { background: linear-gradient(39deg, #2eb1f4, #8952ea); }
.mbn-sheet__hours { margin: 0; color: var(--mbn-muted); font-size: 13px; }

html.mbn-lock,
html.mbn-lock body { overflow: hidden; }

/* Отступы и плавающие кнопки, когда нижнее меню показано */
html.mbn-on body { padding-bottom: calc(var(--mbn-h) + var(--mbn-safe)); }
/* плавающая кнопка связи (телефон / MAX / Telegram / WhatsApp) — над меню */
html.mbn-on #fab-wrap { left: 16px; bottom: calc(var(--mbn-h) + var(--mbn-safe) + 14px); }
html.mbn-on .footer_call { bottom: calc(var(--mbn-h) + var(--mbn-safe) + 70px); }
/* панель «Купить» в карточке товара выезжает над меню; слой ниже меню, чтобы круг корзины был поверх */
html.mbn-on .scrol_top_head { bottom: calc(var(--mbn-h) + var(--mbn-safe)); z-index: 99980; }
/* во всплывающих окнах (быстрый заказ, звонок, галерея) меню не перекрывает их кнопки */
html.with-fancybox .mbn { visibility: hidden; }
/* кнопка «Оформить заказ» в корзине стоит над нижним меню */
html.mbn-on .cart_mob_bbb { bottom: calc(var(--mbn-h) + var(--mbn-safe)); }
html.mbn-on body:has(.cart_mob_bbb) { padding-bottom: calc(var(--mbn-h) + var(--mbn-safe) + 80px); }
/* в корзине кнопка связи стоит над полосой «Оформить заказ» (высота полосы ~80px) */
html.mbn-on body:has(.cart_mob_bbb) #fab-wrap { bottom: calc(var(--mbn-h) + var(--mbn-safe) + 94px); }
/* на странице корзины шапка не закреплена — уезжает вместе со страницей; отступ под неё у хлебных крошек убираем */
html.mbn-on body:has(.cart_backround) header.header { position: relative !important; top: auto !important; }
html.mbn-on .cart_backround #breadcrumbs { padding-top: 14px !important; }
/* корзина и избранное уже есть в нижнем меню — в мобильной шапке их прячем
   (в style.css у .favorit.f_hed стоит display:block !important) */
html.mbn-on header.header .head_right .favorit.f_hed,
html.mbn-on header.header .head_right > .cart { display: none !important; }

/* скрытая панель «Купить» в карточке товара не должна перехватывать нажатия */
.scrol_top_head:not(.scroll_show) { pointer-events: none; }

@media (max-width: 360px) {
    .mbn__item { font-size: 10px; }
}

/* Мелкие исправления мобильной вёрстки */
@media (max-width: 767px) {
    /* длинные названия и размеры товаров не вылезают за экран */
    h1, h2, h3, .content_descr { overflow-wrap: break-word; word-break: break-word; }
}

/* Компактная десктопная шапка (#myHeader) в узком окне — как на dselektric.ru:
   логотип слева, справа круглые кнопки «телефон / поиск / меню», поиск выезжает строкой под шапкой.
   Корзина, избранное и каталог на этой ширине — в нижнем меню. */
.dsh-mob { display: none; }
@media (max-width: 767px) {
    #myHeader .header_top,
    #myHeader .head_right,
    #myHeader .dropbtn22,
    #myHeader .sub_cat { display: none; }
    #myHeader .container { max-width: 100%; width: 100%; padding: 0; }
    #myHeader .wrapper {
        position: relative;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 60px;
        padding: 0 12px 0 14px;
    }
    #myHeader .header_left { flex: 1 1 auto; min-width: 0; }
    /* в .header-item-left_mix лежат поиск, кнопки .dsh-mob и .head_right */
    #myHeader .header-item-left_mix { flex: 0 0 auto; width: auto; margin: 0; gap: 0; }
    /* в style.css до 850px у .header-search стоит display:flex !important */
    #myHeader .header-item-left_mix > .header-search { display: none !important; }
    /* Поиск на весь экран: белый экран, сверху поле со стрелкой «назад», ниже на всю высоту подсказки */
    /* шапка закреплена и образует свой слой (z-index 99999) — белый экран рисуем внутри неё и поднимаем её над нижним меню */
    html.dsh-search-open #myHeader { z-index: 100015 !important; }
    html.dsh-search-open #myHeader::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 1;
        background: #fff;
    }
    html.dsh-search-open #myHeader .header-item-left_mix > .header-search {
        display: flex !important;
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        width: auto !important;
        height: 60px;
        margin: 0;
        padding: 9px 12px 9px 56px;
        background: #fff;
        border-bottom: 1px solid var(--mbn-line);
        box-shadow: 0 4px 12px rgba(11, 54, 85, .06);
        z-index: 2; /* внутри слоя шапки, над белым фоном */
    }
    html.dsh-search-open #myHeader .search_five_res {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        right: 0;
        bottom: 0;
        width: auto !important;
        max-height: none !important;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-radius: 0;
        box-shadow: none !important;
        background: #fff;
        z-index: 2;
    }
    .dsh-mob { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
}
/* поле на всю ширину, крестик «очистить» у правого края; кнопку «Найти» прячем (поиск — Enter или подсказка) */
html.dsh-search-open #myHeader .header-search .search_input { flex: 1 1 auto; min-width: 0; width: auto !important; }
html.dsh-search-open #myHeader .header-search .header-search__search-submit-btn { display: none !important; }
html.dsh-search-open #myHeader .header-search .search-catalog__btn--clear { margin-left: auto; flex: 0 0 auto; }
/* кнопка «назад» из полноэкранного поиска */
.dsh-search-close { display: none; }
html.dsh-search-open .dsh-search-close {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100030;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f3f5f8;
    color: var(--mbn-ink);
    cursor: pointer;
}
html.dsh-search-open,
html.dsh-search-open body,
html.mbn-cat-open,
html.mbn-cat-open body { overflow: hidden; }
/* чат Jivo в мобильной версии не показываем (на узком экране он и не загружается — см. footer.php;
   это правило — если окно сузили уже после загрузки) */
html.mbn-on jdiv,
html.mbn-lock jdiv,
html.mbn-cat-open jdiv,
html.dsh-search-open jdiv { display: none !important; }
.dsh-mob__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color .15s ease, transform .15s ease;
}
.dsh-mob__btn svg { width: 20px; height: 20px; display: block; }
.dsh-mob__btn:hover { background: rgba(255, 255, 255, .22); }
.dsh-mob__btn:active { transform: scale(.94); }
.dsh-mob__btn:focus-visible { outline: 2px solid var(--mbn-accent); outline-offset: 2px; }
.dsh-mob__btn--phone { background: var(--mbn-green); color: #fff; }
.dsh-mob__btn--phone:hover { background: #2f9c35; }
.dsh-mob__btn[aria-expanded="true"] { background: var(--mbn-accent); }

@media (prefers-reduced-motion: reduce) {
    .mbn-sheet, .mbn-overlay, .mbn__icon, .mbn__item { transition: none; }
}
