<?php
/*
* Display Logo and contact details
*/
?>
<?php if (get_theme_mod('industrial_hub_topbar_visibility', true)) : ?>
  <div class="top-main">
    <div class="container">
      <div class="row m-0">
        <div class="col-lg-3 col-md-3 align-self-center top-col">
          <?php 
            $industrial_hub_topbar_text_first = get_theme_mod('industrial_hub_topbar_text_first');
            if ($industrial_hub_topbar_text_first) : ?>
            <p class="topbar-text m-0 py-lg-3 py-2"><i class="fas fa-check me-lg-3 me-2"></i><span class="toptext"><?php echo esc_html($industrial_hub_topbar_text_first); ?></span></p>
          <?php endif; ?>
        </div>
        <div class="col-lg-3 col-md-3 align-self-center top-col">
          <?php 
            $industrial_hub_topbar_text_second = get_theme_mod('industrial_hub_topbar_text_second');
            if ($industrial_hub_topbar_text_second) : ?>
            <p class="topbar-text m-0 py-lg-3 py-2 ps-xl-2"><i class="fas fa-check me-lg-3 me-2"></i><span class="toptext"><?php echo esc_html($industrial_hub_topbar_text_second); ?></span></p>
          <?php endif; ?>
        </div>
        <div class="col-lg-3 col-md-3 align-self-center top-col">
          <?php 
            $industrial_hub_topbar_text_third = get_theme_mod('industrial_hub_topbar_text_third');
            if ($industrial_hub_topbar_text_third) : ?>
            <p class="topbar-text m-0 py-lg-3 py-2 ps-xl-2"><i class="fas fa-check me-lg-3 me-2"></i><span class="toptext"><?php echo esc_html($industrial_hub_topbar_text_third); ?></span></p>
          <?php endif; ?>
        </div>
        <div class="col-lg-3 col-md-3 align-self-center top-col">
          <?php 
            $industrial_hub_topbar_text_fourth = get_theme_mod('industrial_hub_topbar_text_fourth');
            if ($industrial_hub_topbar_text_fourth) : ?>
            <p class="topbar-text m-0 py-lg-3 py-2 ps-xl-2"><i class="fas fa-check me-lg-3 me-2"></i><span class="toptext"><?php echo esc_html($industrial_hub_topbar_text_fourth); ?></span></p>
          <?php endif; ?>
        </div>
      </div>
    </div>
  </div>
<?php endif; ?>

<div class="bottom-header-box">
  <div class="main-header">
    <div class="headerbox">
      <div class="container py-2">
          <div class="row">
            <div class="col-lg-3 col-md-3 col-12 align-self-md-center">
              <div class="logo">
                <?php if( has_custom_logo() ) industrial_hub_the_custom_logo(); ?>
                <?php if(get_theme_mod('industrial_hub_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 $industrial_hub_description = get_bloginfo( 'description', 'display' );
                if ( $industrial_hub_description || is_customize_preview() ) : ?>
                  <?php if(get_theme_mod('industrial_hub_site_tagline',false)){ ?>
                    <p class="site-description mb-0"><?php echo esc_html($industrial_hub_description); ?></p>
                  <?php }?>
                <?php endif; ?>
              </div>
            </div>
            <div class="col-xl-5 col-lg-6 col-md-6 col-12 align-self-center">
              <div class="contactbox">
                <div class="contact call">
                    <?php if (get_theme_mod('industrial_hub_call_contact_no_text') || get_theme_mod('industrial_hub_call_contact_no')) : ?>
                        <div class="row">
                            <div class="col-lg-3 col-md-3 col-2 pe-lg-2 align-self-center text-center text-md-left">
                              <i class="fas fa-phone-alt"></i>
                            </div>
                            <div class="col-lg-9 col-md-9 col-10 ps-md-0 align-self-center text-lg-start contact-col call">
                              <p class="infotext text-capitalize"><?php echo esc_html(get_theme_mod('industrial_hub_call_contact_no_text', '')); ?></p>
                              <p class="mb-0 contact-content">
                                <a href="tel:<?php echo esc_attr(get_theme_mod('industrial_hub_call_contact_no', '')); ?>">
                                  <?php echo esc_html(get_theme_mod('industrial_hub_call_contact_no', '')); ?>
                                </a>
                              </p>
                            </div>
                        </div>
                    <?php endif; ?>
                </div>
                <div class="contact">
                    <?php if (get_theme_mod('industrial_hub_mail_text') || get_theme_mod('industrial_hub_mail')) : ?>
                      <div class="row">
                        <div class="col-lg-3 col-md-3 col-2 pe-lg-2 px-md-0 ps-lg-3 align-self-center text-center text-md-left">
                            <i class="fas fa-envelope"></i>
                        </div>
                        <div class="col-lg-9 col-md-9 col-10 ps-md-0 align-self-center contact-col">
                          <p class="infotext text-capitalize"><?php echo esc_html(get_theme_mod('industrial_hub_mail_text', '')); ?></p>
                          <p class="mb-0 contact-content">
                            <a href="mailto:<?php echo esc_attr(get_theme_mod('industrial_hub_mail', '')); ?>">
                              <?php echo esc_html(get_theme_mod('industrial_hub_mail', '')); ?>
                            </a>
                          </p>
                        </div>
                      </div>
                    <?php endif; ?>
                </div>
              </div>
            </div>
          <div class="col-xl-4 col-lg-3 col-md-3 col-12 align-self-center">
            <div class="middle-right-box">
              <div class="social-media text-md-end text-center mb-md-0 mb-1">
                <?php
                  $industrial_hub_fb_url = get_theme_mod('industrial_hub_facebook_url');
                  $industrial_hub_twt_url = get_theme_mod('industrial_hub_twitter_url');
                  $industrial_hub_ins_url = get_theme_mod('industrial_hub_instagram_url');
                  $industrial_hub_linkedin_url = get_theme_mod('industrial_hub_linkedin_url');
                  $industrial_hub_google_plus_url = get_theme_mod('industrial_hub_google_plus_url');
                  $industrial_hub_youtube_url = get_theme_mod('industrial_hub_youtube_url');

                  $industrial_hub_fb_new_tab = esc_attr(get_theme_mod('industrial_hub_header_fb_new_tab', 'true'));
                  $industrial_hub_twt_new_tab = esc_attr(get_theme_mod('industrial_hub_header_twt_new_tab', 'true'));
                  $industrial_hub_ins_new_tab = esc_attr(get_theme_mod('industrial_hub_header_ins_new_tab', 'true'));
                  $industrial_hub_linkedin_new_tab = esc_attr(get_theme_mod('industrial_hub_linkedin_new_tab', 'true'));
                  $industrial_hub_google_plus_new_tab = esc_attr(get_theme_mod('industrial_hub_header_google_plus_new_tab', 'true'));           
                  $industrial_hub_youtube_new_tab = esc_attr(get_theme_mod('industrial_hub_youtube_new_tab', 'true'));

                  if ($industrial_hub_linkedin_url || $industrial_hub_twt_url || $industrial_hub_fb_url || $industrial_hub_ins_url || $industrial_hub_google_plus_url || $industrial_hub_youtube_url) : ?>

                    <?php if ($industrial_hub_fb_url) : ?>
                        <a <?php if ($industrial_hub_fb_new_tab != false) : ?>target="_blank" <?php endif; ?>href="<?php echo esc_url($industrial_hub_fb_url); ?>"><i class="<?php echo esc_attr(get_theme_mod('industrial_hub_facebook_icon', 'fab fa-facebook-f')); ?>"></i></a>
                    <?php endif; ?>

                    <?php if ($industrial_hub_twt_url) : ?>
                        <a <?php if ($industrial_hub_twt_new_tab != false) : ?>target="_blank" <?php endif; ?>href="<?php echo esc_url($industrial_hub_twt_url); ?>"><i class="ms-xl-4 ms-md-1 ms-3 <?php echo esc_attr(get_theme_mod('industrial_hub_twitter_icon', 'fab fa-twitter')); ?>"></i></a>
                    <?php endif; ?>

                    <?php if ($industrial_hub_ins_url) : ?>
                        <a <?php if ($industrial_hub_ins_new_tab != false) : ?>target="_blank" <?php endif; ?>href="<?php echo esc_url($industrial_hub_ins_url); ?>"><i class="ms-xl-4 ms-md-1 ms-3 <?php echo esc_attr(get_theme_mod('industrial_hub_instagram_icon', 'fab fa-instagram')); ?>"></i></a>
                    <?php endif; ?>
                    
                    <?php if ($industrial_hub_linkedin_url) : ?>
                        <a <?php if ($industrial_hub_linkedin_new_tab != false) : ?>target="_blank" <?php endif; ?>href="<?php echo esc_url($industrial_hub_linkedin_url); ?>"><i class="ms-xl-4 ms-md-1 ms-3 ms-2 <?php echo esc_attr(get_theme_mod('industrial_hub_linkedin_icon', 'fab fa-linkedin-in')); ?>"></i></a>
                    <?php endif; ?>

                    <?php if ($industrial_hub_google_plus_url) : ?>
                        <a <?php if ($industrial_hub_google_plus_new_tab != false) : ?>target="_blank" <?php endif; ?>href="<?php echo esc_url($industrial_hub_google_plus_url); ?>"><i class="ms-xl-4 ms-md-1 ms-3 <?php echo esc_attr(get_theme_mod('industrial_hub_google_plus_icon', 'fab fa-google')); ?>"></i></a>
                    <?php endif; ?>
                    
                    <?php if ($industrial_hub_youtube_url) : ?>
                        <a <?php if ($industrial_hub_youtube_new_tab != false) : ?>target="_blank" <?php endif; ?>href="<?php echo esc_url($industrial_hub_youtube_url); ?>"><i class="ms-xl-4 ms-md-2 ms-3 ms-2 <?php echo esc_attr(get_theme_mod('industrial_hub_youtube_icon', 'fab fa-youtube')); ?>"></i></a>
                    <?php endif; ?>
                    
                <?php endif; ?>
              </div>
              <span class="search-bar ms-xl-5 ms-3 ms-md-2">
                <button type="button" class="open-search"><i class="fas fa-search"></i></button>
              </span>
            </div>
          </div>
          <div class="search-outer">
            <div class="inner_searchbox w-100 h-100">
                <?php get_search_form(); ?>
            </div>
            <button type="button" class="search-close"><?php esc_html_e('CLOSE', 'industrial-hub'); ?></button>
          </div> 
          </div>
      </div>
    </div>
    <div class="bottom-header">
      <div class="container">
        <div class="row">
          <div class="col-lg-2 col-md-4 col-12 align-self-md-center"></div>
          <div class="col-xl-7 col-lg-7 col-md-3 navigation-col">
            <?php get_template_part('template-parts/navigation/site-nav'); ?>
          </div>
          <div class="col-xl-3 col-lg-3 col-md-5 btn-col">
            <div class="header-menu-right">
              <?php if (get_theme_mod('industrial_hub_header_link') || get_theme_mod('industrial_hub_header_button','Request A Quote')) : ?>
                <div class="custom-btn-wrapper">
                  <span class="header-btn text-center ps-md-3 ps-lg-4">
                    <a href="<?php echo esc_url(get_theme_mod('industrial_hub_header_link')); ?>" class="book-appoin">
                      <span><?php echo esc_html(get_theme_mod('industrial_hub_header_button','Request A Quote')); ?></span>
                      <i class="fas fa-arrow-right"></i>
                    </a>
                  </span>
                </div>
              <?php endif; ?>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

