/*!
Theme Name: Hizmet
Theme URI: https://hizmet.mhrtheme.com/
Author: MhrTheme
Author URI: https://templatemonster.com/authors/mhrtheme/
Description: Hizmet - Service Provider Company for Home, Office, and Personal Work WordPress Theme.
Version: 1.0.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hizmet
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned.
*/

<?php global $hizmet;

if( isset($hizmet['preloader-show-hide']) && $hizmet['preloader-show-hide'] == 1 ) : ?>
	<!-- START PRELOADER AREA -->
	<div class="preloader">
		<div class="lds-ripple">
			<div class="loader"></div>
		</div>
	</div>
	<!-- END PRELOADER AREA -->
<?php endif; ?>

<!-- Start Header Area -->  
<header class="header main-header">
    <div id="main-sticky-placeholder"></div>
    <div class="main-mainmenu">
        <div class="container-fluid">
            <div class="header-navbar">
                <div class="header-logo">
                    <?php if( has_custom_logo() ) : ?>
					    <?php the_custom_logo(); ?>
					<?php else: ?>
						<div class="site-branding">
                            <?php
                            if ( is_front_page() && is_home() ) :
                                ?>
                                <h3 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h3>
                                <?php
                            else :
                                ?>
                                <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                                <?php
                            endif;
                            $hizmet_description = get_bloginfo( 'description', 'display' );
                            if ( $hizmet_description || is_customize_preview() ) :
                                ?>
                                <p class="site-description"><?php echo esc_html( $hizmet_description ); /* WPCS: xss ok. */ ?></p>
                            <?php endif; ?>
                        </div><!-- .site-branding -->
					<?php endif; ?>
                </div>
                <div class="header-main-nav">
                    <!-- Start Mainmanu Nav -->
                    <nav class="mainmenu-nav offcanvas" id="mobilemenu-popup">
                        <div class="d-block d-lg-none">
                            <div class="mobile-nav-header">
                                <div class="mobile-nav-logo">
                                    <?php if( has_custom_logo() ) : ?>
									    <?php the_custom_logo(); ?>
									<?php else: ?>
										<div class="site-branding">
				                            <?php
				                            if ( is_front_page() && is_home() ) :
				                                ?>
				                                <h3 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h3>
				                                <?php
				                            else :
				                                ?>
				                                <p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
				                                <?php
				                            endif;
				                            $hizmet_description = get_bloginfo( 'description', 'display' );
				                            if ( $hizmet_description || is_customize_preview() ) :
				                                ?>
				                                <p class="site-description"><?php echo esc_html( $hizmet_description ); /* WPCS: xss ok. */ ?></p>
				                            <?php endif; ?>
				                        </div><!-- .site-branding -->
									<?php endif; ?>
                                </div>
                                <button class="mobile-menu-close" data-bs-dismiss="offcanvas"><i class="fa fa-times"></i></button>
                            </div>
                        </div>
                        <?php
                            $primary_nav_arg = [
                                'theme_location'  => 'hizmet-primary-menu',
                                'container'       => null,
                                'menu_class'      => 'mainmenu',
                                'depth'           => 3,
                                'walker'          => new Hizmet_Bootstrap_Navwalker(),
                                'fallback_cb'     => 'Hizmet_Bootstrap_Navwalker::fallback'
                            ];
                            $secondary_nav_arg = [
                                'theme_location'  => 'one-page-home-menu',
                                'container'       => null,
                                'menu_class'      => 'mainmenu',
                                'depth'           => 3,
                                'walker'          => new Hizmet_Bootstrap_Navwalker(),
                                'fallback_cb'     => 'Hizmet_Bootstrap_Navwalker::fallback'
                            ];
                            if (!is_page_template('template-parts/one-page-home.php') && has_nav_menu( 'hizmet-primary-menu' ) ) :
                                wp_nav_menu( $primary_nav_arg );
                            elseif(is_page_template('template-parts/one-page-home.php') && has_nav_menu( 'one-page-home-menu' ) ) :
                                wp_nav_menu( $secondary_nav_arg );
                            else : 
                                if( is_user_logged_in() ) {
                                echo wp_kses_post( '<ul class="navbar-nav m-auto"><li class="nav-item"><a href="'.esc_url(home_url('/')).'/wp-admin/nav-menus.php">Create a menu</a></li></ul>', 'hizmet' );
                                }
                                else{
                                echo wp_kses_post( '<ul class="navbar-nav m-auto"><li class="nav-item"><a href="'.esc_url(home_url('/')).'">Home</a></li></ul>', 'hizmet' );
                                }
                            endif;
                        ?>
                    </nav>
                    <!-- End Mainmanu Nav -->
                </div>
                <div class="header-action">
                    <ul class="list-unstyled">
                        <li class="header-btn">
                        	<?php if( isset($hizmet['get-button-text']) && $hizmet['get-button-text'] != '' ) : ?>
                                <a href="<?php echo esc_url( $hizmet['get-button-link'] ); ?>" class="default-btn icon">
                                    <i class='bx bx-log-in-circle'></i><?php echo esc_html( $hizmet['get-button-text'] ); ?>
                                </a>
                            <?php endif; ?>
                        </li>
                        <li class="mobile-menu-btn sidemenu-btn d-lg-none d-block">
                            <button class="btn-wrap btn-dark" data-bs-toggle="offcanvas" data-bs-target="#mobilemenu-popup">
                                <span></span>
                                <span></span>
                                <span></span>
                            </button>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</header>
<!-- End Header Area -->
