<?php
/**
 * Displays main header
 *
 * @package Stylish Fashion Shop
 */
?>
<?php
$stylish_fashion_shop_sticky_header = get_theme_mod('stylish_fashion_shop_sticky_header');
    $stylish_fashion_shop_data_sticky = "false";
    if ($stylish_fashion_shop_sticky_header) {
    $stylish_fashion_shop_data_sticky = "true";
    }
?>
<div class="main-header py-2" data-sticky="<?php echo esc_attr($stylish_fashion_shop_data_sticky); ?>">
    <div class="container">
        <div class="row ">
            <div class="col-lg-3 col-md-4 col-sm-4 col-12 logo">
                <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 $stylish_fashion_shop_blog_info = get_bloginfo( 'name' ); ?>
                        <?php if ( ! empty( $stylish_fashion_shop_blog_info ) ) : ?>
                            <?php if ( is_front_page() && is_home() ) : ?>
                                <?php if( get_theme_mod('stylish_fashion_shop_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('stylish_fashion_shop_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
                            $stylish_fashion_shop_description = get_bloginfo( 'description', 'display' );
                            if ( $stylish_fashion_shop_description || is_customize_preview() ) :
                        ?>
                        <?php if( get_theme_mod('stylish_fashion_shop_theme_description',false) != ''){ ?>
                            <p class="site-description pb-2"><?php echo esc_html($stylish_fashion_shop_description); ?></p>
                        <?php } ?>
                    <?php endif; ?>
                </div>
            </div>
            <div class="col-lg-7 col-md-4 col-sm-4 col-6 align-self-center">
                <?php get_template_part('template-parts/navigation/nav'); ?>
            </div>
            <div class="col-lg-2 col-md-4 col-sm-4 col-6 align-self-center text-end header-right-box">
                <div class="row">
                    <div class="col-lg-4 col-md-4 col-sm-4 col-4 align-self-center text-lg-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','stylish-fashion-shop' ); ?>"><i class="fas fa-shopping-bag"></i><span class="cart-value"><?php echo sprintf ( esc_html( '%d', '%d', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?></span></a>
                            <?php }?>
                        </span>
                    </div>
                    
                    <div class="col-lg-4 col-md-4 col-sm-4 col-4 align-self-center">
                        <?php if(get_theme_mod('stylish_fashion_shop_search_setting',true) != ''){ ?>
                            <span class="head-search">
                                <div class="header-search-wrapper">
                                    <span class="search-main">
                                        <i class="fa fa-search"></i>
                                    </span>
                                    <div class="search-form-main clearfix">
                                        <form method="get" class="search-form">
                                          <label>
                                            <input type="search" class="search-field form-control" placeholder="Search …" value="" name="s">
                                          </label>
                                          <input type="submit" class="search-submit btn btn-primary mt-3" value="Search">
                                        </form>
                                    </div>
                                </div>
                            </span>
                        <?php }?>
                    </div>
                    
                    <div class="col-lg-4 col-md-4 col-sm-4 col-4 align-self-center text-lg-center">
                        <?php if(is_active_sidebar( 'sidebar' )) : ?>
                            <span class="header_in">
                                <button type="button" class="toggle" id="toggle">
                                   <span></span>
                                </button>
                            </span>
                            <div class="slidebar text-start" id='slidebar'>
                                <div class="sidebar">
                                    <?php dynamic_sidebar( 'sidebar' ); ?>
                                </div>
                            </div>
                        <?php endif; ?>
                    </div>
            </div>
        </div>
    </div>
</div>
