<?php
/**
 * Displays main header
 *
 * @package Spa Sauna
 */
?>
<?php
$spa_sauna_sticky_header = get_theme_mod('spa_sauna_sticky_header');
    $spa_sauna_data_sticky = "false";
    if ($spa_sauna_sticky_header) {
    $spa_sauna_data_sticky = "true";
    }
?>
<div class="main-header text-center text-md-start" data-sticky="<?php echo esc_attr($spa_sauna_data_sticky); ?>">
    <div class="container">
        <div class="row nav-box">
            <div class="col-xl-5 col-lg-5 col-md-3 col-sm-2 col-12 align-self-center header-box">
                <?php get_template_part('template-parts/navigation/nav1'); ?>
                <?php get_template_part('template-parts/navigation/nav3'); ?>
            </div>
            <div class="col-xl-2 col-lg-2 col-md-4 col-sm-4 logo-box align-self-center">
                <div class="navbar-brand ">
                    <?php if ( has_custom_logo() ) : ?>
                        <div class="site-logo"><?php the_custom_logo(); ?></div>
                    <?php endif; ?>
                    <?php $spa_sauna_blog_info = get_bloginfo( 'name' ); ?>
                        <?php if ( ! empty( $spa_sauna_blog_info ) ) : ?>
                            <?php if ( is_front_page() && is_home() ) : ?>
                                <?php if( get_theme_mod('spa_sauna_logo_title_text',true) != ''){ ?>
                                    <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
                                <?php } ?>
                            <?php else : ?>
                                <?php if( get_theme_mod('spa_sauna_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
                            $spa_sauna_description = get_bloginfo( 'description', 'display' );
                            if ( $spa_sauna_description || is_customize_preview() ) :
                        ?>
                        <?php if( get_theme_mod('spa_sauna_theme_description',false) != ''){ ?>
                            <p class="site-description pb-2"><?php echo esc_html($spa_sauna_description); ?></p>
                        <?php } ?>
                    <?php endif; ?>
                </div>
            </div>
            <div class="col-xl-5 col-lg-5 col-md-5 col-sm-6 col-12 align-self-center header-right-box">
                <div class="row">
                    <div class="col-xl-6 col-lg-4 col-md-0 col-sm-0 col-0 align-self-center">
                        <?php get_template_part('template-parts/navigation/nav2'); ?>
                    </div>
                    <div class="col-xl-1 col-lg-2 col-md-3 col-sm-3 col-3 align-self-center">
                        <span class="cart_no">
                            <?php if(class_exists('woocommerce')){ ?>
                                <?php global $woocommerce; ?>
                                <a class="cart-customlocation" href="<?php echo esc_url(wc_get_cart_url()); ?>" title="<?php esc_attr_e( 'shopping cart','spa-sauna' ); ?>"><i class="fas fa-cart-plus"></i></span></a>
                            <?php }?>
                        </span>
                    </div>
                    <div class="col-xl-5 col-lg-6 col-md-9 col-sm-9 col-9 align-self-center">
                        <?php if ( get_theme_mod('spa_sauna_header_button_url') != "" || get_theme_mod('spa_sauna_header_button_text') != "" ) {?>
                            <div class="header-button">
                                <a href="<?php esc_attr_e(get_theme_mod('spa_sauna_header_button_url')); ?>"><?php echo esc_html(get_theme_mod('spa_sauna_header_button_text')); ?></a>
                            </div>
                        <?php }?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
