<?php
/**
 * header.php
 * @package WordPress
 * @subpackage Froday
 * @since Froday 1.0
 * 
 */
 ?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	
	<?php wp_head(); ?>
</head>

<body id="body" <?php body_class(); ?>>

    <!-- Preloader -->
    <div id="preloader" class="preloader">
        <div class="loader-cube">
            <div class="loader-cube__item1 loader-cube__item"></div>
            <div class="loader-cube__item2 loader-cube__item"></div>
            <div class="loader-cube__item4 loader-cube__item"></div>
            <div class="loader-cube__item3 loader-cube__item"></div>
        </div>
    </div>
    <!-- End Preloader -->

    <!-- WRAPPER   -->
    <div id="pageWrapper" class="page-wrapper">
        <!-- HEADER -->
        <header id="mainHeader" class="main-header">

            <!-- Top Bar -->
			<?php if(ot_get_option('froday_top_header') == "on"){ ?>
            <div class="top-bar bg-gray">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 col-md-4 is-hidden-sm-down">
							<?php 
							   wp_nav_menu(array(
							   'theme_location' => 'top-left-menu',
							   'container' => '',
							   'fallback_cb' => 'show_top_menu',
							   'menu_id' => '',
							   'menu_class' => 'nav-top nav-top-left list-inline t-left',
							   'echo' => true,
							   'depth' => 0 
								)); 
							 ?>
                        </div>
                        <div class="col-sm-12 col-md-8">
							<?php 
							   wp_nav_menu(array(
							   'theme_location' => 'top-right-menu',
							   'container' => '',
							   'fallback_cb' => 'show_top_menu',
							   'menu_id' => '',
							   'menu_class' => 'nav-top nav-top-right list-inline t-xs-center t-md-right',
							   'echo' => true,
							   'depth' => 0 
								)); 
							 ?>
                        </div>
                    </div>
                </div>
            </div>
			<?php } ?>
            <!-- End Top Bar -->

            <!-- Header Header -->
            <div class="header-header bg-white">
                <div class="container">
                    <div class="row row-rl-0 row-tb-20 row-md-cell">
							<?php if (ot_get_option( 'froday_logo' )) { ?>
                        	<div class="brand col-md-4 t-xs-center t-md-left valign-middle">
								<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>" class="logo">
								  <img class="logo__img" src="<?php echo esc_url(ot_get_option( 'froday_logo' )); ?>" alt="<?php bloginfo('name'); ?>">
								</a>
							</div>
							<?php } elseif (ot_get_option( 'froday_logotext' )) { ?>
							<div class="brand col-md-4 t-xs-center t-md-left valign-middle">
								<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>" class="logo klbtext">
									<?php echo esc_html(ot_get_option( 'froday_logotext' )); ?>
								</a>
							</div>
							<?php } else { ?>
							<div class="brand col-md-4 t-xs-center valign-middle">
								<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>" class="logo klbtext">
									<?php esc_html_e('froday','froday'); ?>
								</a>
							</div>
							<?php } ?>
                        
						<?php if(ot_get_option('froday_middle_header_search') == 'on' || ot_get_option('froday_middle_header_cart') == 'on'){ ?>

                        <div class="header-search col-md-8">
                            <div class="row row-tb-10 ">
								<?php if(ot_get_option('froday_middle_header_cart') == 'off') { ?>
                                <div class="col-sm-8 col-md-offset-4">
									<?php if(ot_get_option('froday_middle_header_search') == 'on'){ ?>
										<?php echo froday_advanced_product_searchform(); ?>
									<?php } ?>
                                </div>
								<?php } else { ?>
                                <div class="col-sm-8">
									<?php if(ot_get_option('froday_middle_header_search') == 'on'){ ?>
										<?php echo froday_advanced_product_searchform(); ?>
									<?php } ?>
                                </div>
								<?php } ?>
								<?php if(ot_get_option('froday_middle_header_cart') == 'on') { ?>
                                <div class="col-sm-4 t-xs-center t-md-right">
                                    <div class="header-cart">
										<?php global $woocommerce; ?>
										<a class="cart-contents" href="<?php echo esc_url(wc_get_cart_url()); ?>" title="<?php esc_attr_e('View your shopping cart', 'froday'); ?>">
                                            <span class="icon lnr lnr-cart"></span>
                                            <div><span class="cart-number"><?php echo sprintf(_n('%d', '%d', $woocommerce->cart->cart_contents_count, 'froday'), $woocommerce->cart->cart_contents_count);?></span>
                                            </div>
                                            <span class="title"><?php esc_html_e('Cart','froday'); ?></span>
                                        </a>
                                    </div>
                                </div>
								<?php } ?>
                            </div>
                        </div>
						<?php } ?>
                    </div>
                </div>
            </div>
            <!-- End Header Header -->

            <!-- Header Menu -->
            <div class="header-menu bg-blue">
                <div class="container">
                    <nav class="nav-bar">
                        <div class="nav-header">
                            <span class="nav-toggle" data-toggle="#header-navbar">
		                        <i></i>
		                        <i></i>
		                        <i></i>
		                    </span>
                        </div>
                        <div id="header-navbar" class="nav-collapse">
							<?php 
							   wp_nav_menu(array(
							   'theme_location' => 'main-menu',
							   'container' => '',
							   'fallback_cb' => 'show_top_menu',
							   'menu_id' => '',
							   'menu_class' => 'nav-menu',
							   'echo' => true,
							   'walker' => new froday_description_walker(),
							   'depth' => 0 
								)); 
							 ?>
                        </div>
						<?php if(ot_get_option('froday_bottom_header_button') == 'on'){ ?>
                        <div class="nav-menu nav-menu-fixed">
                            <a href="<?php echo esc_url(ot_get_option('froday_bottom_header_button_url')); ?>"><?php echo esc_html(ot_get_option('froday_bottom_header_button_text')); ?></a>
                        </div>
						<?php } ?>
                    </nav>
                </div>
            </div>
            <!-- End Header Menu -->

        </header>
        <!--  HEADER -->
	