<?php
/**
 * Displays main header
 *
 * @package Motivational Life Coach
 */
?>
<?php
$motivational_life_coach_sticky_header = get_theme_mod('motivational_life_coach_sticky_header');
    $motivational_life_coach_data_sticky = "false";
    if ($motivational_life_coach_sticky_header) {
    $motivational_life_coach_data_sticky = "true";
    }
?>
<div class="main-header text-center text-md-start px-5 pb-3" data-sticky="<?php echo esc_attr($motivational_life_coach_data_sticky); ?>">
    <div class="row nav-box">
        <div class="col-lg-3 col-md-4 col-sm-6 col-12 align-self-center">
            <div class="navbar-brand text-center text-md-start">
                <?php if ( has_custom_logo() ) : ?>
                    <div class="site-logo"><?php the_custom_logo(); ?></div>
                <?php endif; ?>
                <?php $motivational_life_coach_blog_info = get_bloginfo( 'name' ); ?>
                    <?php if ( ! empty( $motivational_life_coach_blog_info ) ) : ?>
                        <?php if ( is_front_page() && is_home() ) : ?>
                            <?php if( get_theme_mod('motivational_life_coach_logo_title_text',true) != ''){ ?>
                                <h1 class="site-title pt-2"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
                            <?php } ?>
                        <?php else : ?>
                            <?php if( get_theme_mod('motivational_life_coach_logo_title_text',true) != ''){ ?>
                                <p class="site-title "><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
                            <?php } ?>
                        <?php endif; ?>
                    <?php endif; ?>
                    <?php
                        $motivational_life_coach_description = get_bloginfo( 'description', 'display' );
                        if ( $motivational_life_coach_description || is_customize_preview() ) :
                    ?>
                    <?php if( get_theme_mod('motivational_life_coach_theme_description',false) != ''){ ?>
                        <p class="site-description pb-2"><?php echo esc_html($motivational_life_coach_description); ?></p>
                    <?php } ?>
                <?php endif; ?>
            </div>
        </div>
        <div class="col-lg-6 col-md-3 col-sm-4 col-3 align-self-center">
            <?php get_template_part('template-parts/navigation/nav'); ?>
        </div>
        <div class="col-lg-3 col-md-5 col-sm-6 col-9 align-self-center text-end">
            <?php if(class_exists('woocommerce')){ ?>
                <span class="user-btn-top">
                    <?php if ( is_user_logged_in() ) { ?>
                        <a class="account-btn" href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('My Account','motivational-life-coach'); ?>"><?php esc_html_e('Logout','motivational-life-coach'); ?></a>
                    <?php } 
                    else { ?>
                        <a class="account-btn" href="<?php echo esc_url( get_permalink( get_option('woocommerce_myaccount_page_id') ) ); ?>" title="<?php esc_attr_e('My Account','motivational-life-coach'); ?>"></i><?php esc_html_e('Login','motivational-life-coach'); ?></a>
                    <?php } ?>
                </span>
            <?php }?>
            <?php if ( get_theme_mod('motivational_life_coach_header_button') != "" || get_theme_mod('motivational_life_coach_header_button_url') != ""  ) {?>
                <span class="head-btn"><a href="<?php echo esc_url(get_theme_mod('motivational_life_coach_header_button_url')); ?>"><?php echo esc_html(get_theme_mod('motivational_life_coach_header_button')); ?></a></span>
            <?php }?>
        </div>
    </div>
</div>
