<header class="main-header">
	<div class="headerbox">
	    <div class="header-main">
	        <div class="row m-0">
	            <div class="col-lg-3 col-md-4 logo-col p-md-0">
	                <div class="logo">
						<?php 
						if (has_custom_logo()) {
							the_custom_logo();
						} else {
							// Check if both title and tagline settings are disabled
							$automotive_services_tagline_enabled = get_theme_mod('automotive_services_tagline_setting', false);
							$automotive_services_title_enabled = get_theme_mod('automotive_services_site_title_setting', true);

							if (!$automotive_services_tagline_enabled && !$automotive_services_title_enabled) {
								// Display the default logo
								$automotive_services_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($automotive_services_default_logo_url) . '" alt="' . esc_attr(get_bloginfo('name')) . '">';
								echo '</a>';
							}

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

							<?php
							// Display site title if the setting is enabled
							if ($automotive_services_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 class="logo-shadow"></div>
	            </div>

	            <div class="col-lg-9 col-md-8 align-self-center px-0">
	                <div class="top-main py-lg-3 py-md-2 py-3">
	                    <div class="row m-0">
	                        <div class="col-lg-8 col-md-8 align-self-center top-contact">
	                            <div class="contact me-md-4">
	                                <?php if (get_theme_mod('automotive_services_location','1901 Thornridge Cir. Shiloh, Hawaii 81063')) : ?>
	                                    <p class="mb-md-0 mb-3 ps-md-5 contact-content">
	                                        <i class="fas fa-map-marker-alt me-2"></i><?php echo esc_html(get_theme_mod('automotive_services_location','1901 Thornridge Cir. Shiloh, Hawaii 81063')); ?>
	                                    </p>
	                                <?php endif; ?>
	                            </div>
	                            <div class="contact">
	                                <?php if (get_theme_mod('automotive_services_call','(+33)7 35 55 21 02')) : ?>
	                                    <p class="mb-md-0 mb-3 contact-content call">
	                                        <i class="fas fa-phone-alt me-2"></i><a href="tel:<?php echo esc_html(get_theme_mod('automotive_services_call','(+33)7 35 55 21 02')); ?>">
	                                                <?php echo esc_html(get_theme_mod('automotive_services_call','(+33)7 35 55 21 02')); ?>
	                                        </a>
	                                    </p>
	                                <?php endif; ?>
	                            </div>
	                        </div>
	                        <div class="col-lg-4 col-md-4 align-self-center">
	                            <div class="social-media mb-md-0 text-md-end text-center">
	                                <?php
		                                $automotive_services_social_media_facebook = get_theme_mod('automotive_services_social_media_facebook','#');
										$automotive_services_social_media_twitter = get_theme_mod('automotive_services_social_media_twitter','#');
										$automotive_services_social_media_instagram = get_theme_mod('automotive_services_social_media_instagram','#');
										$automotive_services_social_media_youtube = get_theme_mod('automotive_services_social_media_youtube','#');
	                               ?>

	                                <?php if( $automotive_services_social_media_facebook != ''){?>
										<a class="me-3" href="<?php echo esc_url( apply_filters('automotive_services_topheader', $automotive_services_social_media_facebook)); ?>"><i class="fab fa-facebook-f"></i></a>
									<?php }?>
									<?php if( $automotive_services_social_media_twitter != ''){?>
										<a class="me-3" href="<?php echo esc_url( apply_filters('automotive_services_topheader', $automotive_services_social_media_twitter)); ?>"><i class="fab fa-twitter"></i></a>
									<?php }?>
									<?php if( $automotive_services_social_media_instagram != ''){?>
										<a class="me-3" href="<?php echo esc_url( apply_filters('automotive_services_topheader', $automotive_services_social_media_instagram)); ?>"><i class="fab fa-instagram"></i></a>
									<?php }?>
									<?php if( $automotive_services_social_media_youtube != ''){?>
										<a href="<?php echo esc_url( apply_filters('automotive_services_topheader', $automotive_services_social_media_youtube)); ?>"><i class="fab fa-youtube"></i></a>
									<?php }?>
	                            </div>
	                        </div>
	                    </div>
	                </div>
	                <div class="row menu-box-col m-0 py-md-3 py-2">
	                    <div class="col-xxl-8 col-xl-12 col-lg-12 col-md-3 col-6 align-self-center d-flex justify-content-lg-start justify-content-center main-menu-box mb-md-0 mb-2">
	                        <div class="main-navhead <?php if( get_theme_mod( 'automotive_services_sticky_header', '0')) { ?>sticky-header<?php } else { ?>close-sticky<?php } ?>">
	                            <!-- Main menu -->
								<div class="navbar-menubar responsive-menu navigation_header">
									<div class="toggle-nav mobile-menu">
										<button onclick="automotive_services_openNav()">
											<i class="fa-solid 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', 'automotive-services' ); ?>">

											<?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="automotive_services_closeNav()">
												<i class="fa-solid fa-times"></i> <!-- Close icon for the menu -->
											</a>
										</nav>
									</div>
								</div>
	                        </div>
	                    </div>
	                    <div class="col-xxl-1 col-xl-6 col-lg-6 col-md-3 align-self-center d-flex justify-content-center mb-md-0 mb-2">
	                    	<span class="search-bar text-md-end align-self-center">
                                <button type="button" class="open-search"><i class="fas fa-search"></i></button>
                            </span>
	                    </div>
	                    <div class="col-xxl-3 col-xl-6 col-lg-6 col-md-6 col-12 align-self-center">
	                        <?php if (get_theme_mod('automotive_services_header_link','#') || get_theme_mod('automotive_services_header_button','Get Consultant')) : ?>
	                            <div class="header-btn my-md-0 my-2 text-md-center">
	                                <a href="<?php echo esc_url(get_theme_mod('automotive_services_header_link','#')); ?>" class="book-appoin">
	                                    <span class="head-icon"><i class="fas fa-calendar"></i></span>
	                                    <span class="head-btn text-capitalize"><?php echo esc_html(get_theme_mod('automotive_services_header_button','Get Consultant')); ?></span></a>
	                            </div>
	                        <?php endif; ?>
	                    </div>
                        <div class="search-outer">
                            <div class="inner_searchbox w-100 h-100">
                                <?php get_search_form(); ?>
                            </div>
                            <button type="button" class="search-close"><?php esc_html_e('CLOSE', 'automotive-services'); ?></button>
                        </div>
	                </div>
	            </div>
	        </div>
	    </div>
	</div>
</header>