<?php
/**
 * The header for our theme.
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Luzuk Premium
 */

?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="profile" href="http://gmpg.org/xfn/11">
	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
	<script src="https://use.fontawesome.com/18a9c36ed1.js"></script>
	
	<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/bootstrap.min.css">
	<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/animate.css" />
	<link href="https://fonts.googleapis.com/css?family=Roboto:700" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Dancing+Script" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Poppins|Roboto:400,900" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Condensed:700" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet">
	<script src="<?php echo get_template_directory_uri(); ?>/js/jquery-3.1.1.slim.min.js" crossorigin="anonymous"></script>
	<!--new for faq-->
	<script src="<?php echo get_template_directory_uri(); ?>/js/jquery.min.js" crossorigin="anonymous"></script>
	<!--new faq-->
	<!--end script for search bar-->
	<script>
		function buttonUp(){
			var valux = $('.sb-search-input').val(); 
			valux = $.trim(valux).length;
			if(valux !== 0){
				$('.sb-search-submit').css('z-index','99');
			} else{
				$('.sb-search-input').val(''); 
				$('.sb-search-submit').css('z-index','-999');
			}
		}

		$(document).ready(function(){
			var submitIcon = $('.sb-icon-search');
			var submitInput = $('.sb-search-input');
			var searchBox = $('.sb-search');
			var isOpen = false;

			$(document).mouseup(function(){
				if(isOpen == true){
					submitInput.val('');
					$('.sb-search-submit').css('z-index','-999');
					submitIcon.click();
				}
			});

			submitIcon.mouseup(function(){
				return false;
			});

			searchBox.mouseup(function(){
				return false;
			});

			submitIcon.click(function(){
				if(isOpen == false){
					searchBox.addClass('sb-search-open');
					isOpen = true;
				} else {
					searchBox.removeClass('sb-search-open');
					isOpen = false;
				}
			});

		});
	</script><!--end script for search bar-->

	<script src="<?php echo get_template_directory_uri(); ?>/js/bootstrap.min.js" type="text/javascript"  ></script>
	<script src="<?php echo get_template_directory_uri(); ?>/js/wow.js" ></script>
	<?php wp_head(); ?>
	<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/ie.css" />
	

</head>

<body <?php body_class(); ?>>
	<div class="main-container">
		<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'Luzuk-premium' ); ?></a>
		<header id="ht-masthead" class="ht-site-header">
			<div class="main-header">
				<div class="container">
					
					<div class="col-md-6 col-sm-6">
						<?php
						$freeshiptext = get_theme_mod('lz_fitness_headermain_freeshiptext', '<span>FREE SHIPPING</span> For All Order Of $150 '); 
						?>
						<div class="header-menu-box">
							<ul>
								<?php if(!empty($freeshiptext)){ ?>
									<li><i class="fa fa-taxi"></i><?php echo ($freeshiptext);  ?> </li>
								<?php }?> 
							</ul>								
						</div>
					</div>
					<div class="col-md-6 col-sm-6 text-right"> 
							<?php 
							$email = get_theme_mod('lz_fitness_headermain_email', 'contact@example.com');
							$phone = get_theme_mod('lz_fitness_headermain_phone', '0123-0456-789'); 
							?>
							<div class="header-right-box">
								<ul>
									<?php if(!empty($email)){ ?>
										<li>
											<a href="mailto:<?php echo $email;?>">
											<i class="fa fa-envelope"></i><?php echo ($email);  ?></a> 
										</li>
									<?php }?> 
									<?php if(!empty($phone)){ ?>
										<li><i class="fa fa-phone"></i><?php echo ($phone);  ?> </li>
									<?php }?> 
									
								</ul>
							</div>
						</div>	

						</div>	
						<div class="clearfix"></div>

					</div>

					<div class="lower-header">
						<div class="container">	
							<div class="header-left col-md-3 col-sm-3">
								<?php 
									if( get_theme_mod('pages_logoTmargin',true) ) {
						                $pages_logoTmargin = 'margin-top:'.esc_attr(get_theme_mod('pages_logoTmargin')).';';
						            }
						            if( get_theme_mod('pages_logoBmargin',true) ) {
						                $pages_logoBmargin = 'margin-bottom:'.esc_attr(get_theme_mod('pages_logoBmargin')).';';
						            }
						            if( get_theme_mod('pages_logoLmargin',true) ) {
						                $pages_logoLmargin = 'margin-left:'.esc_attr(get_theme_mod('pages_logoLmargin')).';';
						            }
						            if( get_theme_mod('pages_logoRmargin',true) ) {
						                $pages_logoRmargin = 'margin-right:'.esc_attr(get_theme_mod('pages_logoRmargin')).';';
						            }
			 					?>
								<div class="logobox"  style="<?php echo esc_attr($pages_logoTmargin); ?>" "<?php echo esc_attr($pages_logoBmargin); ?>" "<?php echo esc_attr($pages_logoLmargin); ?>" "<?php echo esc_attr($pages_logoRmargin); ?>" >
										<?php 
										if ( function_exists( 'has_custom_logo' ) && has_custom_logo() ) :
											the_custom_logo();
									else : 
										if ( is_front_page() ) : ?>
											<h1 class="ht-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
											<?php else : ?>
												<p class="ht-site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
											<?php endif; ?>
											<!-- <p class="ht-site-description"><a href="<?php //echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php //bloginfo( 'description' ); ?></a></p> -->
										<?php endif; ?>
										<!-- .site-branding -->
									</div>
							</div>

							<div class="col-sm-6 col-md-offset-1">
								<div id="sb-search" class="sb-search">
									   <form role="search" method="get" class="woocommerce-product-search" action="<?php echo esc_url( home_url( '/'  ) ); ?>">
										<label class="screen-reader-text" for="s"><?php _e( 'Search for:', 'woocommerce' ); ?></label>
										<input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Search for Products', 'placeholder', 'woocommerce' ); ?>" value="<?php echo get_search_query(); ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label', 'woocommerce' ); ?>" />
										<input type="submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'woocommerce' ); ?>" />
										<input type="hidden" name="post_type" value="product" />
									</form>
								</div>	
							</div>

							<div class="col-md-2 col-sm-2 upper-header padding0">	
									<?php
									$myaccounttitle = get_theme_mod('lz_fitness_headermain_myaccounttitle', 'MY ACCOUNT'); 
									$myaccount = get_theme_mod('lz_fitness_header_myaccount', 'add myaccount page link here');
									?>
									<ul class="header-sm-links col-md-7 col-sm-7 col-xs-4 padding0">
										<?php if(!empty($myaccount)){ ?>
											<li><a href="<?php echo $myaccount ?>" title="myaccount"><?php echo ($myaccounttitle);  ?></a></li>
										<?php }?> 
									</ul>

								<div class="total-count pull-right col-md-3 col-sm-3 col-xs-8 padding0">				
									<?php if(function_exists ('wc_get_cart_url')){?>				
										<a href="<?php echo wc_get_cart_url();?>" class=""><img src="<?php echo get_template_directory_uri(); ?>/images/carticon.png"  alt=""></a>
										<div class="count"><?php global $woocommerce; print_r(count(WC()->cart->get_cart())); ?>
											<?php //global $woocommerce; ?><?php //echo WC()->cart->get_cart_contents_count(); ?></div>
									</div>
								
								<?php }?>
							</div>

						</div>
							<div class="clearfix"></div>
					</div>
				
					<div class="header-main-box">
						<div class="container">
							<?php if(class_exists('woocommerce')){ ?>
								<div class="col-md-3 col-sm-4 header-category-box padding0 ">
									<?php
									$lz_fitness_header_browsebydept = get_theme_mod('lz_fitness_header_browsebydept', 'BROWSE CATEGORIES');
									?>
									<button class="product-btn">
										<?php echo ($lz_fitness_header_browsebydept);  ?><i class="fa fa-bars" aria-hidden="true"></i></button>

									<div class="product-cat" style="display: none">
										<?php
										$args = array(
					              //'number'     => $number,
										'number'     => 0,
			                            'orderby'    => 'title',
			                            'order'      => 'ASC',
			                            'hide_empty' => false,
					              //'include'    => $ids
										);
										$product_categories = get_terms( 'product_cat', $args );
										$count = count($product_categories);
										if ( $count > 0 ){
											foreach ( $product_categories as $product_category ) {
												$cat_id   = $product_category->term_id;
												$cat_link = get_category_link( $cat_id );
												if ($product_category->category_parent == 0) { ?>
													<li class="drp_dwn_menu"><a href="<?php echo esc_url(get_term_link( $product_category ) ); ?>">
														<?php
													}
													echo esc_html( $product_category->name ); ?></a></li>
													<?php
												}
											}
											?>
										</div>
									</div>
								<?php }else {
									echo '<h6>'.esc_html('Please Install Woocommerce Plugin','lz-fashion-ecommerce').'<h6>'; }?>
									<div class="col-md-9 wow ">
										<nav id="ht-site-navigation" class="ht-main-navigation">
											<div class="hamburger-menus">
					                            <span></span>
					                            <span></span>
					                            <span></span>
					                            <span></span>
					                            <span></span>
					                            <span></span>
					                            <span></span>
					                            <span></span>
					                            <span></span>
					                        </div>
											<!-- <div class="toggle-bar"><span><i class="fa fa-bars" aria-hidden="true"></i></span></div> -->
										<div class="navigation">
											<?php 
											wp_nav_menu( array( 
												'theme_location' => 'primary', 
												'container_class' => 'ht-menu clearfix' ,
												'menu_class' => 'ht-clearfix',
												'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
											) ); 
											?>
										</div>
										</nav>
									</div>
									<div class="clearfix"></div>

								</div>

							</div>
							<div class="clearfix"></div>
						</header><!-- #masthead -->
					</div>
