.amazonmenu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .amazonmenu ul li {
        position: static; /* menu li items should have position set to static */
    }

.amazonmenu > ul {
    background: white;
    border: 1px solid #ccc;
    position: relative;
}

    .amazonmenu > ul li a {
        color: black;
        display: block;
        overflow: auto;
        padding: 10px 10px 10px 15px;
        position: relative;
        text-decoration: none;
        border-bottom: 1px dotted #ccc;
    }

    .amazonmenu > ul li:last-child a {
        border-bottom: none;
    }

    .amazonmenu > ul li.hassub > a::after { /* Arrow to indicate this item has sub menu (LI elements with sub menus have a ".hassub" class). */
        border: 5px solid transparent;
        border-left-color: gray; /* Default color of arrow */
        content: '';
        height: 0;
        position: absolute;
        right: 5px;
        top: 15px;
        width: 0;
    }

    .amazonmenu > ul li.hassub.selected > a::after { /* Style of arrow when corresponding sub menu is open (LI element has a "selected" class during this state */
        border-left-color: #fff;
    }

.amazonmenu ul li a:hover, .amazonmenu ul li.hassub.selected > a { /* style of hover and selected menu item links */
    background: #02aff3;
    color: #fff;
}

.amazonmenu ul li > div, .amazonmenu ul li > ul { /* Sub menus (Could be a DIV or UL wrapper) style */
    background: white;
    border: 1px solid #ccc;
    display: none;
    font-weight: normal;
    width: 275px;
    left: 100%;    
    position: absolute;
    top:-1px;    
    z-index: 1000;
}


/* ###### CSS Media queries ###### */

@media screen and (max-width: 480px) { /* When screen size is 480px */
    .amazonmenu ul li > div, .amazonmenu ul li > ul {
        left: 30px; /* Stack the sub menus so they take up less space */
    }

    .amazonmenu > ul li.hassub.selected::after { /* Add "veil" to parent menus */
        background: #eee;
        content: '';
        height: 100%;
        left: 0;
        opacity: .8;
        pointer-events: none;
        position: absolute;
        top: 0;
        width: 100%;
        z-index: 1;
    }
}
