<?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 
		$topheader_phonetext = esc_attr(get_theme_mod('topheader_phonetext','1-222-2333-33'));
		$topheader_btntext = esc_attr(get_theme_mod('topheader_btntext','Contact Us'));
		$topheader_btnlink = esc_attr(get_theme_mod('topheader_btnlink','#'));

		$topheader_fblink = esc_attr(get_theme_mod('topheader_fblink','#'));
		$topheader_twitterlink = esc_attr(get_theme_mod('topheader_twitterlink','#'));
		$topheader_instagramlink = esc_attr(get_theme_mod('topheader_instagramlink','#'));
		$topheader_linkedinlink = esc_attr(get_theme_mod('topheader_linkedinlink','#'));

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

<div class="main">
    <header class="main-header site-header <?php echo esc_attr(carpenterservice_sticky_menu()); ?>">
		<div class="<?php if(esc_attr(get_theme_mod('header_section_width','Box Width')) == 'Full Width'){ ?>container-fluid pd-0 <?php } elseif(esc_attr(get_theme_mod('header_section_width','Box Width')) == 'Box Width'){ ?> container <?php }?>">
			<div class="header-section">
				<div class="headfer-content row m-rl">
					<div class="col-lg-3 col-md-3 col-sm-12 pd-0">
						<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>	
							<?php 						
								}
							?>
						</div>
						<div class="box-info">
							<?php
								$carpenterservice_site_desc = get_bloginfo( 'description');
								if ($carpenterservice_site_desc) : ?>
									<p class="site-description"><?php echo esc_html($carpenterservice_site_desc); ?></p>
							<?php endif; ?>
						</div>
					</div>
					<div class="col-lg-9 col-md-9 col-sm-12 pd-0">
						<div class="tophead row">
							<div class="tophead-brd"></div>
							<div class="col-lg-10">
								<div class="add-ph row">
									<div class="col-lg-9  col-md-12 col-sm-12 address">
									</div>


									<?php if($topheader_phonetext){ ?>
									<div class="col-lg-3 col-md-12 col-sm-12 phone">
										<a class="h-phn" href="telto:<?php echo $topheader_phonetext;?>">
											<i class="fa fa-phone" aria-hidden="true"></i>
											<span><?php echo $topheader_phonetext;?></span>
										</a>
									</div>
									<?php }?>  

									
								</div>
							</div>
							<div class="col-lg-2  col-md-12 col-sm-12">								
								<div class="hbtn">
									<div class="contact">
										<a class="btn" href="<?php echo apply_filters('carpenterservice_header', $topheader_btnlink); ?>"><?php echo apply_filters('carpenterservice_header', $topheader_btntext); ?></a>
									</div>
								</div>
							</div>
						</div>
						<div class="bottomhead row">
							<div class="col-lg-9 col-md-12 col-sm-12">
								<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','carpenter-service'); ?>"> 
											<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','carpenter-service'); ?>"> 
												<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 class="hbtn1">
											<div class="contact">
												<a class="btn" href="<?php echo apply_filters('carpenterservice_header', $topheader_btnlink); ?>"><?php echo apply_filters('carpenterservice_header', $topheader_btntext); ?></a>
											</div>
										</div>
										</div>

									</div>
									</nav>
								</div>
							</div>
							<div class="col-lg-3 col-md-12 col-sm-12 pd-0">
								<div class="social-icons">		
									<?php if(!$topheader_fblink == "") { ?>
										<a title="<?php esc_attr('facebook', 'carpenter-service'); ?>" target="_blank" href="<?php echo apply_filters('carpenterservice_header', $topheader_fblink); ?>"><i class="fa fa-facebook"></i></a> 
									<?php } ?>		
										
									<?php if(!$topheader_twitterlink == "") { ?>
										<a title="<?php esc_attr('twitter', 'carpenter-service'); ?>" target="_blank" href="<?php echo apply_filters('carpenterservice_header', $topheader_twitterlink); ?>"><i class="fa fa-twitter"></i></a>
									<?php } ?>							

									<?php if(!$topheader_instagramlink == "") { ?>
										<a title="<?php esc_attr('instagram', 'carpenter-service'); ?>" target="_blank" href="<?php echo apply_filters('carpenterservice_header', $topheader_instagramlink); ?>"><i class="fa fa-instagram"></i></a>
									<?php } ?>							

									<?php if(!$topheader_linkedinlink == "") { ?>
										<a title="<?php esc_attr('linkedin', 'carpenter-service'); ?>" target="_blank" href="<?php echo apply_filters('carpenterservice_header', $topheader_linkedinlink); ?>"><i class="fa fa-linkedin-square"></i></a>
									<?php } ?>							
								</div>
							</div>
						</div>	
						<div class="topheadbt-brd"></div>
					</div>
				</div>
			</div>
		</div>

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

