/* Basic */
.main-navigation {
	position: relative;
	display: block;
	clear: both;

	ul {
		display: none;
		margin: 0;
		padding-left: 0;
		list-style: none;
	}

	li {
		position: relative;
		text-align: left;
	}

	a {
		position: relative;
		display: block;
		text-decoration: none;
	}

	@include media-breakpoint-down(sm) {
		ul {
			ul {
				a {
					text-indent: 2.5rem;
				}
				ul {
					a {
						text-indent: 3.3rem;
					}
					ul {
						a {
							text-indent: 4rem;
						}
						ul {
							a {
								text-indent: 5rem;
							}
							ul {
								a {
									text-indent: 6rem;
								}
							}
						}
					}
				}
			}
		}

		&.toggled {
			ul {
				display: block;
			}
		}
	}

	@include media-breakpoint-up(md) {
		ul {
			display: block;
		}

		li {
			&:hover,
			&.menu-hover {
				& > ul {
					left: 0;
					visibility: visible;
					opacity: 1;
					top: 120%;
					@include media-breakpoint-up(lg) {
						top: 190%;
					}
				}
			}

			& > ul {
				&.in-transition {
					left: 0;
				}
			}

			li {
				&:hover,
				&.menu-hover {
					& > ul {
						top:0;
						left: 100%;
						margin-left: 5px;
					}
				}

				& > ul {
					&.in-transition {
						left: 100%;
						margin-left: 5px;
					}
				}
			}

			&.super-guacamole__menu {
				&:hover,
				&.menu-hover {
					& > ul {
						left: auto;
						right: 0;
					}
				}

				& > ul {
					&.in-transition {
						left: auto;
						right: 0;
					}
				}

				li {
					&:hover,
					&.menu-hover {
						& > ul {
							left: 100%;
							margin-left: 5px;
						}
					}

					& > ul {
						&.in-transition {
							left: 100%;
							margin-left: 5px;
						}
					}
				}
			}

		}
		.menu {
			display: flex;
			flex-wrap: wrap;
			justify-content: center;
			position: relative;

			&:before {
				display: inline-block;
				content: '';
				left: -50%;
				right: -50%;
				height: 1px;
				position: absolute;
				top: -22px;
			}

			.default & {
				display: block;
			}

			.isStuck &{
				display: flex;
				justify-content: center;
			}

			> li {
				display: inline-block;

				& + li {
					margin-left: 52px;
				}

				> a {
					position: relative;
					font-size: 15px;
					text-transform: uppercase;
					font-weight: 700;
					letter-spacing: 0.04em;

					&:before {
						display: inline-block;
						content: '';
						left: 50%;
						right: 50%;
						transition: .25s;
						height: 4px;
						position: absolute;
						top: -22px;
						opacity: 0;
					}
				}
			}
		}
		.sub-menu {
			position: absolute;
			z-index: 999;
			top: 120%;
			left: -999em;
			visibility: hidden;
			margin: 0;
			transition: 200ms linear;
			transition-property: top, opacity, visibility;
			opacity: 0;

			li + li{
				border-top:1px solid $gray;
			}

			ul {
				top: 20%;
			}

			&:after {
				position: absolute;
				display: inline-block;
				content: '';
				width: 100%;
				height: 35px;
				left: 0;
				top: -35px;
			}
		}

		.menu-toggle {
			display: none;
		}
	}
}

/* Skin */
.main-navigation {
	@include media-breakpoint-up(md) {
		margin-top: 52px;
	}

	a {
		padding: 7px 0;
		z-index: 1111;

		&:focus {
			outline: none;
		}
	}

	.menu {

		@include media-breakpoint-down(sm) {
			ul {
				display: none;
			}
		}

		.sub-menu-toggle {
			position: relative;
			width: 20px;
			height: 20px;
			text-align: center;
			top: 4px;
			margin-left: 5px;
			z-index: 100;
			cursor: pointer;
			transition: .3s;
			color: $white;

			@include font-size(1.125);
			@include media-breakpoint-up(md) {
				display: none;
			}
			&:before {
				content: 'keyboard_arrow_down';
				@include material-icon();
				line-height: 20px;
				font-size: 16px;
			}

			&.active {
				&:before {
					content: 'keyboard_arrow_up';
				}
			}
		}

		> li {
			> a {
				@include media-breakpoint-up(md) {
					border-bottom: none;
				}
			}

			&:last-child {
				> a {
					border-bottom: none;
				}
			}

			&:hover,
			&.menu-hover,
			&.current_page_item,
			&.current_page_ancestor,
			&.current-menu-item,
			&.current-menu-ancestor {
				> a {
					/* Active and hover state (level 1) */
					&:before {
						left: 0;
						right: 0;
						opacity: 1;
					}
				}
			}

			&[hidden] {
				display: none;
			}
		}

		.sub-menu-toggle.active ~ .sub-menu {
			display: block !important;
		}
	}

	.sub-menu {
		li {
			@include media-breakpoint-up(md) {
				&:last-of-type {
					a {
						border-bottom: none;
					}
				}
			}
			&.menu-item-has-children {
				&::after {
					/* Marker (level 2, 3, ..., N) */
					top: 50%;
					transform: translateY(-50%);
					right: 26px;
					content: '\f105';
					@include media-breakpoint-down(sm) {
						display: none;
					}
				}
			}
		}

		a {
			@include font-size(1);
			@include media-breakpoint-up(md) {
				width: 13em;
				padding:10px 25px;
				font-weight: 700;
			}
		}

		li:hover,
		li.menu-hover,
		li.current_page_item,
		li.current_page_ancestor,
		li.current-menu-item,
		li.current-menu-ancestor {
			> a {
				/* Active and hover state (level 2, 3, ..., N) */
			}
		}
	}
	li {
		&::after {
			/* Marker style */
			position: absolute;
			top: 1em;
			right: 1em;
			cursor: pointer;

			@include font-awesome-icon;
			@include font-size(1.125);
		}
	}
	@include media-breakpoint-up(md) {
		.menu {
			> li {
				&::after {
					/* Marker position (level 1) */
					top: 13px;
					right: 18px;
					color: $white;
					transition: .4s all ease;
					font-size: 13px;
				}

				&.current-menu-ancestor::after,
				&.current-page-item::after,
				&.current-menu-item::after,
				&:hover::after {
					color: rgba($black, 0.5);
				}
			}
		}
	}
}

/* Menu items description */
.menu-item__desc {
	@include font-size(.625);

	.menu > li > a > & {
		position: absolute;
		bottom: -2px;
		width: 100%;
		min-width: 50px;
		color: inherit;
		text-transform: lowercase;
		white-space: nowrap;
	}
}

/* Toogle button */
.menu-toggle {
	position: absolute;
	top: -48px;
	right: 0;
	padding: .5em;
	background: none;
	border: none;
	width: 22px;
	height: 18px;
	transition: .4s all ease;

	&:hover {
		opacity: 0.5;
	}

	.menu-open-sign,
	.menu-close-sign {
		position: absolute;
		width: 22px;
		height: 18px;
		top: 0;
		left: 0;
		background: url(assets/images/menu-sign-open.png) 50% 0 no-repeat;
	}

	.menu-close-sign {
		background: url(assets/images/menu-sign-close.png) right 0 no-repeat;
	}

	.main-navigation & {
		.menu-open-sign {
			display: block;
		}
		.menu-close-sign {
			display: none;
		}
	}

	.main-navigation.toggled & {
		.menu-open-sign {
			display: none;
		}
		.menu-close-sign {
			display: block;
		}
	}

	&__icon {
		vertical-align: top;
	}
}

@include media-breakpoint-down(sm) {
	.site-header .main-navigation {
		.menu a {
			color: $white;
			display: inline-block;
			padding-left: 0;
			padding-right: 0;
		}

		.sub-menu {
			border: none;
			background: rgba($black, 0.1);
			border-top: 1px solid rgba($black, 0.1);
			border-bottom: 1px solid rgba($black, 0.05);

			a {
				@include font-size(0.875);
				padding: 9px 0;
			}

			.sub-menu {
				border: none;
				background: none;
				margin: 0 !important;
				padding: 0 !important;
			}
		}

		& .menu ul.sub-menu {
			margin: 0 -45px;
			margin-top: -40px;
			padding: 50px 45px 9px;
		}
	}
}
.main-navigation {
	.menu > li + li{
		@include media-breakpoint-up(md) {
			margin-left: 20px;
		}
		@include media-breakpoint-up(lg) {
			margin-left: 52px;
		}
	}

}
	.header-container .set-menu {
	a {
		color: $white;

		&:hover {
			color: $black;
		}
	}
}