<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div class="content-ts">
 *
 * @package advance-fitness-gym
 */

?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
  <meta charset="<?php bloginfo( 'charset' ); ?>">
  <meta name="viewport" content="width=device-width">
  <?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
  <?php if ( function_exists( 'wp_body_open' ) ) {
    wp_body_open();
  } else {
    do_action( 'wp_body_open' );
  } ?>
  <header role="banner">
      <!-- preloader -->
    <?php if(get_theme_mod('advance_fitness_gym_preloader_option',false)!= '' || get_theme_mod('advance_fitness_gym_responsive_preloader', false) != ''){ ?>
      <?php if(get_theme_mod('advance_fitness_gym_preloader_type_options', 'Preloader 1')  == 'Preloader 1') {?>
        <div id="loader-wrapper" class="w-100 h-100">
          <div id="loader" class="rounded-circle"></div>
          <div class="loader-section section-left"></div>
          <div class="loader-section section-right"></div>
        </div>
      <?php } else if(get_theme_mod('advance_fitness_gym_preloader_type_options', 'Preloader 2') ==  'Preloader 2') {?>
        <div id="loader-wrapper" class="w-100 h-100">
          <div class="loader">
            <div></div>
            <div></div>
            <div></div>
          </div>
        </div>
      <?php }?>
    <?php }?>
  <!-- preloader end -->

    <a class="screen-reader-text skip-link" href="#maincontent"><?php esc_html_e( 'Skip to content', 'advance-fitness-gym' ); ?></a>
    <div id="header"> 
      <?php if( get_theme_mod('advance_fitness_gym_display_topbar', true) != ''){ ?>
        <div class="top_headbar">
          <div class="container">  
            <div class="row">
              <div class="top-contact col-lg-6 col-md-8 p-0">
                <span class="contact p-2">
                  <?php if( get_theme_mod( 'advance_fitness_gym_contact','' ) != '') { ?>
                    <a href="tel:<?php echo esc_attr( get_theme_mod('advance_fitness_gym_contact','' )); ?>"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_phone_icon','fa fa-phone')); ?> me-2" aria-hidden="true"></i><?php echo esc_html( get_theme_mod('advance_fitness_gym_contact','' )); ?><span class="screen-reader-text"><i class="fa fa-phone" aria-hidden="true"></i><?php echo esc_html( get_theme_mod('advance_fitness_gym_contact','' )); ?></span></a>
                 <?php } ?>
                </span>
                <span class="mail">
                  <?php if( get_theme_mod( 'advance_fitness_gym_email','' ) != '') { ?>
                    <a href="mailto:<?php echo esc_attr( get_theme_mod('advance_fitness_gym_email','') ); ?>"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_email_icon','fa fa-envelope')); ?> me-2" aria-hidden="true"></i><?php echo esc_html( get_theme_mod('advance_fitness_gym_email','') ); ?><span class="screen-reader-text"><i class="fa fa-envelope" aria-hidden="true"></i><?php echo esc_html( get_theme_mod('advance_fitness_gym_email','') ); ?></span></a>
                  <?php } ?>
                </span>
              </div>
              <div class="col-lg-6 col-md-4 socialbox text-end">
                <?php if( get_theme_mod( 'advance_fitness_gym_cont_facebook' ) != '') { ?>
                  <a target="_blank" href="<?php echo esc_url( get_theme_mod( 'advance_fitness_gym_cont_facebook','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_facebook_icon','fab fa-facebook-f')); ?> p-2" aria-hidden="true"></i><span class="screen-reader-text"><?php esc_html_e( 'Facebook','advance-fitness-gym' );?></span></a>
                <?php } ?>
                <?php if( get_theme_mod( 'advance_fitness_gym_cont_twitter' ) != '') { ?>
                  <a target="_blank" href="<?php echo esc_url( get_theme_mod( 'advance_fitness_gym_cont_twitter','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_twitter_icon','fab fa-twitter')); ?> p-2" aria-hidden="true"></i><span class="screen-reader-text"><?php esc_html_e( 'Twitter','advance-fitness-gym' );?></span></a>
                <?php } ?>
                <?php if( get_theme_mod( 'advance_fitness_gym_instagram') != '') { ?>
                  <a target="_blank" href="<?php echo esc_url( get_theme_mod( 'advance_fitness_gym_instagram','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_instagram_icon','fab fa-instagram')); ?> p-2"></i><span class="screen-reader-text"><?php esc_html_e( 'Instagram','advance-fitness-gym' );?></span></a>
                <?php } ?>
                <?php if( get_theme_mod( 'advance_fitness_gym_linkedin') != '') { ?>
                  <a target="_blank" href="<?php echo esc_url( get_theme_mod( 'advance_fitness_gym_linkedin','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_linkedin_icon','fab fa-linkedin-in')); ?> p-2"></i><span class="screen-reader-text"><?php esc_html_e( 'Linkdin','advance-fitness-gym' );?></span></a>
                <?php } ?>
              </div>
              <div class="clearfix"></div>  
            </div>
          </div>
        </div>
      <?php } ?>
      <div class="middle-header <?php if( get_theme_mod( 'advance_fitness_gym_sticky_header', false) != '' || get_theme_mod( 'advance_fitness_gym_responsive_sticky_header', false) != '') { ?> sticky-header"<?php } else { ?>close-sticky <?php } ?>">
        <div class="container">
          <div class="row">
            <div class="logo py-2 col-lg-3 col-md-9 col-9 align-self-center">
              <?php if ( has_custom_logo() ) : ?>
                <div class="site-logo"><?php the_custom_logo(); ?></div>
                <?php endif; ?>
                <?php $blog_info = get_bloginfo( 'name' ); ?>
                <?php if ( ! empty( $blog_info ) ) : ?>
                  <?php if( get_theme_mod('advance_fitness_gym_site_title',true) != ''){ ?>
                    <?php if ( is_front_page() && is_home() ) : ?>
                      <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" class="text-uppercase"><?php bloginfo( 'name' ); ?></a></h1>
                    <?php else : ?>
                      <p class="site-title mb-0"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home" class="text-uppercase"><?php bloginfo( 'name' ); ?></a></p>
                    <?php endif; ?>
                  <?php }?>
                <?php endif; ?>
                <?php
                $description = get_bloginfo( 'description', 'display' );
                if ( $description || is_customize_preview() ) :
                  ?>
                  <?php if( get_theme_mod('advance_fitness_gym_tagline',false) != ''){ ?>
                    <p class="site-description mb-0">
                      <?php echo esc_html($description); ?>
                    </p>
                  <?php }?>
              <?php endif; ?>
            </div>
            <div class="col-lg-9 col-md-3 col-3 align-self-center">
              <div class="main-menu align-self-center">
                <div class="toggle-menu responsive-menu text-end">
                  <button role="tab" class="mobiletoggle"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_open_menu_icon','fas fa-bars')); ?> p-2 my-2"></i><span class="screen-reader-text"><?php esc_html_e('Open Menu','advance-fitness-gym'); ?></span></button>
                </div>
                <div id="menu-sidebar" class="nav sidebar">
                  <nav id="primary-site-navigation" class="primary-navigation" role="navigation" aria-label="<?php esc_attr_e( 'Top Menu', 'advance-fitness-gym' ); ?>">
                    <?php 
                      wp_nav_menu( array( 
                        'theme_location' => 'primary',
                        'container_class' => 'main-menu-navigation clearfix' ,
                        'menu_class' => 'main-menu-navigation clearfix',
                          'items_wrap' => '<ul id="%1$s" class="%2$s mobile_nav text-lg-start ps-lg-0">%3$s</ul>',
                          'fallback_cb' => 'wp_page_menu',
                      ) );
                    ?>
                    <div id="contact-info">
                      <div class="contact">
                        <?php if( get_theme_mod( 'advance_fitness_gym_contact','' ) != '') { ?>
                          <a href="tel:<?php echo esc_attr( get_theme_mod('advance_fitness_gym_contact','' )); ?>"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_phone_icon','fa fa-phone')); ?>" aria-hidden="true"></i><?php echo esc_html( get_theme_mod('advance_fitness_gym_contact','' )); ?><span class="screen-reader-text"><i class="fa fa-phone" aria-hidden="true"></i><?php echo esc_html( get_theme_mod('advance_fitness_gym_contact','' )); ?></span></a>
                        <?php } ?>
                      </div>
                      <div class="mail">
                        <?php if( get_theme_mod( 'advance_fitness_gym_email','' ) != '') { ?>
                          <a href="mailto:<?php echo esc_attr( get_theme_mod('advance_fitness_gym_email','') ); ?>" class="text-lowercase"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_email_icon','fa fa-envelope')); ?>" aria-hidden="true"></i><?php echo esc_html( get_theme_mod('advance_fitness_gym_email','') ); ?><span class="screen-reader-text"><i class="fa fa-envelope" aria-hidden="true"></i><?php echo esc_html( get_theme_mod('advance_fitness_gym_email','') ); ?></span></a>
                        <?php } ?>
                      </div>
                      <?php if(get_theme_mod('advance_fitness_gym_mobile_search_option',true) != ''){ ?>
                        <?php get_search_form();?>
                      <?php }?>
                      <div class="socialbox text-center my-2">
                        <?php if( get_theme_mod( 'advance_fitness_gym_cont_facebook' ) != '') { ?>
                          <a target="_blank" href="<?php echo esc_url( get_theme_mod( 'advance_fitness_gym_cont_facebook','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_facebook_icon','fab fa-facebook-f')); ?> p-2" aria-hidden="true"></i><span class="screen-reader-text"><?php esc_html_e( 'Facebook','advance-fitness-gym' );?></span></a>
                        <?php } ?>
                        <?php if( get_theme_mod( 'advance_fitness_gym_cont_twitter' ) != '') { ?>
                          <a target="_blank" href="<?php echo esc_url( get_theme_mod( 'advance_fitness_gym_cont_twitter','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_twitter_icon','fab fa-twitter')); ?> p-2" aria-hidden="true"></i><span class="screen-reader-text"><?php esc_html_e( 'Twitter','advance-fitness-gym' );?></span></a>
                        <?php } ?>
                        <?php if( get_theme_mod( 'advance_fitness_gym_instagram') != '') { ?>
                          <a target="_blank" href="<?php echo esc_url( get_theme_mod( 'advance_fitness_gym_instagram','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_instagram_icon','fab fa-instagram')); ?> p-2"></i><span class="screen-reader-text"><?php esc_html_e( 'Instagram','advance-fitness-gym' );?></span></a>
                        <?php } ?>
                        <?php if( get_theme_mod( 'advance_fitness_gym_linkedin') != '') { ?>
                          <a target="_blank" href="<?php echo esc_url( get_theme_mod( 'advance_fitness_gym_linkedin','' ) ); ?>"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_linkedin_icon','fab fa-linkedin-in')); ?> p-2"></i><span class="screen-reader-text"><?php esc_html_e( 'Linkdin','advance-fitness-gym' );?></span></a>
                        <?php } ?>
                      </div>
                    </div>
                    <a href="javascript:void(0)" class="closebtn responsive-menu"><i class="<?php echo esc_attr(get_theme_mod('advance_fitness_gym_close_close_menu_icon','far fa-times-circle')); ?>"></i><span class="screen-reader-text"><?php esc_html_e('Close Menu','advance-fitness-gym'); ?></span></a>
                  </nav>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </header>