<?php 

$header_socials = themesflat_get_opt('header_socials');

if (themesflat_get_opt_elementor('header_socials') != '') {

    $header_socials = themesflat_get_opt_elementor('header_socials');

}

$header_socials_label = themesflat_get_opt('header_socials_label');

if (themesflat_get_opt_elementor('header_socials_label') != '') {

    $header_socials_label = themesflat_get_opt_elementor('header_socials_label');

}

$header_button = themesflat_get_opt('header_button');

if (themesflat_get_opt_elementor('header_button') != '') {

    $header_button = themesflat_get_opt_elementor('header_button');

}

$header_button_text = themesflat_get_opt('header_button_text');

if (themesflat_get_opt_elementor('header_button_text') != '') {

    $header_button_text = themesflat_get_opt_elementor('header_button_text');

}


$header_button_url = themesflat_get_opt('header_button_url');

if (themesflat_get_opt_elementor('header_button_url') != '') {

    $header_button_url = themesflat_get_opt_elementor('header_button_url');

}


$menu =  themesflat_get_opt_elementor( 'select_page_menu' );

?>

<?php get_template_part( 'tpl/topbar'); ?>

<header id="header" class="header header-default <?php echo themesflat_get_opt_elementor('extra_classes_header'); ?>">

    <div class="inner-header">  

        <div class="wrap-inner-header container">

            <div class="header-wrap">

                <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_socials == 1 || $header_button == 1): ?>

                    <div class="header-ct-right">     

                            <?php if ( $header_socials == 1 ) :?>

                                <?php if ($header_socials_label != '') : ?>

                                    <div class="social-header-2">

                                        <h6><?php echo esc_html($header_socials_label); ?></h6>

                                        <?php themesflat_render_social();   ?>

                                    </div>

                                <?php else: ?>

                                    <?php themesflat_render_social();   ?>

                                <?php endif;?>  

                            <?php endif;?>

                           

                            <?php if ( $header_button == 1 && !empty($header_button_text) ) :?>

                                <a href="<?php echo esc_attr($header_button_url); ?>" class="tf-btn"><?php echo esc_html($header_button_text); ?><span></span></a> 

                            <?php endif;?>                                              

                    </div>

                <?php endif; ?>

                <div class="btn-menu">

                    <span class="line-1"></span>

                </div><!-- //mobile menu button -->

            </div>                

        </div>
        <?php if ( is_single() && themesflat_get_opt('scroll_indicator_single') == 1 ): ?>
            <div class="progress-container">
                <div class="progress-bar" id="myBar"></div>
            </div>
        <?php endif; ?>

        

    </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">

            <?php get_template_part( 'tpl/header/brand-mobile'); ?>

            <nav id="mainnav_canvas" class="mainnav_canvas" role="navigation">

                <?php get_search_form(); ?>
                
                <?php

                    wp_nav_menu( array( 'theme_location' => 'primary', 'fallback_cb' => 'themesflat_menu_fallback', 'container' => false ) );

                ?>                

            </nav><!-- #mainnav_canvas -->  

            

            <?php themesflat_render_social();   ?>

        </div>

    </div><!-- /.canvas-nav-wrap --> 

</header><!-- /.header --> 