/* ============================================================
 * ОБЩЕЕ: aside, лого, список, контакты, mobile, popup
 * ============================================================ */
.mobile-menu-toggle,
.mobile-menu-close,
.mobile-menu-overlay { display: none; }

.custom-side-menu {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    background: #1a1a2e;
    color: #fff;
    z-index: 9999;
    overflow-y: auto;
    box-sizing: border-box;
}
.side-menu-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 40px 22px;
    box-sizing: border-box;
}

.side-menu-logo { text-align: center; margin-bottom: 34px; }
.side-menu-logo img {
    max-width: 200px; height: auto;
    display: inline-block;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}
.side-menu-subtitle {
    margin: 14px 0 0;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #9aa0a6;
}

.side-menu-nav { flex: 1 1 auto; }
.side-menu-list,
.side-menu-list .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}
.side-menu-list > li { margin-bottom: 4px; position: relative; }

.side-menu-list > li > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    text-decoration: none;
    border-radius: 8px;
    transition: background .2s, color .2s;
    position: relative;
    color: inherit;
}
.side-menu-list > li > a .menu-icon {
    display: inline-flex;
    width: 20px; height: 20px;
    flex-shrink: 0;
    color: #e94560;
}
.side-menu-list > li > a .menu-icon svg { width: 100%; height: 100%; display: block; }
.side-menu-list > li > a .menu-text { flex: 1 1 auto; }

.side-menu-list .menu-item-has-children > a::after {
    content: '';
    width: 6px; height: 6px;
    border-right: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.5;
    margin-left: 8px;
    flex-shrink: 0;
}
.side-menu-list .menu-item-has-children:hover > a::after { opacity: 1; }

.side-menu-list > li:nth-child(-n+4) > a {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: rgba(255,255,255,0.06);
}
.side-menu-list > li:nth-child(-n+4) > a:hover {
    background: rgba(255,255,255,0.15);
}
.side-menu-list > li:nth-child(n+5) > a {
    font-size: 14px;
    color: #9aa0a6;
}
.side-menu-list > li:nth-child(n+5) > a:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}
.side-menu-list > li.current-menu-item > a,
.side-menu-list > li.current-menu-ancestor > a { color: #e94560 !important; }

/* Кнопка-шеврон (для tree) — по умолчанию скрыта, включает variant-tree */
.submenu-toggle {
    display: none;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
}

.side-menu-contacts {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.side-menu-phone {
    display: block;
    margin-bottom: 16px;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
}
.side-menu-social { display: flex; gap: 8px; margin-bottom: 18px; }
.side-menu-social a {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    transition: background .2s;
}
.side-menu-social a:hover { background: rgba(255,255,255,0.2); }

.side-menu-contact-btn {
    width: 100%;
    padding: 13px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.side-menu-contact-btn:hover { background: #d63751; }

/* ============================================================
 * MOBILE ≤ 989px — единый drawer для всех вариантов
 * ============================================================ */
@media (max-width: 989px) {
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        position: fixed;
        top: 14px; left: 14px;
        width: 44px; height: 44px;
        background: #1a1a2e;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        z-index: 10001;
        box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    }
    .mobile-menu-toggle span {
        display: block;
        width: 22px; height: 2px;
        background: #fff;
        border-radius: 2px;
    }
    .mobile-menu-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s;
        z-index: 10000;
    }
    body.mobile-menu-open .mobile-menu-overlay { opacity: 1; pointer-events: auto; }

    .custom-side-menu {
        width: 300px !important;
        max-width: 88vw !important;
        transform: translateX(-100%);
        transition: transform .3s ease;
        z-index: 10002;
    }
    body.mobile-menu-open .custom-side-menu { transform: translateX(0); }

    .mobile-menu-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 12px; right: 12px;
        width: 36px; height: 36px;
        background: rgba(255,255,255,0.1);
        border: none;
        border-radius: 50%;
        color: #fff;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
        z-index: 10003;
    }
    .side-menu-inner { padding: 56px 18px 30px; }
    .side-menu-logo img { max-width: 180px; filter: brightness(0) invert(1); }

    /* Мобильная разметка подменю — inline-аккордеон в любом варианте */
    .side-menu-list .sub-menu {
        display: none;
        position: static !important;
        min-width: 0 !important;
        max-width: none !important;
        box-shadow: none !important;
        background: transparent !important;
        border: none !important;
        margin: 4px 0 8px !important;
        padding: 0 0 0 16px !important;
        border-left: 2px solid rgba(255,255,255,0.1) !important;
    }
    .side-menu-list .menu-item-has-children.is-open > .sub-menu { display: block; }
    .side-menu-list .menu-item-has-children > a::after {
        transform: rotate(45deg) translateY(-2px);
    }
    .side-menu-list .menu-item-has-children.is-open > a::after {
        transform: rotate(-135deg) translateY(-2px);
        opacity: 1;
    }
    .side-menu-list .sub-menu a {
        display: block;
        padding: 10px 14px;
        font-size: 14px;
        color: #b0b5ba;
        text-decoration: none;
        border-radius: 6px;
    }

    /* Кнопка-шеврон в tree на мобильном тоже работает — но здесь уже всё inline */
    .submenu-toggle { display: none !important; }

    .mobile-contact-btn {
        position: fixed;
        bottom: 20px; right: 20px;
        padding: 13px 22px;
        background: #e94560;
        color: #fff;
        border: none;
        border-radius: 50px;
        font-size: 15px;
        font-weight: 600;
        box-shadow: 0 6px 24px rgba(233,69,96,0.4);
        cursor: pointer;
        z-index: 9999;
    }
}

/* ============================================================
 * POPUP
 * ============================================================ */
.contact-popup {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}
.contact-popup.is-open { display: flex; }
.contact-popup-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.contact-popup-box {
    position: relative;
    background: #fff;
    padding: 40px;
    border-radius: 14px;
    max-width: 480px;
    width: calc(100% - 40px);
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.contact-popup-box h3 { margin: 0 0 8px; font-size: 22px; }
.contact-popup-box p  { margin: 0 0 22px; color: #666; font-size: 14px; }
.contact-popup-close {
    position: absolute;
    top: 10px; right: 14px;
    background: none; border: none;
    font-size: 28px; line-height: 1;
    color: #999; cursor: pointer;
}
.contact-popup-close:hover { color: #000; }
.contact-popup-form input,
.contact-popup-form textarea {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}
.contact-popup-form textarea { min-height: 90px; resize: vertical; }
.contact-popup-form button {
    width: 100%;
    padding: 14px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.contact-popup-form button:hover { background: #d63751; }