/* M367_SITE_HEADER_CONTRACT_V2 START
   Header visuals and responsive behavior. External geometry is owned by
   m367_site_foundation.css.
*/

:root {
    --m367-header-bg: #050505;
    --m367-header-surface: #111214;
    --m367-header-control: #17181b;
    --m367-header-text: rgba(255, 255, 255, .96);
    --m367-header-muted: rgba(255, 255, 255, .66);
    --m367-header-accent: var(--m367-brand-orange, #ff5a00);
    --m367-header-border: rgba(var(--m367-brand-orange-rgb, 255, 90, 0), .28);
    --m367-header-mini-height: 68px;
    --m367-header-mini-z: 920;
    --m367-system-layer-height: 44px;
    --m367-header-mini-stack-height: 100px;
    --m367-header-transition: .2s ease;
}


/* M367_HEADER_SHELL_GEOMETRY_OWNER_V1 START
   Owner: m367_site_header_contract.css
   Purpose: header/system mini-shell geometry moved from foundation to header contract.
*/
.m367-site-system-layer__shell,
.m367-site-header__mini-shell {
    width: var(--m367-foundation-shell) !important;
    max-width: var(--m367-foundation-shell) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}
/* M367_HEADER_SHELL_GEOMETRY_OWNER_V1 END */
/* System notice */
.m367-site-system-layer {
    position: sticky;
    top: 0;
    z-index: 1100;
    width: 100%;
    margin: 0;
    padding: 2px 0 6px;
    background: #050505;
    border-bottom: 1px solid rgba(var(--m367-brand-orange-rgb, 255, 90, 0), .10);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .22);
    isolation: isolate;
}

.m367-site-system-layer__shell,
.m367-site-status-notice-wrap {
    padding: 0;
}

.m367-site-status-notice {
    display: block;
    width: 100%;
    min-height: 34px;
    margin: 0;
    padding: 7px 16px;
    border: 1px solid rgba(var(--m367-brand-orange-rgb, 255, 90, 0), .18);
    border-radius: 8px;
    background: #0b0b0c;
    box-shadow: none;
    box-sizing: border-box;
}

.m367-site-status-notice::before,
.m367-site-status-notice::after {
    display: none;
    content: none;
}

.m367-site-status-notice__badge {
    flex: 0 0 auto;
    color: var(--m367-header-accent);
    font-size: 11px;
    font-weight: var(--m367-font-weight-strong);
    line-height: 1;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.m367-site-status-notice__badge::after {
    display: inline-block;
    width: 1px;
    height: 15px;
    margin-left: 12px;
    background: var(--m367-header-border);
    vertical-align: middle;
    content: "";
}

.m367-site-status-notice__text {
    min-width: 0;
    color: rgba(255, 255, 255, .80);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
}

.workarea > .container.bx-content-section > .m367-site-status-notice-wrap {
    display: none !important;
}

/* Header ownership */
.m367-site-header {
    position: relative;
    z-index: var(--m367-z-site-header, 960);
    width: 100%;
    background: var(--m367-header-bg);
}

.m367-site-header .m367-header-shell {
    margin: 0 auto;
    padding: 0 0 8px;
    background: transparent;
}

/* ВЫСОТА ДОКУМЕНТА НЕ МЕНЯЕТСЯ НИКОГДА (26.09, владелец: «Дрожание» → «не только
   на этой странице было» → «дифект есть» после первой правки).

   Что было и почему не лечилось плавностью. В мини-режиме шапка СХЛОПЫВАЛАСЬ:
   `max-height: 0` плюс снятый отступ секции — минус 267 px из документа. Порог
   мини-режима стоял на 130. Замер мелкими шагами (колесо, по 40 px через порог
   туда-обратно): при переходе 120 → 140 содержимое уезжало с +237 на −50, то
   есть ПРЫГАЛО НА 287 px от одного щелчка колеса, и повторяло это на каждом
   пересечении порога.

   Арифметика показывает, что сгладить это нечем. Чтобы удержать содержимое на
   месте, когда из документа исчезли 267 px, браузеру надо уехать на
   `130 − 267 = −137`; отрицательной прокрутки не бывает, и остаток прыжка
   остаётся всегда. Первая правка (убрать `max-height` из `transition`) убрала
   ДРОБЛЕНИЕ прыжка на двенадцать кадров — и только его; сам прыжок никуда не
   делся, что владелец и увидел.

   Как теперь. Шапка ничего не схлопывает и вообще не меняется в мини-режиме:
   `.m367-site-header` стоит в потоке (`position: relative`) и уезжает вверх
   сама, обычной прокруткой, как любой блок страницы. Мини-шапка `fixed` и
   приезжает ровно тогда, когда полная ушла за верх экрана — порог считает JS по
   её живому прямоугольнику, а не числом 130. Высота документа постоянна, и
   компенсировать прокрутку браузеру больше не от чего.

   Дыра 267 px (25.09) при этом не возвращается: она была оттого, что шапку
   гасили ПРОЗРАЧНОСТЬЮ, оставляя место в потоке. Здесь шапка не гасится вовсе —
   её просто не видно, потому что она выше края экрана. */
.m367-site-header__chrome {
    width: 100%;
    /* Потолок с запасом и обрезка остаются от прежней редакции: они держат в
       границах шапки то, что из неё вылезает (выпадающий каталог). Высоту
       документа они не трогают — шапка ниже 600 px, — и к дрожанию отношения не
       имеют. Сняв их заодно со схлопыванием, я тут же получил от владельца
       «вообще странно стало»: на странице корзины поверх содержимого повис
       развёрнутый кусок меню. */
    max-height: 600px;
    overflow: hidden;
}

/* Desktop top line: three zones, one geometric owner */
@media (min-width: 992px) {
    .m367-site-header .m367-mobile-header {
        display: none !important;
    }

    .m367-site-header .m367-header-topline {
        display: grid !important;
        grid-template-columns: minmax(280px, 1fr) auto minmax(336px, 1fr) !important;
        align-items: center;
        justify-content: stretch !important;
        justify-self: stretch !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 92px;
        margin: 16px 0 14px !important;
        padding: 0 !important;
        box-sizing: border-box;
    }

    .m367-header-topline__left,
    .m367-header-topline__center,
    .m367-header-topline__right {
        display: flex;
        align-items: center;
        min-width: 0;
        margin: 0;
        padding: 0;
    }

    .m367-header-topline__left {
        justify-content: flex-start !important;
        justify-self: stretch !important;
        width: 100% !important;
        max-width: none !important;
    }

    .m367-header-topline__center {
        justify-content: center !important;
        justify-self: center !important;
        gap: 32px;
    }

    .m367-header-topline__right {
        justify-content: flex-end !important;
        justify-self: stretch !important;
        width: 100% !important;
        max-width: none !important;
    }

    .m367-header-topline__brand,
    .m367-header-topline__brand .m367-logo-link,
    .m367-header-topline__brand .m367-logo-picture {
        display: block;
        width: 300px;
        max-width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
        line-height: 0;
    }

    .m367-header-topline__brand .m367-logo-img--desktop {
        display: block;
        width: 300px;
        max-width: 100%;
        height: auto;
        margin: 0;
        object-fit: contain;
    }

    .m367-header-topline__phones,
    .m367-header-topline__hours {
        display: grid;
        grid-template-columns: 28px max-content;
        align-items: center;
        gap: 10px;
        min-width: 0;
        margin: 0;
        padding: 0;
    }

    .m367-header-topline__icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        color: var(--m367-header-accent);
    }

    .m367-header-topline__icon svg {
        display: block;
        width: 28px;
        height: 28px;
        fill: currentColor;
    }

    .m367-header-topline__phones-value,
    .m367-header-topline__hours-value,
    .m367-header-topline__phones-value .mitino-phones,
    .m367-header-topline__hours-value .mitino-worktime {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        margin: 0;
        padding: 0;
    }

    .m367-header-topline__phones-value .mitino-phones a {
        color: var(--m367-header-text);
        font-family: var(--ui-font-family-primary, "Open Sans", Arial, sans-serif);
        font-size: 18px;
        font-weight: var(--m367-font-weight-strong);
        line-height: 1.08;
        letter-spacing: 0;
        text-decoration: none;
        white-space: nowrap;
    }

    .m367-header-topline__hours-value .mitino-worktime span:first-child {
        color: var(--m367-header-muted);
        font-size: 9px;
        font-weight: var(--m367-font-weight-strong);
        line-height: 1;
        letter-spacing: .10em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .m367-header-topline__hours-value .mitino-worktime span:last-child {
        color: var(--m367-header-text);
        font-size: 16px;
        font-weight: var(--m367-font-weight-strong);
        line-height: 1.08;
        letter-spacing: 0;
        white-space: nowrap;
    }

    .m367-header-topline__personal,
    .m367-header-topline__personal .bx-basket {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
        transform: none;
    }

    .m367-header-topline__personal .m367-basket-line {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }

    /* The menu is a direct shell child. Bootstrap row/col no longer owns it. */
    .m367-site-header .m367-header-menu {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 0 16px !important;
        padding: 0 !important;
    }

    .m367-header-menu .bx-top-nav,
    .m367-header-menu .bx-top-nav-container,
    .m367-header-menu .bx-nav-list-1-lvl {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .m367-site-header .m367-header-topline {
        grid-template-columns: minmax(230px, 1fr) auto minmax(300px, 1fr) !important;
    }

    .m367-header-topline__center {
        gap: 18px;
    }

    .m367-header-topline__brand,
    .m367-header-topline__brand .m367-logo-link,
    .m367-header-topline__brand .m367-logo-picture,
    .m367-header-topline__brand .m367-logo-img--desktop {
        width: 240px;
    }

    .m367-header-topline__phones,
    .m367-header-topline__hours {
        grid-template-columns: 25px max-content;
        gap: 8px;
    }

    .m367-header-topline__icon,
    .m367-header-topline__icon svg {
        width: 25px;
        height: 25px;
    }

    .m367-header-topline__phones-value .mitino-phones a {
        font-size: 15px;
    }

    .m367-header-topline__hours-value .mitino-worktime span:last-child {
        font-size: 14px;
    }
}

/* Compact header uses the same shell */
.m367-site-header__mini {
    position: fixed;
    z-index: var(--m367-header-mini-z);
    top: var(--m367-system-layer-height);
    right: 0;
    left: 0;
    padding: 8px 0;
    background: #050505;
    /* Шов стопки: системная полоса и мини-шапка стыкуются с точностью до доли пикселя,
       и высота, округлённая вверх, оставляет щель в 1px — в неё просвечивает
       прокручиваемое (владелец 18.09: залипайки «не должны иметь под собой мусора»).
       Тень в 1px тем же фоном закрывает стык, ничего не сдвигая. */
    box-shadow: 0 -1px 0 0 #050505;
    border-bottom: 1px solid rgba(var(--m367-brand-orange-rgb, 255, 90, 0), .14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-110%);
    transition: opacity var(--m367-header-transition), transform var(--m367-header-transition), visibility var(--m367-header-transition);
    box-sizing: border-box;
}

body.m367-site-header-mini-active .m367-site-header__mini {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.m367-site-header__mini-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--m367-header-mini-height);
    padding: 8px 12px;
    border: 1px solid var(--m367-header-border);
    border-radius: 8px;
    background: var(--m367-header-surface);
}

.m367-site-header__mini-brand,
.m367-site-header__mini-catalog,
.m367-site-header__mini-contact,
.m367-site-header__mini-auth,
.m367-site-header__mini-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    color: var(--m367-header-text);
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.m367-site-header__mini-brand {
    flex: 0 0 174px;
    width: 174px;
    justify-content: flex-start;
    overflow: hidden;
}

.m367-site-header__mini-brand .m367-logo-img--mini {
    display: block;
    width: 174px;
    height: auto;
}

.m367-site-header__mini-catalog,
.m367-site-header__mini-auth,
.m367-site-header__mini-cart {
    gap: 8px;
    padding: 0 12px;
    border: 1px solid rgba(var(--m367-brand-orange-rgb, 255, 90, 0), .22);
    border-radius: 8px;
    background: var(--m367-header-control);
    font-size: 12px;
    font-weight: var(--m367-font-weight-strong);
}

.m367-site-header__mini-catalog {
    flex: 0 0 112px;
}

.m367-site-header__mini-catalog-icon {
    color: var(--m367-header-accent);
    font-size: 18px;
}

.m367-site-header__mini-contacts {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 128px;
    grid-template-rows: 1fr 1fr;
    gap: 4px 10px;
    flex: 0 0 286px;
}

.m367-site-header__mini-contact {
    justify-content: flex-start;
    gap: 7px;
    min-height: 19px;
    font-size: 12px;
    font-weight: var(--m367-font-weight-strong);
}

.m367-site-header__mini-contact--phone:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.m367-site-header__mini-contact--phone:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
}

.m367-site-header__mini-contact--hours {
    grid-column: 2;
    grid-row: 1 / span 2;
    min-height: 42px;
    padding-left: 10px;
    border-left: 1px solid var(--m367-header-border);
}

.m367-site-header__mini-icon {
    display: inline-flex;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    color: var(--m367-header-accent);
}

.m367-site-header__mini-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.m367-site-header__mini-spacer {
    display: none;
}

.m367-site-header__mini-search {
    position: relative;
    flex: 1 1 440px;
    width: auto;
    min-width: 260px;
    max-width: 520px;
}

.m367-site-header__mini-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    width: 100%;
    height: 42px;
    overflow: hidden;
    background: #0c0c0d;
    border: 1px solid var(--m367-header-border);
    border-radius: 8px;
}

.m367-site-header__mini-search-form input {
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0 12px;
    color: var(--m367-header-text);
    background: transparent;
    border: 0;
    border-radius: 0;
    outline: 0;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}

.m367-site-header__mini-search-form input::placeholder {
    color: var(--m367-header-muted);
}

.m367-site-header__mini-search-form button,
.m367-site-header__mini-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    color: #fff;
    background: var(--m367-header-accent);
    border: 0;
    cursor: pointer;
}

.m367-site-header__mini-search-form svg,
.m367-site-header__mini-search-toggle svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.m367-site-header__mini-search-toggle {
    display: none;
    width: 44px;
    height: 42px;
    border-radius: 8px;
}

.m367-site-header__mini-auth {
    flex: 0 0 82px;
}

.m367-site-header__mini-cart {
    flex: 0 0 104px;
}

.m367-site-header__mini-cart::before {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    background: var(--m367-header-accent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.2 18.4a1.8 1.8 0 1 0 0 3.6 1.8 1.8 0 0 0 0-3.6Zm9.6 0a1.8 1.8 0 1 0 0 3.6 1.8 1.8 0 0 0 0-3.6ZM3 3a1 1 0 0 0 0 2h1.28l2.05 9.93A2.6 2.6 0 0 0 8.88 17h7.72a2.6 2.6 0 0 0 2.48-1.83l1.8-5.8A1.85 1.85 0 0 0 19.12 7H7.05L6.48 4.2A1.5 1.5 0 0 0 5.02 3H3Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.2 18.4a1.8 1.8 0 1 0 0 3.6 1.8 1.8 0 0 0 0-3.6Zm9.6 0a1.8 1.8 0 1 0 0 3.6 1.8 1.8 0 0 0 0-3.6ZM3 3a1 1 0 0 0 0 2h1.28l2.05 9.93A2.6 2.6 0 0 0 8.88 17h7.72a2.6 2.6 0 0 0 2.48-1.83l1.8-5.8A1.85 1.85 0 0 0 19.12 7H7.05L6.48 4.2A1.5 1.5 0 0 0 5.02 3H3Z'/%3E%3C/svg%3E") center / contain no-repeat;
    content: "";
}

/* Page intro belongs to the header. */
.m367-page-intro {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Independent mobile header */
.m367-mobile-header {
    display: none;
    padding: 12px 0 8px;
}

.m367-mobile-header__logo,
.m367-mobile-header__logo .m367-logo-picture {
    display: block;
    width: min(280px, 78vw);
    line-height: 0;
}

.m367-mobile-header__logo .m367-logo-img--mobile {
    display: block;
    width: 100%;
    height: auto;
}

.m367-mobile-header__contacts {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 12px;
}

.m367-mobile-header__contact {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: var(--m367-header-text);
    text-decoration: none;
}

.m367-mobile-header__contact > span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.m367-mobile-header__contact strong,
.m367-mobile-header__contact em {
    color: var(--m367-header-text);
    font-size: 13px;
    font-style: normal;
    font-weight: var(--m367-font-weight-strong);
    line-height: 1.15;
    white-space: nowrap;
}

.m367-mobile-header__contact em {
    color: var(--m367-header-muted);
    font-size: 9px;
    text-transform: uppercase;
}

.m367-mobile-header__icon {
    display: block;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    background: var(--m367-header-accent);
}

.m367-mobile-header__icon--phone {
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.15 6.59 6.59l2.2-2.2c.31-.31.76-.41 1.17-.28 1.29.43 2.68.66 4.12.66.72 0 1.3.58 1.3 1.3v3.5c0 .72-.58 1.3-1.3 1.3C10.32 21.66 2.34 13.68 2.34 3.3 2.34 2.58 2.92 2 3.64 2h3.5c.72 0 1.3.58 1.3 1.3 0 1.44.23 2.83.66 4.12.13.41.03.86-.28 1.17l-2.2 2.2z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.15 6.59 6.59l2.2-2.2c.31-.31.76-.41 1.17-.28 1.29.43 2.68.66 4.12.66.72 0 1.3.58 1.3 1.3v3.5c0 .72-.58 1.3-1.3 1.3C10.32 21.66 2.34 13.68 2.34 3.3 2.34 2.58 2.92 2 3.64 2h3.5c.72 0 1.3.58 1.3 1.3 0 1.44.23 2.83.66 4.12.13.41.03.86-.28 1.17l-2.2 2.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.m367-mobile-header__icon--time {
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2a10 10 0 1 0 .01 0H12zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm.75-13h-1.8v6.15l5.25 3.15.9-1.48-4.35-2.57V7z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2a10 10 0 1 0 .01 0H12zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm.75-13h-1.8v6.15l5.25 3.15.9-1.48-4.35-2.57V7z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.m367-mobile-header__nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 12px;
}

.m367-mobile-header__nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 7px;
    color: var(--m367-header-text);
    background: var(--m367-header-control);
    border: 1px solid rgba(var(--m367-brand-orange-rgb, 255, 90, 0), .22);
    border-radius: 8px;
    font-size: 11px;
    font-weight: var(--m367-font-weight-strong);
    text-align: center;
    text-decoration: none;
}

/* Menu tooltip */
.m367-menu-tooltip {
    position: fixed;
    z-index: 1000;
    width: min(340px, calc(100vw - 32px));
    padding: 14px 16px;
    color: var(--m367-header-text);
    background: #111214;
    border: 1px solid var(--m367-header-border);
    border-radius: 8px;
    box-shadow: 0 16px 38px rgba(0, 0, 0, .38);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease;
}

.m367-menu-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
}

.m367-menu-tooltip__title {
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: var(--m367-font-weight-strong);
}

.m367-menu-tooltip__text {
    color: var(--m367-header-muted);
    font-size: 12px;
    line-height: 1.45;
}

/* Tablet and phone: retain the proven mobile header. */
@media (max-width: 991px) {
    :root {
        --m367-header-mini-height: 54px;
        --m367-system-layer-height: 84px;
    }

    .m367-site-header .m367-header-topline,
    .m367-site-header .m367-header-menu {
        display: none !important;
    }

    .m367-site-header .m367-mobile-header {
        display: block !important;
    }

    .m367-site-header .m367-header-shell {
        padding-bottom: 6px;
    }

    .m367-site-status-notice {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        padding: 8px 12px;
    }

    .m367-site-status-notice__badge::after {
        display: none;
    }

    .m367-site-header__mini {
        padding: 6px 0;
    }

    .m367-site-header__mini-shell {
        justify-content: center;
        padding: 6px 8px;
    }

    .m367-site-header__mini-brand {
        flex: 1 1 auto;
        width: 100%;
        justify-content: center;
        background: #09090a;
        border: 1px solid rgba(var(--m367-brand-orange-rgb, 255, 90, 0), .18);
        border-radius: 8px;
    }

    .m367-site-header__mini-brand .m367-logo-picture {
        display: block;
        width: 174px;
        line-height: 0;
    }

    .m367-site-header__mini-brand .m367-logo-img--mini {
        display: block;
        width: 174px;
        max-width: 100%;
        height: auto;
    }

    .m367-site-header__mini-catalog,
    .m367-site-header__mini-contacts,
    .m367-site-header__mini-search,
    .m367-site-header__mini-spacer,
    .m367-site-header__mini-auth,
    .m367-site-header__mini-cart {
        display: none;
    }

}

@media (max-width: 479px) {
    :root {
        --m367-system-layer-height: 100px;
    }
}

@media (max-width: 560px) {
    .m367-mobile-header__contacts,
    .m367-mobile-header__nav {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .m367-site-header__mini-contacts {
        display: none;
    }

    .m367-site-header__mini-search {
        max-width: none;
    }
}

/* Mobile bottom action dock */
.m367-mobile-dock,
.m367-mobile-dock-search {
    display: none;
}

@media (max-width: 991px) {
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }

    .m367-mobile-dock {
        position: fixed;
        z-index: 1150;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        /* Зазор 3 и боковое поле 4 вместо 4 и 8: шесть кнопок в 390 px делят
           каждый лишний пиксель, и эти семь пикселей — запас под подпись
           «Позвонить» кеглем 10. Было 59,0 на кнопку, стало 61,2. */
        gap: 3px;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        background: #050505;
        border-top: 1px solid rgba(var(--m367-brand-orange-rgb, 255, 90, 0), .28);
        box-shadow: 0 -12px 28px rgba(0, 0, 0, .46);
    }

    .m367-mobile-dock__item {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
        min-height: 52px;
        margin: 0;
        /* Боковой отступ 0, а не 2 px: содержимое и так центровано, а эти
           четыре пикселя — ровно та разница, на которой «Позвонить» при
           кегле 10 включало многоточие (текст 53,0 при месте 53,0). */
        padding: 4px 0;
        color: var(--m367-header-accent);
        background: #111214;
        border: 1px solid rgba(var(--m367-brand-orange-rgb, 255, 90, 0), .18);
        border-radius: 8px;
        font: inherit;
        text-decoration: none;
        cursor: pointer;
        box-sizing: border-box;
    }

    .m367-mobile-dock__item:focus-visible,
    .m367-mobile-dock__item:active {
        color: #fff;
        background: var(--m367-header-accent);
        border-color: var(--m367-header-accent);
    }

    .m367-mobile-dock__item svg {
        width: 23px;
        height: 23px;
        fill: currentColor;
    }

    /* ПОДПИСЬ 10 px, А НЕ 8 (26.09, замечание владельца «по размерам кнопок в
       мобильном»). Восемь пикселей были самым мелким кеглем на всём сайте —
       мельче, чем оговорка «Без НДС» в чеке. Число держалось тем, что в кнопку
       шириной 59 px должно влезть слово «Позвонить»: при 8 px оно занимает
       41 px, при 10 px — 51 px, а места под текст 55 px. То есть запас был и
       при 8, просто никто не мерил. Выше 10 не идём: «Позвонить» при 11 px
       выходит 56 px и включает многоточие — подпись, обрезанная до «Позвони…»,
       хуже мелкой. */
    .m367-mobile-dock__item span {
        max-width: 100%;
        overflow: hidden;
        color: rgba(255, 255, 255, .78);
        font-size: 10px;
        font-weight: var(--m367-font-weight-strong);
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .m367-mobile-dock-search {
        position: fixed;
        z-index: 1151;
        right: 12px;
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        left: 12px;
        padding: 8px;
        background: #050505;
        border: 1px solid var(--m367-header-border);
        border-radius: 8px;
        box-shadow: 0 -14px 32px rgba(0, 0, 0, .48);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(8px);
        transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    }

    .m367-mobile-dock-search.is-open {
        display: block;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .m367-mobile-dock-search form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 76px;
        height: 44px;
        overflow: hidden;
        background: #111214;
        border: 1px solid var(--m367-header-border);
        border-radius: 7px;
    }

    .m367-mobile-dock-search input {
        min-width: 0;
        margin: 0;
        padding: 0 12px;
        color: var(--m367-header-text);
        background: transparent;
        border: 0;
        outline: 0;
        font: inherit;
        font-size: 14px;
    }

    .m367-mobile-dock-search button {
        margin: 0;
        padding: 0 10px;
        color: #fff;
        background: var(--m367-header-accent);
        border: 0;
        font: inherit;
        font-size: 13px;
        font-weight: var(--m367-font-weight-strong);
        cursor: pointer;
    }
}

/* M367_SITE_HEADER_CONTRACT_V2 END */

/* M367_HEADER_CATALOG_CONTRACT_V3_6: catalog menu is open shell width with only light internal separators. */
@media (min-width: 992px) {
    html body .m367-site-header .m367-header-menu,
    html body .m367-header-menu {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    html body .m367-site-header .m367-header-menu .bx-top-nav,
    html body .m367-site-header .m367-header-menu .bx-top-nav-container,
    html body .m367-header-menu .bx-top-nav,
    html body .m367-header-menu .bx-top-nav-container,
    html body .bx-top-nav-container {
        width: 100% !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    html body .m367-header-menu .bx-nav-list-1-lvl,
    html body .bx-top-nav-container .bx-nav-list-1-lvl {
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    html body .m367-header-menu .bx-nav-1-lvl,
    html body .bx-top-nav-container .bx-nav-1-lvl {
        border-right: 1px solid rgba(var(--accent-rgb, 255, 90, 0), .11) !important;
        border-bottom: 1px solid rgba(var(--accent-rgb, 255, 90, 0), .11) !important;
        background: transparent !important;
    }

    html body .m367-header-menu .bx-nav-1-lvl:nth-child(5),
    html body .m367-header-menu .bx-nav-1-lvl:nth-child(10),
    html body .bx-top-nav-container .bx-nav-1-lvl:nth-child(5),
    html body .bx-top-nav-container .bx-nav-1-lvl:nth-child(10) {
        border-right: 0 !important;
    }

    html body .m367-header-menu .bx-nav-1-lvl:nth-child(n+6),
    html body .bx-top-nav-container .bx-nav-1-lvl:nth-child(n+6) {
        border-bottom: 0 !important;
    }
}
/* END M367_HEADER_CATALOG_CONTRACT_V3_6 */


/* ───────────────────────────────────────────────────────────────────────────
   Уведомление о тестовом режиме — свёрнутое (21.09)

   Владелец: «атеншен уменьшим типа предложение а наводишь оно открывается».
   Полный текст занимал на телефоне пол-экрана: покупатель приходил за
   товарами, а первым видел дисклеймер в четыре строки.

   Сделано на `<details>`, а не на скрипте: раскрытие работает без JS, доступно
   с клавиатуры и читается голосовым доступом как раскрывающийся блок. Наведение
   добавлено сверху — оно быстрее нажатия, но заменить его не может: на телефоне
   наводить нечем.
   ─────────────────────────────────────────────────────────────────────────── */

.m367-site-status-notice__line {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

/* Стрелка браузера убрана: она рисуется по-разному в каждом и ломает строку. */
.m367-site-status-notice__line::-webkit-details-marker { display: none; }
.m367-site-status-notice__line::marker { content: ""; }

.m367-site-status-notice__short {
    min-width: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, .62);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Знак «есть что раскрыть». Плюс, а не стрелка: стрелка на этом месте читается
   как «перейти», а тут ничего не открывается кроме текста. */
.m367-site-status-notice__line::after {
    flex: 0 0 auto;
    margin-left: auto;
    color: var(--m367-header-accent);
    font-size: 13px;
    line-height: 1;
    content: "+";
}

.m367-site-status-notice[open] .m367-site-status-notice__line::after { content: "–"; }
.m367-site-status-notice[open] .m367-site-status-notice__short { display: none; }

.m367-site-status-notice .m367-site-status-notice__text {
    display: block;
    padding-top: 6px;
}

/* Наведение раскрывает без нажатия — но только там, где есть мышь. */
@media (hover: hover) and (pointer: fine) {
    .m367-site-status-notice:hover .m367-site-status-notice__text,
    .m367-site-status-notice:focus-within .m367-site-status-notice__text {
        display: block;
    }
    .m367-site-status-notice:not([open]) .m367-site-status-notice__text { display: none; }
    .m367-site-status-notice:hover .m367-site-status-notice__short,
    .m367-site-status-notice:focus-within .m367-site-status-notice__short { display: none; }
}

/* ───────────────────────────────────────────────────────────────────────────
   Короткая строка полосы состояния ПЕРЕНОСИТСЯ на телефоне (25.09)
   ───────────────────────────────────────────────────────────────────────────
   Замер при 390 px: строке нужно 234 px, дано 162 — покупатель читал
   «цены и наличие уточняет мен…». Предупреждение о ценах, обрезанное на
   полуслове, хуже отсутствующего: человек видит, что от него что-то скрыли,
   и не знает что.

   Многоточие здесь ничего не экономит: строка и так одна на всю ширину полосы,
   а вторая строка стоит 16 px высоты. На широком экране текст влезает целиком,
   и там правило не нужно — поэтому оно под медиа-запросом, а не общее.
   ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .m367-site-status-notice__short {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }
}

/* ───────────────────────────────────────────────────────────────────────────
   Поля ввода на телефоне — 16 px (25.09)
   ───────────────────────────────────────────────────────────────────────────
   Safari на iPhone ЗУМИТ страницу на любом поле с кеглем меньше 16 px, и после
   первого касания вёрстка уезжает за край: человек дозаполняет заказ, возя
   страницу пальцем. Правило давно стоит в приёмке кокпита (23.09), а на
   витрине его не было — при 390 px поля оформления заказа были 13 px (девять
   штук), поля формы «Напишите нам» 15 px.

   Кегль поднимаем только у полей ВВОДА и только на узком экране: галочки и
   переключатели зум не вызывают, а на широком экране 13 px — это выбранный
   размер формы, и трогать его незачем.
   ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .m367-request-field input,
    .m367-request-field select,
    .m367-request-field textarea,
    /* У модалки класс висит на ПОДПИСИ, а не на поле: `.m367-contact-modal__field`
       — это `<label>`, ввод внутри (`m367_contact_modal.css:110`). Селектор с
       двумя именами заодно перебивает её собственное правило, которое грузится
       позже. */
    .m367-contact-modal .m367-contact-modal__field input,
    .m367-contact-modal .m367-contact-modal__field select,
    .m367-contact-modal .m367-contact-modal__field textarea,
    /* Вход и регистрация: поля стокового компонента лежат в нашей обёртке
       `.m367-auth__field` — там было 14 px. */
    .m367-auth__field input,
    .m367-auth__field select,
    .m367-search__input,
    .m367-header-search input[type="text"],
    input[name="q"] {
        font-size: 16px;
    }
}

/* ИЗБРАННОЕ В МИНИ-ШАПКЕ (26.09). Значок тихий, число — акцентом: цифра тут
   и есть сообщение, а сердце только говорит, о чём она. */
.m367-site-header__mini-fav {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--m367-header-text, #fff);
	text-decoration: none;
}

.m367-site-header__mini-fav svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linejoin: round;
}

.m367-site-header__mini-fav:hover { color: var(--m367-header-accent); }

.m367-site-header__mini-fav [data-m367-fav-count] {
	min-width: 16px;
	color: var(--m367-header-accent);
	font-size: 12px;
	font-weight: var(--m367-font-weight-strong);
	line-height: 1;
}
