/*-------------------------------------------------------*/
/* Navigation
/*-------------------------------------------------------*/
.envisionx-header {
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	z-index: 120;
	min-height: var(--ebx-nav-height);
	position: relative;

	&__container {
		display: flex;
		flex-flow: row nowrap;
		align-items: center;

		@include bp-lg-up {
			height: var(--ebx-nav-height);
		}

		@include bp-sm-down {
			max-width: 100% !important;
		}

		@include bp-lg-down {
			display: block;
		}
	}

	&__inner {
		line-height: 1;
		flex: 1;
	}

	&__nav-menu,
	&__dropdown-menu {
		list-style: none;
		padding: 0;
	}

	&__nav-menu {
		position: relative;
		display: inline-flex;
		align-items: center;
		flex-wrap: wrap;
		padding: 0;
		margin: 0;

		li {
			position: relative;
		}

		& > li > a {
			font-weight: 500;
			color: var(--ebx-foreground-color);
			font-size: 1rem;
			padding: 16px 0;
			display: block;
			position: relative;
			transition: 0.1s color;

			&:hover,
			&:focus {
				color: var(--ebx-links-hover-color);
			}
		}
	}

	&__item-submenu-trigger {
		margin-left: auto;
		fill: currentColor;
	}

	&__dropdown-menu li a {
		font-size: 1rem;
	}

	/* Dropdowns (large screen) */
	@include bp-lg-up {
		&__nav-wrap {
			&.collapse {
				display: block;
				height: auto;
			}
		}

		&__nav-menu > li {
			display: inline-block;
			text-align: center;
			padding: 0 16px;

			&:first-child {
				padding-left: 0;
			}

			&:last-child {
				padding-right: 0;
			}
		}

		&__dropdown-menu {
			position: absolute;
			background-color: #fff;
			z-index: 1000;
			left: -5px;
			top: 100%;
			min-width: 220px;
			width: 100%;
			text-align: left;
			padding: 20px 0;
			border-radius: var(--ebx-rounded--sm);
			list-style: none;
			box-shadow: 0 10px 20px rgba(#000, 0.07);
			background-clip: padding-box;
			display: block;
			visibility: hidden;
			opacity: 0;
			transform: translateY(20px);
			transition: all 0.2s ease-in-out;

			& > li > a {
				color: var(--ebx-text-color);
				padding: 3px 30px;
				line-height: 22px;
				display: flex;
				align-items: center;

				&:hover,
				&:focus {
					color: var(--ebx-links-hover-color);
				}
			}
		}

		&__dropdown-menu.hide-dropdown {
			visibility: hidden !important;
			opacity: 0 !important;
		}

		&__dropdown:hover > .envisionx-header__dropdown-menu,
		&__dropdown:focus > .envisionx-header__dropdown-menu,
		&__dropdown.focus > .envisionx-header__dropdown-menu {
			opacity: 1;
			visibility: visible;
			transform: translateY(0);
		}

		&__dropdown-menu {
			.envisionx-header__dropdown-menu {
				left: 100%;
				top: -20px;
			}
		}

		&__dropdown &__dropdown {
			position: relative;
		}

		&__dropdown-trigger {
			display: none;
		}
	}
}

/* Dropdown trigger
-------------------------------------------------------*/
.envisionx-header__dropdown-trigger {
	background-color: transparent;
	border: 0;
	padding: 0;
	color: inherit;

	&:hover,
	&:focus {
		box-shadow: none;
	}

	&::before,
	&::after {
		display: none;
	}

	.envisionx-header__dropdown &:hover,
	.envisionx-header__dropdown &:focus {
		background-color: transparent;
		color: inherit;
	}

	svg {
		fill: currentColor;
		display: inline-block;
		vertical-align: middle;
		transition: all 0.2s ease-in-out;
	}

	&--is-open svg {
		transform: rotate(180deg);
	}
}

.mobile body {
	cursor: pointer;
}

.envisionx-header__menu .current-menu-item > a {
	color: var(--ebx-primary-color);
}

/* Logo
-------------------------------------------------------*/
.envisionx-logo {
	line-height: 1;
	display: block;

	&-url {
		display: inline-block;
		vertical-align: middle;
		color: var(--ebx-foreground-color);

		@include bp-lg-up {
			margin-right: 64px;
		}
	}
}

/* Nav Icons / Last menu item
-------------------------------------------------------*/
.envisionx-nav__icons {
	align-items: center;
	justify-content: flex-end;
	margin-left: auto;
	line-height: 1;
	flex: 1;

	&-item {
		margin-left: 10px;
		color: var(--ebx-foreground-color);

		@include bp-lg-up {
			margin-left: 16px;
		}

		&-url {
			color: var(--ebx-foreground-color);
		}

		&:first-child {
			margin-left: 0;
		}
	}
}

.envisionx-nav__icons-item {
	.envisionx-menu-search__trigger:hover,
	.envisionx-menu-search__trigger:focus {
		background-color: transparent;
		outline-color: transparent;
		color: var(--ebx-primary-color);
	}

	&-url:hover svg,
	&-url:focus svg {
		color: var(--ebx-primary-color);
	}
}

/* Nav Mobile / Icon Toggle
-------------------------------------------------------*/
.envisionx-header__mobile {
	display: flex;
	align-items: center;
	margin-left: auto;
}

.envisionx-header__icon-toggle {
	display: block;
	position: relative;
	padding: 9px !important;
	background-color: transparent !important;
	width: 36px;
	height: 32px;
	margin-right: -9px;
	margin-left: 6px;
	border: none;
	z-index: 50;
	box-shadow: none !important;

	&::before,
	&::after {
		display: none;
	}

	.envisionx-header__mobile & {
		background-color: transparent;

		&:hover,
		&:focus {
			outline: none;
			background-color: transparent;
		}
	}

	@include bp-lg-up {
		display: none;
	}

	&-bar {
		background-color: var(--ebx-foreground-color);
		width: 18px;
		display: block;
		position: absolute;
		height: 2px;
		border-radius: 1px;
	}

	span:nth-child(2) {
		top: 9px;
		transition: top 0.2s 0.2s ease-in, opacity 0.1s ease-in;
	}

	span:nth-child(3) {
		top: 15px;
		transition: opacity 0.1s ease-in;
	}

	span:nth-child(4) {
		bottom: 9px;
		transition: bottom 0.2s 0.2s ease-in,
			transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19);
	}

	&--is-opened {
		span:nth-child(2) {
			top: 15px;
			transition: transform 0.5s cubic-bezier(0.215, 0.61, 0.355, 1);
			transform: rotate(45deg);
		}

		span:nth-child(3) {
			opacity: 0;
		}

		span:nth-child(4) {
			bottom: 15px;
			transform: rotate(-45deg);
			transition: bottom 0.1s ease-out,
				transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1);
		}
	}
}

/* Sticky Nav
-------------------------------------------------------*/
.envisionx-header--sticky {
	&.offset {
		transform: translate3d(0, -100%, 0);
		transition: var(--ebx-transition--all) !important;
	}

	&.scrolling {
		transform: translate3d(0, 0px, 0);
	}

	&.sticky {
		position: fixed !important;
		background-color: var(--ebx-background-color);
		visibility: hidden;
		opacity: 0;
		left: 0;
		right: 0;
		top: 0;
		box-shadow: 0 0 5px rgba(62, 64, 69, 0.1);

		&.scrolling {
			opacity: 1;
			visibility: visible;
		}
	}
}

/* Go to Top
-------------------------------------------------------*/
#back-to-top {
	display: block;
	z-index: 100;
	width: 34px;
	height: 34px;
	text-align: center;
	font-size: 15px;
	position: fixed;
	bottom: -34px;
	right: 20px;
	line-height: 34px;
	background-color: var(--ebx-light-color);
	box-shadow: 0px 1px 4px 0px rgba(154, 161, 171, 0.4);
	border-radius: 50%;
	transition: var(--ebx-transition--all);
	text-decoration: none;

	a {
		display: block;
		color: var(--ebx-dark-color);
	}

	&.show {
		bottom: 20px;
	}

	&:hover {
		background-color: var(--ebx-primary-color);
		bottom: 24px;

		svg {
			fill: #fff;
		}
	}
}

/*-------------------------------------------------------*/
/* Nav Mobile Styles
/*-------------------------------------------------------*/
@include bp-lg-down {
	.envisionx-header {
		&__nav-wrap {
			margin-left: 0;
			max-height: calc(100vh - 60px);
			overflow-y: auto;
			overflow-x: hidden;
		}

		&__inner {
			height: var(--ebx-nav-height);
			display: flex;
			align-items: center;
		}

		&__nav-menu {
			display: block;
		}

		&__nav-menu li a {
			padding: 0;
			line-height: 46px;
			display: block;
			border-bottom: 1px solid var(--ebx-border-color);
		}

		&__nav-menu > li:not(.envisionx-header__dropdown):last-child a {
			border-bottom: 0;
		}

		&__item-dropdown > svg {
			display: none;
		}

		&__dropdown-menu a {
			color: var(--ebx-text-color);

			&:hover,
			&:focus {
				color: var(--ebx-links-hover-color);
			}
		}

		&__dropdown-menu > li > a {
			padding-left: 10px;
		}

		&__dropdown-menu > li > ul > li > a {
			padding-left: 20px;
		}

		&__dropdown-trigger {
			display: block;
			width: 20px;
			min-height: 44px;
			line-height: 1;
			font-size: 1rem;
			text-align: center;
			position: absolute;
			right: 0;
			top: 0;
			box-shadow: none;
			z-index: 50;
			cursor: pointer;
		}

		&__dropdown-menu {
			display: none;
			width: 100% !important;
		}

		&__dropdown-trigger.active + .envisionx-header__dropdown-menu {
			display: block;
		}
	}
}
