<?php
$enable_header_top = induxter_option('enable_header_top', true);
$top_info_text = induxter_option('header_top_info_text');
$top_social = induxter_option('header_top_socials');
$header_content_layout    = induxter_option( 'header_content_layout', 'container' );
$sticky_header    = induxter_option( 'sticky_header', true );
$enable_header_cart    = induxter_option( 'enable_header_cart', true );
if($enable_header_cart == true){
	$header_cart_class = 'header-cart-enable';
}else{
	$header_cart_class = 'header-cart-disable';
}

$top_info_column = induxter_option('top_info_column');
if (!empty($top_info_column)) {
	$info_column = induxter_option('top_info_column');
} else {
	$info_column = 'col-lg-8';
}

$top_social_column = induxter_option('top_social_column');
if (!empty($top_social_column)) {
	$social_column = induxter_option('top_social_column');
} else {
	$social_column = 'col-lg-4';
}
?>

<div class="header-style-two">
	<?php if($enable_header_top == true) : ?>
        <div class="header-top-area">
            <div class="<?php echo esc_attr($header_content_layout);?>">
                <div class="row">
                    <div class="<?php echo esc_attr($info_column);?> top-info-column">
                        <div class="td-table">
                            <div class="td-table-cell">
								<?php if(is_array($top_info_text)) : ?>
                                    <ul class="td-list-style td-list-inline">
										<?php foreach ($top_info_text as $top_info) : ?>
                                            <li class="top-info-item">
                                                <i class="<?php echo esc_attr($top_info['info_icon']);?>"></i>
												<?php echo wp_kses_post($top_info['info_text']);?>
                                            </li>
										<?php endforeach;?>
                                    </ul>
								<?php endif; ?>
                            </div>
                        </div>
                    </div>

					<?php if(is_array($top_social)) : ?>
                        <div class="<?php echo esc_attr($social_column);?> top-social-icon-column">
                            <ul class="td-list-style td-list-inline">
								<?php foreach ($top_social as $socialSite) : ?>
                                    <li class="top-social-item">
                                        <a href="<?php echo esc_url($socialSite['profile_url']);?>">
                                            <i class="<?php echo esc_attr($socialSite['icon']);?>"></i>
                                        </a>
                                    </li>
								<?php endforeach;?>
                            </ul>
                        </div>
					<?php endif; ?>
                </div>
            </div>
        </div>
	<?php endif; ?>

    <div class="main-menu-area" <?php if($sticky_header == true ){echo 'data-uk-sticky="top: 250; animation: uk-animation-slide-top;"';} ?>>
        <div class="<?php echo esc_attr($header_content_layout);?>">
            <div class="row">
                <div class="col-lg-2 col-sm-4 col-5 logo-column">
					<?php get_template_part( 'template-parts/header/header-logo' ); ?>
                </div>

                <div class="col-lg-10 col-sm-8 col-7 text-right">
                    <div class="header-navigation-area <?php echo esc_attr($header_cart_class);?>">
						<?php get_template_part( 'template-parts/header/header-menu' );?>

                        <div class="header-buttons-area text-right">
                            <div class="header-buttons-wrapper">
                                <ul class="td-list-style td-list-inline">
									<?php if(class_exists( 'WooCommerce' ) && $enable_header_cart == true): ?>
                                        <li class="header-mini-cart">
                                            <a class="td-header-cart-url" href="<?php echo esc_url( wc_get_cart_url() );?>">
                                                <div class="td-table">
                                                    <div class="td-table-cell">
                                                        <i class="fa fa-shopping-cart"></i>
                                                        <span class="cart-product-count"><?php echo WC()->cart->get_cart_contents_count();?></span>
                                                    </div>
                                                </div>
                                            </a>
                                            <div class="td-header-cart-products">
												<?php the_widget( 'WC_Widget_Cart' ); ?>
                                            </div>
                                        </li>
									<?php endif; ?>

									<?php get_template_part( 'template-parts/header/header-cta-button');?>

                                    <li class="mobile-menu-trigger"><span></span><span></span><span></span></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>