
body:has(.special-header-style) .header,
body:has(.first-screen) .header{
    position: fixed;
    top: 45px;
    margin-top: 0;
    background-color: transparent;
}

html {
    margin-top: 0!important;
}


.header {
    background-color: #4a6671;
    position: sticky;
    top: 0;
    margin-top: 45px;
    transition-timing-function: linear;
   transition: background-color 0.3s ease;
    z-index: 1000;
    left: 0;
    width: 100%;
}

.header.scroll-active {
    background-color: #4a6671!important;
}

.header__top-panel {
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
background-color: #dff8eb;
    padding: .5rem;
    z-index: 100;
}

.header__socials {
    display: flex;
    gap: .5rem;
    justify-content: center;
}

.header__socials i {
    color: #4a6671;
    font-size: 16px;
    transition: all 0.3s ease;
}


.header__socials a:hover i {
    color: red;
}

.header__wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .5rem 0;
}

.sub-menu {
    display: none;
    list-style: none;
    padding-left: 0;
    position: absolute;
    background-color: #fff;
    border: 1px solid #eee;
    color: #000;
    left: -1.5rem;
    top: auto;
    overflow: hidden;
    text-align: left;
    width: 200px;
    z-index: 20000;
}

.header .sub-menu .menu-item a {
    display: inline-block;
    padding: .35rem 0;
    color: #000;
}
.header .sub-menu .menu-item {
padding-left: 1.5rem;
}

@media screen and (min-width: 992px) {
   


    .menu-item:has(.sub-menu):hover .sub-menu {
        display: block !important;
    }
}


.overflow {
    overflow: hidden;
}


.header__mobile-wrapper {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    top: 0;
    right: 0;
    height: 100svh;
    background: #4a6671;
    padding: 104px 1rem 1rem 1rem;
    width: 50%;
    margin-right: auto;
    margin-left: auto;
    gap: 20px;
    transform: translateY(0) translateX(150%);
    transition: all 0.5s ease;
    z-index: 99999;
}

.header__mobile-wrapper.opened {
    transform: translateY(0) translateX(0);
}

.header__logo-link {
    position: relative;
    z-index: 10001;
    display: flex;
    flex-shrink: 0;
    cursor: pointer;
    margin-right: 2.9rem;
}

.header__logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.header__navigation ul:not(.sub-menu) {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0;
}


.header__menu-button {
    display: none;
}

.header .menu-item {
    z-index: 10001;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header .menu-item a {
    color: #FFF;
}

.menu-bar {
    width: 23px;
    height: 2px;
    border-radius: 5px;
    background-color: white;
    transition: all 0.5s ease;
    transform-origin: center;
    animation-duration: .8s;
    animation-fill-mode: forwards;
    animation-timing-function: ease-in-out;
}

.menu-bar:nth-child(2) {
    width: 23px;
}

.menu-bar:not(:last-child) {
    margin-bottom: 5.5px;
}

.opened .menu-bar:not(:last-child) {
    margin-bottom: 7.2px;
}

.opened .menu-bar:first-child,
.opened .menu-bar:last-child {
    width: 23px;
}


@keyframes topBarOpen {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(9px); /* Точніше зміщення для вирівнювання */
    }
    100% {
        transform: translateY(9px) rotate(-45deg); /* Повертаємо в інший бік */
    }
}

@keyframes bottomBarOpen {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-9px); /* Точніше зміщення для вирівнювання */
    }
    100% {
        transform: translateY(-9px) rotate(45deg); /* Повертаємо в інший бік */
    }
}

@keyframes middleBarOpen {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.5);
    }
    100% {
        transform: scale(0);
    }
}

@keyframes topBarClose {
    0% {
        transform: translateY(9px) rotate(-45deg);
    }
    50% {
        transform: translateY(9px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes bottomBarClose {
    0% {
        transform: translateY(-9px) rotate(45deg);
    }
    50% {
        transform: translateY(-9px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes middleBarClose {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(0.5);
    }
    100% {
        transform: scale(1);
    }
}

.opened .menu-bar:first-child {
    animation-name: topBarOpen;
}

.opened .menu-bar:last-child {
    animation-name: bottomBarOpen;
}

.opened .menu-bar:nth-child(2) {
    animation-name: middleBarOpen;
}

.menu-bar:first-child {
    animation-name: topBarClose;
}

.menu-bar:last-child {
    animation-name: bottomBarClose;
}

.menu-bar:nth-child(2) {
    animation-name: middleBarClose;
}

.header__btn-icon {
    width: 19px;
    height: 18px;
}

.header .menu-item {
    position: relative;
}


.header .menu-item::before {
    content: '';
    position: absolute;
    bottom: 0rem;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    background: #dff8eb;
    width: 100%;
    height: 1px;
    transform-origin: center;
    transition: transform 0.3s ease-in-out;
}

.header .sub-menu .menu-item::before {
    bottom: 0;
}

.header .menu-item:hover::before {
    width: 100%;
    transform: translateX(-50%) scaleX(1);
}

/* Коли курсор наводиться на .sub-menu, прибираємо hover з батьківського li */
.menu-item-has-children:hover:has(.sub-menu:hover)::before  {
    transform: translateX(-50%) scaleX(0);
}

.header .menu-item:hover {
    top: -1px;
}

.header .menu-item a:hover {
    border: none;
    text-decoration: none;
}

.header .menu-item:hover >  a{
    color: #dff8eb;
}

.header .sub-menu .menu-item:hover > a {
color: #000;
}

.header .sub-menu .menu-item a:hover {
    color: #4a6671;
}

.header__navigation-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-header-menu-container {
    margin-left: 0!important;
}

.menu {
    justify-content: center;
}

.header-block li.menu-item-has-children > a::after {
    content: "";
    font-family: "Font Awesome 5 Free";
    font-size: 0.7rem;
    font-weight: 900;
    padding-left: 8px;
}

@media screen and (max-width: 1199.98px) {

    .header__logo {
        width: 68px;
        height: 68px;
    }

    body:has(.special-header-style) .header,
    body:has(.first-screen) .header {
        top: 42.5px;
    }

    .header{
        margin-top: 42.5px;
    }
}

@media screen and (max-width: 991.98px) {
    .header__wrapper {
        gap: 33px;
    }

    .header .menu-item:hover {
        top: 0;
    }

    .header__socials i {
        font-size: 15px;
    }

    .header__btn {
        display: none;
    }

    .sub-menu-opened.sub-menu {
        display: block !important;
    }

    .header__btns {
        display: flex;
        gap: .5rem;
    }

    .header__btns .header__btn {
        display: flex;
        gap: 5px;
        margin-left: 0!important;
        margin-right: 0!important;
    }

    .header .menu-item::before {
        display: none;
    }

    #mobile-navigation ul li.current-menu-item {
        border-color: #e54f34;
    }

    .header__logo-link {
        flex-grow: 1;
    }

    #mobile-navigation {
        padding-bottom: .35rem;
    }

    #mobile-navigation ul li {
        width: 100%;
    }

    .header__navigation ul li a {
        width: 100%;
        font-size: 1.35rem;
    }

    .header__navigation ul li:first-child a {
        padding-top: 0;
    }

    .header__navigation ul:not(.sub-menu) {
        gap: .70rem;
    }

    .header .sub-menu {
        position: relative!important;
        background-color: unset;
        border: none;
        width: 100%;
        left: 0;
        top: 0;
    }
    .header .sub-menu li {
        margin-left: 30px !important;
        padding-left: 0!important;
    }

    .header .sub-menu .menu-item a {
        font-size: 18px;
        color: #FFF;
    }


    .header__navigation ul {
        align-items: flex-start;
    }

    .header__navigation ul li {
        text-align: start;
    }


    .header__mobile-body-wrapper {
        overflow: auto;
        max-height: 100svh;
        padding-bottom: 30px;
    }

    .header__navigation-wrapper {
        opacity: 1;
        transition: all 0.3s ease;
    }

    .opened  .header__navigation-wrapper {
        opacity: 0;
    }

    .header__menu-button {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        position: relative;
        z-index: 999999;
    }

    #desktop-navigation .menu-item {
        display: none;
    }

    .header__mobile-navigation ul {
        flex-direction: column;
        gap: 0;
    }

    .header .sub-menu .menu-item:hover > a {
        color: #FFF;
    }
}

@media screen and (max-width: 767.98px) {
    .header__logo {
        width: 64px;
        height: 64px;
    }

    .header__socials i {
        font-size: 14px;
    }

    body:has(.special-header-style) .header,
    body:has(.first-screen) .header {
        top: 40px;
    }

    .header {
        margin-top: 40px;
    }
}

@media screen and (max-width: 599.98px) {
    .header__mobile-wrapper {
        width: 100%;
    }

    .opened .menu-bar:not(:last-child) {
        margin-bottom: 7.1px;
    }
}