<?php
/**
 * The template part for Top Header
 *
 * @package Repair Shop 
 * @subpackage repair-shop
 * @since repair-shop 1.0
 */
?>

<div class="main-header <?php if( get_theme_mod( 'repair_shop_sticky_header', false) == 1 || get_theme_mod( 'repair_shop_stickyheader_hide_show', false) == 1){ ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="menu-header">
    <div class="container">
      <div class="top-menu-box">
        <div class="row">
          <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-3 col-sm-12 col-12 logo-img-sec d-flex">
            <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 $repair_shop_blog_info = get_bloginfo( 'name' ); ?>
                <?php if ( ! empty( $repair_shop_blog_info ) ) : ?>
                  <?php if ( is_front_page() && is_home() ) : ?>
                    <?php if( get_theme_mod('repair_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('repair_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
                  $repair_shop_description = get_bloginfo( 'description', 'display' );
                  if ( $repair_shop_description || is_customize_preview() ) :
                ?>
                <?php if( get_theme_mod('repair_shop_tagline_hide_show',false) == 1){ ?>
                  <p class="site-description mb-0">
                    <?php echo esc_html($repair_shop_description); ?>
                  </p>
                <?php } ?>
              <?php endif; ?>
            </div>
          </div>
          <div class="col-xxl-10 col-xl-10 col-lg-10 col-md-9 col-sm-12 col-12 align-self-center">
            <div class="contact-sec py-3">
              <div class="row">
                <div class="col-xxl-7 col-xl-7 col-lg-5 col-md-5 col-sm-12 col-12 align-self-center location">
                  <?php if(get_theme_mod('repair_shop_topbar_location_text') != ''){ ?>
                    <a href="<?php echo esc_url(get_theme_mod('repair_shop_track_locatin_url',false));?>" target="_blank">
                      <i class="<?php echo esc_attr(get_theme_mod('repair_shop_topbar_location_icon','fa-solid fa-location-dot')); ?> me-2"></i><span class="text-capitalize mb-0"><?php echo esc_html(get_theme_mod('repair_shop_topbar_location_text')) ?></span>
                    </a>
                  <?php }?>
                </div>
                <div class="col-xxl-2 col-xl-2 col-lg-3 col-md-3 col-sm-12 col-12 align-self-center top-phone">
                  <?php if(get_theme_mod('repair_shop_topbar_phone_number') != ''){ ?>
                    <i class="<?php echo esc_attr( get_theme_mod('repair_shop_topbar_phone_icon', 'fa-solid fa-phone') ); ?> me-2"></i>
                    <a href="tel:<?php echo esc_attr( get_theme_mod('repair_shop_topbar_phone_number') ); ?>">
                      <?php echo esc_html( get_theme_mod('repair_shop_topbar_phone_number') ); ?>
                    </a>
                  <?php } ?>
                </div>
                <div class="col-xxl-3 col-xl-3 col-lg-4 col-md-4 col-sm-12 col-12 align-self-center text-end top-mail">
                  <?php if(get_theme_mod('repair_shop_top_email_address') != ''){ ?>
                    <a href="mailto:<?php echo esc_attr(get_theme_mod('repair_shop_top_email_address'));?>"><i class="<?php echo esc_attr(get_theme_mod('repair_shop_top_email_address_icon','fa-solid fa-envelope')); ?> me-2"></i><span><?php echo esc_html(get_theme_mod('repair_shop_top_email_address'));?></span></a>
                  <?php } ?>
                </div>
              </div>
            </div>
            <div class="menu-sec">
              <div class="row">
                <div class="col-xxl-11 col-xl-11 col-lg-10 col-md-7 col-sm-5 col-5 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-5 col-sm-7 col-7 align-items-center d-flex justify-content-between gap-2 top-btn">
                  <?php if (get_theme_mod('repair_shop_search_hide_show', true)){ ?>
                    <div class="search-box">
                      <span><a href="#"><i class='<?php echo esc_attr(get_theme_mod('repair_shop_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('repair_shop_search_close_icon','fa fa-window-close')); ?>"></i></a></div>
                      <div class="serach_inner">
                        <?php get_search_form(); ?>
                      </div>
                    </div>
                  <?php } ?>
                  <?php if (get_theme_mod('repair_shop_cart_button_link')){ ?>
                    <div class="cart">
                      <a href="<?php echo esc_html(get_theme_mod('repair_shop_cart_button_link')); ?>" target="_blank"><i class="<?php echo esc_attr(get_theme_mod('repair_shop_cart_icon','fa-solid fa-basket-shopping')); ?>"></i></a>
                    </div>
                  <?php } ?>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>