<?php
/**
 * The template part for header
 *
 * @package Factory Lite 
 * @subpackage factory-lite
 * @since factory-lite 1.0
 */
?>

<div id="header" class="py-2 <?php if( get_theme_mod( 'factory_lite_sticky_header', false) == 1 || get_theme_mod( 'factory_lite_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="container">
    <div class="row">
      <div class="col-lg-2 col-md-5 py-3 align-self-center">
        <?php if (is_active_sidebar('social-links')) : ?>
          <?php dynamic_sidebar('social-links'); ?>
        <?php else : ?>
          <!-- Default Social Icons Widgets -->
            <div class="widget">
                <ul class="custom-social-icons" >
                  <li><a href="https://facebook.com" target="_blank"><i class="fab fa-facebook"></i></a></li> 
                  <li><a href="https://twitter.com" target="_blank"><i class="fab fa-twitter"></i></a></li>                      
                  <li><a href="https://instagram.com" target="_blank"><i class="fab fa-instagram"></i></a></li>                  
                  <li><a href="https://youtube.com" target="_blank"><i class="fab fa-youtube"></i></a></li>                     
                </ul>
            </div>
        <?php endif; ?>   
      </div>
      <div class="col-lg-6 col-md-3 col-6 mobile-box align-self-center">
        <?php ?>
          <div class="toggle-nav mobile-menu text-center my-1">
            <button role="tab" onclick="factory_lite_menu_open_nav()" class="responsivetoggle"><i class="py-2 px-3 <?php echo esc_attr(get_theme_mod('factory_lite_res_open_menu_icon','fas fa-bars')); ?>"></i><span class="screen-reader-text"><?php esc_html_e('Open Button','factory-lite'); ?></span></button>
          </div>
        <?php ?>
        <div id="mySidenav" class="nav sidenav">
          <nav id="site-navigation" class="main-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Top Menu', 'factory-lite' ); ?>">
            <?php
              wp_nav_menu( array( 
                'theme_location' => 'primary',
                'container_class' => 'main-menu clearfix' ,
                'menu_class' => 'clearfix',
                'items_wrap' => '<ul id="%1$s" class="%2$s mobile_nav">%3$s</ul>',
                'fallback_cb' => 'wp_page_menu',
              ) );
             ?>
            <a href="javascript:void(0)" class="closebtn mobile-menu" onclick="factory_lite_menu_close_nav()"><i class="<?php echo esc_attr(get_theme_mod('factory_lite_res_close_menu_icon','fas fa-times')); ?>"></i><span class="screen-reader-text"><?php esc_html_e('Close Button','factory-lite'); ?></span></a>
          </nav>
        </div>
      </div>

      <div class="col-lg-2 col-md-2 col-6 align-self-center text-center text-md-start text-lg-start">
        <?php if( get_theme_mod( 'factory_lite_header_search',true) == 1) { ?>
          <div class="search-box">
            <span><a href="#"><i class='<?php echo esc_attr(get_theme_mod('factory_lite_search_icon','fas fa-search')); ?>'></i></a></span>
          </div>
        <?php }?>
        <div class="serach_outer">
          <div class="closepop"><a href="#maincontent"><i class="<?php echo esc_attr(get_theme_mod('factory_lite_search_close_icon','fa fa-window-close')); ?>"></i></a></div>
          <div class="serach_inner">
            <?php get_search_form(); ?>
          </div>
        </div>
      </div>

      <div class="col-lg-2 col-md-4 col-6 topbar-btn-outer align-self-center">
        <?php if( get_theme_mod('factory_lite_get_quote_link') != '' || get_theme_mod('factory_lite_get_quote_text') != '' ){ ?>
          <div class="topbar-btn py-3">
            <a href="<?php echo esc_url(get_theme_mod('factory_lite_get_quote_link',''));?>"><?php echo esc_html(get_theme_mod('factory_lite_get_quote_text',''));?><i class="<?php echo esc_attr(get_theme_mod('factory_lite_button_icon','fas fa-long-arrow-alt-right')); ?> ms-2"></i></a>
          </div>
        <?php }?>
      </div>
    </div>
  </div>
</div>