<?php
/**
 * The template part for Top Header
 *
 * @package Immigration Consulting 
 * @subpackage immigration-consulting
 * @since immigration-consulting 1.0
 */
?>

<div class="main-header <?php if( get_theme_mod( 'immigration_consulting_sticky_header', false) == 1 || get_theme_mod( 'immigration_consulting_stickyheader_hide_show', false) == 1) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <?php if (get_theme_mod('immigration_consulting_top_bar_hide_show', true)){ ?>
    <div class="topbar py-2 text-center">
      <div class="container">
        <div class="row">
          <div class="col-xl-8 col-lg-8 col-md-8 col-12 align-self-center text-start">
            <?php if (get_theme_mod('immigration_consulting_topbar_text') != '') { ?>
              <p class="topbar-text text-capitalize mb-0"><?php echo esc_html(get_theme_mod('immigration_consulting_topbar_text')); ?></p>
            <?php } ?>
          </div>
          <div class="col-xl-4 col-lg-4 col-md-4 col-12 align-self-center topbar-social-icon">
            <?php if ( is_active_sidebar( 'social-widget-sidemenu' ) ) : ?>                
              <?php dynamic_sidebar('social-widget-sidemenu'); ?>
            <?php else : ?>
              <div class="widget">
                <div class="custom-social-icons" >
                  <a href="https://facebook.com" target="_blank"><i class="fa-brands fa-facebook-f"></i></a>
                  <a href="https://twitter.com" target="_blank"><i class="fa-brands fa-x-twitter"></i></a>
                  <a href="https://instagram.com" target="_blank"><i class="fab fa-instagram"></i></a>               
                </div>
              </div>
            <?php endif; ?>
          </div>
        </div>
      </div>
    </div>
  <?php }?>
  <div class="main-topbar py-1">
    <div class="container">
      <div class="row">
        <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-4 col-sm-4 col-12 align-self-center">
          <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 $immigration_consulting_blog_info = get_bloginfo( 'name' ); ?>
              <?php if ( ! empty( $immigration_consulting_blog_info ) ) : ?>
                <?php if ( is_front_page() && is_home() ) : ?>
                  <?php if( get_theme_mod('immigration_consulting_logo_title_hide_show',true) == 1){ ?>
                    <p class="site-title mb-0 text-start"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                  <?php } ?>
                <?php else : ?>
                  <?php if( get_theme_mod('immigration_consulting_logo_title_hide_show',true) == 1){ ?>
                    <p class="site-title mb-0 text-start"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                  <?php } ?>
                <?php endif; ?>
              <?php endif; ?>
              <?php
                $immigration_consulting_description = get_bloginfo( 'description', 'display' );
                if ( $immigration_consulting_description || is_customize_preview() ) :
              ?>
              <?php if( get_theme_mod('immigration_consulting_tagline_hide_show',false) == 1){ ?>
                <p class="site-description mb-0 text-start">
                  <?php echo esc_html($immigration_consulting_description); ?>
                </p>
              <?php } ?>
            <?php endif; ?>
          </div>
        </div>
        <div class="col-xxl-8 col-xl-8 col-lg-8 col-md-3 col-sm-3 col-5 align-items-center header-sec-top d-flex justify-content-between">
          <?php get_template_part('template-parts/header/navigation'); ?>
          <?php if (get_theme_mod('immigration_consulting_search_hide_show', true)){ ?>
            <div class="search-box">
              <span><a href="#"><i class='<?php echo esc_attr(get_theme_mod('immigration_consulting_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('immigration_consulting_search_close_icon','fa fa-window-close')); ?>"></i></a></div>
              <div class="serach_inner">
                <?php get_search_form(); ?>
              </div>
            </div>
          <?php } ?>
        </div>
        <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-5 col-sm-5 col-7 align-items-center d-flex justify-content-end top-icons gap-3">
          <?php if ( get_theme_mod('immigration_consulting_topbar_button_url') != '' || get_theme_mod('immigration_consulting_topbar_button_label') != '' ) {?>
            <div class ="topbar-btn">
              <a href="<?php echo esc_url(get_theme_mod('immigration_consulting_topbar_button_url'));?>" class="text-capitalize"><?php echo esc_html(get_theme_mod('immigration_consulting_topbar_button_label'));?>
              </a>
            </div>
          <?php }?>
        </div>
      </div>
    </div>
  </div>
</div>