<?php
/*
* Display Logo and contact details
*/
?>

<?php if (get_theme_mod('packers_and_movers_topbar_visibility', true)) : ?>
  <div class="top-main py-md-2 py-3">
    <div class="container">
      <div class="row">
          <div class="col-lg-8 col-md-9 align-self-center">
              <div class="contact">
                  <?php if (get_theme_mod('packers_and_movers_mail')) : ?>
                      <p class="mb-md-0 mb-2 contact-content">
                          <i class="fas fa-envelope me-md-2 me-1"></i><a href="mailto:<?php echo esc_html(get_theme_mod('packers_and_movers_mail')); ?>">
                              <?php echo esc_html(get_theme_mod('packers_and_movers_mail')); ?>
                          </a>
                      </p>
                  <?php endif; ?>
                  <?php if (get_theme_mod('packers_and_movers_location')) : ?>
                    <p class="mb-md-0 mb-2 contact-content ms-lg-4 ms-md-2 ms-0">
                      <i class="fas fa-map-marker-alt me-md-2 me-1"></i><?php echo esc_html(get_theme_mod('packers_and_movers_location')); ?>
                    </p>
                  <?php endif; ?>
                  <?php if (get_theme_mod('packers_and_movers_call')) : ?>
                    <p class="mb-md-0 mb-2 contact-content call ms-lg-4 ms-md-2 ms-0">
                      <i class="fas fa-phone me-md-2 me-1"></i><span><a href="tel:<?php echo esc_html(get_theme_mod('packers_and_movers_call')); ?>">
                              <?php echo esc_html(get_theme_mod('packers_and_movers_call')); ?>
                      </a>
                    </p>
                  <?php endif; ?>
              </div>
          </div>
          <div class="col-lg-4 col-md-3 align-self-center">
            <div class="top-links">
              <?php if (!empty(get_theme_mod('packers_and_movers_terms_link')) && !empty(get_theme_mod('packers_and_movers_terms_text','Term & Condition'))) : ?>
                <span class="return-btn terms mb-md-0 mb-2">
                  <a href="<?php echo esc_url(get_theme_mod('packers_and_movers_terms_link', '')); ?>">
                    <?php if (!empty(get_theme_mod('packers_and_movers_terms_text','Term & Condition'))) : ?>
                      <?php echo esc_html(get_theme_mod('packers_and_movers_terms_text', 'Term & Condition')); ?>
                    <?php endif; ?>
                  </a>
                </span>
              <?php endif; ?>
              <?php if (!empty(get_theme_mod('packers_and_movers_policy_link')) && !empty(get_theme_mod('packers_and_movers_policy_text','Privacy Policy'))) : ?>
                <span class="return-btn policy ps-lg-5 ps-md-3 ps-0">
                  <a href="<?php echo esc_url(get_theme_mod('packers_and_movers_policy_link', '')); ?>">
                    <?php if (!empty(get_theme_mod('packers_and_movers_policy_text','Privacy Policy'))) : ?>
                      <?php echo esc_html(get_theme_mod('packers_and_movers_policy_text','Privacy Policy')); ?>
                    <?php endif; ?>
                  </a>
                </span>
              <?php endif; ?>
            </div>
          </div>
      </div>
    </div>
  </div>
<?php endif; ?>

<div class="headerbox py-2">
  <div class="container">
    <div class="row">
      <div class="col-lg-3 col-md-4 col-12 align-self-md-center">
        <div class="logo">
          <?php if( has_custom_logo() ) packers_and_movers_the_custom_logo(); ?>
          <?php if(get_theme_mod('packers_and_movers_site_title',true) == 1){ ?>
            <?php if (is_front_page() && is_home()) : ?>
              <h1 class="text-capitalize">
                  <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
              </h1> 
            <?php else : ?>
                <p class="text-capitalize site-title mb-1">
                    <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                </p>
            <?php endif; ?>
          <?php }?>
          <?php $packers_and_movers_description = get_bloginfo( 'description', 'display' );
          if ( $packers_and_movers_description || is_customize_preview() ) : ?>
            <?php if(get_theme_mod('packers_and_movers_site_tagline',false)){ ?>
              <p class="site-description"><?php echo esc_html($packers_and_movers_description); ?></p>
            <?php }?>
          <?php endif; ?>
        </div>
      </div>
      <div class="col-lg-6 col-md-4 col-4 align-self-center">
        <?php get_template_part('template-parts/navigation/site-nav'); ?>
      </div>
      <div class="col-lg-3 col-md-4 col-8 align-self-center">
        <div class="header-menu-right">
          <div class="offcanvas-div d-flex align-items-center align-self-center">
            <?php if(get_theme_mod('packers_and_movers_header_sidebar',true)){ ?>
              <button type="button" data-bs-toggle="offcanvas" data-bs-target="#demo">
                <i class="fas fa-bars"></i>
              </button>
              <div class="offcanvas offcanvas-end" id="demo">
                <div class="offcanvas-header"> 
                  <button type="button" class="btn-close" data-bs-dismiss="offcanvas"><i class="fas fa-times"></i></button>
                </div>
                <div class="offcanvas-body">
                  <div class="logo">
                    <?php if( has_custom_logo() ) packers_and_movers_the_custom_logo(); ?>
                    <?php if(get_theme_mod('packers_and_movers_site_title',true) == 1){ ?>
                      <?php if (is_front_page() && is_home()) : ?>
                        <h1 class="text-capitalize my-2">
                            <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                        </h1> 
                      <?php else : ?>
                          <p class="text-capitalize site-title my-2">
                              <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                          </p>
                      <?php endif; ?>
                    <?php }?>
                    <?php $packers_and_movers_description = get_bloginfo( 'description', 'display' );
                    if ( $packers_and_movers_description || is_customize_preview() ) : ?>
                      <?php if(get_theme_mod('packers_and_movers_site_tagline',false)){ ?>
                        <p class="site-description mb-4"><?php echo esc_html($packers_and_movers_description); ?></p>
                      <?php }?>
                    <?php endif; ?>
                  </div>
                  <div class="social-media mt-3">
                    <?php                 
                      $packers_and_movers_header_fb_new_tab = esc_attr(get_theme_mod('packers_and_movers_header_fb_new_tab','true'));
                      $packers_and_movers_header_twt_new_tab = esc_attr(get_theme_mod('packers_and_movers_header_twt_new_tab','true'));
                      $packers_and_movers_header_ins_new_tab = esc_attr(get_theme_mod('packers_and_movers_header_ins_new_tab','true'));
                      $packers_and_movers_header_ut_new_tab = esc_attr(get_theme_mod('packers_and_movers_header_ut_new_tab','true'));
                      $packers_and_movers_header_pint_new_tab = esc_attr(get_theme_mod('packers_and_movers_header_pint_new_tab','true'));
                      ?>
                    <?php if( get_theme_mod( 'packers_and_movers_facebook_url' ) != '') { ?>
                      <a <?php if($packers_and_movers_header_fb_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'packers_and_movers_facebook_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('packers_and_movers_facebook_icon','fab fa-facebook-f')); ?>"></i></a>
                    <?php } ?>
                    <?php if( get_theme_mod( 'packers_and_movers_twitter_url' ) != '') { ?>
                      <a <?php if($packers_and_movers_header_twt_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'packers_and_movers_twitter_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('packers_and_movers_twitter_icon','fab fa-twitter')); ?>"></i></a>
                    <?php } ?>
                    <?php if( get_theme_mod( 'packers_and_movers_instagram_url' ) != '') { ?>
                      <a <?php if($packers_and_movers_header_ins_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'packers_and_movers_instagram_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('packers_and_movers_instagram_icon','fab fa-instagram')); ?>"></i></a>
                    <?php } ?>
                    <?php if( get_theme_mod( 'packers_and_movers_youtube_url' ) != '') { ?>
                      <a <?php if($packers_and_movers_header_ut_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'packers_and_movers_youtube_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('packers_and_movers_youtube_icon','fab fa-youtube')); ?>"></i></a>
                    <?php } ?>
                    <?php if( get_theme_mod( 'packers_and_movers_pint_url' ) != '') { ?>
                      <a <?php if($packers_and_movers_header_pint_new_tab != false ) { ?>target="_blank" <?php } ?>href="<?php echo esc_url( get_theme_mod( 'packers_and_movers_pint_url','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('packers_and_movers_pinterest_icon','fab fa-pinterest')); ?>"></i></a>
                    <?php } ?>
                  </div>
                  <div class="search_inner">
                  <?php get_search_form(); ?>
                </div>
                </div>
              </div>
            <?php } ?>
          </div>
          <?php if (get_theme_mod('packers_and_movers_header_link') || get_theme_mod('packers_and_movers_header_button','Get A Quote')) : ?>
            <span class="header-btn text-center ps-md-3 ps-lg-4">
              <a href="<?php echo esc_url(get_theme_mod('packers_and_movers_header_link')); ?>" class="book-appoin"><?php echo esc_html(get_theme_mod('packers_and_movers_header_button','Get A Quote')); ?></a>
            </span>
          <?php endif; ?>
        </div>
      </div>
    </div>
  </div>
</div>