<?php
/**
 * The template part for Top Header
 *
 * @package VW Business Lounge 
 * @subpackage vw-business-lounge
 * @since vw-business-lounge 1.0
 */
?>

<div class="main-header <?php if( get_theme_mod( 'vw_business_lounge_sticky_header', false) == 1 || get_theme_mod( 'vw_business_lounge_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="container">
    <div class="header-sec px-4 py-1">
      <div class="row">
        <div class="col-xxl-1 col-xl-2 col-lg-2 col-md-3 col-sm-12 col-12 align-self-center logo-img-sec p-0">
          <div class="logo text-center text-md-center pb-0 pb-md-0">
            <?php if ( has_custom_logo() ) : ?>
              <div class="site-logo"><?php the_custom_logo(); ?></div>
            <?php endif; ?>
            <?php $vw_business_lounge_blog_info = get_bloginfo( 'name' ); ?>
              <?php if ( ! empty( $vw_business_lounge_blog_info ) ) : ?>
                <?php if ( is_front_page() && is_home() ) : ?>
                  <?php if( get_theme_mod('vw_business_lounge_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_business_lounge_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
                $vw_business_lounge_description = get_bloginfo( 'description', 'display' );
                if ( $vw_business_lounge_description || is_customize_preview() ) :
              ?>
              <?php if( get_theme_mod('vw_business_lounge_tagline_hide_show',false) == 1){ ?>
                <p class="site-description mb-0">
                  <?php echo esc_html($vw_business_lounge_description); ?>
                </p>
              <?php } ?>
            <?php endif; ?>
          </div>
        </div>
        <div class="col-xxl-9 col-xl-8 col-lg-7 col-md-4 col-sm-3 col-3 align-self-center header-sec-top">
          <?php get_template_part('template-parts/header/navigation'); ?>
        </div>
        <div class="col-xxl-2 col-xl-2 col-lg-3 col-md-5 col-sm-9 col-9 align-self-center d-flex justify-content-around justify-content-lg-between p-0">
          <!-- MyAccount -->
          <div class="account">
            <?php if(class_exists('woocommerce')){ ?>
              <?php if ( is_user_logged_in() ) { ?>
                <a href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('My Account','vw-business-lounge'); ?>"><i class="<?php echo esc_attr(get_theme_mod('vw_business_lounge_myaccount_icon','fas fa-user')); ?>"></i><span class="screen-reader-text"><?php esc_html_e( 'My Account','vw-business-lounge' );?></span></a>
              <?php }
              else { ?>
                <a href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('Login / Register','vw-business-lounge'); ?>"><i class="<?php echo esc_attr(get_theme_mod('vw_business_lounge_myaccount_icon','fas fa-user')); ?>"></i><span class="screen-reader-text"><?php esc_html_e( 'Login / Register','vw-business-lounge' );?></span></a>
              <?php } ?>
            <?php }?>
          </div>
          <!-- Search -->
          <?php if( get_theme_mod( 'vw_business_lounge_header_search',true) == 1) { ?>
            <div class="menu-search text-md-end text-center">
              <?php get_search_form(); ?>
            </div>
          <?php }?>  
        </div>
      </div>
    </div>
  </div>
</div>