<?php
/**
 * The template part for Top Header
 *
 * @package VW Tourism 
 * @subpackage vw-tourism
 * @since vw-tourism 1.0
 */
?>

<div class="main-header <?php if( get_theme_mod( 'vw_tourism_sticky_header', false) == 1 || get_theme_mod( 'vw_tourism_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="container">
    <div class="row">
      <div class="col-xl-2 col-lg-2 col-md-2 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_tourism_blog_info = get_bloginfo( 'name' ); ?>
            <?php if ( ! empty( $vw_tourism_blog_info ) ) : ?>
              <?php if ( is_front_page() && is_home() ) : ?>
                <?php if( get_theme_mod('vw_tourism_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_tourism_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_tourism_description = get_bloginfo( 'description', 'display' );
              if ( $vw_tourism_description || is_customize_preview() ) :
            ?>
            <?php if( get_theme_mod('vw_tourism_tagline_hide_show',false) == 1){ ?>
              <p class="site-description mb-0">
                <?php echo esc_html($vw_tourism_description); ?>
              </p>
            <?php } ?>
          <?php endif; ?>
        </div>
      </div>
      <div class="col-xl-9 col-lg-9 col-md-8 col-sm-5 col-5 align-self-center header-sec-top">
        <?php get_template_part('template-parts/header/navigation'); ?>
      </div>
      <div class="col-xl-1 col-lg-1 col-md-2 col-sm-7 col-7 align-self-center d-flex justify-content-around justify-content-lg-end align-items-center gap-4 p-0">
        <!-- Search -->
        <?php if( get_theme_mod( 'vw_tourism_header_search',true) == 1) { ?>
          <div class="search-box">
            <span><a href="#"><i class='<?php echo esc_attr(get_theme_mod('vw_tourism_search_open_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('vw_tourism_search_close_icon','fa fa-window-close')); ?>"></i></a></div>
          <div class="serach_inner">
            <?php get_search_form(); ?>
          </div>
        </div>
        <!-- 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-tourism'); ?>"><i class="<?php echo esc_attr(get_theme_mod('vw_tourism_myaccount_icon','fas fa-user')); ?>"></i><span class="screen-reader-text"><?php esc_html_e( 'My Account','vw-tourism' );?></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-tourism'); ?>"><i class="<?php echo esc_attr(get_theme_mod('vw_tourism_myaccount_icon','fas fa-user')); ?>"></i><span class="screen-reader-text"><?php esc_html_e( 'Login / Register','vw-tourism' );?></span></a>
            <?php } ?>
          <?php }?>
        </div>
      </div>
    </div>
  </div>
</div>