<?php
/**
 * The header for our theme
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Yoga Center
 */
?>

<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>

<meta http-equiv="Content-Type" content="<?php echo esc_attr(get_bloginfo('html_type')); ?>; charset=<?php echo esc_attr(get_bloginfo('charset')); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.2, user-scalable=yes" />

<?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('yoga_center_preloader_hide', false ) == true ){ 

	$yoga_center_type = get_theme_mod('yoga_center_preloader_type','diamond');
?>
<div class="frame">
	<div class="loader preloader-types">

		<?php if($yoga_center_type == 'diamond'){ ?>

			<div class="preloader">
				<div class="diamond">
					<span></span>
					<span></span>
					<span></span>
				</div>
			</div>

		<?php } elseif($yoga_center_type == 'orbit'){ ?>

			<div class="orbit-loader">
				<div class="orbit-center"></div>
				<div class="orbit-ring">
					<span></span>
					<span></span>
					<span></span>
				</div>
			</div>

		<?php } elseif($yoga_center_type == 'liquid'){ ?>

			<div class="liquid-loader">
				<div class="liquid-blob"></div>
			</div>

		<?php } ?>

	</div>
</div>
<?php } ?>

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

<header id="site-navigation" class="header py-1">
	<div class="top-header">
		<div class="container">
			<div class="row py-2">
				<div class="col-lg-5 col-md-5 col-sm-12 col-12 advertisment-col text-md-start text-center">
					<?php if ( get_theme_mod('yoga_center_header_advertisement_text') ) : ?>
						<p class="mb-0 adver-text"><i class="fa-solid fa-volume-high me-2"></i><?php echo esc_html( get_theme_mod('yoga_center_header_advertisement_text' ) ); ?></p>
					<?php endif; ?>
				</div>
				<div class="offset-lg-2 col-lg-5 col-md-7 col-sm-12 col-12 align-self-center d-flex justify-content-between info-col">
					<?php if ( get_theme_mod('yoga_center_header_phone_number') ) : ?>
						<a class="me-2 adver-text" href="tel:<?php echo esc_attr( get_theme_mod('yoga_center_header_phone_number')); ?>"><span class="phone-text" ><i class="fas fa-phone me-2"></i><?php echo esc_html( get_theme_mod('yoga_center_header_phone_number' ) ); ?></span></a>
					<?php endif; ?>
					<?php if ( get_theme_mod('yoga_center_header_email') ) : ?>
						<a class="me-2 adver-text" href="mailto:<?php echo esc_url( get_theme_mod('yoga_center_header_email' ) ); ?>"><span class="email-text"><i class="fa-solid fa-envelope me-2"></i><?php echo esc_html( get_theme_mod('yoga_center_header_email' ) ); ?></span></a>
					<?php endif; ?>
					<?php if ( get_theme_mod('yoga_center_header_location_text') || get_theme_mod('yoga_center_header_location_link') ) : ?>
						<a class="me-2 adver-text" target="_blank" href="<?php echo esc_url( get_theme_mod('yoga_center_header_location_link' ) ); ?>"><span class="location-text"><i class="fa-solid fa-location-dot me-2"></i><?php echo esc_html( get_theme_mod('yoga_center_header_location_text' )); ?></span></a>
					<?php endif; ?>
				</div>
			</div>
		</div>
	</div>
	<div id="bottom-header" >
		<div class="container">
			<div class="row menu-row-col"> 
				<div class="col-lg-5 col-md-5 col-sm-4 col-7 align-self-center menu-first-col">
					<div class="menu-first d-flex justify-content-between align-items-center">
						<?php if ( get_theme_mod('yoga_center_search_enable_setting', true)) : ?>
							<div class="search-icon">
								<div class="search-cont">
									<button type="button" class="search-cont-button"><i class="fas fa-search"></i></button>
								</div>
								<div class="outer-search">
									<div class="inner-search">
										<?php get_search_form(); ?>
									</div>
									<button type="button" class="closepop search-cont-button-close" ><i class="fa-solid fa-xmark"></i></button>
								</div>
							</div>
						<?php endif; ?>
						<div class="responsive-menu text-center">
							<button class="menu-toggle my-2" aria-controls="top-menu" aria-expanded="false" type="button">
								<span aria-hidden="true"><i class="fa-solid fa-bars"></i></span>
							</button>
							<nav id="main-menu" class="close-panal">
								<?php
									wp_nav_menu( array(
										'theme_location' => 'responsive-menu',
										'container' => false
									));
								?>
								<button class="close-menu my-2 p-2" type="button">
									<span aria-hidden="true"><i class="fa fa-times"></i></span>
								</button>
							</nav>
						</div>
						<div class="left-menu">
							<nav id="main-menu" class="close-panal">
								<?php
									wp_nav_menu( array(
										'theme_location' => 'left-menu',
										'container' => 'false'
									));
								?>
							</nav>
						</div>
					</div>
				</div>
				<div class="col-lg-2 col-md-2 col-sm-6 col-12 align-self-center text-center menu-logo-col">
					<div class="logo text-center">
						<div class="logo-image text-center">
							<?php the_custom_logo(); ?>
						</div>
						<div class="logo-content text-center">
							<?php
								if ( get_theme_mod('yoga_center_display_header_title', true) == true ) :
									echo '<a href="' . esc_url(home_url('/')) . '" title="' . esc_attr(get_bloginfo('name')) . '">';
									echo esc_attr(get_bloginfo('name'));
									echo '</a>';
								endif;
								if ( get_theme_mod('yoga_center_display_header_text', false) == true ) :
									echo '<span>'. esc_attr(get_bloginfo('description')) . '</span>';
								endif;
							?>
						</div>
					</div>
				</div>
				<div class="col-lg-5 col-md-5 col-sm-2 col-5 align-self-center text-end menu-second-col">
					<div class="menu-second d-flex justify-content-between align-items-center">
						<div class="right-menu">
							<nav id="main-menu" class="close-panal">
								<?php
									wp_nav_menu( array(
										'theme_location' => 'right-menu',
										'container' => false
									));
								?>
							</nav>
						</div>
						<?php if ( get_theme_mod('yoga_center_header_login_button') ) : ?>
							<a class="login-text me-2" href="<?php echo esc_url( get_theme_mod('yoga_center_header_login_button')); ?>"><span class="login-text-para"><i class="fa-solid fa-user"></i></span></a>
						<?php endif; ?>
					</div>
				</div>
			</div>
		</div>
	</div>
</header>