<!-- Start: Header
============================= -->
<?php

$chocolate_store_header_text = get_theme_mod('chocolate_store_header_text');

?>

<div id="top_header">
	<div class="container">
		<div class="top_header_text text-center">
			<?php if ( ! empty( $chocolate_store_header_text ) ): ?>
				<p class="m-0">
					<marquee>
						<?php echo esc_html( $chocolate_store_header_text ); ?>
					</marquee>
				</p>
			<?php endif; ?>
		</div>
	</div>
</div>

<header id="header" role="banner" class="nav-stick  <?php echo esc_attr(chocolate_store_sticky_header()); ?>" <?php if ( get_header_image() ) { ?> style="background-image: url( <?php header_image(); ?> ); background-size: 100%;" <?php } ?> >
	<div class="container">
		<div class="navbar-area wow fadeInDown" data-wow-duration="2s">
			<div class="row">
				<div class="col-lg-3 col-md-3 col-sm-4 col-12 align-self-center">
					<div class="logo main">
						<?php if ( function_exists( 'chocolate_store_logo_title_description' ) ) :chocolate_store_logo_title_description(); endif; ?>
					</div>
				</div>
				<div class="col-lg-6 col-md-6 col-sm-2 col-2 align-self-center">
					<div class="toggle-menu gb_menu text-md-start">
						<button onclick="chocolate_store_navigation_open()" class="gb_toggle p-2"><i class="fa fa-bars" aria-hidden="true"></i></button>
					</div>
					<div id="gb_responsive" class="nav side_gb_nav">
						<nav id="top_gb_menu" class="gb_nav_menu" role="navigation" aria-label="<?php esc_attr_e( 'Menu', 'chocolate-store' ); ?>">
							<?php 
							    wp_nav_menu( array( 
									'theme_location' => 'primary_menu',
									'container_class' => 'gb_navigation clearfix' ,
									'menu_class' => 'clearfix',
									'items_wrap' => '<ul id="%1$s" class="%2$s mobile_nav mb-0 px-0">%3$s</ul>',
									'fallback_cb' => 'wp_page_menu',
							    ) ); 
							?>
							<a href="javascript:void(0)" class="closebtn gb_menu" onclick="chocolate_store_navigation_close()">x<span class="screen-reader-text"><?php esc_html_e('Close Menu','chocolate-store'); ?></span></a>
						</nav>
					</div>
				</div>
				<div class="col-lg-3 col-md-3 col-sm-6 col-10 align-self-center text-md-end text-end">
					<span class="search-container">
						<button id="search-icon" class="search-icon">
							<i class="fa fa-search"></i>
						</button>
						<div id="search-popup" class="search-popup">
							<div class="search-popup-content">
								<button id="close-search-popup" class="close-popup">&times;</button>
								<form method="get" class="search-form" action="<?php home_url('/'); ?>">
									<input type="search" class="search-field" placeholder="Search…" value="" name="s" />
									<button type="submit" class="search-submit">
										<i class="fa fa-search"></i>
									</button>
								</form>
							</div>
						</div>
					</span>
					<?php if(class_exists('woocommerce')){ ?>
						<span class="admin-box ms-3">
							<?php if ( is_user_logged_in() ) { ?>
								<a href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>"><span class="dashicons dashicons-admin-users"></span></a>
							<?php }
							else { ?>
								<a href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('Login / Register','chocolate-store'); ?>"><span class="dashicons dashicons-admin-users"></span></a>
							<?php } ?>
						</span>
					<?php }?>
					<?php if (class_exists('woocommerce')) { ?>
					    <span class="cart-count lower-icons ms-3">
					        <a class="cart-customlocation" href="<?php echo esc_url(wc_get_cart_url()); ?>" title="<?php esc_attr_e('View Shopping Cart', 'chocolate-store'); ?>">
					            <span class="dashicons dashicons-products"></span>
					            <span class="cart-item-box">
					                <?php 
					                $cart_count = WC()->cart->get_cart_contents_count(); 
					                ?>
					            </span>
					        </a>
					    </span>
					<?php } ?>
				</div>
			</div>
		</div>
	</div>
</header>