<header class="main-header-top wow fadeIn">
    <div class="headerbox pt-md-2 pb-md-2">
        <div class="header-main px-md-5 px-lg-0">
            <div class="row mx-0">
                <div class="col-lg-3 col-md-12 align-self-center">
                    <div class="logo">
                        <?php 
                        if (has_custom_logo()) {
                            the_custom_logo();
                        } else {
                            // Check if both title and tagline settings are disabled
                            $expert_construction_company_tagline_enabled = get_theme_mod('expert_construction_company_tagline_setting', false);
                            $expert_construction_company_title_enabled = get_theme_mod('expert_construction_company_site_title_setting', true);

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

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

                            <?php
                            // Display site title if the setting is enabled
                            if ($expert_construction_company_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-9 col-md-12 align-self-center">
                    <div class="row">
                        <div class="col-xl-2"></div>
                        <div class="col-xl-3 col-lg-4 col-md-4 align-self-center my-md-0 my-2">
                            <div class="contact call">
                                <?php if (get_theme_mod('expert_construction_company_call_text','Call Us Today') || get_theme_mod('expert_construction_company_call','+1 800 559 6580')) : ?>
                                    <div class="row">
                                        <div class="col-xl-2 col-lg-3 col-md-4 col-3 align-self-center text-center text-md-left">
                                            <i class="fas fa-phone"></i>
                                        </div>
                                        <div class="col-xl-10 ol-lg-9 col-md-8 col-9 align-self-center text-lg-start contact-col call">
                                            <p class="infotext text-capitalize"><?php echo esc_html(get_theme_mod('expert_construction_company_call_text', 'Call Us Today')); ?></p>
                                            <p class="mb-0 contact-content">
                                                <a href="tel:<?php echo esc_html(get_theme_mod('expert_construction_company_call', '+1 800 559 6580')); ?>">
                                                    <?php echo esc_html(get_theme_mod('expert_construction_company_call', '+1 800 559 6580')); ?>
                                                </a>
                                            </p>
                                        </div>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-xl-3 col-lg-4 col-md-4 align-self-center my-md-0 my-2">
                            <div class="contact">
                                <?php if (get_theme_mod('expert_construction_company_mail_text','Email') || get_theme_mod('expert_construction_company_mail','info@example.com')) : ?>
                                    <div class="row">
                                        <div class="col-xl-2 col-lg-4 col-md-4 col-3 align-self-center text-center text-md-left">
                                            <i class="fas fa-envelope"></i>
                                        </div>
                                        <div class="col-xl-10 ol-lg-8 col-md-8 col-9 align-self-center contact-col">
                                            <p class="infotext text-capitalize"><?php echo esc_html(get_theme_mod('expert_construction_company_mail_text', 'Email')); ?></p>
                                            <p class="mb-0 contact-content">
                                                <a href="mailto:<?php echo esc_html(get_theme_mod('expert_construction_company_mail', 'info@example.com')); ?>">
                                                    <?php echo esc_html(get_theme_mod('expert_construction_company_mail', 'info@example.com')); ?>
                                                </a>
                                            </p>
                                        </div>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-xl-3 col-lg-4 col-md-4 align-self-center my-md-0 my-2">
                            <div class="contact">
                                <?php if (get_theme_mod('expert_construction_company_location_text','Address') || get_theme_mod('expert_construction_company_location','99 S.t Jomblo Park Pekanbaru 28292')) : ?>
                                    <div class="row">
                                        <div class="col-xl-2 col-lg-3 col-md-4 col-3 align-self-center text-center text-md-left">
                                            <i class="fas fa-map-marker-alt"></i>
                                        </div>
                                        <div class="col-xl-10 ol-lg-9 col-md-8 col-9 align-self-center contact-col">
                                            <p class="infotext text-capitalize"><?php echo esc_html(get_theme_mod('expert_construction_company_location_text', 'Address')); ?></p>
                                            <p class="mb-0 contact-content">
                                                <?php echo esc_html(get_theme_mod('expert_construction_company_location', '99 S.t Jomblo Park Pekanbaru 28292')); ?>
                                            </p>
                                        </div>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>
                        <div class="col-xl-1"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="main-navhead">
        <div class="menubox text-end">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-4 col-md-4 col-4"></div>
                    <div class="col-lg-8 col-md-8 col-8 px-0">
                        <div class="menu-content <?php if( get_theme_mod( 'expert_construction_company_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="expert_construction_company_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', 'expert-construction-company' ); ?>">

                                        <?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_construction_company_closeNav()">
                                            <i class="fa-solid fa-times"></i> <!-- Close icon for the menu -->
                                        </a>
                                    </nav>
                                </div>
                            </div>
                            <span class="search-bar text-md-end">
                                <button type="button" class="open-search"><i class="fas fa-search"></i></button>
                            </span>
                        </div>
                    </div>
                     <!-- Search Form -->
                    <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', 'expert-construction-company'); ?></button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</header>