<header class="main-header">
    <div class="headerbox <?php if( get_theme_mod( 'mobile_app_launch_sticky_header') != '') { ?>sticky-header<?php } else { ?>close-sticky<?php } ?>">
        <div class="header-main container">
            <div class="row">
                <div class="col-lg-3 col-md-4 align-self-center">
                    <div class="logo text-center text-md-start mb-md-1 mb-3">
                        <?php 
                        if (has_custom_logo()) {
                            the_custom_logo();
                        } else {
                            // Check if both title and tagline settings are disabled
                            $mobile_app_launch_tagline_enabled = get_theme_mod('mobile_app_launch_tagline_setting', false);
                            $mobile_app_launch_title_enabled = get_theme_mod('mobile_app_launch_site_title_setting', true);

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

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

                            <?php
                            // Display site title if the setting is enabled
                            if ($mobile_app_launch_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-7 col-md-4 col-4 align-self-center">
                    <div class="main-navhead">
                        <div class="menubox">
                            <div class="menu-content">
                                <!-- Main menu -->
                                <div class="navbar-menubar responsive-menu navigation_header">
                                    <div class="toggle-nav mobile-menu">
                                        <button onclick="mobile_app_launch_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', 'mobile-app-launch' ); ?>">
                                            <?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="mobile_app_launch_closeNav()">
                                                <i class="fa-solid fa-times"></i> <!-- Close icon for the menu -->
                                            </a>
                                        </nav>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-2 col-md-4 col-8 align-self-center text-lg-end text-center d-md-flex justify-content-lg-end align-items-md-center justify-content-center menu-col">
                    <span class="search-bar text-md-end text-center me-3 justify-content-center">
                        <button type="button" class="open-search"><i class="fas fa-search"></i></button>
                    </span>
                    <?php if (get_theme_mod('mobile_app_launch_header_link') || get_theme_mod('mobile_app_launch_header_button','Sign Up')) : ?>
                        <div class="header-btn my-md-0 my-2 ms-lg-4 ms-md-5 text-md-center">
                            <a href="<?php echo esc_url(get_theme_mod('mobile_app_launch_header_link')); ?>" class="book-appoin">
                                <span class="head-btn text-capitalize"><?php echo esc_html(get_theme_mod('mobile_app_launch_header_button','Sign Up')); ?></span></a>
                        </div>
                    <?php endif; ?>
                </div>
                <div class="search-outer">
                    <div class="inner_searchbox w-100 h-100">
                        <?php get_search_form(); ?>
                    <button type="button" class="search-close"><?php esc_html_e('CLOSE', 'mobile-app-launch'); ?></button>
                    </div>
                </div> 
            </div>
        </div>
    </div>
 <div class="clearfix"></div>
</header>