<?php
/**
 * The template part for Top Header
 *
 * @package Courier Services 
 * @subpackage courier-services
 * @since courier-services 1.0
 */
?>

<div class="top-header <?php if( get_theme_mod( 'courier_services_sticky_header', false) == 1 || get_theme_mod( 'courier_services_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="container">
    <div class="row">
      <div class="col-xl-2 col-lg-2 col-md-12 align-self-center p-md-0">
        <div class="logo pb-0 pb-md-0">
          <?php if ( has_custom_logo() ) : ?>
            <div class="site-logo"><?php the_custom_logo(); ?></div>
          <?php endif; ?>
          <?php $courier_services_blog_info = get_bloginfo( 'name' ); ?>
            <?php if ( ! empty( $courier_services_blog_info ) ) : ?>
              <?php if ( is_front_page() && is_home() ) : ?>
                <?php if( get_theme_mod('courier_services_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('courier_services_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
              $courier_services_description = get_bloginfo( 'description', 'display' );
              if ( $courier_services_description || is_customize_preview() ) :
            ?>
            <?php if( get_theme_mod('courier_services_tagline_hide_show',false) == 1){ ?>
              <p class="site-description mb-0">
                <?php echo esc_html($courier_services_description); ?>
              </p>
            <?php } ?>
          <?php endif; ?>
        </div>
      </div>
      <div class="col-xl-10 col-lg-10 col-md-12 align-self-center">
          <div class="row">
            <div class="col-xl-12 col-lg-12 col-md-12 align-self-center topbar-details-col">
              <?php if( get_theme_mod( 'courier_services_topbar_hide_show', true) == 1 || get_theme_mod('courier_services_responsive_topbar_hide',false)) { ?>
                <div class="skew-background">
                  <div class="row">
                    <div class="col-xl-3 col-lg-3 col-md-3 align-self-center location">
                      <?php if(get_theme_mod('courier_services_topbar_location_icon') != '' || get_theme_mod('courier_services_topbar_location_text') != ''){ ?>
                       <p class="topbar-text mb-0"> <i class="<?php echo esc_attr(get_theme_mod('courier_services_topbar_location_icon','me-2 fa-solid fa-location-dot')); ?>"></i><?php echo esc_html(get_theme_mod('courier_services_topbar_location_text')) ?></p>
                      <?php }?>
                    </div>
                    <div class="col-xl-3 col-lg-3 col-md-3 align-self-center location-mail p-md-0">
                      <?php if(get_theme_mod('courier_services_email_address_icon') != '' || get_theme_mod('courier_services_email_address') != ''){ ?>
                        <i class="<?php echo esc_attr(get_theme_mod('courier_services_email_address_icon','me-2 fa-solid fa-envelope')); ?>"></i><a class="location-mail" href="mailto:<?php echo esc_attr(get_theme_mod('courier_services_email_address',''));?>"><?php echo esc_html(get_theme_mod('courier_services_email_address',''));?></a>
                      <?php } ?>
                    </div>
                    <div class="col-xl-3 col-lg-3 col-md-3 align-self-center location p-md-0">
                      <?php if(get_theme_mod('courier_services_topbar_time_icon') != '' || get_theme_mod('courier_services_topbar_time_text') != ''){ ?>
                        <p class="topbar-text mb-0"> <i class="<?php echo esc_attr(get_theme_mod('courier_services_topbar_time_icon','me-2 fa-solid fa-clock')); ?>"></i><?php echo esc_html(get_theme_mod('courier_services_topbar_time_text')) ?></p>
                      <?php }?>
                    </div>
                    <div class="col-xl-3 col-lg-3 col-md-3 align-self-center text-xl-end text-center p-md-0">
                      <div class="topbar-social-icon">
                        <?php if (is_active_sidebar('topbar-social-icon')) : ?>
                          <?php dynamic_sidebar('topbar-social-icon'); ?>
                        <?php else : ?>
                          <!-- Default Social Icons Widgets -->
                            <div class="widget">
                                <ul class="custom-social-icons" >
                                  <li><a href="https://facebook.com" target="_blank"><i class="fab fa-facebook"></i></a></li> 
                                  <li><a href="https://twitter.com" target="_blank"><i class="fab fa-twitter"></i></a></li> 
                                  <li><a href="https://instagram.com" target="_blank"><i class="fab fa-instagram"></i></a></li> 
                                  <li><a href="https://whatsapp.com" target="_blank"><i class="fab fa-whatsapp"></i></a></li> 
                     
                                </ul>
                            </div>
                        <?php endif; ?>   
                      </div>
                    </div>
                  </div>
                </div>
              <?php }?>
            </div>
            <div class="col-xl-12 align-self-center text-xl-center text-center col-topbar">
              <div class="row">
                <div class="col-xl-10 col-lg-10 col-6 align-self-center">
                  <?php get_template_part('template-parts/header/navigation'); ?>
                </div>
                <div class="col-xl-2 col-lg-2 col-6 align-self-center text-xl-end text-start p-0">
                  <?php if ( get_theme_mod('courier_services_get_a_quote_button_text') != '' || get_theme_mod('courier_services_get_a_quote_btn_link') != '' ) {?>
                    <div class ="read-more">
                      <a href="<?php echo esc_url(get_theme_mod('courier_services_get_a_quote_btn_link',false));?>"><?php echo esc_html(get_theme_mod('courier_services_get_a_quote_button_text'));?><span class="screen-reader-text"><?php esc_html_e( 'Get A Quote','courier-services');?></span>
                      </a>
                    </div>
                  <?php }?>
                </div>
              </div>
            </div>
          </div>
      </div>
    </div>
  </div>
</div>