<?php 
$header_login = themesflat_get_opt('header_login');
$header_button = themesflat_get_opt('header_button');
$header_button_text = themesflat_get_opt('header_button_text');
$header_button_url = themesflat_get_opt('header_button_url');
?>
<header id="header" class="header header-default <?php echo themesflat_get_opt_elementor('extra_classes_header'); ?>">
    <div class="inner-header">  
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-12">
                    <div class="header-wrap clearfix">
                        <div class="header-ct-left">
                            <?php get_template_part( 'tpl/header/brand'); ?>
                        </div>
                        <div class="header-ct-center">
                            <div class="inner-center">
                                <?php get_template_part( 'tpl/header/navigator'); ?>
                            </div>
                        </div>
                    <?php if( $header_button == 1 || $header_login == 1): ?>
                        <div class="header-ct-right">
                        <?php if ( themesflat_get_opt('header_login') == 1 ) :?>
                            <?php if (is_user_logged_in()): ?>
                                <?php if (class_exists('Widget_Login_Menu')): ?>
                                    <?php the_widget('Widget_Login_Menu'); ?>
                                <?php endif; ?>
                            <?php else: ?>
                            <div class="login-header">
                                <ul>
                                    <li><span class="display-pop-login login"><?php esc_html_e('Login', 'homeya'); ?></span></li>
                                    <li><span class="display-pop-login register"><?php esc_html_e('Register', 'homeya'); ?></span></li>
                                </ul>
                            </div>
                            <?php endif; ?>
                        <?php endif; ?>
                        <?php if ( $header_button == 1 ) :?>
                            <a href="<?php echo get_permalink ( get_theme_mod ( 'header_button_url' )); ?>" class="tf-btn <?php if(!is_user_logged_in()) echo 'display-pop-login'; ?>"><?php echo wp_kses($header_button_text, themesflat_kses_allowed_html()); ?><span></span></a> 
                        <?php endif;?>
                                                          
                            </div>
                    <?php endif; ?>
                    <div class="btn-menu">
                        <span class="line-1"></span>
                    </div><!-- //mobile menu button -->
                    </div>                
                </div><!-- /.col-md-12 -->
            </div><!-- /.row -->
        </div><!-- /.container -->
    </div>

    <div class="canvas-nav-wrap">
        <div class="overlay-canvas-nav"><div class="canvas-menu-close"><span></span></div></div>
        <div class="inner-canvas-nav">
            <div class="group-header-logo">
                <?php get_template_part( 'tpl/header/brand-mobile'); ?>
            </div>

            <div class="bottom-canvas-nav">
                <?php if ( themesflat_get_opt('header_login') == 1 ) :?>
                    <?php if (is_user_logged_in()): ?>
                        <?php if (class_exists('Widget_Login_Menu')): ?>
                            <?php the_widget('Widget_Login_Menu'); ?>
                        <?php endif; ?>
                        <?php else: ?>
                        <div class="login-header">
                            <ul>
                                <li><span class="display-pop-login login"><?php esc_html_e('Login', 'homeya'); ?></span></li>
                                <li><span class="display-pop-login register"><?php esc_html_e('Register', 'homeya'); ?></span></li>
                            </ul>
                        </div>
                    <?php endif; ?>
                <?php endif; ?>    
                <nav id="mainnav_canvas" class="mainnav_canvas" role="navigation">
                    <?php
                        wp_nav_menu( array( 'theme_location' => 'primary', 'fallback_cb' => 'themesflat_menu_fallback', 'container' => false ) );
                    ?>
                </nav><!-- #mainnav_canvas -->
                <div class="wrap-btn-mobile">
                    <a href="<?php echo get_permalink ( get_theme_mod ( 'header_button_url' )); ?>" class="tf-btn <?php if(!is_user_logged_in()) echo 'display-pop-login'; ?>"><?php echo wp_kses($header_button_text, themesflat_kses_allowed_html()); ?><span></span></a> 
                </div>
            </div>
        </div>
    </div><!-- /.canvas-nav-wrap --> 
</header><!-- /.header --> 

