.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    /* bottom: calc(100svh - 5rem); */
    transition: bottom 600ms ease;
    display: flex;
    z-index: 1000;
    justify-content: space-between;
    background-color: rgba(249, 249, 249, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.header.open {
    bottom: 0;
    overflow-y: auto;
    grid-template-rows: auto auto 1fr;
    padding-bottom: 3rem;
}

.header__logo__c {
    grid-column: 1/5;
}

.header__logo {
    display: none;
    transition: 300ms;
}

.header__logo__c:hover .header__logo {
    opacity: 0.3;
}

.header__title {
    font-weight: 500;
    display: none;
}

.header__title.mobile {
    display: block;
}

.header__title.short {
    display: none;
}

.header__menu,
.header__menu__button,
.header__secondary-menu {
    display: none;
}

.header.open .header__menu {
    display: block;
    grid-column: 1/-1;
    margin-top: 4rem;
    animation: fade-in 600ms 200ms ease both;
}

.header__menu .page,
.header.open .header__secondary-menu {
    display: grid;
    grid-column: 1/-1;
    padding-top: 0.5rem;
    margin-top: 1rem;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid black;
}

.header.open .header__secondary-menu {
    margin-top: 4rem;
    animation: fade-in 600ms 200ms ease both;
}

.header__secondary-menu ul {
    grid-column: 2;
}

.header__secondary-menu ul li:not(:last-child) {
    margin-right: 1rem;
}

/* .header__menu a.active,
.header__menu a:hover,
.header__secondary-menu ul a.active,
.header__secondary-menu ul a:hover {
    color: black;
} */

.header__secondary-menu__language__submenu a {
    display: block;
}

.header__secondary-menu__logout {
    display: none;
}

@media only screen and (max-width: 64rem) {
    .languages-flex {
        display: flex;
    }
    
    .languages-flex > *{
        margin-right: 0.5rem;
    }
}

/* Mobile */
@media only screen and (hover: none) {
    .header__menu a,
    .header__secondary-menu a {
        color: black !important;
    }

    .header__title.short {
        display: none !important;
    }

    .header__logo__c {
        grid-column: 1/-2 !important;
    }
}





/* Desktop */
@media only screen and (min-width: 64rem) and (hover: hover) {
    .header {
        padding: 0.5rem 2.5rem 0.5rem 2.5rem;
    }

    .header__title {
        font-weight: 500;
        display: block;
        padding: 1rem 0;
    }

    .header__title.mobile {
        display: none;
    }
    
    .header__hamburger {
        display: none;
    }
    
    .header__logo__c {
        grid-column: 1/7;
        height: fit-content;
        display: flex;
        padding-left: 1.75rem;
    }

    .header__logo {
        display: flex;
        border: 2px solid black;
        position: fixed;
        top: 1.1rem;
        left: 1.75rem;
        width: 1.8rem;
        height: 1.8rem;
        border-radius: 50%;
        justify-content: flex-end;
        align-items: center;
    }
    
    .header__logo svg {
        width: 50%;
        padding-right: 1rem;
        opacity: 0;
        /* translate: "0 -50%"; */
    }

    .header__menu {
        display: block;
        padding: 1rem 0;
    }
    
    .header.collapsed .header__menu__button {
        display: block;
    }

    .header.collapsed .header__menu:hover .header__menu__button {
        display: none;
    }

    .header.collapsed .header__menu > ul {
        display: none;
    }

    .header.collapsed .header__menu:hover > ul {
        display: block;
    }

    .header.collapsed .header__menu:hover span {
        display: none;
    }

    .header__menu,
    .header__menu__button {
        grid-column: 7/-3;
    }

    .header__menu a,
    .header__secondary-menu ul a {
        display: block;
        margin: 0;
    }



    .header__menu,
    .header__secondary-menu {
        display: flex;
    }

    .header__secondary-menu {
        padding: 1rem 0;
        grid-column: -3/-1;
        justify-content: flex-end;
    }

    .header__secondary-menu__language {
        margin-left: 0.5rem;
        position: relative;
    }

    .header__secondary-menu__language__submenu {
        position: absolute;
        top: 100%;
        right: 0;
        display: none;
        text-align: right;
        z-index: 1000;
    }

    .header__secondary-menu__language:hover .header__secondary-menu__language__submenu {
        display: block;
    }

    .header__secondary-menu__logout {
        border: 1.5px solid rgb(136, 136, 136);;
        border-radius: 50%;
        width: 1.6rem;
        min-width: 1.6rem;
        height: 1.6rem;
        min-height: 1.6rem;
        aspect-ratio: 1/1;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: 0.5rem;
        padding-top: 0.1rem;
        translate: 0 -0.2rem;
        transition: 300ms;
    }


    .header__menu > ul {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .header__menu .page {
        display: none;
        border: 0;
        padding: 0;
        margin: 0;
        order: 2;
        animation: fade-in-top 300ms 50ms ease both;
        white-space: nowrap;
    }

    .header__menu {
        max-height: 4rem;
        transition: max-height 500ms ease-out;
    }

    .header__menu:hover {
        max-height: 7rem;
    }

    .header__menu:hover .page,
    .header__menu .page.available {
        display: grid;
        grid-template-columns: repeat(9, 1fr);
        padding: 0 0 0.4rem;
        grid-gap: 1rem;
    }

    .header__menu .page.available {
        order: 1;
    }

    .header__menu .page > a {
        grid-column: span 2;
    }

    .header__menu .page > ul {
        grid-column: span 6;
        display: flex;
        gap: 1rem;
        opacity: 0;
        transition: 300ms ease;
    }

    .header__menu .page.active>ul {
        opacity: 1;
    }

    .header__menu:hover .page.active > ul {
        opacity: 0;
    }

    .header__menu .page:hover > ul {
        opacity: 1 !important;
    }
}

/* Tablet */
@media only screen and (min-width: 64rem) and (max-width: 84rem) {
    .header__title {
        display: none;
    }

    .header__logo__c {
        grid-column: 1/3;
    }

    .header__menu {
        grid-column: 3/-3;
    }

    .header__title.short {
        display: block;
    }
}


/* Touch Devices Large (Tablet & Desktop) */
@media only screen and (min-width: 64rem) and (hover: none) {
    .header__title {
        font-weight: 500;
        display: block;
        padding: 0.25rem 0 0 2rem;
    }

    .header__logo__c {
        grid-column: 1/7;
        height: fit-content;
        display: flex;
        padding-left: 1.75rem;
    }

    .header__logo {
        display: flex;
        border: 2px solid black;
        position: fixed;
        top: 1.1rem;
        left: 1.75rem;
        width: 1.8rem;
        height: 1.8rem;
        border-radius: 50%;
        justify-content: flex-end;
        align-items: center;
    }

    .header__logo svg {
        width: 50%;
        padding-right: 1rem;
        opacity: 0;
        /* translate: "0 -50%"; */
    }

    .header__title.mobile {
        display: none;
    }

    .header__menu {
        max-height: 10rem;
        padding: 0 1.5rem;
    }

    .header__menu__button {
        display: none !important;
    }

    .header__menu ul {
        display: block !important;
        opacity: 1 !important;
    }

    .header__menu ul .page {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-gap: 1rem;
        opacity: 1;
        padding-bottom: 0 !important;
        margin-bottom: 2rem;
    }

    .header__menu ul .page ul {
        opacity: 1;
    }

    .header__secondary-menu {
        position: fixed;
        top: 1rem;
        right: 3rem;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .header.open .header__secondary-menu {
        display: flex;
        border: 0;
    }

    .header.open .header__secondary-menu a {
        margin-right: 1rem;
    }

    .header__secondary-menu__language {
        display: flex;
    }

    .header__secondary-menu__language__submenu {
        display: flex;
    }

}


/* Hamburger */
.header__hamburger {
    grid-column: -2/-1;
    scale: 0.7;
    transform-origin: 100% 0;
}

.hamburger .line {
    width: 2rem;
    height: 2px;
    background-color: black;
    display: block;
    margin: 0 0 8px auto;
    -webkit-transition: all 0.3s ease-in-out;
    -o-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
}

.hamburger:hover {
    cursor: pointer;
}

.header.open .hamburger .line:nth-child(2) {
    opacity: 0;
}

.header.open .hamburger .line:nth-child(1) {
    -webkit-transform: translateY(10px) rotate(45deg);
    -ms-transform: translateY(10px) rotate(45deg);
    -o-transform: translateY(10px) rotate(45deg);
    transform: translateY(10px) rotate(45deg);
}

.header.open .hamburger .line:nth-child(3) {
    -webkit-transform: translateY(-10px) rotate(-45deg);
    -ms-transform: translateY(-10px) rotate(-45deg);
    -o-transform: translateY(-10px) rotate(-45deg);
    transform: translateY(-10px) rotate(-45deg);
}

/* Animtations */

@keyframes fade-in-top {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}