<?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
		$stickyheader = esc_attr(drivingschoolacademy_sticky_menu());
		$topheader_phone = esc_attr(get_theme_mod('topheader_phone','+012 3456 789'));
		$topheader_email = esc_attr(get_theme_mod('topheader_mail','example@example.com'));
		$topheader_adres = esc_attr(get_theme_mod('topheader_address','23 Main Street, City, State'));

		$facebook = get_theme_mod('topheader_fblink', '#');
		$instagram = get_theme_mod('topheader_instalink', '#');
		$twitter = get_theme_mod('topheader_twitterlink', '#');
		$youtube = get_theme_mod('topheader_youtubelink', '#');

		$topheader_btntext = esc_attr(get_theme_mod('topheader_btntext','Book Now'));
		$topheader_btnlink = esc_attr(get_theme_mod('topheader_btnlink','#'));

	?>

<div class="main">
    <header class="main-header site-header <?php echo esc_attr(drivingschoolacademy_sticky_menu()); ?>">
		<div class="header-section">
			<div class="h-sectionbx">
				<div class="tphead">
					<div class="container">
						<div class="row m-0">
							<div class="delsbx">
								<li>
									<div class="ph">
										<i class="fa fa-phone"></i> 
										<a href="tel:<?php echo $topheader_phone;?>">
												<span class="tooltiptext"><?php echo $topheader_phone;?></span>
										</a>		
									</div>
								</li>
								<li>
									<div class="em">
										<i class="fa fa-envelope"></i> 
										<a href="tel:<?php echo $topheader_email;?>">
												<span class="tooltiptext"><?php echo $topheader_email;?></span>
										</a>		
									</div>
								</li>
								<li>
									<div class="adres">
										<i class="fa fa-map-marker"></i> <p><span class="tooltiptext"><?php echo $topheader_adres;?></span></p>		
									</div>
								</li>

							</div>
							<?php if(!empty($facebook || $instagram || $twitter || $youtube)){ ?>
							<div class="smedibx">
								<div class="s-media">	
									<?php if(!empty($facebook)){ ?>
										<li><a href="<?php echo $facebook ?>" title="Facebook" target="_blank"><i class="fa-brands fa-facebook-f"></i></a></li>
									<?php }?>				

									<?php if(!empty($instagram)){ ?>
										<li><a href="<?php echo $instagram ?>" title="Instagram" target="_blank"><i class="fa-brands fa-instagram"></i></a></li>
									<?php }?>

									<?php if(!empty($twitter)){ ?>
										<li><a href="<?php echo $twitter ?>" title="Twitter" target="_blank"><i class="fa-brands fa-x-twitter"></i></a></li>
									<?php }?>

									<?php if(!empty($youtube)){ ?>
										<li><a href="<?php echo $youtube ?>" title="Youtube" target="_blank"><i class="fa-brands fa-youtube"></i></a></li>
									<?php }?>
									<div class="clearfix"></div>															
								</div>
							</div>
							<?php }?>
						</div>
					</div>
				</div>			
				<div class="container">
					<div class="btmmhead">
						<div class="row mr-0">
							<div class="lbxot ">
								<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
													$drivingschoolacademy_site_desc = get_bloginfo( 'description');
													if ($drivingschoolacademy_site_desc) : ?>
														<p class="site-description"><?php echo esc_html($drivingschoolacademy_site_desc); ?></p>
												<?php endif; ?>
											</div>
										<?php 						
											}
										?>
									</div>
								</div>
							</div>
							<div class="m-mbx">
								
								<div class="bottomhead ">
									<div class=" row mr-0">
										<div class="m-bxinn">
											<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','driving-school-academy'); ?>"> 
														<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','driving-school-academy'); ?>"> 
															<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>
										
										<!-- </?php if ($topheader_phone) { ?> -->
											<div class="bn-btn ">							
												<a href="<?php echo $topheader_btnlink;?>">
													<?php echo $topheader_btntext;?>
												</a>						
											</div>
										<!-- </?php } ?> -->
										
									</div>
									<div class="clearfix"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

    </header>
	<div class="clearfix"></div>

</div>
