/*
 * jQuery FlexPanel v1.1
 * https://github.com/dcooney/flexpanel
 *
 * Copyright 2015 Connekt Media - http://connekthq.com/flexpanel
 * Free to use under the GPLv2 license.
 * http://www.gnu.org/licenses/gpl-2.0.html
 *
 * Author: Darren Cooney 
 * Twitter: @KaptonKaos
*/ 
  
@import "_mixins";
@import "_variables";

#container,
#wrapper {
	width: 100%;
	position: relative;		
}

#wrapper{
	left:0;	
    @include transform('translate3d(0,0,0)');	
	-webkit-backface-visibility: hidden;
	-webkit-perspective: 1000;		
	@include transition(all, $speed, ease);
	z-index: 0;
	background: #f7f7f7;
}	
 
//***********************************************
// -- FlexPanel Default Styles - RIGHT MENU
//***********************************************
.flexpanel{	
	position: fixed;
	top:0;		
	right: -$desktopPanelWidth;
	width: $desktopPanelWidth;	
	height:102%;
	padding: 0;
	margin: 0;
	z-index: 1;
	display: none;
    @include transform('translate3d(0,0,0)');	
	-webkit-transition: -webkit-transform $speed ease;
	-moz-transition: -moz-transform $speed ease;
	transition: transform $speed ease;	
	@media screen and (min-width:$tablet) and (max-width:$desktop) {	
		right: -$tabletPanelWidth;
		width: $tabletPanelWidth;
	}
	@media screen and (max-width:$tablet) {	
		right: -$mobilePanelWidth;
		width: $mobilePanelWidth;	
	}	
	//********************
	//Viewport, Do not remove this element
	.viewport-wrap{
		position: relative;
		width:100%;
		height: 100%;
		@include transform('translate3d(0,0,0)');
		-webkit-backface-visibility: hidden;
		-webkit-perspective: 1000;
		@include transition(all, $speed, ease);
		z-index: 1;
	}	
	
	.viewport{
		width:100%;
		height: 100%;
		position: relative;
		padding: 0;			
		overflow: hidden;			
		overflow-y: auto;	
		background: #222;
		@include box-sizing;
		&.smooth{// Add smooth scroll to webkit browsers <- This is a big deal
			-webkit-overflow-scrolling: touch; 
		}		
	}
		
	div.navigation{
		padding: 10px 10px 80px;
		@include transition(all, $speed, ease);			
		ul{		
			display: block;
			clear: both;			
			padding:0;
			margin:0;
			@include transition(all, $speed, ease);			
			li{
				margin:0 3%;
				padding:0;
				clear: both;
				list-style: none;
				width: auto;
				display: block;
				font-size:18px;
				border-bottom: 1px solid #333;		
				&:first-child{
					border-top:none;
				}
				ul{
					margin:0;
					border: none;
					li{
						font-size:14px;
						margin:0 5px 5px;
						border:none;
						position: relative;
						a{
							padding:6px 12px;
							&:hover{
								color: #ccc;
							}
							&:before{
								content: '»';
								position: absolute;
								left: 0;
								top: 5px;
								opacity: 0.5;
								color: #9edeff;
							}
						}
					}
				}
				a{
					padding:10px 0;
					display: block;
					color:#fff;
					text-decoration: none;	
					-webkit-tap-highlight-color: rgba(0, 0, 0, 0);				
					&:hover{
						color: #ccc;
					}
				}
				&.active > a{				
					color:#ef6f6f !important;
					font-weight: bold;
				}
			}
		}
	}
}

//***********************************************
// -- Menu Button
//***********************************************

.flex-btn{
	width:34px;
	height:33px;  
	position: absolute;
	left:-52px;
	top:25px;	
	background: #fff;		
	@include border-radius(3px);
	@include transition(all, $speed, ease);
	cursor: pointer;
	opacity: 0;
	filter: alpha(opacity = 0);
	&:active{
		background: #ccc;
	}
	&.in-view{
		opacity: 1;
		filter: alpha(opacity = 100);
	}
	span{			
		width: 20px;
		height: 3px;
		display: block;
		overflow: hidden;
		background-color:#666;
		text-indent: -9999px;
		display: block;
		margin:0 auto 3px;
		clear: both;
		@include transition(all, 0.2s, ease, $wait);
		position: absolute;
		&.one{
			top: 9px;
			left: 7px;
		}
		&.two{
			top: 15px;
			left: 7px;
		}
		&.three{
			top: 21px;
			left: 7px;
		}
	}	
	&:hover span{
		background-color:#333;
	}
}

//flex-btn active states
.flexpanel-active{
	.flex-btn{
		opacity: 1 !important;
		filter: alpha(opacity = 100) !important;				
		span{
			background-color: #222;
			&.two {
				opacity: 0;
			}
			&.one{
				@include transform("rotate(45deg)");
				top:15px;
			}
			&.three{
				@include transform("rotate(-45deg)");
				top:15px;
			}
		}
	}
}


//***********************************************
// -- LEFT MENU
//***********************************************
body.flexpanel-left .flexpanel{	
	right:auto;
	left: -$desktopPanelWidth;
	width: $desktopPanelWidth;
	@media screen and (min-width:$tablet) and (max-width:$desktop) {
		right: auto;	
		left: -$tabletPanelWidth;
		width: $tabletPanelWidth;
	}
	@media screen and (max-width:$tablet) {
		right: auto;	
		left: -$mobilePanelWidth;
		width: $mobilePanelWidth;	
	}
	.flex-btn{		
		left:auto;
		right:-48px;
	}
}


//***********************************************
// -- Panel Active Properties
//***********************************************

body.flexpanel-active{		
	&.flexpanel-left{
		#wrapper{		
			@include transform("translate(#{$desktopPanelWidth}, 0)");
			opacity: 0.7;
			filter: alpha(opacity = 70);
			@media screen and (min-width:$tablet) and (max-width:$desktop) {
				@include transform("translate(#{$tabletPanelWidth}, 0)")
			}
			@media screen and (max-width:768px) {	
				@include transform("translate(#{$mobilePanelWidth}, 0)");	
			}	
		}
		.flexpanel{
			left:-$desktopPanelWidth;
			@media screen and (min-width:$tablet) and (max-width:$desktop) {
				left:-$tabletPanelWidth;
			}
			@media screen and (max-width:768px) {	
				left:-$mobilePanelWidth;	
			}
	    	.viewport-wrap{
				@include transform("translate(100%, 0)");				
			}
		}
	} 
	&.flexpanel-right{
		#wrapper{		
			@include transform("translate(-#{$desktopPanelWidth}, 0)");
			opacity: 0.7;
			filter: alpha(opacity = 70);			
			@media screen and (min-width:$tablet) and (max-width:$desktop) {
				@include transform("translate(-#{$tabletPanelWidth}, 0)");	
			}
			@media screen and (max-width:768px) {	
				@include transform("translate(-#{$mobilePanelWidth}, 0)");	
			}	
		}	
		.flexpanel{
			right:-$desktopPanelWidth;
			@media screen and (min-width:$tablet) and (max-width:$desktop) {
				right:-$tabletPanelWidth;
			}
			@media screen and (max-width:768px) {	
				right:-$mobilePanelWidth;	
			}
	    	.viewport-wrap{
				@include transform("translate(-100%, 0)");					
			}
		}	
	}
}


//***********************************************
// -- IE fixes for translate
//***********************************************

body.isIE{
   &.flexpanel-right{
      #wrapper{
         left: -$desktopPanelWidth;
      }
      .flexpanel{
         right: 0;
      }
   }
   &.flexpanel-left{
	   &.flexpanel-active{
	      #wrapper{
	         left: $desktopPanelWidth;
	      }
	      .flexpanel{
	         left: 0;
	      }
	   }
   }
}

//***********************************************
// -- Reveal Properties
//***********************************************

body.flexpanel-reveal{
	#wrapper{
		z-index: 1;
	    @include transform('none !important');
		-webkit-backface-visibility: hidden;
		-webkit-perspective: 1000;	
	}
	//Right Reveal
	&.flexpanel-right{
		#wrapper{
			right: auto;
			left: 0;
		}
		.flexpanel{
			right:-100%;
			z-index: 0;
			&.reveal{
				right: 0;
			}
		}
		.flex-btn{
			position: fixed;
			left: auto;
			right:0;
			top:0;
			margin: $btnMargin; 
			z-index: 999;
		}
		//Flexpanel Active
		&.flexpanel-active{
			#wrapper{		
				left: -$desktopPanelWidth;
				opacity: 1;
				filter: alpha(opacity = 100);
				@media screen and (min-width:$tablet) and (max-width:$desktop) {	
					left: -$tabletPanelWidth;
				}
				@media screen and (max-width:$tablet) {	
					left: -$mobilePanelWidth;
				}
			} 
			.flex-btn{
				right: $desktopPanelWidth;
				@media screen and (min-width:$tablet) and (max-width:$desktop) {	
					right: $tabletPanelWidth;
				}
				@media screen and (max-width:768px) {	
					right: $mobilePanelWidth;
				}
			}
			.flexpanel{
				right: 0;
				&.reveal{
					right: 0;
				}	
				.viewport-wrap{
					@include transform("translate(0, 0)");
				}
			}
		}
	}
	//Left Reveal
	&.flexpanel-left{
		#wrapper{
			right:auto;
			left: 0;
		}
		.flexpanel{
			right: auto;
			left:0;
			z-index: 0;
			&.reveal{
				left: 0;
			}
		}
		.flex-btn{
			position: fixed;
			right: auto;
			left:0;
			top:0;
			margin: $btnMargin; 
			z-index: 999;
		}
		//Flexpanel Active
		&.flexpanel-active{
			#wrapper{		
				left: $desktopPanelWidth;
				opacity: 1;
				filter: alpha(opacity = 100);
				@media screen and (min-width:$tablet) and (max-width:$desktop) {	
					left: $tabletPanelWidth;
				}
				@media screen and (max-width:$tablet) {	
					left: $mobilePanelWidth;
				}
			} 
			.flex-btn{
				left: $desktopPanelWidth;
				@media screen and (min-width:$tablet) and (max-width:$desktop) {	
					left: $tabletPanelWidth;
				}
				@media screen and (max-width:768px) {	
					left: $mobilePanelWidth;
				}
			}
			.flexpanel{
				left: 0;
				&.reveal{
					left: 0;
				}
				.viewport-wrap{
					@include transform("translate(0, 0)");
				}
			}
		}
	}
}

//***********************************************
// -- Hide Flexpanel
//***********************************************
body.flexpanel-hide{
   .flex-btn,
   .flexpanel{
      display: none;
   }
}


// Show scrollbars in webkit
// https://gist.github.com/dcooney/8692729
::-webkit-scrollbar { width: 10px; color: #a3a499; }
::-webkit-scrollbar-track { background-color: #ecede3; border-radius: 10px; border: 1px solid #d8d9cf; }
::-webkit-scrollbar-thumb { border-radius: 10px; background-color: #a3a499; }

	


