<?php if ( get_header_image() ) : ?>
	<a href="<?php echo esc_url( home_url( '/' ) ); ?>" id="custom-header" rel="home">
		<img src="<?php esc_url(header_image()); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php echo esc_attr(get_bloginfo( 'title' )); ?>">
	</a>	
<?php endif;  ?>

<!-- Header Area -->

	<?php 

		// header
		$tophead_mail = esc_attr(get_theme_mod('tophead_mail','demo@example.com'));
		$tophead_phone = esc_attr(get_theme_mod('tophead_phone','+000 0000 000'));
		$tophead_address = esc_attr(get_theme_mod('tophead_address','3261 Anmoore Lorem Ipsum , NY 11230'));

		$stickyheader = esc_attr(automotivemechanic_sticky_menu());
	?>

<div class="main">
    <header class="main-header site-header <?php echo esc_attr(automotivemechanic_sticky_menu()); ?>">	
		<div class="header-section">
			<div class="tophead ">
				<div class="container">					
					<div class=" row mr-0">
						<div class="col-lg-12 col-md-12 col-sm-12 col-12 emphbx">
							<li>
								<a class="tooltip-text" href="mailto:<?php echo apply_filters('automotivemechanic_header', $tophead_mail); ?>">
									<i class="fa-regular fa-envelope"></i>
									<span><?php echo apply_filters('automotivemechanic_header', $tophead_mail); ?></span>
								</a>
							</li>
							<li>
								<a class="tooltip-text" href="tel:<?php echo apply_filters('automotivemechanic_header', $tophead_phone); ?>">
									<i class="fa-solid fa-phone-volume"></i>
									<span><?php echo apply_filters('automotivemechanic_header', $tophead_phone); ?></span>
								</a>
							</li>
							<li>
								<p> <i class="fa-solid fa-location-dot"></i> <span><?php echo apply_filters('automotivemechanic_header', $tophead_address); ?></span></p>
							</li>
						</div>
					</div>
				</div>
			</div>
			<div class="container">
				<div class="bthead ">
					<div class="btmmhead ">
						<div class=" row mr-0">
							<div class="col-lg-3 col-md-3 col-sm-6 col-7">
								<div class="logobx">
									<div class="site-logo">
										<?php
										if(has_custom_logo())
											{	
												the_custom_logo();
											}
											else { 
											?>
											<a class="site-title" href="<?php echo esc_url( home_url( '/' ) ); ?>">
												
												<?php 
													echo esc_html(bloginfo('name'));
												?>
											</a>	

											<div class="box-info">
												<?php
													$automotivemechanic_site_desc = get_bloginfo( 'description');
													if ($automotivemechanic_site_desc) : ?>
														<p class="site-description"><?php echo esc_html($automotivemechanic_site_desc); ?></p>
												<?php endif; ?>
											</div>
										<?php 						
											}
										?>
									</div>
								</div>
							</div>
							<div class="col-lg-7 col-md-12 col-sm-2 col-12 m-box">
								<div class="menus">
									<nav class="navbar navbar-expand-lg navbaroffcanvase">
										<div class="navbar-menubar">
											<!-- Small Divice Menu-->
											<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-menu"  aria-label="<?php echo esc_attr_e('Toggle navigation','automotive-mechanic'); ?>"> 
												<i class="fa fa-bars"></i>
											</button>
											<div class="collapse navbar-collapse navbar-menu">
												<button class="navbar-toggler navbar-toggler-close" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-menu"  aria-label="<?php echo esc_attr_e('Toggle navigation','automotive-mechanic'); ?>"> 
													<i class="fa fa-times"></i>
												</button> 
												<?php 
													wp_nav_menu( 
														array(  
															'theme_location' => 'primary_menu',
															'container'  => '',
															'container_id'    => '',
															'menu_class' => 'navbar-nav main-nav',
															'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
															'walker' => new WP_Bootstrap_Navwalker()
															) 
														);
												?>
											</div>
										</div>
									</nav>
								</div>
								<div class="clearfix"></div>
							</div>
							<div class="col-lg-2 col-md-6 col-sm-4 col-3 fm-box">
							<?php if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { ?>
								<div class="wcbox">
									<div class="row">
										<div class="col-6">
											<div class="top-form">
												<button type="button" id="formButton"></button>		
												<form id="form1">					
													<?php get_search_form(); ?>
												</form>
											</div>
										</div>
										<div class="col-6">
											<a class="acc" href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>">
												<i class="fa-regular fa-user"></i>
											</a>
										</div>
									</div>
								</div>
							<?php } ?>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
    </header>
	<div class="clearfix"></div>
</div>
