.header-menu{
    display: flex;
    align-items: center;
    gap: 40px;
    position: relative;
    transition: all .8s;
}

.menu-item-1334{

}

.logo-header svg {
    transition: all 1s;
}

.header-menu .menu{
    display: flex;
    gap: 20px;
    padding-right: 70px;
}

.header-menu :is(a, span) {
    color: #373935;
    font-size: 14px;
    transition: all .5s;
}

.header-menu :is(a, span):hover{
    color: #f16728;
}

#menu-item-1341{
    margin-left: 80px;
}

.menu-header-btn{
    border-radius: 40px;
    width: min-content;
    background: #F16728;
    box-shadow: 0 2px 20px 0 rgba(241, 103, 40, 0.37);
    padding: 17px 20.5px;
    display: flex;
    cursor: pointer;
    align-items: center;
    transition: all .5s;
    z-index: 4;
    position: fixed;
    right: 20px
}

.menu-header-btn:hover{
    box-shadow: 0 2px 2px 0 rgba(33, 15, 6, 0.17);
    background: #373935;
}

.menu-header-btn :is (span, path){
    fill: #ffffff;
    transition: all .7s;
}

.menu-header-btn svg path{
    transition: all .7s;
}

.menu-header-btn:hover svg path{
    d: path("M 0 1.5 H 10 M 3 8.5 H 7 M 0 16.5 H 10");
    transition: all .7s;
}

.menu-hidden{
    position: fixed;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    flex-wrap: wrap;
}

.menu-hidden > div {
    flex: 1 1 20%
}

.menu-hidden .logo-header{
    transition: all 1s;
    width: 90%;
}

.menu-hidden{
    position: fixed;
    right: 0;
    top: 0;
    grid-auto-flow: row;
    display: grid;
    grid-template-columns: 3fr 3fr 2fr;
    grid-template-rows: 1fr;
    gap: 1rem;
    z-index: 3;
    color: #fff;
    padding: 100px 100px 100px 60px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 10px 111px 70px hsl(0deg 0% 0% / 24%);
    background: hsl(0deg 0% 0% / 72%);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    width: 100%;
    transition: all 1.5s cubic-bezier(0.64, 0, 0.33, 1);
    transform: translateY(-1000px);
}

.menu-hidden-open{
    transform: translateY(0px);
}

.menu-hidden .menu{
    display: flex;
    flex-direction: column;
    gap: 12px;
    list-style-type: none;
}

.menu-hidden__menu-title {
    font-size: 13px;
    font-weight: 400;
    padding: 20px 0 10px 0;
    color: #cecece;
}

/* Базовий (закритий) стан */
.menu-hidden .menu a {
    color: #ffffff;
    font-size: 30px;
    text-decoration: none;
    transition: all .7s;
    display: flex;
    overflow: hidden;
}

.menu-hidden .menu a span {
    display: flex;
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 0.5s ease, transform 0.5s ease; /* плавне закриття */
}

/* Коли меню відкрито — відразу ставимо кінцеві значення,
   анімація лише відтворює перехід (без fill-forwards) */
.menu-hidden-open .menu a span {
    opacity: 1;
    transform: translateY(0);
    animation: menuFadeIn 1s ease;
    animation-delay: 0.6s;
    animation-fill-mode: none;
}

/* Кейфрейм для появи (візуально ідентичний переходу) */
@keyframes menuFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Базовий (закритий) стан */
.menu-hidden__menu-links {
    opacity: 0;
    transform: translateY(-30px); /* трохи піднятий для ефекту */
    transition: opacity 0.5s ease, transform 0.5s ease; /* плавне закриття */
}

/* Коли меню відкрито — ставимо кінцеві стилі; animation лише додає візуал */
.menu-hidden-open .menu-hidden__menu-links {
    opacity: 1;
    transform: translateY(0);
    animation: menuFadeOpacity 1s ease;
    animation-delay: 0.5s; /* твоя затримка перед появою */
    /* не використовуємо animation-fill-mode: forwards */
}

/* Кейфрейм тільки для візуального ефекту появи */
@keyframes menuFadeOpacity {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-hidden .menu a:hover{
    transform: translateX(3px) !important;
    color: #f16728;
}

.menu-hidden__menu-links{
    font-size: 24px;
    margin: 10px 0;
    display: flex;
    text-decoration: none;
    transition: all .5s;
    color: #ffffff;
}

.menu-hidden__menu-links:hover{
    transform: translateX(3px);
    color: #f16728;
}

.menu-hidden__menu-btn{
    background-color: #f16728;
    color: #ffffff;
    text-decoration: none;
    padding: 6px 6px 6px 30px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: max-content;
    transition: all .5s !important;
}

.menu-hidden__menu-btn:hover{
    background-color: #d5551a;
}

.menu-hidden__menu-btn:hover span:nth-of-type(2) svg{
    transform: rotate(45deg);
}

.menu-hidden__menu-btn span:nth-of-type(2){
    background-color: #fff;
    padding: 18px;
    border-radius: 30px;
    display: flex;
    box-sizing: content-box;
}

.menu-hidden__menu-btn span:nth-of-type(2) svg{
    width: 13px;
    height: 13px;
    transition: all .5s;
}

.menu-hidden__menu-contact{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-links-mail{
    flex-grow: 1;
}

.menu-header-btn .close-btn{
    display: none;
}

.menu-header-btn-active .close-btn{
    display: flex;
    fill: #ffffff;
    margin: 1px -2px 1px -3px;
}

.menu-header-btn-active .close-btn path{
    d: path("M13.46,12L19,17.54V19H17.54L12,13.46L6.46,19H5V17.54L10.54,12L5,6.46V5H6.46L12,10.54L17.54,5H19V6.46L13.46,12Z") !important;
}

.menu-header-btn-active .open-btn{
    display: none;
}

.menu-header-btn-active svg{

}

.menu-header-btn-active svg path{
    d: path("M 2 0.5 H 8 M 0 8.5 H 10 M 2 16.5 H 8");
}

@media (max-width: 1350px){
    .logo-header svg {
        width: 70%;
        transition: all 1s;
    }

    #menu-item-1341{
        margin-left: 60px;
    }

    .header-menu :is(a, span) {
        font-size: 14px;
    }

    .header-menu .menu {
        gap: 18px;
    }

    .header-menu {
        gap: 30px;
    }

    .header-top {
        gap: 0;
    }

}

@media (max-width: 1100px){
    .logo-header svg {
        width: 80%;
        transition: all 2s;
    }

    .logo-header {
        width: 20%;
    }

    #menu-item-1341{
        margin-left: 0;
    }

    .menu-hidden .menu a {
        font-size: 24px;
    }

    .menu-hidden__menu-links {
        font-size: 24px;
        margin: 4px 0;
    }
}


@media (max-width: 991px){
    .menu-header-btn{
        position: fixed;
        right: 30px;
    }

    .menu-hidden {
        grid-template-columns: 2fr 3fr 2fr;
        padding: 100px 40px 60px 40px;
    }

    .menu-hidden__menu-links {
        font-size: 19px;
        margin: 7px 0;
    }

    .menu-hidden .menu a {
        font-size: 23px;
    }

    .menu-hidden .logo-header svg {
        width: 90%;
    }

    .header-menu .menu{
        display: none;
    }

    .logo-header svg {
        width: 100%;
        transition: all 2s;
        min-width: 200px;
    }

}

@media (max-width: 767px){
    .menu-hidden {
        grid-template-columns: 1fr;
        padding: 20px 30px 40px 30px;
        gap: 20px;
        transition: all 1s cubic-bezier(0.64, 0, 0.43, 1);
    }

    .menu-header-btn {
        position: fixed;
        right: 30px;
        top: 30px;
    }

    .menu-links-mail {
        flex-grow: 1;
        margin-bottom: 30px;
    }

    .menu-hidden .menu a {
        font-size: 18px;
    }

    .menu-hidden__menu-links {
        font-size: 16px;
        margin: 7px 0;
    }

    .menu-header-btn{
        background: #F16728 !important;
    }

    .menu-hidden-open .menu a span{
        animation-delay: .3s;
    }

}

