#{$wrap} {

	#{$menu}.mega-menu-vertical {
		flex-direction: column;

		// top level items
		> li.mega-menu-item {
	    	display: list-item;
	    	margin: 0;
	    	clear: both;
	    	width: 100%;
	    	margin: 0 0 $menu_item_spacing 0;

            @if $menu_item_divider == 'on' {
                border-left: 0;
                border-top: 1px solid $menu_item_divider_color;
				@include box-shadow(inset 1px 0 0 0 rgba(255,255,255,$menu_item_divider_glow_opacity));
                
                /* Hide divider on first menu item */
                &:first-child {
                    border-top: 0;
                    @include box-shadow(none);
                }
            }

            > a.mega-menu-link {
            	height: auto;
            }

            &.mega-icon-top > a.mega-menu-link {
            	display: list-item;
            }

			@include mobile {
				&.mega-hide-on-mobile {
					display: none;
				}
			}

			@include desktop {
				&.mega-hide-on-desktop {
					display: none;
				}
			}
	    }

		@if unit($panel_width) == '%' {
			@include desktop {
				> li.mega-menu-megamenu > ul.mega-sub-menu {
					width: 600px;
				}
			}
		}

		> li.mega-menu-megamenu.mega-menu-item,
		> li.mega-menu-flyout.mega-menu-item {
		    position: relative;
		}

		// arrows
		@include desktop {
			li.mega-align-bottom-right.mega-menu-item-has-children,
			li.mega-align-bottom-right.mega-menu-flyout li.mega-menu-item-has-children {
				li.mega-menu-item a.mega-menu-link {
				    text-align: left;
				}

                > a.mega-menu-link > span.mega-indicator {
                    float: right;
                    margin-left: auto;

                    &:after {
                        content: $arrow_right;
                        margin: 0;
                    }
                }
			}

			li.mega-align-bottom-left.mega-menu-item-has-children,
			li.mega-align-bottom-left.mega-menu-flyout li.mega-menu-item-has-children {
				> a.mega-menu-link {
					text-align: right;
				}

                > a.mega-menu-link > span.mega-indicator {
                    float: left;
                    margin-left: auto;

                    &:after {
                        content: $arrow_left;
                        margin: 0;
                    }
                }

				&.mega-icon-left > a.mega-menu-link:before {
				    float: right;
				    margin: 0 0 0 6px;
				}
			}
		}

		li.mega-menu-megamenu.mega-align-bottom-right {
		    > ul.mega-sub-menu {
				top: 0;
				left: 100%;
				right: auto;
			}
		}

		li.mega-menu-flyout.mega-align-bottom-right,
		li.mega-menu-flyout.mega-align-bottom-right li.mega-menu-item,
		li.mega-menu-flyout.mega-align-bottom-right ul.mega-sub-menu li.mega-menu-item {
		    ul.mega-sub-menu {
				top: 0;
				left: 100%;
				right: auto;
			}

			&.mega-icon-left > a.mega-menu-link:before {
			    float: left;
			    margin: 0 6px 0 0;
			}
		}

		li.mega-menu-megamenu.mega-align-bottom-left {
			> ul.mega-sub-menu {
				top: 0;
				left: auto;
				right: 100%;
			}
		}

		li.mega-menu-flyout.mega-align-bottom-left,
		li.mega-menu-flyout.mega-align-bottom-left li.mega-menu-item,
		li.mega-menu-flyout.mega-align-bottom-left li.mega-menu-item ul.mega-sub-menu li.mega-menu-item {
			> ul.mega-sub-menu {
				top: 0;
				left: auto;
				right: 100%;
			}
		}
	}

	#{$menu}.mega-menu-accordion {
		flex-direction: column;

		// top level items
		> li.mega-menu-item {
	    	display: list-item;
	    	margin: 0;
	    	clear: both;
	    	width: 100%;
	    	margin: 0 0 $menu_item_spacing 0;

            @if $menu_item_divider == 'on' {
                border-left: 0;
                border-top: 1px solid $menu_item_divider_color;
                @include box-shadow(inset 1px 0 0 0 rgba(255,255,255,$menu_item_divider_glow_opacity));

                /* Hide divider on first menu item */
                &:first-child {
                    border-top: 0;
                    @include box-shadow(none);
                }
            }

            > a.mega-menu-link {
            	height: auto;
            }

            &.mega-icon-top > a.mega-menu-link {
            	display: list-item;
            }

			@include mobile {
				&.mega-hide-on-mobile {
					display: none;
				}
			}

			@include desktop {
				&.mega-hide-on-desktop {
					display: none;
				}
			}
	    }

		> li.mega-menu-megamenu > ul.mega-sub-menu {
            position: static;
            width: 100% !important;
        }

        > li.mega-menu-flyout > ul.mega-sub-menu {
            position: static;
            width: 100% !important;
            padding: 0;

            li.mega-menu-item.mega-current-menu-item {
                > a.mega-menu-link {
                    @include background($flyout_background_hover_from, $flyout_background_hover_to);
                    font-weight: $flyout_link_weight_hover;
                    text-decoration: $flyout_link_text_decoration_hover;
                    color: $flyout_link_color_hover;
                }
            }

            li.mega-menu-item ul.mega-sub-menu {
                position: static;
                left: 0;
                width: 100%;
                border: 0;
                @include box-shadow(none);

	            a.mega-menu-link {
	                padding-left: 20px;
	            }

	            li.mega-menu-item ul.mega-sub-menu {
		            a.mega-menu-link {
		                padding-left: 30px;
		            }

		            li.mega-menu-item ul.mega-sub-menu {
			            a.mega-menu-link {
			                padding-left: 40px;
			            }
			        }
		        }
            }
        }

        li.mega-menu-item > ul.mega-sub-menu {
            display: none;
            visibility: visible;
            opacity: 1;
        }

        li.mega-menu-item.mega-toggle-on > ul.mega-sub-menu,
        li.mega-menu-item.mega-menu-megamenu.mega-toggle-on ul.mega-sub-menu {
            display: block;
        }

        // Arrows
        @include desktop {
            li.mega-menu-item-has-children > a.mega-menu-link > span.mega-indicator {
                float: right;
                margin-left: auto;
            }
        }

        li.mega-menu-item li.mega-menu-item-has-children > a.mega-menu-link > span.mega-indicator:after {
            content: $arrow_down;
        }
        
        li.mega-menu-item-has-children.mega-toggle-on > a.mega-menu-link > span.mega-indicator:after,
        li.mega-menu-item li.mega-menu-item-has-children.mega-toggle-on > a.mega-menu-link > span.mega-indicator:after {
            content: $arrow_up;
        }
	}
}