/* --- Logo&menu ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ --- */
:root {
    --vdx-accent-color: #ffffff;
    --vdx-glass-base: rgba(10, 10, 10, 0.4);
    --vdx-submenu-bg: rgba(6, 9, 16, 0.7);
    --vdx-line-subtle: rgba(255, 255, 255, 0.08);
    --vdx-text-dim: rgba(255, 255, 255, 0.6);
}

/* --- ШАПКА --- */
.vdx-site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 72px;
    z-index: 99999;
    display: flex;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
}

.vdx-glass-overlay {
    position: absolute;
    inset: 0;
    background: var(--vdx-glass-base);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid var(--vdx-line-subtle);
}

.vdx-header-wrapper {
    position: relative;
    width: 100%;
    max-width: 1400px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* --- НАВИГАЦИЯ (ДЕСКТОП) --- */
.vdx-main-registry {
    display: flex;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.vdx-unit-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--vdx-text-dim);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.vdx-unit-link:hover {
    color: #fff;
}

.vdx-chevron {
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    margin-left: 8px;
    opacity: 0.5;
    transition: 0.3s ease;
}

/* --- ВЫПАДАЮЩЕЕ МЕНЮ (ДЕСКТОП) --- */
.vdx-has-submenu {
    position: relative;
    padding-bottom: 15px; 
    margin-bottom: -15px;
}

.vdx-submenu-list {
    position: absolute;
    top: calc(100% + 15px); 
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.98);
    background: var(--vdx-submenu-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 20px;
    list-style: none;
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.vdx-submenu-list::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}

@media (min-width: 1025px) {
    .vdx-has-submenu:hover .vdx-submenu-list {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    .vdx-has-submenu:hover .vdx-chevron {
        transform: rotate(225deg) translateY(2px);
        opacity: 1;
    }
}

.vdx-submenu-link {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    border-radius: 14px;
    transition: background 0.2s ease;
}

.vdx-submenu-link:hover {
    background: rgba(255, 255, 255, 0.06);
}

.vdx-submenu-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: #fff;
}

.vdx-submenu-content {
    display: flex;
    flex-direction: column;
}

.vdx-submenu-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.vdx-submenu-desc {
    color: var(--vdx-text-dim);
    font-size: 11px;
    margin-top: 3px;
    line-height: 1.2;
}

/* --- КНОПКА CTA --- */
.vdx-cta-trigger {
    background: rgba(255, 255, 255, 0.05); 
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vdx-cta-trigger:hover {
    background: #fff;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border-color: #fff;
}


/* ================================================= */
/* ФИНАЛЬНАЯ МОБИЛЬНАЯ ВЕРСИЯ (Header, Nav, Burger)  */
/* ================================================= */

/* Кнопка бургера (база) */
.vdx-mobile-commander {
    display: none; /* Скрыт на десктопе */
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1100; /* Всегда выше меню */
}

.vdx-bar-element {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: transform 0.3s ease, width 0.3s ease, opacity 0.3s ease;
}

@media (max-width: 1024px) {
    /* Показываем бургер */
    .vdx-mobile-commander {
        display: flex;
    }

    /* Прячем обычную навигацию */
    .vdx-nav-shell {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: #000000;
        z-index: 1000;
        display: none; /* По умолчанию скрыто */
        flex-direction: column;
        padding: 100px 24px 40px;
        overflow-y: auto;
    }

    /* Когда меню активно (класс от твоего JS) */
    .vdx-site-header.vdx-portal-active .vdx-nav-shell {
        display: flex;
    }

    /* Вертикальный список */
    .vdx-main-registry {
        flex-direction: column;
        gap: 0;
        width: 100%;
        list-style: none;
    }

    .vdx-registry-unit {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .vdx-unit-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 22px 0;
        font-size: 24px;
        color: #fff;
        text-decoration: none;
        width: 100%;
        font-family: 'Golos Text', sans-serif;
    }

    /* --- ПОДМЕНЮ (Портфолио) - ИСПРАВЛЕННОЕ --- */
    .vdx-submenu-list {
        display: none !important; /* Скрыто, пока нет класса is-open */
        position: static !important; /* Выключаем десктопное позиционирование */
        opacity: 1 !important; /* Сбрасываем прозрачность */
        visibility: visible !important; /* Сбрасываем скрытость */
        background: rgba(255, 255, 255, 0.05) !important;
        width: 100% !important;
        padding: 10px 0 !important;
        transform: none !important; /* Убираем десктопные смещения */
    }

    /* Когда кликнули (JS добавил класс is-open) */
    .vdx-has-submenu.is-open .vdx-submenu-list {
        display: block !important;
    }

    /* Чтобы пункты внутри не слипались */
    .vdx-submenu-item {
        width: 100%;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .vdx-submenu-link {
        padding: 15px 20px !important;
        display: flex !important;
        opacity: 1 !important;
    }

    .vdx-submenu-title { font-size: 18px; display: block; color: #fff; }
    .vdx-submenu-desc { font-size: 13px; color: #888; }

    /* Анимация бургера в крестик */
    .vdx-site-header.vdx-portal-active .vdx-bar-alpha {
        transform: translateY(4px) rotate(45deg);
    }

    .vdx-site-header.vdx-portal-active .vdx-bar-omega {
        transform: translateY(-4px) rotate(-45deg);
    }

    /* Убираем кнопку "Связаться" на мобилках, если она мешает логотипу */
    .vdx-cta-trigger {
        display: none; 
    }
}

@media (max-width: 1024px) {
    /* 1. Делаем контейнер кнопок гибким */
    .vdx-action-zone {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    /* 2. По умолчанию на мобилке кнопку в шапке можно скрыть, 
       ЧТОБЫ ОНА ПОЯВИЛАСЬ ТОЛЬКО ВНУТРИ МЕНЮ */
    .vdx-cta-trigger {
        display: none; /* Скрываем в обычной шапке */
    }

    /* 3. МАГИЯ: показываем кнопку только когда меню открыто! */
    .vdx-site-header.vdx-portal-active .vdx-cta-trigger {
        display: block;
        position: fixed; /* Фиксируем её относительно экрана */
        bottom: 40px;    /* Прижимаем к низу */
        left: 24px;
        right: 24px;
        z-index: 1100;   /* Выше черного фона */
        
        background: #fff;
        color: #000;
        padding: 18px;
        border-radius: 14px;
        text-align: center;
        font-weight: 700;
        text-decoration: none;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }
}

.main-header {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
    margin-top: -120px;
    position: relative;
    z-index: 10;
    padding-bottom: 60px; /* Отступ до следующего контента */
}

.sidebar {
    position: sticky;
    top: 20px; 
}

.logo-box {
    margin-bottom: 24px;
    text-align: center;
}
.logo-box img {
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; /* Магия: картинка впишется целиком, сохраняя пропорции, и не обрежется */
    display: block;
}

/* ================================================= */
/* MEGA MENU (3 колонки) — ИДЕАЛЬНОЕ ЦЕНТРИРОВАНИЕ  */
/* ================================================= */

.vdx-submenu-list.vdx-megamenu {
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;                          /* Центрируем относительно родителя */
    transform: translate(-50%, 10px) scale(0.98);
    min-width: 800px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    background: var(--vdx-submenu-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

/* Появление при ховере */
@media (min-width: 1025px) {
    .vdx-has-submenu:hover .vdx-submenu-list.vdx-megamenu {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, 0) scale(1);
    }
}

/* Колонка мега-меню */
.vdx-megamenu-column {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Заголовок колонки */
.vdx-column-title {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-left: 16px;
}

/* Контейнер элементов внутри колонки */
.vdx-column-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Бейджи (NEW, POPULAR, HOT, PRO) */
.vdx-menu-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.12);  /* полупрозрачный светлый фон */
    color: #fff;
    font-size: 8px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 40px;          /* овальная форма */
    margin-left: 8px;
    text-transform: none;         /* убираем uppercase, если не нужно */
    letter-spacing: 0.2px;
    vertical-align: middle;
    line-height: 1.3;
    border: 1px solid rgba(255, 255, 255, 0.2); /* тонкая обводка */
    backdrop-filter: blur(2px);   /* лёгкое размытие фона (опционально) */
}

/* ================================================= */
/* АДАПТАЦИЯ MEGA MENU ПОД МОБИЛЬНЫЕ (до 1024px)     */
/* ================================================= */
@media (max-width: 1024px) {
    /* Мега-меню превращается в вертикальный список */
    .vdx-submenu-list.vdx-megamenu {
        grid-template-columns: 1fr;   /* одна колонка */
        min-width: auto;              /* сбрасываем фикс. ширину */
        left: auto;                   /* убираем позиционирование */
        transform: none;              /* убираем трансформацию */
        padding: 10px 0;
        background: transparent;      /* прозрачный фон, так как подложка уже есть */
        backdrop-filter: none;
        border: none;
        box-shadow: none;
    }

    /* Убираем лишние отступы у колонок */
    .vdx-megamenu-column {
        margin-bottom: 20px;
    }

    /* Заголовки колонок на мобилках можно сделать чуть заметнее */
    .vdx-column-title {
        color: rgba(255, 255, 255, 0.6);
        font-size: 12px;
        padding-left: 20px;
        margin-bottom: 8px;
    }

    /* Сами элементы сохраняют свои стили (иконки, текст) */
    .vdx-submenu-item {
        width: 100%;
    }
}

/* Футер мега-меню */
.vdx-megamenu-footer {
    grid-column: span 3;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.vdx-megamenu-button {
    display: inline-block;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: color 0.2s ease;
}

.vdx-megamenu-button:hover {
    color: #fff;
}

/* Добавляем стрелку, как в других пунктах */
.vdx-megamenu-button::after {
    content: "→";
    margin-left: 6px;
    opacity: 0.5;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: inline-block;
}

.vdx-megamenu-button:hover::after {
    transform: translateX(3px);
    opacity: 1;
}

@media (max-width: 1024px) {
    .vdx-megamenu-footer {
        grid-column: span 1;
    }
}