@menuitem-padding-x: 13px;
@menuitem-padding-y: 12px;
@sub-menu-width: 190px;
@menu-height: 31px;

/* -------------------------------------------------------------------------- */

@main-menu-hover-background-local: @main-menu-hover-background;

/* Level 1 */
@menu-level1-bg: @accent-color-8;
@menu-level1-color: @css_submenu_color;
@menu-level1-hover-bg: @menu-level1-bg;
@menu-level1-hover-color: @css_submenu_hover_color;

/* -------------------------------------------------------------------------- */

#menus {
	position: relative;
	z-index: 210;
	min-height: @menu-height;
}

#main-menu .menu {
	position: relative;
	min-height: @menu-height;
	font-size: 0;

	// any menu item
	.menu-item {
		position: relative;
		list-style: none;
		cursor: pointer;

		&:hover > .sub-menu-wrapper > .sub-menu {
			display: block;
			box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.12);
			border-radius: 0;
		}

		a {
			display: block;
			text-decoration: none;
			padding: .3em .6em;
			transition: color .4s;

			strong {
				font-weight: normal;
			}
		}

		&.home > a {
			@home-icon-size: 16px;
			width: @home-icon-size;
			text-align: left;
			text-indent: -6000px;
			position: relative;

			&:before {
				position: absolute;
				top: 4px;
				left: 5px;
				z-index: 5;
				width: @home-icon-size;
				height: @home-icon-size;
				content: icon(home3);
				text-indent: 0 !important;
				font-size: @home-icon-size;
				font-family: icomoon;
			}
		}
	}

	// any sub menu
	.sub-menu {
		position: absolute;
		top: 0;
		z-index: 200;
		display: none;
		margin: 0 auto auto 0;
		width: @sub-menu-width;
		text-align: left;
		background: @menu-level1-bg;
		padding: 0;
		.border-box();

		&.invert-position {
			left: auto;
			right: 0;
		}

		.menu-item {
			padding: 0;
			transition: all .4s;

			> a {
				padding: 13px @menuitem-padding-x;
				color: @menu-level1-color;
				font: e(@menu-font-weight)  @menu-font-face (@menu-font-size -2px);
				text-transform: none;
				transition: all .3s;
				border: none;
			}

			&:last-child {
				padding-bottom: 0;
			}

			&.current-menu-parent,
			&.current-menu-item,
			&.current-menu-ancestor,
			&.current-menu-ancestor,
			&:hover {
				background: @css_menu_background;
				border-radius: 0px;

				> a {
					text-decoration: none;
					color: @menu-level1-hover-color;
					border-left-color: @accent-color-1;
					border-bottom-color: @accent-color-7;
					padding: 13px;
				}
			}
		}
	}

	body.sticky-header-type-over.sticky-header.wpv-not-scrolled &,
	body.sticky-header-type-half-over.sticky-header.wpv-not-scrolled .layout-standard &,
	body.sticky-header-type-half-over.sticky-header.wpv-not-scrolled .layout-logo-text-menu & {
		> .menu-item {
			&:not(.current-menu-parent):not(.current-menu-item):not(.current-menu-ancestor):not(.current-menu-ancestor):not(:hover) {
				> a {
					&, &:visited {
						color: @main-menu-sticky-color;
					}
				}
			}
		}
	}


	// first level
	> .menu-item {
		padding: 3px 15px 0 15px;
		background: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); // 1px transparent gif, otherwise IE won't extend the element to contain its children
		display: inline-block;

		> a {
			&, &:visited {
				color: @menu-font-color;
				font: e(@menu-font-weight) @menu-font-size/16px @menu-font-face;
				border-bottom: solid 3px  transparent;
				padding: 1em 0;
				letter-spacing: 0.05em;
				transition-duration: .3s;
				transition-property: color, border-bottom-color;
			}
		}

		&.current-menu-parent,
		&.current-menu-item,
		&.current-menu-ancestor,
		&.current-menu-ancestor,
		&:hover {
			> a {
				background-color: @main-menu-hover-background-local;
				color: @css_menu_hover_color;
				text-decoration: none;
				border-bottom: solid 3px @accent-color-1;
				padding-bottom: 1em;
			}
		}

		&:hover > .sub-menu-wrapper {
			padding-top: 14px;
			position: absolute;
			top: 100%;
			left: 10%;
			width: 100%;
			z-index: 10000;

			> .sub-menu {
				top: 0;
			}
		}

		// second level
		> .sub-menu-wrapper > .sub-menu {
			left: 0;
			margin: 0 auto auto 0;
			transition: all .3s;

			.menu-item-has-children > a:after {
				position: absolute;
				top: 50%;
				top: calc(50% - 2px);
				right: 10px;
				line-height: 0;
				font-size: 12px;
			}

			// lower levels
			.sub-menu {
				left: 100%;
				top: 0px;

				&.invert-position {
					left: auto;
					right: 100%;
				}
			}
		}
	}
}
