<header class="main-header">
    <div class="headerbox <?php if( get_theme_mod( 'islamic_trust_sticky_header', '0')) { ?>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
                            $islamic_trust_tagline_enabled = get_theme_mod('islamic_trust_tagline_setting', false);
                            $islamic_trust_title_enabled = get_theme_mod('islamic_trust_site_title_setting', true);

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

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

                            <?php
                            // Display site title if the setting is enabled
                            if ($islamic_trust_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="islamic_trust_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', 'islamic-trust' ); ?>">
                                            <?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="islamic_trust_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 wow bounceInUp" data-wow-delay="0.5s">
                    <?php if (get_theme_mod('islamic_trust_header_link','#') || get_theme_mod('islamic_trust_header_button','Donate Now')) : ?>
                        <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('islamic_trust_header_link','#')); ?>" class="book-appoin">
                                <span class="head-btn text-capitalize"><?php echo esc_html(get_theme_mod('islamic_trust_header_button','Donate Now')); ?></span></a>
                        </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
 <div class="clearfix"></div>
</header>