/* === Сброс и базовые стили === */
body {
    margin: 0;
    font-family: Arial, sans-serif;
}

.header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: black;
    z-index: 100;
}

.container {
    display: flex;
    justify-content: space-between;
    align-items: center; /* вертикально центрируем весь контент */
    padding: 0 20px;
    height: 60px; /* фиксированная высота шапки */
    box-sizing: border-box;
}

/* === Логотип и название === */
.branding {
    display: flex;
    align-items: center; /* логотип и текст на одной линии */
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo svg {
    height: 32px;
    width: 32px;
}

.title {
    font-size: 24px;
    color: white;
    line-height: 1;
    white-space: nowrap;
}

/* === Главное меню === */
.menu {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
    align-items: center; /* вертикально центрируем элементы меню */
}

.menu li a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    line-height: 32px;
}

.menu li a:hover {
    color: gray;
}

/* === Подменю === */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 10px 0;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 50;
}

.menu li:hover .submenu {
    display: block;
}

.submenu li a {
    display: block;
    padding: 10px 20px;
    color: white;
}

/* === Меню с стрелками === */
.menu-item {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    width: 100%;
}

.arrow {
    transition: transform 0.3s ease;
    display: none;
}

.rotated {
    transform: rotate(180deg);
}

/* === Бургер-меню === */
.menu-toggle {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    color: white;
}

/* === Мобильные устройства === */
@media (max-width: 720px) {
    .menu-toggle {
        display: block;
    }

    .menu {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 60px;
        right: 0;
        width: 80%;
        height: 100%;
        background-color: black;
        padding-top: 20px;
    }

    .menu.active {
        display: flex;
    }

    .submenu {
        position: relative;
        top: 0;
        left: 0;
        padding-left: 10px;
        display: none;
        flex-direction: column;
    }

    .submenu.active {
        display: flex;
    }

    .menu-item {
        justify-content: space-between;
        width: 100%;
        align-items: center;
    }
    .arrow {
        display: block;
    }
    .arrow.rotated {
        transform: rotate(180deg);
    }

    .title {
        font-size: 1.6em;
        margin-left: 0.75em;
        margin-top: 0;
    }
}

/* === Десктоп === */
@media (min-width: 721px) {
    .menu-toggle {
        display: none;
    }

    .menu {
        display: flex;
        position: relative;
        align-items: center;
    }

    .logo, .branding {
        align-items: center;
    }

    .title {
        align-self: center;
        margin-top: 0;
    }

    .arrow {
        display: none;
    }
}
