<?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 Production Industry
 */
?>

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

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

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

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

		<?php } elseif($production_industry_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($production_industry_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', 'production-industry' ); ?></a>

<div class="topheader">
	<div class="container">
		<div class="row">
			<div class="col-lg-7 col-md-6 col-sm-12 text-md-start text-center align-self-center adver-text">
				<?php if ( get_theme_mod('production_industry_header_advertisement_text') ) : ?>
					<p class="mb-0 py-2"><?php echo esc_html( get_theme_mod('production_industry_header_advertisement_text' ) ); ?></p>
				<?php endif; ?>
			</div>
			<div class="col-lg-5 col-md-6 col-sm-12 align-self-center text-center d-flex flex-wrap justify-content-md-end column-gap-5 justify-content-center row-gap-2">
				<?php if ( get_theme_mod('production_industry_header_faq_text') ) : ?>
					<div class="faq-text py-2" ><a href="<?php echo esc_url( get_theme_mod('production_industry_header_faq_url' ) ); ?>"><?php echo esc_html( get_theme_mod('production_industry_header_faq_text' ) ); ?></a></div>
				<?php endif; ?>
				<?php if ( get_theme_mod('production_industry_header_terms_text') ) : ?>
					<div class="terms-text py-2" ><a href="<?php echo esc_url( get_theme_mod('production_industry_header_terms_url' ) ); ?>"><?php echo esc_html( get_theme_mod('production_industry_header_terms_text' ) ); ?></a></div>
				<?php endif; ?>
				<?php $production_industry_settings = get_theme_mod( 'production_industry_social_links_settings' ); ?>
				<div class="social-links  text-end d-flex align-items-center">
					<?php if ( is_array($production_industry_settings) || is_object($production_industry_settings) ){ ?>
						<span class="me-2 py-2"><?php esc_html_e('Follow Us: ','production-industry'); ?></span>
						<?php foreach( $production_industry_settings as $production_industry_setting ) { ?>
							<a href="<?php echo esc_url( $production_industry_setting['link_url'] ); ?>" target="_blank">
								<i class="<?php echo esc_attr( $production_industry_setting['link_text'] ); ?> me-3"></i>
							</a>
						<?php } ?>
					<?php } ?>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="middle-header py-2">
	<div class="container">
		<div class="row">
			<div class="col-lg-5 col-md-3 col-12 align-self-center">
				<div class="logo text-center text-md-start mb-3 mb-md-0">
					<div class="logo-image text-md-start text-center">
						<?php the_custom_logo(); ?>
					</div>
					<div class="logo-content text-md-start text-center">
						<?php
							if ( get_theme_mod('production_industry_display_header_title', true) == true ) :
								echo '<a href="' . esc_url(home_url('/')) . '" title="' . esc_attr(get_bloginfo('name')) . '">';
								echo esc_html( get_bloginfo( 'name' ) );
								echo '</a>';
							endif;
							if ( get_theme_mod('production_industry_display_header_text', false) == true ) :
								echo '<span>' . esc_html( get_bloginfo( 'description' ) ) . '</span>';
							endif;
						?>
					</div>
				</div>
			</div>
			<div class="col-lg-7 col-md-9 col-12 d-flex align-self-center flex-wrap justify-content-md-end column-gap-5 justify-content-center row-gap-3">
				<?php if ( get_theme_mod('production_industry_header_phone_number') || get_theme_mod('production_industry_header_phone_number_text') ) : ?>
					<div class="d-flex flex-column align-items-center middle-content align-items-sm-end">
						<p class="mb-0"><?php echo esc_html( get_theme_mod('production_industry_header_phone_number_text' ) ); ?></p>
						<a href="tel:<?php echo esc_attr( get_theme_mod('production_industry_header_phone_number' ) ); ?>"><h6 class="mb-0"><?php echo esc_html( get_theme_mod('production_industry_header_phone_number' ) ); ?></h6></a>
					</div>
				<?php endif; ?>
				<?php if ( get_theme_mod('production_industry_header_time_text') || get_theme_mod('production_industry_header_time') ) : ?>
					<div class="d-flex flex-column align-items-center middle-content align-items-sm-end">
						<p class="mb-0"><?php echo esc_html( get_theme_mod('production_industry_header_time_text' ) ); ?></p>
						<h6 class="mb-0"><?php echo esc_html( get_theme_mod('production_industry_header_time' ) ); ?></h6>
					</div>
				<?php endif; ?>
				<?php if ( get_theme_mod('production_industry_search_enable', 'on' ) == true ) : ?>
					<div class="search-cont me-2 d-flex">
						<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" >X</button>
					</div>
				<?php endif; ?>
				<div class="toggle-btn  d-flex align-items-center">
					<a class="sidebar-toggle" id="sidebar-pop" href="#"><i class="fas fa-bars"></i></a>
				</div>
			</div>
			<div class="header-sidebar">
				<div class="close-pop"><a href="javascript:void(0);"><i class="fas fa-window-close"></i></a></div>
				<div class="menu-drawer">
					<div class="logo-collapse">
						<div class="logo-sidebar text-start mb-3 mb-md-0">
							<div class="logo-image text-start">
								<?php the_custom_logo(); ?>
							</div>
							<div class="logo-content text-start">
								<?php
									if ( get_theme_mod('production_industry_display_header_title', true) == true ) :
										echo '<a href="' . esc_url(home_url('/')) . '" title="' . esc_attr(get_bloginfo('name')) . '">';
										echo esc_html(get_bloginfo('name'));
										echo '</a>';
									endif;
									if ( get_theme_mod('production_industry_display_header_text', false) == true ) :
										echo '<span>'. esc_html(get_bloginfo('description')) . '</span>';
									endif;
								?>
							</div>
						</div>
					</div>
					<div class="row">
						<?php if ( get_theme_mod('production_industry_sidebar_header_text')) : ?>
							<p><?php echo esc_html( get_theme_mod('production_industry_sidebar_header_text' ) ); ?></p>
						<?php endif; ?>
					</div>
					<div class="row">
						<?php if ( get_theme_mod('production_industry_sidebar_header_location_text')) : ?>
							<p class="topheader-location"><a href="<?php echo esc_url( get_theme_mod('production_industry_sidebar_header_location'));?>" target="_blank"><i class="fas fa-map-marker-alt me-2"></i><?php echo esc_html( get_theme_mod('production_industry_sidebar_header_location_text' ) ); ?></a></p>
						<?php endif; ?>
					</div>
					<div class="row">
						<?php if (get_theme_mod('production_industry_sidebar_header_email_address') ) : ?>
							<p class="topheader-email" ><a href="mailto:<?php echo esc_html( get_theme_mod('production_industry_sidebar_header_email_address' ) ); ?>"><i class="fa-solid fa-envelope-open-text me-2"></i><?php echo esc_html( get_theme_mod('production_industry_sidebar_header_email_address' ) ); ?></a></p>
						<?php endif; ?>
					</div>
					<div class="row">
						<?php if ( get_theme_mod('production_industry_sidebar_header_phone_number') ) : ?>
							<p class="topheader-phone"><a href="tel:<?php echo esc_attr( get_theme_mod('production_industry_sidebar_header_phone_number' ) ); ?>"><i class="fas fa-phone me-2"></i><?php echo esc_html( get_theme_mod('production_industry_sidebar_header_phone_number' ) ); ?></a></p>
						<?php endif; ?>
					</div>
					<div class="row media-div">
						<?php $production_industry_sidebar_settings = get_theme_mod( 'production_industry_sidebar_social_links_settings' ); ?>
						<div class="social-links">
							<?php if ( is_array($production_industry_sidebar_settings) || is_object($production_industry_sidebar_settings) ){ ?>
								<?php foreach( $production_industry_sidebar_settings as $production_industry_sidebar_setting ) { ?>
									<a href="<?php echo esc_url( $production_industry_sidebar_setting['link_url'] ); ?>" target="_blank">
										<i class="<?php echo esc_attr( $production_industry_sidebar_setting['link_text'] ); ?> me-2"></i>
									</a>
								<?php } ?>
							<?php } ?>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<header id="site-navigation" class="header <?php if( get_theme_mod( 'production_industry_sticky_header', false) != false) { ?>sticky-header<?php } else { ?>close-sticky <?php } ?>">
	<div class="container">
		<div class="row">
			<div class="col-lg-8 col-md-9 col-sm-6 col-3 align-self-center px-md-0">
				<button class="menu-toggle py-2 px-3" 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' => 'main-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="col-lg-4 col-md-3 col-sm-6 col-9 align-self-center text-end">
				<?php if ( get_theme_mod('production_industry_header_button_url') || get_theme_mod('production_industry_header_button_text') ) : ?>
					<div class="quote-btn">
						<a href="<?php echo esc_url( get_theme_mod('production_industry_header_button_url' ) ); ?>"><?php echo esc_html( get_theme_mod('production_industry_header_button_text' ) ); ?></a>
					</div>
				<?php endif; ?>
			</div>
		</div>
	</div>
</header>