:root {
    --menuheight: 76px;
    --dropheight: 40px;
    --menucolor: rgb(195, 249, 255);
    --menuhover: rgb(97, 226, 240);
    --menubluehover: rgb(170, 208, 247);
    --menutext: rgb(0, 0, 0, );
    --dropmenutext: rgb(210, 255, 214);
    --texthover: rgb(100, 100, 100);
    --menuActive: rgb(28, 221, 243);
    --menuActiveText: rgb(100, 100, 100);
}

.myMenu {
    /* define the height of the menu */
    /* holder and ul general style */
    font-family: 'Arial';
    font-size: 1.5vw;
    font-style: 'normal';
    background-color: var(--menucolor);
    line-height: var(--menuheight);
    text-align: center;
    box-sizing: border-box;
    min-width: 60px;
    position: relative;
    z-index: 2000;
    /*position: fixed;
    top: 0;
    left: 0;
    width: 100vw;*/

    ul {
        list-style: none;
        padding: 0 0 0 5;
        margin: 0;
        color: var(--menutext);
        background-color: var(--menucolor);

        li,
        li a {

            color: var(--menutext);
            text-decoration: none;
            white-space: nowrap;
            padding: 0 0 0 5;
            margin: 0;
            padding-right: 10px;



            a {
                display: flex;
                align-items: baseline;
                /*width: 100%;*/
            }

        }

        /*li.focus {
                 background-color: var(--menuActive);
                 color: var(--menuActiveText);
           }*/

        /* put an arrow down to the li`s with dropdown */
        .toplink {
            padding-right: 36px;

            &::before {
                content: '';
                width: 0;
                height: 0;
                border-left: 5px solid transparent;
                border-right: 5px solid transparent;
                border-top: 5px solid #000000;
                position: absolute;
                right: 0;
                top: 50%;
                transform: translateY(-50%);
            }

        }

        .topflatlink {

            /* links dont need arrow */
            &::before {
                padding-right: 0;
                display: none;
            }

            &:hover {
                color: var(--texthover);
            }
        }

        .subflatlink {

            color: var(--menutext);

            /* links dont need arrow */
            &::before {
                padding-right: 0;
                display: none;
            }

        }

        .lowflatlink {

            color: var(--menutext);

            /* links dont need arrow */
            &::before {
                padding-right: 0;
                display: none;
            }

            &:hover {
                color: var(--texthover);
                background-color: var(--menuhover);
            }
        }

        .sublink {

            color: var(--dropmenutext);

            &::before {
                content: '';
                width: 0;
                height: 0;
                border-left: 5px solid transparent;
                border-right: 5px solid transparent;
                border-top: 5px solid #000000;
                position: absolute;
                right: 0;
                top: 50%;
                transform: translateY(-50%);
            }

            &:hover {
                color: aqua;
                background-color: #000000;
            }
        }

        .focus {
            background-color: var(--menuActive);
            color: var(--menuActiveText);

            &::before {
                content: '';
                width: 0;
                height: 0;
                border-left: 5px solid transparent;
                border-right: 5px solid transparent;
                border-top: 5px solid #000000;
                position: absolute;
                right: 0;
                top: 50%;
                transform: translateY(-50%);
            }

            &:hover {
                color: var(--texthover);
                background-color: var(--menuActive);
            }
        }

        .flatfocus {
            background-color: var(--menuActive);
            color: var(--menuActiveText);

            &:hover {
                color: var(--texthover);
            }
        }
    }

    /*
    /* the first ul inside the container is the menu, so must be visible and have its own style */
    >ul {
        display: flex;
        align-items: center;

        /* the first ul elements can be a link or an li with a nested ul.  the nested ul will be a dropdown */
        li {
            position: relative;
            margin: 0 8px;
            /*padding-right: 36px;*/

            /* the dropdown style */
            ul {
                visibility: hidden;
                opacity: 0;
                padding: 0;
                min-width: 160px;
                position: absolute;
                z-index: 2001;
                top: var(--lineheight);
                line-height: var(--dropheight);
                left: 50%;
                transform: translateX(-50%);

                /*transition: 200ms;
                transition-delay: 200ms;*

                /*the dropdown items style */
                li {
                    margin: 0;
                    padding: 8px 16px;
                    display: flex;
                    align-items: center;
                    justify-content: flex-start;
                    /*padding-right: 36px;*/

                    /* lets put an arrow right to the inner li`s with dropdowns */
                    &::before {
                        width: 0;
                        height: 0;
                        border-top: 5px solid transparent;
                        border-bottom: 5px solid transparent;
                        border-left: 5px solid #000000;
                    }


                    /* every dropdown after the first must open to the right */
                    ul {
                        top: -2%;
                        left: 100%;
                        transform: translate(0)
                    }

                    &:hover {
                        /*background-color: var(--menuhover);*/
                        /*color: var(--menutext);*/
                        opacity: 1;
                    }
                }

            }

            .subflatlink {
                color: var(--menutext);

                &:hover {
                    color: var(--menutext);
                    background-color: var(--menuhover);
                }
            }

            .sublink {
                color: var(--menutext);

                &:hover {
                    color: var(--menutext);
                    background-color: var(--menuhover);
                }
            }

            /* on hover an li (not an <a>) must show its ul (dropdown) */
            &:hover {
                /*background-color: var(--menuhover);*/
                /*color: var(--texthover);*/
                opacity: 1;


                >ul {
                    opacity: 1;
                    visibility: visible;
                    transition-delay: 0ms;
                }
            }
        }
    }
}

@media (max-width: 700px) and (orientation: portrait) {
    .myMenu {
        font-size: 16px;
        line-height: 1.2;
    }

    .myMenu > ul {
        display: grid;
        grid-template-columns: 1.12fr 1.18fr 0.85fr 0.85fr;
        align-items: stretch;
    }

    .myMenu > ul > li,
    .myMenu > ul > li > a,
    .myMenu > ul > a {
        font-size: 16px !important;
        line-height: 1.25;
        font-weight: 600;
    }

    .myMenu > ul > li {
        margin: 0;
    }

    .myMenu > ul > li > a,
    .myMenu > ul > a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 54px;
        padding: 8px 4px;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}