<?php
/**
 * The header for our theme
 *
 * @subpackage Sweet Delights Bakery
 * @since 1.0
 * @version 0.1
 */

?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js no-svg">
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>

<?php if ( function_exists( 'wp_body_open' ) ) {
    wp_body_open();
} else {
    do_action( 'wp_body_open' );
}?>

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

<div class="headerbox ">

<div id="header">
	<div class="main-header">
		<div class="tphead">
			<div class="row m-0">
			<div class="person">	
				<div class="person-imgbx">
					<div class="logo text-lg-left text-center">
						<?php if ( has_custom_logo() ) : ?>
							<?php the_custom_logo(); ?>
						<?php endif; ?>
						<?php $blog_info = get_bloginfo( 'name' ); ?>
						<?php if ( ! empty( $blog_info ) ) : ?>
							<?php if ( is_front_page() && is_home() ) : ?>
								<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
							<?php else : ?>
								<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
							<?php endif; ?>
						<?php endif; ?>
						<?php $description = get_bloginfo( 'description', 'display' );
						if ( $description || is_customize_preview() ) : ?>
							<p class="site-description"><?php echo esc_html($description); ?></p>
						<?php endif; ?>
					</div>			
				</div>
			</div>	
			<div class="hshop "> 
			<?php if(function_exists ('wc_get_cart_url')){?>				
				<a href="<?php echo wc_get_cart_url();?>" class="">
					<i class="fa fa-cart-plus"></i>   <div class="hshoptxt">cart</div>
					<div class="count">
						<?php global $woocommerce; ?><?php echo WC()->cart->get_cart_contents_count(); ?>
					</div> 
				</a>
			<?php }?>
			</div>
			<div class="m-headbox">
				<div class="m-head">
					<div class="header-inner section-inner">
						<div class="header-titles-wrapper">
							<button class="toggle nav-toggle mobile-nav-toggle" data-toggle-target=".menu-modal"  data-toggle-body-class="showing-menu-modal" aria-expanded="false" data-set-focus=".close-nav-toggle">
								<span class="toggle-inner">
									<span class="toggle-icon">
										<i class="fas fa-bars"></i>
									</span>
								</span>
							</button><!-- .nav-toggle -->
						</div><!-- .header-titles-wrapper -->

						<div class="header-navigation-wrapper">
							<?php
							if ( has_nav_menu( 'primary' ) || ! has_nav_menu( 'expanded' ) ) {
								?>
								<nav class="primary-menu-wrapper" aria-label="<?php echo esc_attr_x( 'Horizontal', 'menu', 'sweet-delights-bakery' ); ?>">
									<ul class="primary-menu reset-list-style">
										<?php
										if ( has_nav_menu( 'primary' ) ) {

											wp_nav_menu(
												array(
													'container'  => '',
													'items_wrap' => '%3$s',
													'theme_location' => 'primary',
												)
											);

										} elseif ( ! has_nav_menu( 'expanded' ) ) {

											wp_list_pages(
												array(
													'match_menu_classes' => true,
													'show_sub_menu_icons' => true,
													'title_li' => false,
													'walker'   => new Sweet_Delights_Bakery_Walker_Page(),
												)
											);

										}
										?>
									</ul>
								</nav><!-- .primary-menu-wrapper -->
							<?php } ?>
						</div><!-- .header-navigation-wrapper -->
					</div><!-- .header-inner -->
					<?php
						// Output the menu modal.
						get_template_part( '/inc/modal-menu' );
					?>
					<!-- </div> -->
				</div>
			</div>

			<div class="l-contactbox">
				<i class="fa-solid fa-phone"></i>	
				<?php _e( 'Call Now', 'sweet-delights-bakery' ); ?>
				<a href="tel:<?php echo esc_html(get_theme_mod('luzuk_sweet_delights_bakery_sidepanel_phonenumber', '111 222 333')); ?>">
					<p><?php echo esc_html(get_theme_mod('luzuk_sweet_delights_bakery_sidepanel_phonenumber', '111 222 333')); ?></p>
				</a>
			</div>
			<div class="l-box">
				<div class="s-media">
					<li>
						<?php 
							$instagram_link = get_theme_mod('luzuk_sweet_delights_bakery_instagramlink', '#');
							if ($instagram_link) { 
							?>
								<a href="<?php echo esc_html($instagram_link); ?>">
									<i class="fa-brands fa-instagram"></i>
								</a>
						<?php } ?>
					</li> 

					<li>
						<?php 
							$pinterest_link = get_theme_mod('luzuk_sweet_delights_bakery_pinterestlink', '#');
							if ($pinterest_link) { 
							?>
								<a href="<?php echo esc_html($pinterest_link); ?>">
									<i class="fa-brands fa-pinterest-p"></i>					
								</a>
						<?php } ?>
					</li>

					<li>
						<?php 
							$fb_link = get_theme_mod('luzuk_sweet_delights_bakery_fblink', '#');
							if ($fb_link) { 
							?>
								<a href="<?php echo esc_html($fb_link); ?>">
									<i class="fab fa-facebook-f"></i>
								</a>
						<?php } ?>
					</li>
					<div class="clearfix"></div>
				</div>
			</div>
		</div>
		</div>	
	</div>
</div>
</div>
