.header {
    box-shadow: 0 0 1px #00000052, 0 4px 8px #0000003d;
    position: sticky;
    top: 0;
    z-index: 2;
    margin-bottom: 24px;
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 70px;
}

.header-mobile-btn {
    display: none;
}

.header-logo {
    max-width: 120px;
    height: 60px;
    width: 120px;
    flex: 0 0 120px;
}

.header-logo-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.header-menu {
    margin: 0 auto;
    font-weight: 700;
    border-top-color: var(--border);
    border-top-width: 1px;
    border-top-style: solid;
    padding: 20px 0;
}

.header-menu-ul {
    display: flex;
    gap: 24px;
    list-style: none;
    justify-content: center;
}

.header-menu-ul li {
    position: relative;
}

.header-menu-ul li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
}

.header-menu-ul .sub-menu {
    position: absolute;
    list-style: none;
    background-color: var(--header);
    top: 0;
    left: 100%;
    transition: .3s;
    opacity: 0;
    visibility: hidden;
    border: 2px solid var(--border);
    min-width: 240px;
    z-index: 1;
}

/* Стили для подменю первого уровня (открываются вниз) */
.header-menu-ul > li > .sub-menu {
    top: 100%;
    left: 50%;
    transform: translate(-50%, 0);
}

.header-menu-ul .sub-menu li {
    padding: 5px 10px;
}

.header-menu-ul a {
    display: block;
    color: var(--header-font);
}

.header-buttons {
    display: flex;
    justify-content: end;
    gap: 12px;
    white-space: nowrap;
}

@media screen and (max-width: 768px) {
    .header-wrapper {
        gap: 10px;
    }

    .header-mobile-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        flex: 0 0 36px;
        width: 36px;
        height: 24px;
    }

    .header-mobile-btn div {
        height: 4px;
        width: 100%;
        background-color: var(--font);
    }

    .header-mobile-btn div:first-child {
        width: 90%;
    }

    .header-mobile-btn div:last-child {
        width: 70%;
    }

    .header-logo {
        max-width: 100px;
        height: 60px;
        width: 100px;
        flex: 0 0 100px;
    }

    .header-menu {
        display: none;
        position: absolute;
        z-index: 2;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--header);
        padding: 0;
    }

    .header-menu.open {
        display: block;
    }

    .header-menu-ul {
        flex-direction: column;
        gap: 0;
    }

    .header-menu-ul a {
        padding: 20px;
        border-bottom: 1px solid var(--border);
    }

    .header-menu-ul li:last-child a {
        border: none;
    }

    .header-menu-ul .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: none;
        min-width: auto;
        padding-left: 20px;
        background-color: rgba(0, 0, 0, 0.1);
    }

    .header-menu-ul > li > .sub-menu {
        left: 0;
        transform: none;
    }

    .header-menu-ul .sub-menu li {
        padding: 0;
    }

    .header-menu-ul .sub-menu a {
        padding: 15px 20px 15px 30px;
        border-bottom: 1px solid rgba(255, 255, 255, .05);
    }

    .header-buttons {
        margin-left: auto;
    }
}

@media screen and (max-width: 768px) {
    .header-buttons a:first-child {
        display: none;
    }
}
