<?php
/*
* Display Logo and contact details
*/
?>
<div class="main-header">
  <div class="headerbox">
    <?php if (get_theme_mod('product_review_topbar_visibility', true)) : ?>
      <div class="top-header">
        <div class="container">
          <div class="row">
            <div class="col-lg-5 col-md-5 col-12 social-box align-self-center">
              <div class="social-media">
                <?php
                  $product_review_fb_url = get_theme_mod('product_review_facebook_url');
                  $product_review_ins_url = get_theme_mod('product_review_instagram_url');
                  $product_review_linkedin_url = get_theme_mod('product_review_linkedin_url');
                  $product_review_twt_url = get_theme_mod('product_review_twitter_url');

                  $product_review_fb_new_tab = esc_attr(get_theme_mod('product_review_header_fb_new_tab', 'true'));
                  $product_review_ins_new_tab = esc_attr(get_theme_mod('product_review_header_ins_new_tab', 'true'));
                  $product_review_linkedin_new_tab = esc_attr(get_theme_mod('product_review_linkedin_new_tab', 'true'));
                  $product_review_twt_new_tab = esc_attr(get_theme_mod('product_review_header_twt_new_tab', 'true'));

                  if ($product_review_twt_url || $product_review_fb_url || $product_review_ins_url || $product_review_linkedin_url) : ?>
                    <div class="icon-social">
                      <?php if ($product_review_fb_url) : ?>
                          <a <?php if ($product_review_fb_new_tab != false) : ?>target="_blank" <?php endif; ?>href="<?php echo esc_url($product_review_fb_url); ?>"><i class="<?php echo esc_attr(get_theme_mod('product_review_facebook_icon', 'fab fa-facebook-f')); ?>"></i></a>
                      <?php endif; ?>
                      <?php if ($product_review_twt_url) : ?>
                          <a <?php if ($product_review_twt_new_tab != false) : ?>target="_blank" <?php endif; ?>href="<?php echo esc_url($product_review_twt_url); ?>"><i class="ms-md-2 ms-3 <?php echo esc_attr(get_theme_mod('product_review_twitter_icon', 'fab fa-twitter')); ?>"></i></a>
                      <?php endif; ?>
                      <?php if ($product_review_linkedin_url) : ?>
                          <a <?php if ($product_review_linkedin_new_tab != false) : ?>target="_blank" <?php endif; ?>href="<?php echo esc_url($product_review_linkedin_url); ?>"><i class="ms-md-2 ms-3 ms-2 <?php echo esc_attr(get_theme_mod('product_review_linkedin_icon', 'fab fa-linkedin-in')); ?>"></i></a>
                      <?php endif; ?>
                      <?php if ($product_review_ins_url) : ?>
                          <a <?php if ($product_review_ins_new_tab != false) : ?>target="_blank" <?php endif; ?>href="<?php echo esc_url($product_review_ins_url); ?>"><i class="ms-md-2 ms-3 <?php echo esc_attr(get_theme_mod('product_review_instagram_icon', 'fab fa-instagram')); ?>"></i></a>
                      <?php endif; ?>
                  </div>
                <?php endif; ?>
              </div>
            </div>
            <div class="col-lg-7 col-md-7 col-12 align-self-center">
              <div class="right contact">
                <div>
                  <p class="day-time-text my-0"><?php echo product_review_get_current_day_time(); ?></p>
                </div>
                  <div class="header-button ms-md-4">
                  <?php 
                  $product_review_button_link = get_theme_mod('product_review_header_button_link');
                  $product_review_button_text = get_theme_mod('product_review_header_button_text', __('Write A Review', 'product-review'));

                  if ( $product_review_button_link || $product_review_button_text ) : ?>
                      <a href="<?php echo esc_url( $product_review_button_link ); ?>">
                          <?php echo esc_html( $product_review_button_text ); ?>
                      </a>
                  <?php endif; ?>
              </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    <?php endif; ?>
    <div class="menubox py-md-2 py-3">
      <div class="container">
        <div class="row">
          <div class="col-lg-3 col-md-4 logo-col align-self-center">
            <div class="logo my-lg-2 my-3">
              <?php if( has_custom_logo() ) product_review_the_custom_logo(); ?>
              <?php if(get_theme_mod('product_review_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 $product_review_description = get_bloginfo( 'description', 'display' );
              if ( $product_review_description || is_customize_preview() ) : ?>
                <?php if(get_theme_mod('product_review_site_tagline',false)){ ?>
                  <p class="site-description mb-0"><?php echo esc_html($product_review_description); ?></p>
                <?php }?>
              <?php endif; ?>
            </div>
          </div>
          <div class="col-lg-6 col-md-4 align-self-center">
            <?php get_template_part('template-parts/navigation/site-nav'); ?>
          </div>
          <div class="col-lg-3 col-md-4 align-self-center btn-col">
            <div class="search-block">
              <?php 
                get_search_form();
              ?>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>