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

<div class="main-header <?php if( get_theme_mod( 'vw_locksmith_sticky_header', false) == 1 || get_theme_mod( 'vw_locksmith_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <?php if (get_theme_mod('vw_locksmith_topbar_hide_show', false)){ ?>
    <div class="container">
      <div class="contact-info py-2 wow fadeInDown">
        <div class="row">
          <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-12 col-12 align-self-center location text-lg-start text-md-start text-center">
            <?php if(get_theme_mod('vw_locksmith_topbar_location_text') != ''){ ?>
              <a href="<?php echo esc_url(get_theme_mod('vw_locksmith_track_locatin_url',false));?>" target="_blank">
                <i class="<?php echo esc_attr(get_theme_mod('vw_locksmith_topbar_location_icon','fa-solid fa-location-dot')); ?> me-2"></i><span class="text-capitalize mb-0"><?php echo esc_html(get_theme_mod('vw_locksmith_topbar_location_text')) ?></span>
              </a>
            <?php }?>
          </div>
          <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-12 col-12 align-self-center top-time text-center">
            <?php if(get_theme_mod('vw_locksmith_topbar_time_text') != ''){ ?>
              <p class="mb-0"><i class="<?php echo esc_attr( get_theme_mod('vw_locksmith_topbar_time_icon', 'fa-solid fa-clock') ); ?> me-2"></i><?php echo esc_html( get_theme_mod('vw_locksmith_topbar_time_text') ); ?></p>
            <?php } ?>
          </div>
          <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-12 col-12 align-self-center top-mail text-lg-end text-md-end text-center">
            <?php if(get_theme_mod('vw_locksmith_top_email_address') != ''){ ?>
              <a href="mailto:<?php echo esc_attr(get_theme_mod('vw_locksmith_top_email_address'));?>"><i class="<?php echo esc_attr(get_theme_mod('vw_locksmith_top_email_address_icon','fa-solid fa-envelope-open')); ?> me-2"></i><span><?php echo esc_html(get_theme_mod('vw_locksmith_top_email_address'));?></span></a>
            <?php } ?>
          </div>
        </div>
      </div>
    </div>
  <?php }?>

  <div class="main-topbar wow fadeInDown py-2">
    <div class="container">
      <div class="row">
        <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-4 col-sm-8 col-8 align-self-center header-left-box">
          <div class="logo-box pb-0 pb-md-0">
            <?php if ( has_custom_logo() ) : ?>
              <div class="site-logo"><?php the_custom_logo(); ?></div>
            <?php endif; ?>
            <?php $vw_locksmith_blog_info = get_bloginfo( 'name' ); ?>
              <?php if ( ! empty( $vw_locksmith_blog_info ) ) : ?>
                <?php if ( is_front_page() && is_home() ) : ?>
                  <?php if( get_theme_mod('vw_locksmith_logo_title_hide_show',true) == 1){ ?>
                    <p class="site-title mb-0 text-start"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                  <?php } ?>
                <?php else : ?>
                  <?php if( get_theme_mod('vw_locksmith_logo_title_hide_show',true) == 1){ ?>
                    <p class="site-title mb-0 text-start"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                  <?php } ?>
                <?php endif; ?>
              <?php endif; ?>
              <?php
                $vw_locksmith_description = get_bloginfo( 'description', 'display' );
                if ( $vw_locksmith_description || is_customize_preview() ) :
              ?>
              <?php if( get_theme_mod('vw_locksmith_tagline_hide_show',false) == 1){ ?>
                <p class="site-description mb-0 text-start">
                  <?php echo esc_html($vw_locksmith_description); ?>
                </p>
              <?php } ?>
            <?php endif; ?>
          </div>
        </div>
        <div class="col-xxl-8 col-xl-7 col-lg-7 col-md-3 col-sm-4 col-4 align-self-center header-mid-box">
          <?php get_template_part('template-parts/header/navigation'); ?>
        </div>
        <div class="col-xxl-2 col-xl-3 col-lg-3 col-md-5 col-sm-12 col-12 header-right-box d-flex justify-content-between align-items-center">


          <?php if (get_theme_mod('vw_locksmith_search_hide_show', false)){ ?>
            <div class="search-box">
              <span><a href="#"><i class='<?php echo esc_attr(get_theme_mod('vw_locksmith_search_open_icon','fas fa-search')); ?>'></i></a></span>
            </div>
            <div class="serach_outer">
              <div class="closepop"><a href="#maincontent"><i class="<?php echo esc_attr(get_theme_mod('vw_locksmith_search_close_icon','fa fa-window-close')); ?>"></i></a></div>
              <div class="serach_inner">


                <?php if(class_exists('woocommerce')):?>
                  <?php get_product_search_form(); ?>
                <?php else : ?>
                  <?php get_search_form(); ?>
                <?php endif; ?>

              </div>
            </div>
          <?php } ?>




          <?php if(get_theme_mod('vw_locksmith_topbar_phone_text') != '' || get_theme_mod('vw_locksmith_topbar_phone_number') != ''){ ?>
            <div class="phone-box text-center px-3 py-2">
              <p class="mb-0 text-capitalize"><i class="<?php echo esc_attr( get_theme_mod('vw_locksmith_topbar_phone_icon', 'fa-solid fa-phone-flip') ); ?> me-2"></i><?php echo esc_html( get_theme_mod('vw_locksmith_topbar_phone_text') ); ?></p>
              <a href="tel:<?php echo esc_attr( get_theme_mod('vw_locksmith_topbar_phone_number') ); ?>">
                <?php echo esc_html( get_theme_mod('vw_locksmith_topbar_phone_number') ); ?>
              </a>
            </div>
          <?php } ?>
        </div>
      </div>
    </div>
  </div>
</div>