<?php
/*
 * Displays the header section with logo, site title, tagline, navigation, and contact information.
 */
?>

<div class="headerbox my-2">
    <div class="container header-main">
        <div class="row m-0">
            <div class="col-lg-3 col-md-3 col-12 logo-col align-self-center">
                <div class="logo text-center text-md-start">
                    <?php if (has_custom_logo()) : ?>
                        <?php the_custom_logo(); ?>
                    <?php endif; ?>

                    <?php if (get_theme_mod('mobile_app_hub_site_title', 1)) : ?>
                        <?php if (is_front_page() && is_home()) : ?>
                            <p class="text-capitalize mb-0">
                                <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                            </p>
                        <?php else : ?>
                            <h1 class="text-capitalize">
                                <a href="<?php echo esc_url(home_url('/')); ?>" rel="home"><?php bloginfo('name'); ?></a>
                            </h1>
                        <?php endif; ?>
                    <?php endif; ?>

                    <?php
                    $description = get_bloginfo('description', 'display');
                    if ($description || is_customize_preview()) :
                        if (get_theme_mod('mobile_app_hub_site_tagline', 1)) :
                            ?>
                            <p class="site-description my-1 text-capitalize"><?php echo esc_html($description); ?></p>
                        <?php endif; 
                    endif;
                    ?>
                </div>
            </div>
            <div class="col-lg-6 col-md-3 col-12 align-self-center">
                <div class="main-navhead">
                    <div class="menubox">
                        <div class="menu-content">
                            <?php get_template_part('template-parts/navigation/site-nav'); ?>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-lg-1 col-md-3 col-5 align-self-center text-center text-lg-end align-items-center">
                <span class="search-bar">
                    <button type="button" class="open-search"><i class="fas fa-search"></i></button>
                </span>
            </div>
            <div class="col-lg-2 col-md-3 col-7 align-self-center">
                <?php if (get_theme_mod('mobile_app_hub_header_link') || get_theme_mod('mobile_app_hub_header_button','Sign Up')) : ?>
                    <div class="header-btn text-center text-md-end">
                        <a href="<?php echo esc_url(get_theme_mod('mobile_app_hub_header_link')); ?>" class="book-appoin"><?php echo esc_html(get_theme_mod('mobile_app_hub_header_button','Sign Up')); ?></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', 'mobile-app-hub'); ?></button>
            </div>
        </div>
    </div>
</div>