
header .top-head {
    display: flex; 
    gap: 30px;
    padding: 0;
    align-items: center;
}
header #top-header-logo {
    max-width: 46px;
    flex:1;
    vertical-align: middle;
}
header #top-header-title {
    flex:3;
    color: #022456;
    /* justify-content: center; */
    align-items: center;
    font-family: 'Roboto';
}

header #top-header-contacts p{
    padding: 0;
    text-align: right;
}
    header #top-header-contacts p img{
        padding-left: 5px;
    }

/* Блок с названием сайта выравнен в строку, занимает место по центру */
.site-title {
    flex: 0 0 auto;
    /* ширина по содержимому (тексту) */
    white-space: nowrap;
    padding: 0 30px;
    /*text-align: center;*/
}

.site-title h1 {
    width: fit-content;
    display: block;
    margin: 0;
}

.site-title h1 a {
    /* font-size: 1.5rem; */
    text-decoration: none;
    font-size: 33pt;
}

.title {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: 7%;
    line-height: 150%;
    padding: 10px 0;
}

/* Главное меню справа */
.top-menu {
    flex: 1 1 auto;
    padding: 0 20px;
}
#menu-top-menu .menu-item {
    display: flex;
}
#menu-top-menu li {
    /* margin: auto 0; */
    font-size: 14px;
    max-width: 220px;
    /* height: 100%; */
}
.top-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0px;
}

.top-menu ul li a {
    text-decoration: none;
    font-weight: 600;
    /* padding: 5px 20px; */
    padding: 10px 12px;
    display: block;
    font-size: 14px;
    line-height: 101%;
    letter-spacing: 8%;
    margin: auto;
}

/* .top-menu ul li a:hover {
    background-color: #154279;
} */
.top-menu ul li:hover {
    background-color: #154279;
}


#mega-menu-wrap-pie-menu .mega-menu-toggle+#mega-menu-pie-menu {
    overflow-y: auto;
}

header #site-header .dropdown-menu.dropdown-menu-mobile {
    position: static;
}

/* Общие стили для контейнера шапки */
header[role="banner"]>div>.container {
    display: flex;
    /* Выстраиваем дочерние элементы в строку */
    align-items: center;
    /* Вертикальное выравнивание элементов */
    justify-content: space-between;
    /* Отодвигаем крайние элементы по краям */
    padding: 10px 0px;
    position: relative;
    /* Для абсолютного позиционирования меню */
    /* background-color: #022456; */
    /*border-bottom: 1px solid #ddd;*/
    z-index: 1000;

    height: 80px;
}

header a {
    color: #fff;
}

#site-header {
    position: relative;

}

#pie-btn-div {
    height: 100%;
    display: flex;
}

#pie-menu-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

#pie-menu-button.active-menu-btn {
    background-color: #F4F4FF;
    border-radius: 3px;
    /* align-self: flex-end;
    margin-bottom: 0; */
    height: 50px;
}

#pie-menu-button img {
    display: block;
    width: 60px;
}


/* Отсоединяем меню от контента */
#pie-menu-list.pie-menu-container ul.pie-menu {
    /* list-style: none; */
    margin: 0;
    padding: 0;
}

/* Элементы меню */
#pie-menu-list ul.pie-menu li {
    padding: 10px 0;
    width: 50%;
}

/* Ссылки меню */
#pie-menu-list ul.pie-menu li a {
    text-decoration: none;
    color: #333;
    display: block;
    font-size: 16px;
    font-family: "Roboto", sans-serif;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0px;
}

/* Эффект при наведении */
#pie-menu-list ul.pie-menu li a:hover {
    /*background-color: #f0f0f0;*/
}

/* Показываем все подменю */
#pie-menu-list .mega-sub-menu {
    display: block !important;
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    overflow: visible !important;

}

#pie-menu-button {
    cursor: pointer;
    /* стили кнопки */
}

#pie-menu-button .icon-opened {
    width: 60px;
    height: 60px;
    padding: 20px;
}

#menu-pie-menu {
    padding: 20px 62px;
}

#mega-menu-pie-menu {
    height: calc(100vh - 160px) !important;
}

#mega-menu-wrap-pie-menu {
    overflow-y: auto;
    /* Прокрутка, если много пунктов */
}

#mega-menu-pie-menu {
    column-count: 2;
    column-gap: 20px;
    list-style-type: none;
}

#mega-menu-pie-menu>li.mega-menu-item {
    display: block;
    /* ключевой момент для вертикального расположения */
    break-inside: avoid;
    /* не разрывать элементы между столбцами */
    margin-bottom: 10px;
    /* расстояние между элементами */
}

#mega-menu-pie-menu {
    column-count: 2;
    /* количество колонок */
    column-gap: 20px;
    /* отступ между колонками */
    /* при необходимости ограничить высоту */
    overflow-y: auto;
    /* прокрутка, если элементов много */
    list-style: none;
    /* убрать маркеры */
    padding: 0;
    margin: 0;

}

#mega-menu-pie-menu>li {
    break-inside: avoid;
    /* не разрывать пункт меню между колонками */
    padding: 5px 0;
}

.mega-sub-menu .mega-menu-item {
    width: 100%;
}
#mega-menu-pie-menu li.mega-menu-item.mega-menu-item-type-post_type.mega-menu-flyout a[tabindex="0"]{
    text-transform: uppercase !important;
}
#mega-menu-pie-menu li.mega-menu-item.mega-menu-item-type-post_type.mega-menu-flyout a[tabindex="0"]:hover {
    color:#650101 !important;
    text-decoration: underline !important;
}
/* Отступ для дочерних пунктов меню */
.mega-sub-menu .mega-menu-item .mega-sub-menu {
    padding-left: 20px;
    /* отступ слева для дочерних подменю */
    column-count: 1 !important;
    /* подменю выводим в один столбец */
    width: 100%;
}

/* Отступ у дочерних ссылок */
.mega-sub-menu .mega-menu-link {
    padding-left: 20px;
    display: block;
}

#pie-menu-list .mega-indicator {
    display: none !important;
}

#site-header .dropdown-menu {
    bottom: 0;
    width: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 80px;
    max-width: 60px;
    flex-shrink: 0;
}

/*search*/
.search-btn, .llm-btn{
    border: 1px solid #fff;
    border-radius: 10px;
}
.search-btn img {
    margin: 5px;
}

#search-overlay {
    position: absolute;
    top: 6px;
    right: 0;
    height: 50px;
    width: 0px;
    z-index: 20000;
    /* выше шапки и всех элементов */
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s ease, opacity 0.2s ease, width 0.2s ease;
}

#search-overlay.active {
    visibility: visible;
    opacity: 1;
    /* width: calc(100% - 220px); */
    width: calc(100% - 80px);
}

#search-form {
    display: flex;
    width: 100%;
    position: relative;
}

#search-form input[type="search"] {
    flex-grow: 1;
    font-size: 18px;
    padding: 10px;
    border: 1px solid #ccc;
    width: 100%;
    z-index: 9;
}

#search-form button {
    cursor: pointer;
    font-size: 16px;
    padding: 0 6px;
    border: none;
    background: none;
    color: white;
    height: 100%;
    background: none;
}

#search-form button#search {
    filter: invert(1);
}

#search-form button#close-search img {
    width: 20px;
}

#search-form-btns {
    position: absolute;
    right: 10px;
    height: 100%;
    z-index: 99999;
}

#close-search {
    background-color: transparent;
    color: #333;
    font-weight: bold;
}

#open-search-modal, #open-llm-page {
    background: none;
    color: #F4F4FF;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
}
#open-llm-page {
    padding-left: 5px;
}
#open-search-modal:hover {
    cursor: pointer;
}

.right-past-top-menu {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

@media (min-width: 769px) {

    .site-title.mobile {
        display: none ;
    }
    header .top-head {
        height: 73px;
            padding: 0 10px;
    }

    #site-header {
        padding: 0 10px;
    }

    header #top-header-title {
        font-weight: 700;
        font-size: 25px;
        letter-spacing: 5%;
        line-height: 150%;
        text-transform: uppercase;
    }
    header #top-header-contacts p{
        font-size: 14px;
        font-weight: 500;
        line-height: 139%;
        letter-spacing: 14%;
        margin: 7px 0;
    }

    header[role="banner"]>div>.container {
        height: 60px;
    }
    header[role="banner"]>div>.container >.site-title{
        display: none;
    }
    #pie-menu-button img {
        display: block;
        width: auto;
        height: 34px;
    }
    #pie-menu-list {
        max-height: calc(100vh - 160px);
    }

    #pie-menu-list {
        width: 100%;
    }

    #site-header .dropdown-menu.dropdown-menu-desctop {
        display: block;
        width: 100%;
    }

    #site-header .dropdown-menu.dropdown-menu-mobile {
        display: none;
    }

    /* Сам список меню под шапкой */
    #site-header .dropdown-menu.dropdown-menu-desctop #pie-menu-list {
        position: absolute;
        top: 100%;
        /* Ставим снизу под header */
        left: 0;
        background: #F4F4FF;
        z-index: 999;
    }

    /* Отступ у дочерних ссылок */
    #pie-menu-list .mega-sub-menu .mega-menu-link {
        line-height: 30px;
        letter-spacing: 5%;
    }

}

@media (max-width: 768px) {


    header .top-head{
        display: none;
    }

    #search-overlay.active {
        width: calc(100% - 100px);
    }

    #search-form input[type="search"] {
        padding: 5px;
    }

    #site-header .dropdown-menu.dropdown-menu-desctop {
        display: none;
    }

    #site-header .dropdown-menu.dropdown-menu-mobile {
        display: block;
        width: 50px;
        height: 40px;
    }

    .dropdown-menu.dropdown-menu-mobile #pie-menu-list {
        width: 100%;
    }

    #site-header .dropdown-menu.dropdown-menu-mobile #mega-menu-pie-menu {
        right: 0;
        width: 100%;
        position: absolute;
        background-color: #f4f4ff;
        top: 90px;
    }

    #site-header .dropdown-menu.dropdown-menu-mobile #mega-menu-wrap-pie-menu {
        position: static;
    }

    #site-header .dropdown-menu.dropdown-menu-mobile .mega-menu-toggle {
        overflow: hidden;
        background-color: transparent;
    }

    #pie-menu-list {
        max-height: calc(100vh - 160px);
    }

    /*header*/
    .site-title.mobile {
        display: block ;
        color:#fff;
    }
    .site-title.mobile #top-header-title {
        font-size: 17px;
        line-height: 100%;
        color:#fff;
        display: inline-block;
        word-wrap: break-word;
        white-space: normal;
        margin: 0;
            padding: 0 15px;
        font-weight: 500;
    }
    .site-title.mobile img {
        width: 46px;
        height: 46px;
        /* padding: 0 10px; */
    }
    header #site-header {
        flex-wrap: wrap;
        height: 81px;
        padding: 0 10px;
    }
    .top-head {
        padding: 0 10px;
    }

    header #site-header .logo {
        font-size: 22px;
    }

    header #site-header .site-title {
        left: 20px;
        padding: 0;
        top: 15px;
        display: flex;
        padding: 0 10px;
        width: 200px;
    }

    header #site-header .dropdown-menu {
        right: 30px;
        height: 20px;
        top: 35px;
    }

    header #site-header .site-title a {
        font-size: 22pt;
        text-decoration: none;
    }

    header .top-menu {
        display: none !important;
    }

    .mega-menu-item.mega-menu-item-type-post_type.mega-menu-item-object-page .mega-menu-link {
        padding-left: 35px !important;
        font-size: 14px;
    }
 #mega-menu-wrap-pie-menu #mega-menu-pie-menu > li.mega-menu-item.mega-toggle-on > a.mega-menu-link {
    background-color: transparent;
    color: #650101;
 }
    #mega-menu-wrap-pie-menu #mega-menu-pie-menu>li.mega-menu-item>a.mega-menu-link {
        padding-left: 20px !important;
        color: #650101;
        font-size: 12px;
        font-weight: 17px;
    }

    #mega-menu-wrap-pie-menu #mega-menu-pie-menu>li.mega-menu-item>a.mega-menu-link {
        height: auto !important;
    }

    #mega-menu-wrap-pie-menu #mega-menu-pie-menu>li.mega-menu-item>a.mega-menu-link {
        height: auto !important;
        line-height: 17px;
    }

    #mega-menu-wrap-pie-menu #mega-menu-pie-menu>li.mega-menu-item {
        margin-top: 20px;
    }

    #mega-menu-wrap-pie-menu #mega-menu-pie-menu>li.mega-menu-flyout ul.mega-sub-menu li.mega-menu-item a.mega-menu-link {
        font-size: 12px !important;
        color: black;
        font-weight: bold;
    }
    #mega-menu-wrap-pie-menu #mega-menu-pie-menu>li.mega-menu-flyout ul.mega-sub-menu {
        list-style: disc;
    }
    #mega-menu-wrap-pie-menu #mega-menu-pie-menu>li.mega-menu-flyout ul.mega-sub-menu li.mega-menu-item {
        display: list-item;

    }
}

/* @media (min-width:1000px) {
    
header .top-head,#site-header  {
    padding: 0;
}
} */
