header {
    display: flex;
    flex-direction: column;
    position: relative;
    isolation: isolate;
    z-index: 999;

    @media only screen and (max-width: 640px) {
        align-items: center;
    }

    & ul {
        list-style: none;
        display: flex;

        & li {
            display: flex;
            align-items: center;
            font-family: "Poppins", sans-serif;
        }

        & a {
            text-decoration: none;
            color: white;

            /* .active {
                color: red;
            } */

            &:hover {
                & {
                    color: #ac8d56;
                }
            }
        }
    }

    .header-top,
    .header-bottom {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 2rem;
        width: 100%;
        padding-left: var(--body-padding-lateral-header-footer) !important;
        padding-right: var(--body-padding-lateral-header-footer) !important;

        /* @media only screen and (max-width: 1404px) {
            &.header-bottom {
                justify-content: center;
            }
        } */

        @media only screen and (max-width: 547px) {
            &.header-top {
                justify-content: center;
            }
        }
    }

    .header-top {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
        background-color: #38579c;

        & img {
            max-height: 30px;
        }

        .header-left {
            display: flex;

            & ul {
                gap: 2rem;
                flex-wrap: wrap;

                @media only screen and (max-width: 368px) {
                    & {
                        justify-content: center;
                    }
                }

                & li {
                    font-size: 1rem;
                }
            }
        }

        .header-right {
            display: flex;

            & ul {
                gap: 1.5rem;

                & img {
                    fill: #15AAFF;
                }

                @media only screen and (max-width: 320px) {
                    & {
                        justify-content: center;
                        gap: 2rem;
                    }
                }
            }
        }
    }

    .header-bottom {
        padding-block: 2.25rem;
        position: relative;
        background-color: white;

        & img {
            max-height: 45px;
        }

        .header-right-responsive {
            /* position: relative; */
            display: flex;
            align-items: center;
            gap: 20px;
            transition: transform 0.3s ease;

            &[data-visible="true"] {
                transform: translate(0%);
            }

            /* &::before {
                display: none;
                position: absolute;
                content: "";
                width: calc(100% - 250px);
                inset: 0 0 0 0;
                background-color: rgba(0, 0, 0, 0.5);
            } */

            & ul {
                flex-wrap: wrap;
                gap: 1rem;

                @media only screen and (max-width: 1390px) {
                    & {
                        flex-direction: column;
                        align-items: center;
                        gap: 2rem;
                    }
                }

                & li {
                    opacity: 0.71;
                    display: flex;
                    flex-direction: column;
                    justify-content: center;
                    align-items: center;
                    position: relative;

                    & a {
                        font-size: 1.5rem;
                        font-weight: 500;
                        color: #2c3847;
                        text-align: center;
                    }

                    &:first-child {
                        padding: 0.5rem 2rem;
                        border: 3px solid #2c3847;
                        border-radius: 2.3rem;
                        transition: all 0.3s ease-out;

                        &:hover {
                            opacity: 1;
                            background-color: #2c3847;
                            transition: all 0.3s ease-in;

                            & a {
                                color: white;
                            }
                        }

                        &.active {
                            opacity: 1;
                            background-color: #2c3847;

                            & a {
                                color: white;
                            }
                        }
                    }

                    &:not(&:first-child) {
                        &::after {
                            content: "";
                            height: 4px;
                            background-color: #2c3847;
                            border-radius: 2px;
                            opacity: 0;
                            width: 0;
                            transition: opacity 0.3s ease-out, width 0.3s ease-out;
                        }

                        &.active {
                            opacity: 1;
                        }

                        &.active::after {
                            opacity: 1;
                            width: 100%;
                            transition: opacity 0.3s ease-in, width 0.3s ease-in;
                        }

                        &:hover {
                            opacity: 1;
                            transition: opacity 0.3s ease-in;

                            &::after {
                                opacity: 1;
                                width: 100%;
                                transition: opacity 0.3s ease-in, width 0.3s ease-in;
                            }
                        }

                        @media only screen and (max-width: 1390px) {
                            & {
                                width: fit-content;
                            }
                        }
                    }
                }
            }

            @media only screen and (max-width: 1390px) {
                & {
                    flex-direction: column;
                    gap: 30px;
                    justify-content: flex-start;
                    align-items: center;
                    width: auto;
                    position: fixed;
                    inset: 0 0 0 calc(100% - 300px);
                    z-index: 1000;
                    background-color: #dddddd;
                    padding: min(30vh, 80px) 30px;
                    transform: translate(100%);
                    transition: transform 0.3s ease;
                }
            }

            @media only screen and (max-width: 768px) {
                &[data-visible="true"] {
                    &::before {
                        display: block;
                        transform: translate(0%);
                    }
                }
            }

            @media only screen and (max-width: 480px) {
                /* & {
                    inset: 0 0 0 70px;
                } */

                /* &::before {
                    position: absolute;
                    content: "";
                    width: 70px;
                    inset: 0 0 0 -70px;
                    background-color: rgba(0, 0, 0, 0.5);
                } */
            }
        }

        .header-mobile-menu-button {
            display: none;
            border: none;
            background: none;
            position: relative;

            &::before {
                /* content: "\f0c9";
                font-family: 'Font Awesome 5 Free'; */
                font-weight: 600;
                font-size: 20px;
                color: #6a6f81;
            }

            @media only screen and (max-width: 1390px) {
                & {
                    display: block;
                    width: 30px;
                    height: 30px;
                    z-index: 9999;
                }

                &[aria-expanded="false"] {
                    transition: all 0.3s ease;
                }

                &[aria-expanded="true"] {
                    position: fixed;
                    top: 20px;
                    right: 20px;
                    transition: all 0.3s ease;

                    &::before {
                        content: "\f00d";
                    }
                }
            }
        }

        @media only screen and (max-width: 640px) {
            img {
                max-height: 30px;
            }
        }
    }

    .animated-content {
        --animation-duration: 0.5s;
        --translate-y-size: 130px;

        background-color: #38579c;
        border-radius: 0 0 2.5rem 2.5rem;
        position: absolute;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        align-items: center;
        gap: 0.5rem;
        top: 0;
        bottom: -64px;
        right: var(--body-padding-lateral-header-footer);
        width: max-content;
        padding: 1rem 3rem;
        z-index: -1;
        transition: all var(--animation-duration) ease-in-out;

        & img,
        & a {
            display: none;
            height: auto;
            width: 100px;
            max-height: none;
        }

        & a,
        & p {
            font-family: "Poppins";
        }

        & a {
            width: fit-content;
            font-weight: 300;
            text-decoration: none;
            color: #38579c;
            position: relative;
            padding-right: 20px;

            &::before {
                position: absolute;
                right: 0;
                top: 50%;
                transform: translateY(-50%);
                /* padding-right: 8px; */
            }
        }

        & p {
            font-weight: 500;
            font-size: 24px;
            color: white;
            text-transform: uppercase;
            text-align: center;
        }

        @media only screen and (min-width: 1390px) {
            &:hover {
                background-color: white;
                transform: translateY(var(--translate-y-size));
                transition: all var(--animation-duration) ease-in-out;

                & img,
                & a {
                    display: block;
                    transition: all var(--animation-duration) ease-in-out;
                }

                & p {
                    color: #38579c;
                    transition: all var(--animation-duration) ease-in-out;
                }
            }
        }

        @media only screen and (max-width: 1390px) {
            & {
                position: relative;
                inset: auto;
                width: auto;
                border-radius: 2.5rem;
                /* margin-bottom: 3rem; */
                background-color: white;
                border: 2px solid #38579c;
                padding: 1rem 1.5rem;

                & img,
                & a {
                    display: block;
                }

                & p {
                    color: #38579c;
                    font-size: 20px;
                    line-break: normal;
                }
            }
        }

        /* @media only screen and (max-width: 400px) {
            & {
                padding: 0.5rem 1.5rem;
            }
        }

        @media only screen and (max-width: 320px) {
            & {
                padding: 0.5rem;
            }
        } */
    }
}
