<?php
/**
 * The header for our theme
 *
 * @package Fashion Outfit
 */

?>
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
	<meta charset="<?php bloginfo( 'charset' ); ?>">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="profile" href="https://gmpg.org/xfn/11">

	<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<?php wp_body_open(); ?>
<div id="page" class="site">
	<a class="skip-link screen-reader-text" href="#primary"><?php esc_html_e( 'Skip to content', 'fashion-outfit' ); ?></a>

	<?php
		$fashion_outfit_preloader_wrap = absint(get_theme_mod('fashion_outfit_enable_preloader', 0));
		if($fashion_outfit_preloader_wrap == 1){ ?>
			<div id="loader">
				<div class="loader-container">
					<div id="preloader" class="loader-2">
						<div class="dot"></div>
					</div>
				</div>
			</div>
	<?php } ?>

	<header id="masthead" class="site-header">
		<?php if( get_theme_mod( 'fashion_outfit_header_info',true ) ) { ?>
			<div class="header-info-box text-center">
				<div class="container">
					<div class="top-text">
						<?php if ( get_theme_mod('fashion_outfit_topheader_text','GET 50% OFF ON BRAND AFFILIATED PRODUCTS, USE CODE ELBLOI') ) : ?><p> <?php echo esc_html( get_theme_mod('fashion_outfit_topheader_text','GET 50% OFF ON BRAND AFFILIATED PRODUCTS, USE CODE ELBLOI') ); ?></p><?php endif; ?>
					</div>
				</div>
			</div>
		<?php } ?>

		<?php $fashion_outfit_has_header_image = has_header_image(); ?>
			<div class="main-header-wrap <?php echo esc_attr( get_theme_mod( 'fashion_outfit_enable_sticky_header', false ) ? 'sticky-header' : '' ); ?>">
				<div class="top-box" <?php if (!empty($fashion_outfit_has_header_image)) { ?> style="background-image: url(<?php echo header_image(); ?>);" <?php } ?>>
					<div class="container">
						<div class="flex-row">
							<div class="main-info-box">
								<div class="site-branding">
									<?php
									the_custom_logo();
									if ( is_front_page() && is_home() ) :
										?>
										<?php if( get_theme_mod('fashion_outfit_site_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('fashion_outfit_site_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 $fashion_outfit_description = get_bloginfo( 'description', 'display' );
										if ( $fashion_outfit_description || is_customize_preview() ) :
										?>
										<?php if( get_theme_mod('fashion_outfit_site_tagline_text',false)){ ?>
											<p class="site-description"><?php echo $fashion_outfit_description; ?></p>
										<?php } ?>
									<?php endif; ?>
								</div>
							</div>
							<div class="nav-box-header-menu">
								<nav id="site-navigation" class="main-navigation">
									<button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false"><i class="fas fa-bars"></i></button>
									<?php
										wp_nav_menu(
											array(
												'theme_location' => 'menu-1',
												'menu_id'        => 'primary-menu',
											)
										);
									?>
								</nav>
							</div>
							<div class="nav-box-header-three">
								<?php if ( get_theme_mod('fashion_outfit_facebook_link_option', '#') ) : ?><a href="<?php echo esc_url(get_theme_mod('fashion_outfit_facebook_link_option', '#')); ?>"><i class="fab fa-facebook-f"></i></a><?php endif; ?>
								<?php if ( get_theme_mod('fashion_outfit_twitter_link_option', '#') ) : ?><a href="<?php echo esc_url(get_theme_mod('fashion_outfit_twitter_link_option', '#')); ?>"><i class="fab fa-twitter"></i></span><?php endif; ?>
								<?php if ( get_theme_mod('fashion_outfit_youtube_link_option', '#') ) : ?><a href="<?php echo esc_url(get_theme_mod('fashion_outfit_youtube_link_option', '#')); ?>"><i class="fab fa-youtube"></i></a><?php endif; ?>
								<?php if ( get_theme_mod('fashion_outfit_instagram_link_option', '#') ) : ?><a href="<?php echo esc_url(get_theme_mod('fashion_outfit_instagram_link_option', '#')); ?>"><i class="fab fa-instagram"></i></a><?php endif; ?>
							</div>
							<div class="main-woo-box">
							    <?php if(class_exists('woocommerce')){ ?>
						            <div class="cart-no-box">
						                <a href="<?php if(function_exists('wc_get_cart_url')){ echo esc_url(wc_get_cart_url()); } ?>" title="<?php esc_attr_e( 'shopping cart','fashion-outfit' ); ?>"><i class="fas fa-shopping-bag"></i><span class="screen-reader-text"><?php esc_html_e( 'shopping cart','fashion-outfit' );?></span></a>
						                <span class="cart-value"> <?php echo esc_html(wp_kses_data( WC()->cart->get_cart_contents_count() ));?></span>
					              	</div>
					            <?php }?>
					        </div>
						</div>
					</div>
				</div>
			</div>
		
	</header>