.mobile-menu-open {
    overflow: hidden;
}

.header__nav {
    padding: 24px 0;
    border-top: 1px solid var(--color-black-opacity);
    border-bottom: 1px solid var(--color-black-opacity);
    background-color: var(--color-white);
    z-index: 10;
    position: relative;
    transition: opacity 0.2s ease;
}

.header__nav_blue {
    background-color: var(--color-accent-blue);
    border-top: 1px solid var(--color-white-opacity);
    border-bottom: 1px solid var(--color-white-opacity);
}

.header__list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    padding: 0;
}

.header__item {
    list-style-type: none;
    font-size: 18px;
    font-weight: 600;
    line-height: 22px;
    cursor: pointer;
}

.header__link {
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.header__link:hover {
    color: var(--color-accent-blue);
}

.mobile-toggle {
    display: none;
}

/* Меню 1-го уровня */
.header__item_level_1.has-submenu {
    display: flex;
    flex-wrap: nowrap;
    flex-direction: row-reverse;
    align-items: center;
    grid-column-gap: 10px;
}

.header__item_level_1.has-submenu > a {
    position: relative;
}

.header__item_level_1.has-submenu > a:after {
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='%23222128'%3E%3Cpath d='M0 0H4V4H0V0Z'/%3E%3Cpath d='M0 7H4V11H0V7Z'/%3E%3Cpath d='M0 14H4V18H0V14Z'/%3E%3Cpath d='M7 0H11V4H7V0Z'/%3E%3Cpath d='M7 7H11V11H7V7Z'/%3E%3Cpath d='M7 14H11V18H7V14Z'/%3E%3Cpath d='M14 0H18V4H14V0Z'/%3E%3Cpath d='M14 7H18V11H14V7Z'/%3E%3Cpath d='M14 14H18V18H14V14Z'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    object-fit: contain;
    width: 18px;
    height: 18px;
    transition: background-image 0.2s ease, fill 0.2s ease;
}

.header__item_level_1.has-submenu > a.header__link_white:after {
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0H4V4H0V0Z' fill='white'/%3E%3Cpath d='M0 7H4V11H0V7Z' fill='white'/%3E%3Cpath d='M0 14H4V18H0V14Z' fill='white'/%3E%3Cpath d='M7 0H11V4H7V0Z' fill='white'/%3E%3Cpath d='M7 7H11V11H7V7Z' fill='white'/%3E%3Cpath d='M7 14H11V18H7V14Z' fill='white'/%3E%3Cpath d='M14 0H18V4H14V0Z' fill='white'/%3E%3Cpath d='M14 7H18V11H14V7Z' fill='white'/%3E%3Cpath d='M14 14H18V18H14V14Z' fill='white'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    object-fit: contain;
    width: 18px;
    height: 18px;
    transition: background-image 0.2s ease, fill 0.2s ease;
}

.header__item_level_1:hover.has-submenu > a:after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='%23ED7180'%3E%3Cpath d='M0 0H4V4H0V0Z'/%3E%3Cpath d='M0 7H4V11H0V7Z'/%3E%3Cpath d='M0 14H4V18H0V14Z'/%3E%3Cpath d='M7 0H11V4H7V0Z'/%3E%3Cpath d='M7 7H11V11H7V7Z'/%3E%3Cpath d='M7 14H11V18H7V14Z'/%3E%3Cpath d='M14 0H18V4H14V0Z'/%3E%3Cpath d='M14 7H18V11H14V7Z'/%3E%3Cpath d='M14 14H18V18H14V14Z'/%3E%3C/svg%3E");
}

.header__item_level_1.has-submenu > .header__sublist {
    position: absolute;
    left: 0;
    top: 70px;
    background-color: var(--color-white);
    width: 100%;
}

.header__item_level_1.has-submenu > .header__sublist ul {
    padding: 0;
    list-style: none;
    display: none;
}

.header__item_level_1.has-submenu.submenu-open ul {
    display: block;
    width: 100%;
    margin: auto;
}

.header__link_level_1 {
    text-decoration: none;
    color: var(--color-black);
    transition: color .2s ease;
    font-weight: 600;
    font-size: 18px;
    gap: 10px;
    flex-direction: row-reverse;
}

.header__link_white {
    color: white;
}

.header__link_white:hover {
    color: var(--color-accent-pink);
}

/* Меню 2-го уровня */
.header__link_level_2 {
    display: flex;
    margin: auto;
    font-size: 20px;
    grid-column-gap: 5px;
    text-decoration: none;
    cursor: pointer;
    width: 64%;
    max-width: 1230px;
    color: var(--color-black);
    transition: color 0.3s ease, background-color 0.3s ease;

    padding: 40px 0 40px 35px;
    position: relative;
    box-sizing: border-box;
}

.header__item_level_2 {
    border-top: 1px solid var(--color-black-opacity);
    padding: 0;
}

.header__item_level_2 > .header__sublist ul {
    grid-column-gap: 30px;
    display: flex !important;
    flex-wrap: wrap;
    margin: auto;
    width: 74%;

    box-sizing: border-box;
}

.header__item_level_2.has-submenu > .header__sublist ul {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.25, 0.8, 0.25, 1),
                max-height 1.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 64%;
    background-color: white;
}

//@media screen and (max-width: 1920px) {
    //.header__item_level_2.has-submenu > .header__sublist ul {
        //width: 74%;
    //}
//}

.header__item_level_2.has-submenu:hover > .header__sublist ul {
    max-width: 1230px;
    max-height: 500px;
    opacity: 1;
    padding: 0 0 27px 0;
    background-color: var(--color-accent-blue-opacity);
    transition: opacity 1.2s ease-in,
                max-height 1.2s ease-out;
}

@media screen and (max-width: 1300px) {
    .header__item_level_2.has-submenu > .header__sublist ul {
        transition: opacity .6s cubic-bezier(0.25, 0.8, 0.25, 1),
                    max-height .6s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    .header__item_level_2.has-submenu:hover > .header__sublist ul {
        transition: opacity .6s ease-in,
                    max-height .6s ease-out;
    }
}

.header__item_level_2_active {
    background-color: var(--color-accent-blue-opacity);
    color: var(--color-accent-blue);
}

.submenu_active {
    width: 84% !important;
    display: flex !important;
    background-color: var(--color-accent-blue-opacity) !important;
    margin: auto !important;
    box-sizing: border-box !important;
}

.header__link_level_2_active {
    color: var(--color-accent-blue);
}

.header__item_level_2:hover {
    background-color: var(--color-accent-blue-opacity);
}

.header__link_level_2:before {
    content: '';
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1H13M13 1V13M13 1L1 13' stroke='%23222128' stroke-width='2'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    object-fit: contain;
    width: 18px;
    height: 18px;
    position: absolute;
    top: 40%;
    left: 0;
}

.header__link_level_2_active:before {
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1H13M13 1V13M13 1L1 13' stroke='%231F40E5' stroke-width='2'/%3E%3C/svg%3E");
}

.header__item_level_2:hover > .header__link_level_2:before {
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1H13M13 1V13M13 1L1 13' stroke='%231F40E5' stroke-width='2'/%3E%3C/svg%3E");
}

.header__item_level_2:hover > .header__link_level_2 {
    color: var(--color-accent-blue);
}

.header__item_level_2 a:hover {
    color: var(--color-accent-blue);
}


.header__item_level_2.has-submenu:hover > .header__link_level_2:hover {
    color: var(--color-accent-pink) !important;
}

.header__item_level_2.has-submenu:hover > .header__link_level_2:hover::before {
    background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 14 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1H13M13 1V13M13 1L1 13' stroke='%23ED7180' stroke-width='2'/%3E%3C/svg%3E");
}

/* Меню 3-го уровня */
.header__item_level_3 a {
    font-size: 18px;
    font-weight: 400;
    padding: 12px;
    color: var(--color-accent-blue);
}

.header__item_level_3 a:before {
    content: "\25CF";
}

.header__item_level_3 a:hover {
    background-color: unset;
    font-weight: 600;
}

/* Мобильное меню */
.header__mobile-buttons-container {
    display: none;
}

@media screen and (max-width: 1920px) {
    .header__link_level_2 {
        width: 74%;
    }
}

@media screen and (max-width: 1700px) {
    .header__link_level_2, .header__item_level_2.has-submenu:hover > .header__sublist ul {
        width: 74%;
    }

    .submenu_active {
        width: 94% !important;
    }
}

@media screen and (max-width: 1400px) {
    .header__nav {
        padding: 24px 0;
    }
}

@media screen and (max-width: 1300px) {
    .header__link_level_2, .header__item_level_2.has-submenu:hover > .header__sublist ul {
        width: 94%;
    }

    .header_flex {
        display: flex !important;
    }
    
    .header__link_level_1 {
        width: 94%;
        margin: auto;
        padding: 10px;
        justify-content: flex-end;
    }

    .header__item_level_2.has-submenu > .header__sublist ul {
        padding: 0 0 5px 0;
    }

    .header__mobile-buttons-container {
        display: flex;
    }

    .header__burger-button {
        cursor: pointer;
    }

    .header__burger-button svg path {
        fill: #222128;
        transition: fill .2s ease;
    }

    .header__burger-button_white svg path {
        fill: white;
        transition: fill .2s ease;
    }

    .header__burger-button:hover svg path {
        fill: #ED7180;
        transition: fill .2s ease;
    }

    .header:has(.mobile-toggle:checked) .header__nav {
        display: flex;
    }

    .header:has(.mobile-toggle:checked) ul {
        flex-direction: column;
        width: 100%;
    }

    .header__item_level_1.has-submenu > .header__sublist {
        position: relative;
        top: 0;
    }

    .header:has(.mobile-toggle:checked) li {
        flex-direction: column;
        width: 100%;
    }

    .header__item_level_2 a {
        font-size: 16px;
        padding: 24px 0 24px 30px;
    }

    .header__link_level_2:before {
        top: 36%;
    }

    .header__item_level_3 a {
        font-size: 14px;
        padding: 10px 10px 10px 0;
    }
}

@media screen and (max-width: 1024px) {
    .header__nav {
        position: fixed !important;
        width: 100%;
    }
}