/* ====== БАЗОВОЕ ПОВЕДЕНИЕ ХЕДЕРА ====== */

#masthead {
    position: fixed;
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    z-index: 1000;
    background: #fff;
}

.tg-site-header-bottom {
    padding: 0;
}

.dom-ready #masthead {
    transition: transform 0.5s ease-out, background 0.5s ease-out;
}

.site-header.fixed-header .tg-site-header-bottom {
    background: #fff;
    box-shadow:0 15px 40px rgba(0,0,0,0.12);
}

html.overflow,
body.overflow {
    overflow: hidden;
}

/* ====== ДЕСKTOP-ЛЕЙАУТ ХЕДЕРА ====== */
.tg-primary-menu {
    display: flex;
    align-items: center;
}

.str-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 20px;
}

.str-header__left,
.str-header__right {
    flex: 1 1 0;
    display: flex;
    align-items: center;
}

.str-header__left ul > li:hover > a,
.str-header__right ul > li:hover > a {
    color: #fb5e40;
}

.str-header__left .header-menu-wrap--left,
.str-header__right .header-menu-wrap--right {
    display: flex;
    align-items: center;
}

.str-header__center {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
}

.str-header__center .site-info-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header__button-desktop {
    margin-left: 24px;
}

.tg-header-action {
    display: none;
}

.header__mobile-menu {
    display: none;
    overflow-x: hidden;
}


ul.sub-menu {
    padding-inline-start: unset;
    list-style-type: none;
    padding: 20px;
    border-radius: 15px;

}
.str-header__left ul.menu>li,
.str-header__right ul.menu>li{
    margin-bottom: 0;
}
.str-header__left ul.menu li.menu-item-has-children,
.str-header__right ul.menu li.menu-item-has-children{
    position: relative;
}

.str-header__left .sub-menu,
.str-header__right .sub-menu{
    position: absolute;
    top: calc(100% + 10px);
    left: 0;

    width: 340px;
    background: #fff;
    border-radius: 15px;

    padding: 20px;
    list-style: none;

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);

    transition: all .3s ease;

    box-shadow:0 15px 40px rgba(0,0,0,0.12);
}
.str-header__left li.menu-item-has-children:hover > .sub-menu,
.str-header__right li.menu-item-has-children:hover > .sub-menu{
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.str-header__left li.menu-item-has-children{
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}
.str-header__left li.menu-item-has-children::after{
    content: '';
    background: url("/wp-content/uploads/2026/03/ucon-item-menu.svg")center/contain no-repeat;
    width: 8px;
    height: 5px;
    flex-shrink: 0;
    display: block;
    margin-top: 4px;
    transition: transform .3s ease;
}
.str-header__left li.menu-item-has-children:hover::after{
    transform: rotate(180deg);
}

@media screen and (max-width: 991.98px) {
    .header__button-desktop {
        display: none;
    }

    .tg-header-action {
        display: block;
    }

    .str-header {
        gap: 16px;
        justify-content: space-between;
    }

    /* Лого слева, иконка меню справа */
    .str-header__center {
        flex: 1 1 auto;
        justify-content: flex-start;
    }

    .str-header__right {
        flex: 0 0 auto;
        justify-content: flex-end;
    }

    /* Лого и кнопка поверх мобильного меню */
    .str-header__center,
    .tg-header-action {
        position: relative;
        z-index: 20;
    }

    /* Прячем десктопные меню на мобилке */
    .str-header__left {
        display: none;
    }

    .str-header__right #site-navigation {
        display: none;
    }

    /* Кнопка меню и SVG */
    .header__menu-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: none;
        background: transparent;
        cursor: pointer;
    }

    .header__menu-icon {
        display: block;
        width: 36px;
        height: 36px;
    }

    /* по умолчанию показываем "бургер" */
    .header__menu-icon--close {
        display: none;
    }

    /* при открытом меню показываем "крестик" */
    .tg-mobile-toggle.menu-opened .header__menu-icon--open {
        display: none;
    }

    .tg-mobile-toggle.menu-opened .header__menu-icon--close {
        display: block;
    }

    body:has(.opened),
    html:has(.opened) {
        overflow: hidden;
    }

    .header__mobile-menu {
        z-index: -1;
        display: flex;
        overflow: hidden;
        flex-direction: column;
        gap: 10px;
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateY(-1000px) translateX(-50%);
        height: 100svh;
        width: 100vw;
        background: #fff;
    }

    .header__mobile-menu::before {
        position: absolute;
        left: 0;
        top: 0;
        content: '';
        width: 100%;
        height: 105px;
        z-index: 10;
        background: #fff;
    }

    .header__mobile-nav-menu li {
        display: flex;
    }

    .dom-ready .header__mobile-menu {
        transition: all 0.5s ease-out;
    }

    .opened .header__mobile-menu {
        transform: translateY(0) translateX(-50%);
        z-index: 10;
    }

    header.opened {
        background: #101010;
    }
.but.purple_button.header__mobile-button{
    width: fit-content;
}
.header__mobile-nav-menu--left,
.header__mobile-nav{
    margin-bottom: 10px;
}
    .header__mobile-nav ul,
    .header__mobile-language-switcher ul {
        display: flex;
        flex-direction: column;
        gap: 10px !important;
    }

    .header__mobile-nav ul:not(.sub-menu) {
        padding-left: 0 !important;
    }

    header ul li {
        list-style: none;
    }

    header .menu-item a,
    .header__nav-title,
    .header__nav-back,
    .header__mobile-button {
        width: 100%;
        border: 1px solid #ABC9F6;
        border-radius: 20px;
        font-weight: 400;
        font-size: 18px;
        line-height: 1.2;
        padding: 18.4px 20px;
        backdrop-filter: blur(50px);
        background: #E6F0FF;
        color: #1B1E21;
    }

    #masthead .sub-menu .menu-item > a,
    .header__mobile-menu .menu-item {
        width: 100%;
    }

    .header__mobile-language-switcher {
        order: 3;
        margin-top: 10px;
    }

    #masthead .menu-item > a .menu-arrow {
        position: relative;
    }

    #masthead .menu-item > a .menu-arrow {
        transform: translateY(1px) rotate(-90deg);
    }

    .header__mobile-menu .sub-menu {
        margin: 0;
        position: absolute;
        width: 100%;
        max-height: 100svh;
        padding: 115px 20px 20px 20px;
        overflow-y: auto;
        visibility: hidden;
        height: fit-content;
        min-height: 100svh;
        background: linear-gradient(118deg, #e6eefe 0%, #f3faff 100%);
        left: 0;
        top: 0;
        transform: translate3d(100%, 0, 0);
        transition: transform .6s ease-out 0.1s, visibility 0s ease-out .6s;
    }

    .sub-menu:has(.sub-menu-open) .sub-menu {

    }


    #masthead .sub-menu-open.sub-menu {
        display: flex;
        visibility: visible;
        transform: translate3d(100%, 0, 0);
        transition: transform .6s ease-out, visibility 0s ease-out 0s;
    }

    .header__mobile-menu-wrap {
        padding: 115px 20px 20px 20px;
        transform: translate(0px, 0px);
        transition: all 0.6s ease-out;
    }

    .header__mobile-menu-wrap:has(.sub-menu-open),
    #masthead .sub-menu-open.sub-menu:has(.sub-menu-open.sub-menu) {
        translate: none;
        rotate: none;
        scale: none;
        transform: translate(-100%, 0%);
    }

    #masthead .sub-menu-open.sub-menu:has(.sub-menu-open.sub-menu) {
        transform: translate(0%, 0%);
    }

    .header__nav-controls {
        display: flex;
        gap: 10px;
        margin-bottom: 20px;
    }

    .sub-menu * {
        height: fit-content;
    }

    .header__nav-back,
    .header__nav-title {
        padding: 13.6px 16px;
        height: auto;
    }

    .header__nav-back {
        min-width: 62px;
        max-width: 62px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header__nav-title {
        display: flex;
        align-items: center;
        width: 100% !important;
        background: linear-gradient(137deg, #459cf8 0%, #2f78fb 100%) !important;
        background-clip: text !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent;
    }

    .header__mobile-menu .menu-item-has-children {
        position: unset;
    }

    .header__mobile-button.btn::after {
        content: none;
    }

    #masthead a {
        z-index: 10;
        font-size: 18px;
        justify-content: space-between;
    }

    .header__mobile-button {
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
    }

    .menu-item {
        width: fit-content;
    }

    .menu-item:has(.sub-menu) > a::after {
        content: '';
        display: inline-block;
        width: 22px;
        height: 22px;
        background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='none'><path d='M8 4L15 11L8 18' stroke='%231B1E21' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat center;
        background-size: contain;
    }

    .menu-item:has(.sub-menu) > a {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        align-items: center;
    }
}

.site-info-wrap img {
    max-width: 100px
}

/* ====== CTA-КНОПКА В ХЕДЕРЕ (как в макете) ====== */

.str-header .header__button-desktop,
.header__mobile-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 9px 17px;
    border-radius: 34px;
    background: #FE2221;
    border: 2px solid #FE6464;
    color: #FFFFFF;
    font-weight: 500;
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10),
    0 10px 20px rgba(0, 0, 0, 0.10);
    transition: all 0.25s ease;
}
.str-header .header__button-desktop:hover,
.header__mobile-button:hover {
    background: #e61d1c;
    border-color: #ff4a4a;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15),
    0 14px 28px rgba(0,0,0,0.15);
}
.str-header__right {

    justify-content: end;
}

.tg-site-header ul li a {
    font-size: 16px;
    font-weight: bold;
    color: #1D2652;
}

.header__button-icon svg {
    display: block;
}

.header__button-text {
    display: inline-block;
    color: #fff;
    font-size: 17.5px;
    font-weight: bold;
}

.header__menu-icon.header__menu-icon--close svg {
    background: red;
    border-radius: 50%;
}

.menu {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
}