/*-------------------------------------------------------*/
/* Navigation
/*-------------------------------------------------------*/
.nav {
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	z-index: 120;
	min-height: $nav-height;
	position: relative;

	&__wrap {
		flex: 1 0 0;

		@include bp-lg-up {
			text-align: center;
		}
	}

	&__menu,
	&__dropdown-menu {
		list-style: none;
	}

	&__menu {
		position: relative;
		display: inline-flex;
		align-items: center;
		flex-wrap: wrap;

		li {
			position: relative;
			padding: 0px 1px;
		}

		& > li > a {
			font-weight: 600;
			color: $nav-links-color;
			font-size: 0.9375rem;
			line-height: $nav-height;
			display: block;
			position: relative;
			@include transition(0.1s color);

			&:hover,
			&:focus {
				color: $primary-color;
			}
		}
	}

	// Megamenu
	.eversor-nav-menu &__dropdown-menu.nav__dropdown-menu-megamenu,
	&__menu &__dropdown-menu.nav__dropdown-menu-megamenu {
		background-color: transparent;
		padding: 0;
	}

	&__dropdown-menu li a {
		font-size: 0.8125rem;
	}

	/* Dropdowns (large screen) */
	@include bp-lg-up {
		&__flex-parent {
			height: $nav-height;
		}

		&__wrap {
			&.collapse {
				display: block;
				height: auto;
			}
		}

		&__menu > li {
			display: inline-block;
			text-align: center;
			padding: 0 17px;

			&: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;
			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);
			@include transition(all 0.2s ease-in-out);

			& > li > a {
				color: $text-color;
				padding: 3px 30px;
				line-height: 22px;
				display: block;

				&:hover,
				&:focus {
					color: $primary-color;
				}
			}
		}

		&__item-dropdown::after {
			content: "\e900";
			font-size: 12px;
			opacity: 0.5;
			font-family: "amela";
			line-height: 1;
			margin-left: 4px;
		}

		&__dropdown-menu.hide-dropdown {
			visibility: hidden !important;
			opacity: 0 !important;
		}

		&__dropdown:hover > .nav__dropdown-menu,
		&__dropdown:focus > .nav__dropdown-menu,
		&__dropdown.focus > .nav__dropdown-menu,
		&__dropdown-megamenu:hover > .nav__dropdown-menu,
		&__dropdown-megamenu:focus > .nav__dropdown-menu,
		&__dropdown-megamenu.focus > .nav__dropdown-menu {
			opacity: 1;
			visibility: visible;
			transform: translateY(0);
		}

		&__dropdown-menu {
			.nav__dropdown-menu {
				left: 100%;
				top: -16px;
			}
		}

		&__dropdown &__dropdown {
			position: relative;
		}

		&__dropdown &__dropdown > a:after {
			content: "\e902";
			font-family: "amela";
			font-size: 14px;
			position: absolute;
			right: 20px;
			top: 50%;
			@include transform(translateY(-50%));
		}

		&__dropdown-trigger {
			display: none;
		}
	}
}

/* Top bar
-------------------------------------------------------*/
.top-bar {
	padding: 11px 0;
	background-color: $heading-color;
	text-align: center;
	color: #fff;

	&__url {
		color: inherit;
		transition: color $transition;

		&:focus,
		&:hover {
			color: $primary-color;
		}
	}

	&__message {
		margin-bottom: 0;
		font-weight: 600;
		font-size: 0.8175rem;
		line-height: 1.2;
	}

	.top-bar__message {
		font-weight: normal;
	}
}

/* Dropdown trigger
-------------------------------------------------------*/
.nav__dropdown-trigger {
	background-color: transparent;
	border: 0;
	padding: 0;
	color: inherit;

	&:hover,
	&:focus {
		background-color: transparent;
		color: inherit;
	}

	i {
		display: inline-block;
		vertical-align: middle;
		@include transition(all 0.2s ease-in-out);
	}

	&--is-open i {
		@include transform(rotate(180deg));
	}
}

.mobile body {
	cursor: pointer;
}

.nav__menu > li.active > a,
.nav__menu > .current_page_parent > a,
.nav__menu .current-menu-item > a {
	color: $primary-color;
}

/* Logo
-------------------------------------------------------*/
.logo {
	line-height: 1;
	display: block;

	&-url {
		vertical-align: middle;
		color: $nav-links-color;
	}
}

/* Nav Flexbox
-------------------------------------------------------*/
.nav__flex-parent {
	align-items: center;

	@include bp-lg-down {
		display: block;
	}
}

/* Nav Right / Last menu item
-------------------------------------------------------*/
.nav__right {
	margin-left: auto;
	align-items: center;

	&-item {
		margin-right: 16px;

		&:last-child {
			margin-right: 0;
		}
	}

	&-btn-holder {
		margin-left: 10px;
	}
}

.nav__last-item-mobile {
	padding: 16px 0;
}

.nav__right-item a,
.nav__right-item button {
	&:hover {
		color: $primary-color;
	}
}

.nav__right-item .amela-menu-search__trigger:hover {
	background-color: transparent;
	color: $primary-color;
}

.amela-menu-account__url {
	color: $nav-links-color;
}

.amela-menu-account__icon,
.amela-menu-search__icon {
	font-size: 1.25rem;
	display: block;
}

.amela-menu-cart__icon,
.amela-menu-wishlist__icon {
	font-size: 1.1875rem;
	display: block;
}

.amela-menu-wishlist__icon {
	font-size: 1.125rem;
}

/* Nav Mobile / Icon Toggle
-------------------------------------------------------*/
.nav__mobile {
	display: flex;
	align-items: center;
	margin-left: auto;
}

.nav__icon-toggle {
	display: block;
	position: relative;
	padding: 9px !important;
	width: 36px;
	height: 32px;
	margin-right: -9px;
	margin-left: auto;
	border: none;
	z-index: 50;
	box-shadow: none;

	&.eversor-nav-menu__icon-toggle,
	.nav__mobile & {
		background-color: transparent;

		&:hover,
		&:focus {
			background-color: transparent;
		}
	}

	@include bp-lg-up {
		display: none;
	}

	&-bar {
		background-color: $nav-links-color;
		width: 18px;
		display: block;
		position: absolute;
		height: 2px;
		border-radius: 1px;
	}

	span:nth-child(2) {
		top: 9px;
		@include transition(top 0.2s 0.2s ease-in, opacity 0.1s ease-in);
	}

	span:nth-child(3) {
		top: 15px;
		@include transition(opacity 0.1s ease-in);
	}

	span:nth-child(4) {
		bottom: 9px;
		@include 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;
			@include transition(transform 0.5s cubic-bezier(0.215, 0.61, 0.355, 1));
			@include transform(rotate(45deg));
		}

		span:nth-child(3) {
			opacity: 0;
		}

		span:nth-child(4) {
			bottom: 15px;
			@include transform(rotate(-45deg));
			@include transition(
				bottom 0.1s ease-out,
				transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1)
			);
		}
	}

	&:focus .nav__icon-toggle-bar,
	&:hover .nav__icon-toggle-bar {
		background-color: $primary-color;
	}
}

/* Header Layout 2 (Bottom navbar)
-------------------------------------------------------*/
.amela-header-layout-2 {
	@include bp-lg-up {
		.nav__flex-parent {
			display: block;
			height: auto;
			text-align: center;
		}

		.nav__navbar-holder {
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.nav__wrap {
			margin-left: 0;
		}

		.nav--sticky.sticky .nav__flex-parent {
			height: auto;
		}

		.nav__header {
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.logo-url,
		.nav__wrap.collapse {
			display: inline-flex;
		}

		.nav__right {
			display: inline-flex !important;
			align-items: center;
		}
	}
}

/* Header Layout 3 (Logo right, menu left)
-------------------------------------------------------*/
.amela-header-layout-3 {
	.nav__flex-parent {
		flex-flow: row-reverse nowrap;
	}

	@include bp-lg-up {
		.nav__wrap {
			margin-left: 0;
			margin-right: auto;
		}
	}

	.nav__right {
		margin-right: 32px;
		margin-left: 0;
	}

	.nav__menu > li:first-child {
		padding-left: 0;
	}
}

/* Custom Header Logo
-------------------------------------------------------*/
.amela-logo-container {
	display: inline-block;
	vertical-align: middle;
}

/* Sticky Nav
-------------------------------------------------------*/
.nav--sticky {
	&.offset {
		@include transform(translate3d(0, -100%, 0));
		@include transition($transition-all !important);
	}

	&.scrolling {
		@include transform(translate3d(0, 0px, 0));
	}

	&.sticky {
		position: fixed !important;
		background-color: #fff;
		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: $bg-light;
	box-shadow: 0px 1px 4px 0px rgba(154, 161, 171, 0.4);
	border-radius: 50%;
	@include transition($transition-all);
	text-decoration: none;

	i {
		@include transition($transition-all);
	}

	a {
		display: block;
		color: $nav-links-color;
	}

	&.show {
		bottom: 20px;
	}

	&:hover {
		background-color: $primary-color;
		bottom: 24px;
	}

	&:hover i {
		color: #fff;
	}
}

/*-------------------------------------------------------*/
/* Nav Mobile Styles
/*-------------------------------------------------------*/
@include bp-lg-down {
	.nav {
		&__wrap {
			margin-left: 0;
			max-height: calc(100vh - 97px);
			overflow-y: auto;
		}

		&__header {
			height: $nav-height;
			display: flex;
			align-items: center;
		}

		&__menu {
			display: block;
		}

		&__menu li a {
			padding: 0;
			line-height: 46px;
			height: 46px;
			display: block;
			border-bottom: 1px solid $border-color;
		}

		&__menu > li:not(.nav__dropdown):last-child a {
			border-bottom: 0;
		}

		&__dropdown-menu a {
			color: $text-color;

			&:hover {
				color: #000;
			}
		}

		&__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 + .nav__dropdown-menu {
			display: block;
		}
	}

	.logo-wrap {
		float: left;

		a {
			display: table-cell;
			vertical-align: middle;
			height: $nav-height;
		}
	}

	.nav__btn {
		width: 100%;
		margin-bottom: 18px;
	}
}
