<?php
/**
 * The template part for Top Header
 *
 * @package VW Gift Shop 
 * @subpackage vw-gift-shop
 * @since vw-gift-shop 1.0
 */
?>

<div class="main-header <?php if( get_theme_mod( 'vw_gift_shop_sticky_header', false) == 1 || get_theme_mod( 'vw_gift_shop_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="container">
    <div class="row">
      <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-6 col-sm-12 col-12 align-self-center logo-img-sec">
        <div class="logo text-start pb-0 pb-md-0">
          <?php if ( has_custom_logo() ) : ?>
            <div class="site-logo"><?php the_custom_logo(); ?></div>
          <?php endif; ?>
          <?php $vw_gift_shop_blog_info = get_bloginfo( 'name' ); ?>
            <?php if ( ! empty( $vw_gift_shop_blog_info ) ) : ?>
              <?php if ( is_front_page() && is_home() ) : ?>
                <?php if( get_theme_mod('vw_gift_shop_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_gift_shop_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_gift_shop_description = get_bloginfo( 'description', 'display' );
              if ( $vw_gift_shop_description || is_customize_preview() ) :
            ?>
            <?php if( get_theme_mod('vw_gift_shop_tagline_hide_show',false) == 1){ ?>
              <p class="site-description mb-0">
                <?php echo esc_html($vw_gift_shop_description); ?>
              </p>
            <?php } ?>
          <?php endif; ?>
        </div>
      </div>
      <div class="col-xxl-9 col-xl-9 col-lg-8 col-md-3 col-sm-4 col-4 align-self-center header-sec-top">
        <?php get_template_part('template-parts/header/navigation'); ?>
      </div>
      <div class="col-xxl-1 col-xl-1 col-lg-2 col-md-3 col-sm-8 col-8 d-flex align-items-center justify-content-center gap-4 topbar-icons">
        <?php if ( class_exists( 'woocommerce' ) ) { ?>
          <div class="wishlist">
            <?php if ( defined('YITH_WCWL') ) { ?>
              <a class="wishlist_view" href="<?php echo YITH_WCWL()->get_wishlist_url(); ?>" title="<?php esc_attr_e('Wishlist','vw-gift-shop'); ?>">
                <i class="<?php echo esc_attr(get_theme_mod('vw_gift_shop_heart_icon','far fa-heart')); ?>"></i>
              </a>
            <?php } ?>
          </div>
          <div class="cart_shop">
            <a href="<?php echo esc_url(wc_get_cart_url()); ?>" title="<?php esc_attr_e('shopping cart','vw-gift-shop'); ?>">
              <i class="<?php echo esc_attr(get_theme_mod('vw_gift_shop_cart_icon','fa-solid fa-bag-shopping')); ?>"></i>
              <span class="screen-reader-text"><?php esc_html_e('Shopping Cart','vw-gift-shop'); ?></span>
            </a>
          </div>
          <?php if ( is_user_logged_in() ) { ?>
            <a class="myaccount-icon" href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>">
              <i class="<?php echo esc_attr(get_theme_mod('vw_gift_shop_topbar_myaccount_icon','fas fa-user')); ?>"></i>
            </a>
          <?php } else { ?>
            <a class="myaccount-icon" href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('Login / Register','vw-gift-shop'); ?>">
              <i class="<?php echo esc_attr(get_theme_mod('vw_gift_shop_topbar_myaccount_icon','fas fa-user')); ?>"></i>
            </a>
          <?php } ?>
        <?php } ?>
      </div>
    </div>
  </div>
</div>