<header class="main-header">

	<?php if( get_theme_mod( 'expert_business_consultant_display_topbar', true ) != '') { ?>
		<div class="upper-header-aera wow fadeInDown" data-wow-delay="0.5s">
			<div class="container">
				<?php
					$expert_business_consultant_call = get_theme_mod( 'expert_business_consultant_call','1(868) 225-6155' );
					$expert_business_consultant_call_text = get_theme_mod( 'expert_business_consultant_call_text' );
				?>
				<div class="row">
					<div class="col-lg-3 col-md-2 col-12 contactbox my-2 my-md-0 align-self-center text-center text-md-start">
						<?php if( class_exists( 'GTranslate' ) ) { ?>
	            			<div class="translate-lang position-relative d-md-inline-block me-md-3 py-2">
          				<?php echo do_shortcode( '[gtranslate]' );?>
		            </div>
		          <?php }?>
						</div>
					<div class="col-lg-9 col-md-10 col-12 contactbox align-self-center text-center text-md-end">
						<span class="call pe-3">
					        <?php if( get_theme_mod( 'expert_business_consultant_call' ) != '1(868) 225-6155') { ?>
					            <a class="phn py-md-2" href="tel:<?php echo esc_url( get_theme_mod('expert_business_consultant_call','1(868) 225-6155' )); ?>"><i class="fas fa-phone-alt me-2"></i><?php echo esc_html( get_theme_mod('expert_business_consultant_call','1(868) 225-6155')); ?></a>
					        <?php } ?>
				      	</span>
				      	<span class="email pe-md-4">
					        <?php if( get_theme_mod( 'expert_business_consultant_mail' ) != 'admin@example.com') { ?>
					              <a class="mail py-md-2" href="mailto:<?php echo esc_attr( get_theme_mod('expert_business_consultant_mail','admin@example.com') ); ?>"><i class="fas fa-envelope-open-text me-2"></i><?php echo esc_html( get_theme_mod('expert_business_consultant_mail','admin@example.com') ); ?></a>
					        <?php } ?>
				      	</span>
						<span class="text-md-end text-center align-self-center social-area mb-md-0 mb-3">
			    			<?php
								$expert_business_consultant_social_media_facebook = get_theme_mod('expert_business_consultant_social_media_facebook','#');
								$expert_business_consultant_social_media_twitter = get_theme_mod('expert_business_consultant_social_media_twitter','#');
								$expert_business_consultant_social_media_instagram = get_theme_mod('expert_business_consultant_social_media_instagram','#');
								$expert_business_consultant_social_media_linkedin = get_theme_mod('expert_business_consultant_social_media_linkedin','#');
								$expert_business_consultant_social_media_pinterest = get_theme_mod('expert_business_consultant_social_media_pinterest','#');
							?>
							<?php if( $expert_business_consultant_social_media_facebook != ''){?>
								<a class="me-2" href="<?php echo esc_url( apply_filters('expert_business_consultant_topheader', $expert_business_consultant_social_media_facebook)); ?>"><i class="fab fa-facebook-f"></i></a>
							<?php }?>
							<?php if( $expert_business_consultant_social_media_twitter != ''){?>
								<a class="me-2" href="<?php echo esc_url( apply_filters('expert_business_consultant_topheader', $expert_business_consultant_social_media_twitter)); ?>"><i class="fab fa-twitter"></i></a>
							<?php }?>
							<?php if( $expert_business_consultant_social_media_instagram != ''){?>
								<a class="me-2" href="<?php echo esc_url( apply_filters('expert_business_consultant_topheader', $expert_business_consultant_social_media_instagram)); ?>"><i class="fab fa-instagram"></i></a>
							<?php }?>
							<?php if( $expert_business_consultant_social_media_pinterest != ''){?>
								<a class="me-2" href="<?php echo esc_url( apply_filters('expert_business_consultant_topheader', $expert_business_consultant_social_media_pinterest)); ?>"><i class="fab fa-pinterest-p"></i></a>
							<?php }?>
						</span>
						<?php 
						$expert_business_consultant_register_btn_text = get_theme_mod('expert_business_consultant_register_btn_text','REGISTER');
						$expert_business_consultant_register_btn_link = get_theme_mod('expert_business_consultant_register_btn_link','#');
						$expert_business_consultant_login_btn_text = get_theme_mod('expert_business_consultant_login_btn_text','LOGIN');
						$expert_business_consultant_login_btn_link = get_theme_mod('expert_business_consultant_login_btn_link','#');

						if (!empty($expert_business_consultant_register_btn_text) || !empty($expert_business_consultant_login_btn_text)) { ?>
						    <span class="topbar-btn ps-lg-5">
						        <?php 
						        if (!empty($expert_business_consultant_register_btn_text) && !empty($expert_business_consultant_register_btn_link)) { ?>
						            <a class="topbtn1 text-uppercase" href="<?php echo esc_url(apply_filters('expert_business_consultant_topheader', $expert_business_consultant_register_btn_link)); ?>">
						                <?php echo esc_html(apply_filters('expert_business_consultant_topheader', $expert_business_consultant_register_btn_text)); ?>
						            </a>
						        <?php } ?>
						        <?php 
						        if (!empty($expert_business_consultant_login_btn_text) && !empty($expert_business_consultant_login_btn_link)) { ?>
						            <a class="topbtn2 text-uppercase" href="<?php echo esc_url(apply_filters('expert_business_consultant_topheader', $expert_business_consultant_login_btn_link)); ?>">
						                <i class="fas fa-lock pe-2"></i><?php echo esc_html(apply_filters('expert_business_consultant_topheader', $expert_business_consultant_login_btn_text)); ?>
						            </a>
						        <?php } ?>
						    </span>
						<?php } ?>
				    </div>
				</div>
			</div>
		</div>
	<?php } ?>
	<div class="middle-header-aera pt-2 pb-5 wow fadeInUp" data-wow-delay="0.5s">
		<div class="container">
			<div class="row">
				<div class="col-lg-3 col-md-6 col-12 text-md-start text-center align-self-center mb-lg-0 mb-3">
				    <div class="logo">
						<?php 
						if (has_custom_logo()) {
							the_custom_logo();
						} else {
							// Check if both title and tagline settings are disabled
							$expert_business_consultant_tagline_enabled = get_theme_mod('expert_business_consultant_tagline_setting', false);
							$expert_business_consultant_title_enabled = get_theme_mod('expert_business_consultant_site_title_setting', false);

							if (!$expert_business_consultant_tagline_enabled && !$expert_business_consultant_title_enabled) {
								// Display the default logo
								$expert_business_consultant_default_logo_url = get_template_directory_uri() . '/assets/images/logo.png'; // Replace with your default logo path
								echo '<a href="' . esc_url(home_url('/')) . '">';
								echo '<img src="' . esc_url($expert_business_consultant_default_logo_url) . '" alt="' . esc_attr(get_bloginfo('name')) . '">';
								echo '</a>';
							}

							// Display tagline if the setting is enabled
							if ($expert_business_consultant_tagline_enabled) :
								$expert_business_consultant_site_desc = get_bloginfo('description'); ?>
								<p class="site-description"><?php echo esc_html($expert_business_consultant_site_desc); ?></p>
							<?php endif; ?>

							<?php
							// Display site title if the setting is enabled
							if ($expert_business_consultant_title_enabled) : ?>
								<p class="site-title">
									<a href="<?php echo esc_url(home_url('/')); ?>">
										<?php echo esc_html(get_bloginfo('name')); ?>
									</a>
								</p>
							<?php endif; ?>
                            <?php } ?>
				    </div>
				</div>
				<div class="col-lg-5 col-md-6 col-12 text-md-end text-center align-self-center mb-lg-0 mb-3">
				    <div class="searching-area">
				        <div class="search-cat-box">
				            <div class="row m-0 align-items-center">
				                <div class="col-lg-7 col-md-5 px-2 main-searh-col align-self-center">
				                    <form id="searchForm" action="<?php echo esc_url(home_url('/')); ?>" method="get">
				                        <input class="search-text" type="text" name="s" class="form-control" placeholder="<?php esc_attr_e('Search Courses', 'expert-business-consultant'); ?>">
				                        <input type="hidden" name="post_type" value="service">
				                        <input type="hidden" name="category" id="categoryInput" value="">
				                    </form>
				                </div>
				                <!-- Category Dropdown -->
				                <div class="col-lg-4 col-md-5 px-2 align-self-center">
				                    <button class="category-btn btn btn-secondary">
				                        <?php echo esc_html(__('Category', 'expert-business-consultant')); ?> <i class="fas fa-chevron-down ps-3"></i>
				                    </button>
				                    <ul class="category-dropdown" style="display: none;">
				                        <?php
				                        $args = array(
				                            'orderby'    => 'title',
				                            'order'      => 'ASC',
				                            'hide_empty' => 0,
				                            'parent'     => 0
				                        );
				                        $post_categories = get_terms('category', $args);
				                        if (!empty($post_categories)) {
				                            foreach ($post_categories as $post_category) {
				                                echo '<li><a href="#" data-id="' . esc_attr($post_category->term_id) . '">' . esc_html($post_category->name) . '</a></li>';
				                            }
				                        }
				                        ?>
				                    </ul>
				                </div>
				                <div class="col-lg-1 col-md-2 searchbtn align-self-center">
				                    <button id="searchButton" class="btn btn-search w-100"><i class="fas fa-search"></i></button>
				                </div>
				            </div>
				        </div>
				    </div>
				</div>
				<div class="col-lg-3 col-md-6 col-12 align-self-center mb-md-0 mb-3">
					<div class="header-btn text-center text-md-start">
						<?php 
							$expert_business_consultant_header_btn_text = get_theme_mod( 'expert_business_consultant_header_btn_text','START CONSULTING' );
							$expert_business_consultant_header_btn_link = get_theme_mod( 'expert_business_consultant_header_btn_link','#' );

						if( $expert_business_consultant_header_btn_text != '' || $expert_business_consultant_header_btn_link != '' ){?>
	        				<a href="<?php echo esc_html( apply_filters('expert_business_consultant_topheader', $expert_business_consultant_header_btn_link)); ?>" class="offer-text"><?php echo esc_html( apply_filters('expert_business_consultant_topheader', $expert_business_consultant_header_btn_text)); ?></a>
	      				<?php } ?>
	      			</div>
				</div>
				<div class="col-lg-1 col-md-6 align-self-center mb-md-0 mb-3">
					<?php
					$expert_business_consultant_like_option = get_theme_mod('expert_business_consultant_like_option');
					?>
					<div class="header-details">
					    <p class="mb-0 pe-4">
					        <?php if (class_exists('woocommerce')): ?>
					            <?php if (is_user_logged_in()): ?>
					                <a href="<?php echo esc_url(get_permalink(get_option('woocommerce_myaccount_page_id'))); ?>"><i class="fas fa-user"></i></a>
					            <?php else: ?>
					                <a href="<?php echo esc_url(get_permalink(get_option('woocommerce_myaccount_page_id'))); ?>"><i class="far fa-user"></i></a>
					            <?php endif; ?>
					        <?php endif; ?>
					    </p>
					    <?php if ($expert_business_consultant_like_option != ''): ?>
					        <p class="mb-0 pe-4">
					            <a href="<?php echo esc_url(apply_filters('expert_business_consultant_topheader', $expert_business_consultant_like_option)); ?>"><i class="far fa-heart"></i></a>
					        </p>
					    <?php endif; ?>
					    <p class="mb-0 pe-4">
					        <?php if (class_exists('YITH_WCWL')): ?>
					            <a href="<?php echo esc_url(YITH_WCWL()->get_wishlist_url()); ?>"><i class="fas fa-heart"></i></a>
					        <?php endif; ?>
					    </p>
					    <p class="mb-0">
					    	<?php if(class_exists('woocommerce')){ ?> 
					            <span class="product-cart text-center position-relative pe-2">
					              <a href="<?php if(function_exists('wc_get_cart_url')){ echo esc_url(wc_get_cart_url()); } ?>" title="<?php esc_attr_e( 'shopping cart','expert-business-consultant' ); ?>"><i class="fas fa-shopping-bag"></i></a>
					              <?php 
					              $cart_count = WC()->cart->get_cart_contents_count(); 
					              if($cart_count > 0): ?>
					                  <span class="cart-count"><?php echo $cart_count; ?></span>
					              <?php endif; ?>
					            </span>
					        <?php }?>
					    </p>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div class="<?php if( get_theme_mod( 'expert_business_consultant_sticky_header', '0')) { ?>sticky-header<?php } else { ?>close-sticky<?php } ?>">
		<div class="container menubox">
			<!-- Main menu -->
			<div class="navbar-menubar responsive-menu navigation_header">
				<div class="toggle-nav mobile-menu">
					<button onclick="expert_business_consultant_openNav()">
						<i class="fa fa-bars"></i> <!-- Initial hamburger icon -->
					</button>
				</div>
				<div id="mySidenav" class="nav sidenav">
					<nav id="site-navigation" class="main-navigation navbar navbar-expand-xl" aria-label="<?php esc_attr_e( 'Top Menu', 'expert-business-consultant' ); ?>">

						<?php 
							wp_nav_menu(
								array(
									'theme_location' => 'primary',
									'container_class' => 'main-menu clearfix',
									'menu_class' => 'clearfix menu',
									'items_wrap' => '<ul id="%1$s" class="%2$s mobile_nav">%3$s</ul>',
									'fallback_cb' => 'wp_page_menu',
								)
							);
						?>
						<a href="javascript:void(0)" class="closebtn mobile-menu" onclick="expert_business_consultant_closeNav()">
							<i class="fa fa-times"></i> <!-- Close icon for the menu -->
						</a>
					</nav>
				</div>
			</div>
		</div>
	</div>

</header>