/**
 * Styles for the main_header holder
 */

#main_header {
	background: white;
	border-bottom: 1px solid @color-gray-9;
	width: 100vw;
	&.main_header--disable_pointer_events {
		pointer-events: none; //This is done cause of iOS touch events
	}
	&.main_header--fixed {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 9998;
		transition: top 0.2s ease-in-out;
	}
}




/**
 * Styles for the list holding the elemenst in the navigation
 */
.main_header__navigation__list {
	display: flex;
	@media only screen and (max-width: 500px) {
		padding: 0 !important;
		display: block;
	}
}





/**
 * Styles for the scrollable content which is the main and product navigation on mobile devices
 */
.main_header__navigation__scroll_content {
	@media only screen and (max-width: @navigation-responsive-width) {
		max-height: 100%;
		overflow-y: auto;
	}
}





/**
 * Styles for the list items in the navigation
 */
.main_header__navigation__item {
	order: 1;
	position: relative;
	> a {
		&:not(.button) {
			color: @color-gray-3;
			display: flex;
			align-items: center;
			position: relative;
			.typography-rule(1);
			.generate-spacing-rule(2,padding,all);
			&.active {
				color: @color_teritary;
				svg {
					stroke: @color_teritary;
				}
				&:hover,
				&:active,
				&:visited,
				&:focus {
					color: @color_teritary;
				}
				.main_header__navigation__item__icon:not(.hamburger_icon) { //This selector is so it doesn't hide the icon in the products button
					display: none;
					&.main_header__navigation__item__icon--close {
						display: inline-block;
					}
				}
				@media only screen and (max-width: @navigation-responsive-width) {
					color: white;
					background: @color_teritary;
					svg {
						stroke: white;
					}
				}
			}
		}
	}
	@media only screen and (max-width: @navigation-responsive-width) {
		position: static;
	}
}





/**
 * Styles for the holder of all the elements in the right
 */
.main_header__navigation__item--main {
	padding: 0;
	@media only screen and (min-width: 501px) {
		display: flex;
		> ul {
			display: flex;
		}
	}
	.main_header__navigation__item {
		display: flex;
		&:last-of-type {
			padding: 0;
		}
		&.main_header__navigation__item--compare {
			order: 0;
		}
		&.main_header__navigation__item--search {
			order: 1;
		}
		&.main_header__navigation__item--basket {
			order: 2;
		}
		&.main_header__navigation__item--profile,
		&.main_header__navigation__item--guest {
			order: 3;
		}
		&.main_header__navigation__item--region {
			order: 4;
		}
	}
}





/**
 * Styles for the adaptive buttons
 */
.main_header__navigation__item--adaptive {
	> a {
		&:not(.button) {
			.link--inherit;
		}
		&.button {
			border-radius: 0;
			display: flex;
			align-items: center;
		}
	}
	@media only screen and (max-width: @header-navigation-responsive) {
		> a {
			position: relative;
			.element--curtain;
			.main_header__navigation__item__text {
				display: none;
			}
			&.button {
				svg {
					margin: 0;
				}
			}
		}
	}
}





/**
 * Styles for the logo in the header
 */
.main_header__navigation__item--logo {
	.generate-spacing-rule(6,padding,right);
	@media only screen and (max-width: @categories-media-max-width) {
		.generate-spacing-rule(2,padding,left);
	}

	@media only screen and (max-width: @navigation-responsive-width) {
		padding-left: 0;
	}

	@media only screen and (max-width: 500px) {
		text-align: center;
		border-bottom: 1px solid @color-gray-9;
		display: block;
		order: 0;
		width: 100%;
		padding: 0;
		.generate-spacing-rule(2,padding,top);
		.generate-spacing-rule(2,padding,bottom);
	}

	a {
		background: none;
		border: 0;
		display: block;
		padding-left: 0;
		overflow: hidden;
		@media only screen and (max-width: 1445px) {
			.generate-spacing-rule(2,padding,left);
		}
		@media only screen and (max-width: @categories-media-max-width) {
			padding-left: 0;
			padding-right: 0;
		}
		@media only screen and (max-width: 500px) {
			padding: 0;
			justify-content: center;
		}
	}
}





/**
 * Holder for categories button,logo,links
 */
.main_header__navigation__left_elements {
	display: flex;
	align-items: center;
}





/**
 * Styles for the products button in the header
 */
.main_header__navigation__item--products {
	display: flex;
	padding: 0;
	& + .main_header__navigation__item--logo {
		@media only screen and (min-width: @navigation-responsive-width-min) {
			order: 0;
		}
	}
	@media only screen and (max-width: 1240px) {
		.main_header__navigation__item__icon {
			.generate-spacing-rule(1,margin,right);
		}
	}
	@media only screen and (max-width: @categories-media-max-width) {
		display: none; //We show another button below the header
	}
	> a {
		padding-left: 0;
		&:hover {
			&:before {
				display: block;
			}
		}
		&:before {
			content: '';
			display: none;
			position: absolute;
			top: ~"calc((@{spacing-min} + (1 * @{spacing-step})) * -1)";
			left: 0;
			right: 0;
			height: @header-item-products-curtain-height;
		}
	}
}





/**
 * Styles for the search button in the header
 */
.main_header__navigation__item--search {
	.main_header__navigation__item__icon {
		margin: 0;
	}
}





/**
 * Styles for the compare button in the header
 */
.main_header__navigation__item--compare {
	> a {
		&.active {
			background: white;
			.main_header__navigation__item__icon {
				display: block !important; //We hide the icons on the other buttons
			}
			svg {
				stroke: @color_teritary;
			}
		}
		svg {
			stroke: @color_teritary;
		}
		> span {
			&.main_header__navigation__item__icon {
				margin: 0;
			}
		}
	}
}





/**
 * Styles for the region button
 */
.main_header__navigation__item--region {
	img {
		border-radius: 50%;
		display: block;
		position: absolute;
		top: 50%;
		left: 50%;
		width: 24px;
		height: 24px;
		.translate(-50%,-50%);
	}
}





/**
 * Styles for the basket button in the header
 */
.main_header__navigation__item--basket {
	cursor: default;
	.main_header__navigation__item__icon {
		cursor: default;
	}
	@media only screen and (max-width: 1240px) {
		svg {
			stroke: @color-gray-8;
		}
	}
	.main_header__navigation__item__counter {
		display: none;
	}

	.main_header__navigation__item--basket--active {
		svg {
			stroke: @color_teritary;
		}
		.main_header__navigation__item__text {
			color: @color_teritary;
		}
		.main_header__navigation__item__counter {
			display: none;
			@media only screen and (max-width: @header-navigation-responsive) {
				display: block;
			}
		}
	}

}





/**
 * Styles for the profile button
 */
.main_header__navigation__item--profile {
	position: relative;
	.navigation--adaptive {
		&.active {
			display: block;
		}
	}
	@media only screen and (max-width: @navigation-responsive-width) {
		position: static;
	}
}



/**
 * Styles for the pages navigation
 */
.main_header__navigation__item__counter {
	color: white;
	background: @color_teritary;
	border-radius: 50%;
	text-align: center;
	white-space: nowrap;
	display: block;
	position: absolute;
	top: 2px;
	left: calc(~"100% - 20px");
	width: 20px;
	height: 20px;
	.typography-rule(0, regular, false, @typography-base-size, 20px);

	@media only screen and (max-width: @header-navigation-responsive) {
		width: 8px;
		height: 8px;
		overflow: hidden;
		top: 3px;
		left: auto;
		right: 3px;
		.typography-rule(none);
	}
}


/**
 * Styles for the header links navigation
 */
.main_header__navigation__item--nav {
	display: flex;
	flex: 1 auto;
	a:not(.button) {
		color: @color-gray-3;
		display: block;
		position: relative;
		.typography-rule(1);
		.link--accessory;
	}
	.navigation--adaptive {
		display: flex;
		align-items: center;
		ul {
			.clear_fix;
			li {
				float: left;
				.generate-spacing-rule(3,padding,right);
				&.navigation--adaptive__item--hidden {
					display: none;
				}
			}
		}
		@media only screen and (max-width: @navigation-responsive-width) {
			display: none;
			&.active {
				display: block;
			}
			ul {
				li {
					&.navigation--adaptive__item--hidden {
						display: block;
					}
					a {
						background: white;
						border: 0;
						border-radius: 0;
						.generate-spacing-rule(4,padding,top);
						.generate-spacing-rule(4,padding,bottom);
						.generate-spacing-rule(2,padding,left);
						.generate-spacing-rule(2,padding,right);
						&:hover {
							background: @color-gray-10;
						}
						&.button {
							> svg {
								display: none;
							}
						}
					}
				}
			}
		}
	}
}

.main_header__navigation__item--nav--right {
	justify-content: flex-end;
}





/**
 * Styles for the pages navigation icon
 */
.main_header__navigation__item--nav__icon {
	display: none;
	@media only screen and (max-width: @navigation-responsive-width) {
		.main_header__navigation__item--nav__icon--visible;
	}
}

.main_header__navigation__item--nav__icon--visible {
	display: flex;
	flex: 0 auto;
	order: 0;
	.generate-spacing-rule(2,padding,right);
	&.main_header__navigation__item--nav__icon--secondary {
		order: 1;
		padding: 0;
	}
	a {
		display: flex;
		.link--inherit;
		&:before {
			content: '';
			background: rgba(255,255,255,0);
			display: block;
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			z-index: 99;
		}
		.main_header__navigation__item__icon {
			margin: 0;
		}
	}
}





/**
 * Styles for icons in the buttons
 */
.main_header__navigation__item__icon {
	display: inline-block;
	position: relative;
	vertical-align: middle;
	width: 24px;
	height: 24px;
	cursor: pointer;
	.generate-spacing-rule(1,margin,right);
	@media only screen and (max-width: @header-navigation-responsive) {
		margin: 0;
	}
	> svg {
		stroke: @color-gray-3;
		display: block;
		position: absolute;
		top: 50%;
		left: 50%;
		.translate(-50%,-50%);
	}
}

.main_header__navigation__item__icon--close { //Hiding the close button by deffault
	display: none;
}