/* Загальний стиль хедера */
.header {
    position: fixed;
    width: 100%;
    top: -100%;
    left: 0;
    z-index: 1000;
    /*background: rgba(0, 0, 0, 0.5);*/
    /*border-bottom: 1px solid #000;*/
    transition: top 0.9s ease, background 0.3s ease-in-out;
}

.header.visible {
    top: 0;
}
.header.scrolled {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.5);
    transition: top 0.9s ease, background 0.3s ease-in-out;
}
.header_blocks {
    width: 100%;
    padding: 15px 100px;
}
.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header_logo img {
    max-height: 50px;
}

.header_logo_link {
    display: flex;
}

.header_menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 50%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    padding: 150px 100px 0 0;
    z-index: 999;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateY(-100%);
}
.header_menu.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.header_menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.header_menu ul li {
    position: relative;
    text-align: right;
}
.header_menu ul li a {
    text-decoration: none;
    color: #ffffff;
    padding: 6px 0;
    display: block;
    font-size: 35px;
    font-family: "Helvetica Neue", serif;
    color: #FFFFFF;
    font-weight: 400;
}

.header_menu ul li.current-menu-item > a {
    font-style: italic;
    font-weight: bold;
    text-decoration: underline;
}

.header_menu ul li.current-menu-parent:has(.current-menu-item) > a {
    font-style: italic;
    font-weight: bold;
    text-decoration: underline;
}

.menu-item-has-children.open:has(> .sub-menu a:hover) > a {
    font-style: italic;
    font-weight: bold;
    text-decoration: underline;
}

.menu-item-has-children.open > a .submenu-toggle {
    transform: rotate(180deg);
}

/* Додаємо стрілку до батьківських елементів */
.header_menu ul li.menu-item-has-children > a {
    position: relative;
    /*padding-right: 25px;*/
}
.header_menu ul li.menu-item-has-children > a .submenu-toggle {
    position: absolute;
    left: -55px;
    top: calc(50% - 5px);
    width: 30px;
    background-repeat: no-repeat;
    background-size: contain;
    height: 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='63.379' height='28.397' viewBox='0 0 63.379 28.397'%3E%3Cdefs%3E%3CclipPath id='clip-path'%3E%3Crect x='-0.707' y='2' width='63.379' height='28.397' fill='none'/%3E%3C/clipPath%3E%3C/defs%3E%3Cg id='Scroll_Group_1' data-name='Scroll Group 1' transform='translate(0.707 -2)' clip-path='url(%23clip-path)' style='isolation: isolate'%3E%3Cpath id='Path_120' data-name='Path 120' d='M867.685,1373.61l30.275-30.275,30.275,30.275' transform='translate(928.943 1374.317) rotate(180)' fill='none' stroke='%23fff' stroke-width='4'/%3E%3C/g%3E%3C/svg%3E%0A");
    cursor: pointer;
    transition: transform 0.3s ease;
}

/* Анімація повороту стрілки при відкритті */
/* .menu-item-has-children.open > a .submenu-toggle {
    transform: translateY(-50%) rotate(180deg);
} */

/* Стиль підменю */
.sub-menu {
    display: block;
    position: relative;
    width: 100%;
    text-align: center;
    list-style: none;
    padding: 10px 0;
    margin: 0;
}
.header_menu ul li .sub-menu li a  {
    font-style: italic;
    padding: 3px 0;
    font-size: 20px;

}
.sub-menu.hidden {
    display: none;
}
/*.sub-menu li {*/
/*    padding: 10px;*/
/*}*/
.sub-menu li a {
    color: #ffffff;
    display: block;
    transition: background 0.3s;
}
.header_menu ul li a:hover,
.sub-menu li a:hover {
    font-style: italic;
    font-weight: bold;
    text-decoration: underline;
}

/* Бургер-меню */
.burger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}
.burger span {
    width: 30px;
    height: 4px;
    background: #fff;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Анімація бургер-іконки при відкритті меню */
.burger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.burger.active span:nth-child(2) {
    opacity: 0;
}
.burger.active span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}
.header_right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header_btn a {
    background-color: #FF3600;
    padding: 10px 20px;
    font-family: "Helvetica Neue", serif;
    font-size: 18px;
    color: #fff;
    font-weight: 400;
    border-radius: 10px;
    transition: all 0.3s ease-in-out;
}
/* Мобільна адаптація */
@media (max-width: 768px) {
    .header_blocks {
        padding: 15px 20px;
    }
    .header_logo img {
        max-height: 40px;
        width: 130px;
    }

    .header_menu {
        padding: 100px 16px 0 16px;
    }
    .header_menu {
        width: 100%;
    }
    .header_right {
        gap: 15px;
    }
    .header_btn a {
        font-size: 12px;
        padding: 7px 10px;
        border-radius: 8px;
    }
}

@media (max-width: 380px) {
    .header_logo img {
        width: 100px;
    }
}
