:root {
    --primary: #7a1f17;
    --bg: #f8f5ef;
    --border: #ebe4d8;
    --text: #1e1e1e;
    --muted: #756b63;
    --white: #ffffff;
    --black: #1e1e1e;
    --success-bg: #e7f5e8;
    --success-text: #16823a;
    --danger-bg: #ffd9d9;
    --danger-text: #9b1c1c;
    --gold: #d9a441;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
}

a {
    color: inherit;
}

main,
.page-content,
.content-wrapper {
    flex: 1;
}

/* HEADER */

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: minmax(220px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    min-width: 0;
}

.site-logo,
.logo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    flex: 0 0 64px;
}

.site-logo {
    object-fit: contain;
    background: #ffffff;
}

.logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
}

.brand-text {
    min-width: 0;
}

.brand-title {
    font-size: 20px;
    line-height: 1.1;
    font-weight: 900;
    color: #241915;
    white-space: nowrap;
}

.brand-subtitle {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
    display: none;
}

.site-nav a {
    color: #30211c;
    text-decoration: none;
    background: var(--bg);
    border: 1px solid #e4dace;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.site-nav a:hover {

.site-nav a[aria-current="page"] {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}
    color: var(--primary);
    border-color: var(--primary);
}

.user-menu {
    position: relative;
    justify-self: end;
}

.user-trigger {
    border: none;
    background: var(--bg);
    color: #30211c;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    width: 220px;
    padding-top: 8px;
    z-index: 200;
}

.user-menu:hover .user-dropdown {
    display: block;
}

.user-dropdown-inner {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    overflow: hidden;
}

.user-dropdown a {
    display: block;
    padding: 12px 14px;
    text-decoration: none;
    color: #222;
    font-size: 14px;
    font-weight: 800;
}

.user-dropdown a:hover {
    background: var(--bg);
}

.user-dropdown hr {
    margin: 0;
    border: none;
    border-top: 1px solid #eee;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 900;
    white-space: nowrap;
}

/* COMMON */

.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px;
}

.box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 7px 18px rgba(55, 33, 25, .05);
}

.box-title {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 14px;
}

.error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-radius: 15px;
    padding: 13px;
    margin-bottom: 14px;
    font-weight: 900;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
    margin-top: 8px;
}

/* FOOTER */

.site-footer {
    background: #241915;
    color: #ffffff;
    margin-top: auto;
    padding: 28px 14px 110px;
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 1fr;
    gap: 24px;
}

.footer-title {
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 10px;
}

.footer-line,
.footer-link {
    display: block;
    color: rgba(255,255,255,.78);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 7px;
    line-height: 1.35;
}

.footer-link:hover {
    color: #ffffff;
}

.footer-schedule-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255,255,255,.78);
    font-size: 13px;
    font-weight: 700;
    padding: 3px 0;
}

.footer-schedule-row strong {
    color: #ffffff;
}

.footer-schedule-row .closed {
    color: #fca5a5;
}

.footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-socials a {
    color: #ffffff;
    background: rgba(255,255,255,.1);
    border-radius: 999px;
    padding: 8px 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
}

/* COOKIE */
.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);

    z-index: 10000;

    width: min(760px, calc(100% - 32px));

    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding: 16px;

    border-radius: 18px;

    background: #241713;
    color: #ffffff;

    box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
}

.cookie-text {
    flex: 1;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.cookie-text a {
    color: #ffffff;
    text-decoration: underline;
}

.cookie-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-actions button {
    min-height: 42px;

    padding: 9px 18px;

    border-radius: 12px;

    font-size: 12px;
    font-weight: 900;

    cursor: pointer;
}

.cookie-reject {
    min-width: 150px;

    border: 1px solid rgba(255, 255, 255, .25);

    background: transparent;
    color: #ffffff;
}

.cookie-reject:hover {
    background: rgba(255, 255, 255, .08);
}

.cookie-accept {
    min-width: 110px;

    border: 1px solid #e4a82f;

    background: #e4a82f;
    color: #241713;
}

.cookie-accept:hover {
    background: #efb640;
}

@media (max-width: 640px) {

    .cookie-banner {
        bottom: 12px;

        width: calc(100% - 24px);

        flex-direction: column;
        align-items: stretch;

        gap: 14px;

        padding: 16px;
    }

    .cookie-actions {
        width: 100%;
    }

    .cookie-actions button {
        flex: 1;
        min-width: 0;
    }

}
.support-chat-orders {
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #e4dace;
}

.support-orders-title {
    font-size: 12px;
    font-weight: 900;
    color: #7b6d64;
    margin-bottom: 6px;
}

.support-orders-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
}

.support-order-btn {
    flex: 0 0 auto;
    border: 1px solid #e4dace;
    background: #f8f5ef;
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 900;
    color: #241915;
    cursor: pointer;
}
#cookie-accept {
    border: none;
    background: var(--gold);
    color: #241915;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}

.support-chat {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 6000;
}

.support-chat-toggle {
    border: none;
    border-radius: 999px;
    background: #241915;
    color: #fff;
    padding: 14px 18px;
    font-weight: 900;
    box-shadow: 0 12px 30px rgba(0,0,0,.25);
    cursor: pointer;
}

.support-chat-box {
    display: none;
    width: 340px;
    height: 460px;
    background: #fff;
    border: 1px solid #e4dace;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 60px rgba(0,0,0,.28);
}

.support-chat.open .support-chat-box {
    display: flex;
    flex-direction: column;
}

.support-chat.open .support-chat-toggle {
    display: none;
}

.support-chat-header {
    background: #241915;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.support-chat-header button {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.support-chat-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: #f8f5ef;
}

.support-chat-empty {
    color: #7b6d64;
    font-size: 14px;
    font-weight: 700;
}

.support-message {
    max-width: 82%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.35;
}

.support-message.customer {
    margin-left: auto;
    background: #7a1f17;
    color: #fff;
}

.support-message.operator {
    margin-right: auto;
    background: #fff;
    color: #241915;
    border: 1px solid #e4dace;
}

.support-chat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e4dace;
}

.support-chat-form input {
    flex: 1;
    border: 1px solid #e4dace;
    border-radius: 14px;
    padding: 10px 12px;
    outline: none;
}

.support-chat-form button {
    border: none;
    border-radius: 14px;
    background: #7a1f17;
    color: #fff;
    padding: 10px 12px;
    font-weight: 900;
    cursor: pointer;
}
.site-rating-strip {
    background: #fff7ed;
    border-bottom: 1px solid #fed7aa;
    text-align: center;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 900;
}

.site-rating-strip a {
    color: #9a3412;
    text-decoration: none;
}

.site-rating-strip span {
    color: #7c2d12;
    font-weight: 700;
}
        @media (max-width: 991.98px){
            .top-user{
                margin-top:.75rem;
                justify-content:space-between;
            }
        }
/* TABLET */

@media (max-width: 980px) {
    .site-header-inner {
        grid-template-columns: 1fr auto;
        gap: 12px;
    }

    .site-brand {
        grid-column: 1 / 2;
    }

    .user-menu {
        grid-column: 2 / 3;
        grid-row: 1;
    }

    .site-nav {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-top: 2px;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

/* MOBILE */

@media (max-width: 640px) {
    .site-header-inner {
        padding: 10px 12px;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .site-brand {
        width: 100%;
    }

    .site-logo,
    .logo-placeholder {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
        border-radius: 12px;
    }

    .brand-title {
        font-size: 17px;
        white-space: normal;
    }

    .brand-subtitle {
        font-size: 11px;
        white-space: normal;
    }

    .site-nav {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .site-nav a {
        padding: 9px 12px;
        font-size: 12px;
    }

    .user-menu {
        width: 100%;
        justify-self: stretch;
    }

    .user-trigger,
    .login-btn {
        width: 100%;
    }

    .user-dropdown {
        left: 0;
        right: 0;
        width: 100%;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
        left: 10px;
        right: 10px;
        bottom: 10px;
        border-radius: 16px;
    }

    #cookie-accept {
        width: 100%;
    }
}

/* SMALL MOBILE */

@media (max-width: 380px) {
    .brand-title {
        font-size: 15px;
    }

    .site-logo,
    .logo-placeholder {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    .site-nav a {
        padding: 8px 10px;
    }
}

/* Cookie: покинуть сайт */
.cookie-leave {
    min-width: 120px;

    border: 1px solid rgba(255, 255, 255, .25);

    background: rgba(255, 255, 255, .08);
    color: #ffffff;
}

.cookie-leave:hover {
    background: rgba(255, 255, 255, .14);
}

/* ============================================================
 * FOOTER BRAND / LOGO / REQUISITES
 * ============================================================ */

.footer-inner {
    align-items: start;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-brand .footer-title {
    margin-bottom: 8px;
}

.footer-logo-link {
    display: block;
    width: 210px;

    margin: 0 0 12px -26px;

    line-height: 0;
    text-decoration: none;
}

.footer-logo {
    display: block;

    width: 210px;
    height: 180px;

    object-fit: contain;
    object-position: center;

    border-radius: 0;
}

.footer-brand .footer-line,
.footer-brand .footer-link {
    margin-left: 0;
}


/* Нижние реквизиты */

.footer-requisites {
    max-width: 1180px;

    margin: 24px auto 0;
    padding-top: 16px;

    border-top: 1px solid rgba(255, 255, 255, .14);

    color: rgba(255, 255, 255, .62);

    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.footer-requisites-name {
    margin-bottom: 2px;

    color: rgba(255, 255, 255, .82);

    font-size: 13px;
    font-weight: 900;
}

.footer-requisites-data {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;

    font-weight: 600;
}

.footer-requisites-separator {
    margin: 0;
}

.footer-copyright {
    margin-top: 6px;

    color: rgba(255, 255, 255, .48);

    font-size: 11px;
    font-weight: 600;
}

@media (max-width: 1199.98px) and (min-width: 640.02px) {
    .footer-logo-link {
        margin-left: 0;
    }
}


/* Mobile */

@media (max-width: 640px) {

    .footer-logo-link {
        width: 180px;
        margin-left: -20px;
    }

    .footer-logo {
        width: 180px;
        height: 155px;
    }

    .footer-requisites {
        margin-top: 24px;
        padding-top: 18px;
    }

    .footer-requisites-data {
        display: block;
    }

    .footer-requisites-separator {
        display: none;
    }

}


/* ============================================================
 * MOBILE SITE POLISH
 * Footer / Header / Bottom actions
 * ============================================================ */

@media (max-width: 640px) {

    /* ========================================================
     * HEADER
     * ======================================================== */

    .site-header-inner {
        position: relative;

        min-height: 82px;
        padding: 10px 12px;

        display: grid;

        grid-template-columns:
            minmax(82px, 1fr)
            auto
            minmax(82px, 1fr);

        grid-template-areas:
            "nav brand user";

        align-items: center;

        gap: 8px;
    }

    .site-brand {
        grid-area: brand;

        justify-self: center;

        width: auto;
        min-width: 0;

        display: flex;
        align-items: center;
        justify-content: center;

        text-align: center;
    }

    .site-brand .site-logo {
        display: block;

        width: 62px;
        height: 62px;

        margin: 0;

        object-fit: contain;
    }

    /*
     * На мобильном оставляем только логотип —
     * название уже есть в дизайне сайта и footer.
     */

    .site-brand .brand-text {
        display: none;
    }

    .site-nav {
        grid-area: nav;

        justify-self: start;

        display: flex;
        align-items: center;
        gap: 6px;
    }

    .site-nav a {
        min-height: 42px;
        padding: 0 12px;

        display: inline-flex;
        align-items: center;
        justify-content: center;

        border: 1px solid #e8ded5;
        border-radius: 14px;

        background: #fffaf5;
        color: #241915;

        font-size: 12px;
        font-weight: 900;

        white-space: nowrap;
    }

    /*
     * Чтобы в шапке не было двух широких кнопок,
     * на мобильном оставляем "Меню".
     * Корзина находится в нижней мобильной панели.
     */

    .site-nav a[href*="/cart"] {
        display: none;
    }

    .user-menu {
        grid-area: user;

        justify-self: end;

        min-width: 0;
    }

    .user-trigger,
    .login-btn {
        max-width: 105px;

        min-height: 42px;
        padding: 0 11px;

        overflow: hidden;

        border-radius: 14px;

        white-space: nowrap;
        text-overflow: ellipsis;

        font-size: 12px;
    }


    /* ========================================================
     * FOOTER
     * ======================================================== */

    .site-footer {
        padding:
            28px 18px
            calc(120px + env(safe-area-inset-bottom));
    }

    .footer-inner {
        width: 100%;
        max-width: 430px;

        margin: 0 auto;

        display: flex;
        flex-direction: column;

        gap: 28px;
    }

    .footer-block {
        width: 100%;
    }


    /* BRAND */

    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;

        text-align: center;
    }

    .footer-brand .footer-title {
        width: 100%;

        margin-bottom: 8px;

        text-align: center;

        font-size: 18px;
    }

    .footer-logo-link {
        width: 190px;

        margin: 0 auto 10px;

        display: flex;
        justify-content: center;
    }

    .footer-logo {
        width: 180px;
        height: 180px;

        margin: 0 auto;

        object-fit: contain;
        object-position: center;
    }

    .footer-brand .footer-line,
    .footer-brand .footer-link {
        margin-left: 0;

        text-align: center;
    }


    /* SECTION TITLES */

    .footer-block > .footer-title {
        margin-bottom: 14px;

        font-size: 18px;
        line-height: 1.2;
    }


    /* WORKING HOURS */

    .footer-schedule-row {
        width: 100%;

        padding: 4px 0;

        display: flex;
        align-items: center;
        justify-content: space-between;

        gap: 16px;

        font-size: 14px;
    }

    .footer-schedule-row span {
        min-width: 0;
    }

    .footer-schedule-row strong {
        flex: 0 0 auto;

        text-align: right;

        white-space: nowrap;
    }


    /* SOCIALS */

    .footer-socials {
        display: flex;
        flex-wrap: wrap;

        gap: 10px;
    }

    .footer-socials a {
        min-height: 42px;
        padding: 0 14px;

        display: inline-flex;
        align-items: center;
        justify-content: center;

        border-radius: 12px;

        background:
            rgba(255, 255, 255, .08);

        color: #ffffff;

        font-size: 13px;
        font-weight: 800;

        text-decoration: none;
    }


    /* DOCUMENTS */

    .footer-legal {
        display: grid;
        gap: 0;
    }

    .footer-legal .footer-title {
        margin-bottom: 8px;
    }

    .footer-legal .footer-link {
        min-height: 42px;

        display: flex;
        align-items: center;

        padding: 8px 0;

        border-bottom:
            1px solid rgba(255, 255, 255, .08);

        line-height: 1.3;
    }

    .footer-legal .footer-link:last-child {
        border-bottom: 0;
    }


    /* REQUISITES */

    .footer-requisites {
        max-width: 430px;

        margin-top: 30px;

        padding: 18px 4px 0;

        text-align: center;
    }

    .footer-requisites-data {
        justify-content: center;

        font-size: 11px;
    }


    /* ========================================================
     * MOBILE BOTTOM ACTIONS
     *
     * Стили захватывают существующую корзину и кнопку
     * поддержки, не меняя их backend/JS-логику.
     * ======================================================== */

    a[href$="/cart/"],
    a[href="/cart/"] {
        box-sizing: border-box;
    }


    /*
     * Саму плавающую кнопку поддержки ограничиваем справа,
     * чтобы она физически не могла наехать на корзину.
     *
     * Используем несколько существующих вариантов селекторов:
     * браузер применит только те, которые реально есть.
     */

    .support-chat-button,
    .support-chat-toggle,
    #support-chat-button,
    #support-chat-toggle {
        left: auto !important;

        right: 14px !important;
        bottom:
            calc(14px + env(safe-area-inset-bottom))
            !important;

        width: calc(50% - 21px) !important;
        max-width: 180px !important;
        min-width: 0 !important;

        height: 52px !important;

        margin: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        border-radius: 16px !important;
    }


    /*
     * Если корзина оформлена как fixed/floating элемент,
     * ставим её симметрично слева.
     */

    .floating-cart,
    .cart-floating,
    .mobile-cart-button,
    .cart-fixed,
    #floating-cart,
    #mobile-cart-button {
        left: 14px !important;
        right: auto !important;

        bottom:
            calc(14px + env(safe-area-inset-bottom))
            !important;

        width: calc(50% - 21px) !important;
        max-width: 180px !important;
        min-width: 0 !important;

        height: 52px !important;

        margin: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        border-radius: 16px !important;
    }

}


/* ============================================================
 * VERY SMALL MOBILE
 * ============================================================ */

@media (max-width: 390px) {

    .site-header-inner {
        grid-template-columns:
            minmax(72px, 1fr)
            auto
            minmax(72px, 1fr);
    }

    .site-brand .site-logo {
        width: 56px;
        height: 56px;
    }

    .site-nav a {
        padding: 0 10px;

        font-size: 11px;
    }

    .user-trigger,
    .login-btn {
        max-width: 90px;

        padding: 0 9px;

        font-size: 11px;
    }

    .footer-inner,
    .footer-requisites {
        max-width: 100%;
    }

    .footer-logo-link {
        width: 175px;
    }

    .footer-logo {
        width: 165px;
        height: 165px;
    }

    .footer-schedule-row {
        font-size: 13px;
    }

}


/* ============================================================
 * EXACT MOBILE FLOATING BUTTONS FIX
 * Корзина слева / Поддержка справа
 * ============================================================ */

@media (max-width: 640px) {

    /*
     * Корзина
     */

    .floating-cart-button,
    #floating-cart-button {
        position: fixed !important;

        left: 12px !important;
        right: auto !important;

        bottom:
            calc(14px + env(safe-area-inset-bottom))
            !important;

        width: calc(50vw - 18px) !important;
        max-width: 190px !important;
        min-width: 0 !important;

        height: 54px !important;
        min-height: 54px !important;

        margin: 0 !important;
        padding: 0 12px !important;

        box-sizing: border-box !important;

        display: flex;
        align-items: center;
        justify-content: center;

        gap: 7px;

        border-radius: 18px !important;

        z-index: 1050 !important;
    }


    /*
     * Контейнер поддержки.
     * Позиционируем контейнер, а не пытаемся
     * независимо двигать кнопку внутри него.
     */

    .support-chat {
        position: fixed !important;

        left: auto !important;
        right: 12px !important;

        bottom:
            calc(14px + env(safe-area-inset-bottom))
            !important;

        width: calc(50vw - 18px) !important;
        max-width: 190px !important;

        margin: 0 !important;

        z-index: 1060 !important;
    }


    .support-chat-toggle,
    #support-chat-toggle {
        position: static !important;

        left: auto !important;
        right: auto !important;
        bottom: auto !important;

        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;

        height: 54px !important;
        min-height: 54px !important;

        margin: 0 !important;
        padding: 0 12px !important;

        box-sizing: border-box !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        gap: 6px !important;

        border-radius: 18px !important;

        white-space: nowrap;
    }


    /*
     * Убираем лишнее содержимое корзины на узком экране.
     * Оставляем иконку + "Корзина".
     */

    .floating-cart-total {
        display: none !important;
    }

    .floating-cart-count {
        flex: 0 0 auto;
    }

    .floating-cart-label {
        white-space: nowrap;
    }


    /*
     * Окно чата остаётся над кнопками.
     */

    .support-chat-box {
        position: absolute !important;

        right: 0 !important;
        left: auto !important;

        bottom: 66px !important;

        width: min(360px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
    }


    /*
     * Footer не должен прятаться под fixed-кнопками.
     */

    .site-footer {
        padding-bottom:
            calc(100px + env(safe-area-inset-bottom))
            !important;
    }

}


/* Очень узкие телефоны */

@media (max-width: 370px) {

    .floating-cart-button,
    #floating-cart-button {
        left: 8px !important;

        width: calc(50vw - 12px) !important;

        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .support-chat {
        right: 8px !important;

        width: calc(50vw - 12px) !important;
    }

    .support-chat-toggle,
    #support-chat-toggle {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

}


/* ============================================================
 * MOBILE HEADER FINAL FIX
 * Меню слева / Логотип по центру / Пользователь справа
 * ============================================================ */

@media (max-width: 640px) {

    .site-header {
        position: relative;
    }

    .site-header-inner {
        position: relative !important;

        width: 100% !important;
        min-height: 76px !important;

        padding: 8px 12px !important;

        display: block !important;

        box-sizing: border-box !important;
    }


    /* ========================================================
     * LOGO — СТРОГО ПО ЦЕНТРУ
     * ======================================================== */

    .site-brand {
        position: absolute !important;

        top: 50% !important;
        left: 50% !important;

        transform:
            translate(-50%, -50%) !important;

        width: auto !important;
        height: auto !important;

        margin: 0 !important;
        padding: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        z-index: 2;
    }

    .site-brand .site-logo {
        width: 54px !important;
        height: 54px !important;

        margin: 0 !important;

        display: block !important;

        object-fit: contain !important;
    }

    .site-brand .brand-text {
        display: none !important;
    }


    /* ========================================================
     * МЕНЮ — СЛЕВА
     * ======================================================== */

    .site-nav {
        position: absolute !important;

        top: 50% !important;
        left: 12px !important;

        right: auto !important;

        transform:
            translateY(-50%) !important;

        width: auto !important;
        height: auto !important;

        margin: 0 !important;
        padding: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;

        gap: 0 !important;

        z-index: 3;
    }

    .site-nav a {
        margin: 0 !important;

        min-width: 0 !important;
        min-height: 42px !important;

        padding: 0 13px !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        border-radius: 14px !important;

        white-space: nowrap !important;

        font-size: 12px !important;
    }


    /*
     * Корзина в шапке мобильного не нужна:
     * для неё уже есть нижняя кнопка.
     */

    .site-nav a[href*="/cart"] {
        display: none !important;
    }


    /* ========================================================
     * ПОЛЬЗОВАТЕЛЬ — СПРАВА
     * ======================================================== */

    .user-menu {
        position: absolute !important;

        top: 50% !important;
        right: 12px !important;

        left: auto !important;

        transform:
            translateY(-50%) !important;

        width: auto !important;

        margin: 0 !important;
        padding: 0 !important;

        z-index: 4;
    }

    .user-trigger,
    .login-btn {
        width: auto !important;
        max-width: 100px !important;

        min-height: 42px !important;

        margin: 0 !important;
        padding: 0 12px !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        border-radius: 14px !important;

        overflow: hidden !important;

        white-space: nowrap !important;
        text-overflow: ellipsis !important;

        font-size: 12px !important;
    }

}


/* ============================================================
 * VERY SMALL MOBILE
 * ============================================================ */

@media (max-width: 360px) {

    .site-header-inner {
        min-height: 70px !important;

        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .site-nav {
        left: 8px !important;
    }

    .user-menu {
        right: 8px !important;
    }

    .site-brand .site-logo {
        width: 48px !important;
        height: 48px !important;
    }

    .site-nav a {
        min-height: 38px !important;

        padding-left: 10px !important;
        padding-right: 10px !important;

        font-size: 11px !important;
    }

    .user-trigger,
    .login-btn {
        max-width: 88px !important;

        min-height: 38px !important;

        padding-left: 9px !important;
        padding-right: 9px !important;

        font-size: 11px !important;
    }

}


/* ============================================================
 * MOBILE HEADER — FINAL STABLE LAYOUT
 * ============================================================ */

@media (max-width: 640px) {

    .site-header {
        width: 100% !important;
        overflow: visible !important;
    }

    .site-header-inner {
        position: relative !important;

        width: 100% !important;
        max-width: none !important;
        min-height: 72px !important;

        margin: 0 !important;
        padding: 8px 12px !important;

        box-sizing: border-box !important;

        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;

        gap: 8px !important;

        overflow: visible !important;
    }


    /* ========================================================
     * ЛОГОТИП — СТРОГО ПО ЦЕНТРУ
     * ======================================================== */

    .site-brand {
        position: absolute !important;

        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;

        transform: translate(-50%, -50%) !important;

        width: 52px !important;
        min-width: 52px !important;
        max-width: 52px !important;

        height: 56px !important;

        margin: 0 !important;
        padding: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        z-index: 2 !important;
    }

    .site-brand .site-logo {
        width: 50px !important;
        height: 50px !important;

        max-width: 50px !important;

        margin: 0 !important;
        padding: 0 !important;

        object-fit: contain !important;
    }

    .site-brand .brand-text {
        display: none !important;
    }


    /* ========================================================
     * МЕНЮ — НОРМАЛЬНО СЛЕВА, БЕЗ ABSOLUTE
     * ======================================================== */

    .site-nav {
        position: relative !important;

        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;

        transform: none !important;

        width: auto !important;
        max-width: 105px !important;
        min-width: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;

        flex: 0 0 auto !important;

        z-index: 3 !important;
    }

    .site-nav a {
        position: static !important;

        transform: none !important;

        min-width: 0 !important;
        min-height: 40px !important;

        margin: 0 !important;
        padding: 0 12px !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        box-sizing: border-box !important;

        white-space: nowrap !important;

        font-size: 12px !important;
        line-height: 1 !important;
    }

    .site-nav a[href*="/cart"] {
        display: none !important;
    }


    /* ========================================================
     * ПОЛЬЗОВАТЕЛЬ — СПРАВА
     * ======================================================== */

    .user-menu {
        position: relative !important;

        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;

        transform: none !important;

        width: auto !important;
        max-width: 110px !important;
        min-width: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        flex: 0 0 auto !important;

        z-index: 4 !important;
    }

    .user-trigger,
    .login-btn {
        position: static !important;

        transform: none !important;

        width: auto !important;
        max-width: 105px !important;
        min-width: 0 !important;

        min-height: 40px !important;

        margin: 0 !important;
        padding: 0 12px !important;

        box-sizing: border-box !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        white-space: nowrap !important;

        font-size: 12px !important;
    }

}


/* iPhone / узкие экраны */

@media (max-width: 390px) {

    .site-header-inner {
        min-height: 68px !important;

        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .site-brand {
        width: 46px !important;
        min-width: 46px !important;
        height: 50px !important;
    }

    .site-brand .site-logo {
        width: 44px !important;
        height: 44px !important;
    }

    .site-nav a {
        min-height: 38px !important;

        padding-left: 10px !important;
        padding-right: 10px !important;

        font-size: 11px !important;
    }

    .user-trigger,
    .login-btn {
        max-width: 92px !important;

        min-height: 38px !important;

        padding-left: 9px !important;
        padding-right: 9px !important;

        font-size: 11px !important;
    }

}


/* ============================================================
 * MOBILE UI FINAL
 * user dropdown / floating actions
 * ============================================================ */

@media (max-width: 640px) {

    /* --------------------------------------------------------
     * USER DROPDOWN
     * Должен быть выше поиска, категорий и карточек меню.
     * -------------------------------------------------------- */

    .site-header {
        position: relative !important;
        z-index: 9000 !important;
        overflow: visible !important;
    }

    .site-header-inner {
        overflow: visible !important;
    }

    .user-menu {
        position: relative !important;
        z-index: 9100 !important;
        overflow: visible !important;
    }

    .user-trigger {
        position: relative !important;
        z-index: 9101 !important;
    }

    .user-dropdown {
        z-index: 9200 !important;
    }

    .user-dropdown-inner {
        position: relative !important;
        z-index: 9201 !important;
    }


    /* --------------------------------------------------------
     * SUPPORT — круглая кнопка справа
     * -------------------------------------------------------- */

    .support-chat {
        position: fixed !important;

        left: auto !important;
        right: 14px !important;

        bottom: calc(14px + env(safe-area-inset-bottom)) !important;

        width: 52px !important;
        max-width: 52px !important;
        min-width: 52px !important;

        height: 52px !important;

        margin: 0 !important;
        padding: 0 !important;

        z-index: 6000 !important;
    }

    .support-chat-toggle,
    #support-chat-toggle {
        position: static !important;

        width: 52px !important;
        min-width: 52px !important;
        max-width: 52px !important;

        height: 52px !important;
        min-height: 52px !important;

        margin: 0 !important;
        padding: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        border-radius: 50% !important;

        font-size: 0 !important;
        line-height: 1 !important;

        overflow: hidden !important;
    }

    #support-chat-toggle::before {
        content: "\F268";

        font-family: "bootstrap-icons" !important;
        font-size: 21px !important;
        font-weight: normal !important;
        line-height: 1 !important;

        color: #ffffff;
    }


    /* Когда чат открыт, контейнер снова получает
       нормальную ширину для окна чата. */

    .support-chat.open {
        width: auto !important;
        max-width: none !important;
        height: auto !important;
    }


    /* --------------------------------------------------------
     * CHAT WINDOW
     * -------------------------------------------------------- */

    .support-chat-box {
        max-width: calc(100vw - 28px) !important;
        max-height: calc(100dvh - 110px) !important;
    }

}


/* Очень узкие телефоны */

@media (max-width: 370px) {

    .support-chat {
        right: 10px !important;
    }

}


/* ============================================================
 * MOBILE USER DROPDOWN WIDTH
 * ============================================================ */

@media (max-width: 640px) {

    .user-dropdown {
        left: auto !important;
        right: 0 !important;

        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
    }

    .user-dropdown-inner {
        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;

        box-sizing: border-box !important;
    }

    .user-dropdown a {
        white-space: nowrap !important;
    }

}


/* ============================================================
 * COOKIE BANNER — MOBILE FINAL FIX
 * ============================================================ */

@media (max-width: 640px) {

    .cookie-banner {
        left: 12px !important;
        right: 12px !important;
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;

        transform: none !important;

        width: auto !important;
        max-width: none !important;

        margin: 0 !important;
        padding: 16px !important;

        box-sizing: border-box !important;

        flex-direction: column !important;
        align-items: stretch !important;

        gap: 14px !important;

        border-radius: 18px !important;
    }


    .cookie-text {
        width: 100% !important;
        min-width: 0 !important;

        box-sizing: border-box !important;

        font-size: 13px !important;
        line-height: 1.45 !important;

        overflow-wrap: anywhere;
    }


    .cookie-actions {
        width: 100% !important;
        min-width: 0 !important;

        display: grid !important;
        grid-template-columns: 1fr 1fr !important;

        gap: 8px !important;

        box-sizing: border-box !important;
    }


    .cookie-actions button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;

        min-height: 44px !important;

        margin: 0 !important;
        padding: 9px 8px !important;

        box-sizing: border-box !important;

        white-space: normal !important;

        font-size: 12px !important;
        line-height: 1.2 !important;
    }


    #cookie-accept,
    .cookie-accept {
        grid-column: 1 / -1 !important;

        width: 100% !important;

        white-space: nowrap !important;
    }

}


/* Совсем узкие телефоны */
@media (max-width: 370px) {

    .cookie-banner {
        left: 8px !important;
        right: 8px !important;

        padding: 14px !important;
    }

    .cookie-actions {
        grid-template-columns: 1fr !important;
    }

    #cookie-accept,
    .cookie-accept {
        grid-column: auto !important;
    }

}


/* ============================================================
 * USER DROPDOWN — DESKTOP FINAL POSITION
 * ============================================================ */

@media (min-width: 641px) {

    .site-header {
        position: relative;
        z-index: 9000;
        overflow: visible;
    }

    .site-header-inner {
        overflow: visible;
    }

    .user-menu {
        position: relative !important;
        z-index: 9100 !important;
        overflow: visible !important;
    }

    .user-dropdown {
        position: absolute !important;

        top: calc(100% + 8px) !important;
        right: 0 !important;
        left: auto !important;
        bottom: auto !important;

        transform: none !important;

        width: 190px !important;
        min-width: 190px !important;
        max-width: 190px !important;

        margin: 0 !important;

        z-index: 9200 !important;
    }

    .user-dropdown-inner {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .user-dropdown a {
        white-space: nowrap !important;
    }

}


/* ============================================================
 * SUPPORT CHAT ICON — SVG
 * ============================================================ */

.support-chat-toggle::before,
#support-chat-toggle::before {
    content: none !important;
    display: none !important;
}

.support-chat-icon {
    display: block;

    width: 23px;
    height: 23px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;
}

@media (max-width: 640px) {

    .support-chat-toggle,
    #support-chat-toggle {
        width: 52px !important;
        min-width: 52px !important;
        max-width: 52px !important;

        height: 52px !important;
        min-height: 52px !important;

        padding: 0 !important;

        border-radius: 50% !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        color: #ffffff !important;
    }

    .support-chat-icon {
        width: 22px;
        height: 22px;
    }

}
