<?php
/**
 * Displays main header
 *
 * @package Kitchen Interior Design
 */
?>
<?php
$kitchen_interior_design_sticky_header = get_theme_mod('kitchen_interior_design_sticky_header');
    $kitchen_interior_design_data_sticky = "false";
    if ($kitchen_interior_design_sticky_header) {
    $kitchen_interior_design_data_sticky = "true";
    }
?>
<div class="main-header text-center text-md-start" data-sticky="<?php echo esc_attr($kitchen_interior_design_data_sticky); ?>">
    <div class="container">
        <div class="row nav-box m-0">
            <div class="col-xl-3 col-lg-3 col-md-4 col-sm-4 col-12 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 $kitchen_interior_design_blog_info = get_bloginfo( 'name' ); ?>
                        <?php if ( ! empty( $kitchen_interior_design_blog_info ) ) : ?>
                            <?php if ( is_front_page() && is_home() ) : ?>
                                <?php if( get_theme_mod('kitchen_interior_design_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('kitchen_interior_design_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
                            $kitchen_interior_design_description = get_bloginfo( 'description', 'display' );
                            if ( $kitchen_interior_design_description || is_customize_preview() ) :
                        ?>
                        <?php if( get_theme_mod('kitchen_interior_design_theme_description',false) != ''){ ?>
                            <p class="site-description pb-2"><?php echo esc_html($kitchen_interior_design_description); ?></p>
                        <?php } ?>
                    <?php endif; ?>
                </div>
            </div>
            <div class="col-xl-8 col-lg-8 col-md-4 col-sm-4 col-6 align-self-center header-box">
                <?php get_template_part('template-parts/navigation/nav'); ?>
            </div>
            <div class="col-xl-1 col-lg-1 col-md-4 col-sm-4 col-6 align-self-center header-right-box">
                <?php if (get_theme_mod('kitchen_interior_design_header_search_setting', false) != '') { ?>
                    <span class="head-search">
                        <span 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" action="<?php echo esc_url( home_url( '/' ) ); ?>">
                                    <label>
                                        <input type="search" class="search-field form-control" placeholder="Search for products..." value="<?php echo get_search_query(); ?>" name="s">
                                    </label>
                                    <input type="submit" class="search-submit btn btn-primary mt-3" value="Search">
                                </form>
                            </div>
                        </span>
                    </span>
                <?php } ?>
                <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','kitchen-interior-design' ); ?>"><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>
    </div>
</div>
