<?php
/**
 * The template part for Middle Header
 *
 * @package VW Dark
 * @subpackage vw-dark
 * @since vw-dark 1.0
 */
?>

<div class="main-header <?php if( get_theme_mod( 'vw_dark_sticky_header', false) == 1 || get_theme_mod( 'vw_dark_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="row mx-0">
    <div class="col-lg-2 col-md-3 col-9 logo-bg">
      <div class="logo text-md-center text-start">
        <?php if ( has_custom_logo() ) : ?>
          <div class="site-logo"><?php the_custom_logo(); ?></div>
        <?php endif; ?>
        <?php $blog_info = get_bloginfo( 'name' ); ?>
          <?php if ( ! empty( $blog_info ) ) : ?>
            <?php if ( is_front_page() && is_home() ) : ?>
              <?php if( get_theme_mod('vw_dark_logo_title_hide_show',true) == 1){ ?>
                <p class="site-title mb-0"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
              <?php } ?>
            <?php else : ?>
              <?php if( get_theme_mod('vw_dark_logo_title_hide_show',true) == 1){ ?>
                <p class="site-title mb-0"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
              <?php } ?>
            <?php endif; ?>
          <?php endif; ?>
          <?php
            $description = get_bloginfo( 'description', 'display' );
            if ( $description || is_customize_preview() ) :
          ?>
          <?php if( get_theme_mod('vw_dark_tagline_hide_show',false) == 1){ ?>
            <p class="site-description mb-0">
              <?php echo esc_html($description); ?>
            </p>
          <?php } ?>
        <?php endif; ?>
      </div>
    </div>
    <div class="<?php if(get_theme_mod('vw_dark_phone_number') != ''){ ?>col-lg-6 col-md-4<?php } else {?> col-lg-8 col-md-7 <?php }?> col-3 align-self-center">
      <?php get_template_part('template-parts/header/navigation'); ?>
    </div>
    <?php if(get_theme_mod('vw_dark_phone_number') != ''){ ?>
      <div class="col-lg-2 col-md-3 px-md-0 align-self-center text-md-end text-center">
        <a href="tel:<?php echo esc_attr(get_theme_mod('vw_dark_phone_number')); ?>" class="phone"><i class="fas fa-headphones me-2"></i><?php echo esc_html(get_theme_mod('vw_dark_phone_number')); ?><span class="screen-reader-text"><?php echo esc_html(get_theme_mod('vw_dark_phone_number')); ?></span></a>
      </div>
    <?php }?> 
    <div class="col-lg-1 col-md-1 col-6 align-self-center">
      <div class="search-box text-center">
        <span><a href="#"><i class="<?php echo esc_attr(get_theme_mod('vw_dark_searchopen_icon','fas fa-search')); ?>"></i></a></span>
      </div>
      <div class="serach_outer">
        <div class="closepop"><a href="#sidebar-pop"><i class="<?php echo esc_attr(get_theme_mod('vw_dark_searchclose_icon','fas fa-window-close')); ?>"></i></a></div>
        <div class="serach_inner">
          <?php get_search_form(); ?>
        </div>
      </div>
    </div>
    <div class="col-lg-1 col-md-1 col-6 bar-icon">
      <a href="#" id="sidebar-pop"><i class="<?php echo esc_attr(get_theme_mod('vw_dark_baropen_icon','fas fa-bars')); ?>"></i></a>
    </div>
    <div class="header-sidebar">
      <div class="close-pop"><a href="#maincontent"><i class="<?php echo esc_attr(get_theme_mod('vw_dark_barclose_icon','fas fa-window-close')); ?>"></i></a></div>
      <div class="logo">
        <?php if ( has_custom_logo() ) : ?>
          <div class="site-logo"><?php the_custom_logo(); ?></div>
        <?php endif; ?>
        <?php $blog_info = get_bloginfo( 'name' ); ?>
          <?php if ( ! empty( $blog_info ) ) : ?>
            <?php if ( is_front_page() && is_home() ) : ?>
              <?php if( get_theme_mod('vw_dark_logo_title_hide_show',true) == 1
){ ?>
                <h1 class="site-title mb-0"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
              <?php } ?>
            <?php else : ?>
              <?php if( get_theme_mod('vw_dark_logo_title_hide_show',true) == 1
){ ?>
                <p class="site-title mb-0"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
              <?php } ?>
            <?php endif; ?>
          <?php endif; ?>
          <?php
            $description = get_bloginfo( 'description', 'display' );
            if ( $description || is_customize_preview() ) :
          ?>
          <?php if( get_theme_mod('vw_dark_tagline_hide_show',false) == 1
){ ?>
            <p class="site-description mb-0">
              <?php echo esc_html($description); ?>
            </p>
          <?php } ?>
        <?php endif; ?>
      </div>
      <div id="sidebar" class="mt-5">
        <?php dynamic_sidebar('header-sidebar'); ?>
      </div>
    </div>
  </div>
</div>