header {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;

    position: fixed;
    top: 0;
    z-index: 1000;

    .link-button svg, #toggle-menu svg {
        fill: var(--latte, #EFE9CE);
    }

    .contact-info {
        display: flex;
        align-items: center;
        gap: 10px;

        a {
            color: var(--latte, #EFE9CE);
            font-family: Poppins;
            font-size: var(--small, 14px);
            font-style: normal;
            font-weight: 400;
            line-height: normal;
        }

        .text {
            display: flex;
            flex-direction: column;
            
            span {
                color: var(--olive-light, #96B0A6);
                font-family: Poppins;
                font-size: var(--small, 14px);
                font-style: normal;
                font-weight: 400;
                line-height: normal;
            }
        }
    }
}

header nav {
    display: flex;
    padding: 20px 40px;
    justify-content: space-between;
    align-items: center;
    align-self: stretch;
    background-color: var(--olive, #1C5551);
    flex-wrap: nowrap;

    .col-1 {
        display: flex;
        align-items: center;
        gap: 20px;
        flex-wrap: wrap;
        max-width: 80%;
        overflow: hidden;
        max-height: 20px;
    }

    .col-2 {
        display: flex;
        align-items: center;
        gap: 40px;
    }

    a, span, p, ul {
        display: flex;
        align-items: center;
        gap: 6px;
        
        color: #FFF;
        font-family: Poppins;
        font-size: var(--small, 14px);
        font-style: normal;
        font-weight: 400;
        line-height: normal;
        text-decoration: none;

        white-space: nowrap;
    }

    .menu {
        display: flex;
        padding: 20px 0;
        align-items: center;
        gap: 20px;    
        list-style: none;
        padding: 0;
        margin: 0;

        li {
            display: block;

            svg {
                display: block;
                height: var(--small, 14px);
                fill: var(--latte, #EFE9CE);
            }
        }
    }

    @media screen and (max-width: 767px) {
        .col-1 {
            display: none;
        }
        .col-2 {
            justify-content: space-between;
            flex: 1 1 0;
            #menu-header {
                display: none;
            }
        }
    }
}

header .contact {
    display: flex;
    padding: 20px 80px;
    justify-content: space-between;
    align-items: center;
    align-self: stretch;

    border-bottom: 1px solid #54504B;
    background-color: rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);

    .col {
        display: flex;
        align-items: center;
        gap: 40px;

        .logo {
            max-width: 283px;
        }
    }

    @media screen and (max-width: 1024px) {
        .col .book-link {
            display: none;
        }
    }

    @media screen and (max-width: 767px) {
        padding: 20px;

        .col .contact-info {
            display: none;
        }
    }
}

header .extended-header {
    display: none;
    opacity: 0;

    background-color: var(--latte, #EFE9CE);
    padding: 60px;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
    align-self: stretch;
    max-height: 94vh;
    overflow: hidden;

    max-width: 100%;
    width: 500px;
    position: absolute;
    top: 0;
    right: 0;

    border-radius: 0 0 0 6px;

    .top {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;

        img {
            display: block;
            width: 100px;
        }

        #close-menu svg {
            width: 22px;
            fill: var(--olive);
        }
    }

    .links {
        width: 100%;
        overflow-y: auto;

        .menu {
            margin: 0;
            padding: 0;

            columns: 2;
            column-gap: 60px;

            li {
                display: block;
            }

            li a {
                color: var(--olive);
                font-size: var(--small, 14px);
                font-style: normal;
                font-weight: 400;
                line-height: normal;
                text-decoration: none;
            }
            li a:hover {
                text-decoration: underline;
            }
        }

        .menu-item {
            break-inside: avoid;
            margin: 10px 0;
        }

        .sub-menu {
            padding: 0;

            .menu-item {
                margin-left: 20px;
            }
        }
    }

    .bottom {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;

        .contact-info {
            a, span {
                color: var(--olive)
            }
        }

        .menu {
            display: flex;
            padding: 20px 0;
            align-items: center;
            gap: 20px;    
            list-style: none;
            padding: 0;
            margin: 0;

            li {
                display: block;

                svg {
                    display: block;
                    height: 22px;
                    fill: var(--olive);
                }
            }
        }
    }

    @media screen and (max-width: 500px) {
        border-radius: 0 0 6px 6px;
        padding: 40px;

        .links {
            .menu {
                columns: 1;
            }
        }

        .bottom {
            flex-direction: column;
            align-items: flex-start;
            gap: 20px;
        }
    }
}

header.extended {
    .contact {
        .book-link, .contact-info {
            opacity: 0;
            display: none;
        }
    }

    .extended-header {
        display: flex;
        opacity: 1;

        @starting-style {
            opacity: 0;
        }
    }
}

/* Transitions */
header {
    .extended-header {
        transition: opacity 0.2s ease-in-out, display 0.2s ease-in-out;
        transition-behavior: allow-discrete;
    }

    .contact {
        .book-link, .contact-info {
            transition: opacity 0.2s ease-in-out, display 0.2s ease-in-out;
            transition-behavior: allow-discrete;
        }
    }
}