<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section and everything up till <div class="container">
 *
 * @package Live Artist
 */
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>

<?php if ( function_exists( 'wp_body_open' ) ) {
  wp_body_open();
} else {
  do_action( 'wp_body_open' );
} ?>

<?php if ( get_theme_mod('live_artist_preloader', false) != "") { ?>
  <div id="preloader">
    <div id="status">&nbsp;</div>
  </div>
<?php }?>

<a class="screen-reader-text skip-link" href="#content"><?php esc_html_e( 'Skip to content', 'live-artist' ); ?></a>

<div id="pageholder" <?php if( get_theme_mod( 'live_artist_box_layout', false) != "" ) { echo 'class="boxlayout"'; } ?>>

<div class="mainhead <?php if( get_theme_mod( 'live_artist_sticky_header', false) == 1 ) { ?> header-sticky"<?php } else { ?>close-sticky <?php } ?>">
  <div class="main-header">
    <div class="container">
      <div class="header-sec">
        <div class="row">
          <div class="col-xxl-2 col-xl-2 col-lg-2 col-md-5 col-sm-12 col-12 align-self-center">
            <div class="live-artist-logo">
              <?php if (get_theme_mod('live_artist_logo_enable', true)) { ?>
                <?php live_artist_the_custom_logo(); ?>
              <?php } ?>
              <div class="site-branding-text">
                <?php if (get_theme_mod('live_artist_title_enable', false)) { ?>
                  <?php if (is_front_page() && is_home()) : ?>
                    <h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a></h1>
                  <?php else : ?>
                    <p class="site-title"><a href="<?php echo esc_url(home_url('/')); ?>"><?php bloginfo('name'); ?></a></p>
                  <?php endif; ?>
                <?php } ?>
                <?php $live_artist_description = get_bloginfo('description', 'display');
                if ($live_artist_description || is_customize_preview()) : ?>
                  <?php if (get_theme_mod('live_artist_tagline_enable', false)) { ?>
                    <span class="site-description"><?php echo esc_html($live_artist_description); ?></span>
                  <?php } ?>
                <?php endif; ?>
              </div>
            </div>
          </div>
          <div class="col-xxl-7 col-xl-7 col-lg-7 col-md-2 col-sm-5 col-12 align-self-center">
            <div class="toggle-nav text-center">
              <?php if (has_nav_menu('primary')) { ?>
                <button role="tab"><?php esc_html_e('Menu', 'live-artist'); ?></button>
              <?php } ?>
            </div>
            <div id="mySidenav" class="nav sidenav">
              <nav id="site-navigation" class="main-nav" role="navigation" aria-label="<?php esc_attr_e('Top Menu', 'live-artist'); ?>">
                <ul class="mobile_nav">
                  <?php wp_nav_menu(array(
                    'theme_location' => 'primary',
                    'container_class' => 'main-menu',
                    'items_wrap' => '%3$s',
                    'fallback_cb' => 'wp_page_menu',
                  )); ?>
                </ul>
                <a href="javascript:void(0)" class="close-button"><?php esc_html_e('CLOSE', 'live-artist'); ?></a>
              </nav>
            </div>
          </div>
          <div class="col-xxl-3 col-xl-3 col-lg-3 col-md-5 col-sm-7 col-12 align-items-center d-flex justify-content-end gap-4 top-btn">
            <div class="top-search">
              <div class="main-search">
                <span class="search-box text-center">
                  <button type="button" class="search-open"><i class="fas fa-search"></i></button>
                </span>
              </div>
              <div class="search-outer">
                <div class="serach_inner w-100 h-100">
                  <?php get_search_form(); ?>
                </div>
                <button type="button" class="search-close"><span>X</span></button>
              </div>
            </div>
            <?php if ( get_theme_mod('live_artist_cart_btn_link') != "") { ?>
              <div class="cart-box">
                <a target="_blank" href="<?php echo esc_url(get_theme_mod('live_artist_cart_btn_link')); ?>"><i class="fa-solid fa-cart-shopping"></i></a>
              </div> 
            <?php } ?>
            <?php if ( get_theme_mod('live_artist_header_btn_text') || get_theme_mod('live_artist_header_btn_url')) { ?> 
              <div class="btn-box">
                <a href="<?php echo esc_url(get_theme_mod ('live_artist_header_btn_url','')); ?>" class="text-capitalize"><?php echo esc_html(get_theme_mod ('live_artist_header_btn_text','live-artist')); ?></a>
              </div>
            <?php }?>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>