<?php
/* Header Style5 */
$storeup_sh_inline_style = $storeup_sh_style_prop = $storeup_sh_bg_props = $storeup_frontpageid = '';
if ( is_tag() || is_search() || is_404() || is_home() ) {
	$storeup_frontpageid = '';
} else {
	$storeup_sh_bg_props = get_post_meta( $post->ID,'subheader_img', true );
	$storeup_frontpageid = $post->ID;
}

if ( is_array( $storeup_sh_bg_props ) && ! empty( $storeup_sh_bg_props['0']['image'] ) ) {
	$storeup_sh_style_prop = 'background:url(' . $storeup_sh_bg_props['0']['image'] . ') ' . $storeup_sh_bg_props['0']['position'] . ' ' . $storeup_sh_bg_props['0']['repeat'] . ' ' . $storeup_sh_bg_props['0']['attachement'] . ' ' . $storeup_sh_bg_props['0']['color'] . ';';
} elseif ( is_array( $storeup_sh_bg_props ) && ! empty( $storeup_sh_bg_props['0']['color'] ) ) {
	$storeup_sh_style_prop = 'background-color:' . $storeup_sh_bg_props['0']['color'] . ';';
} elseif ( ! is_array( $storeup_sh_bg_props )  && '' !== $storeup_sh_bg_props ) {
	$storeup_sh_style_prop  = 'background:url(' . $storeup_sh_bg_props . ');';
}

$storeup_sh_inline_style 	= ( '' !== $storeup_sh_style_prop ) ? ' style="' . $storeup_sh_style_prop . '"' : '';
$storeup_header_light_logo  = get_option( 'storeup_header_light_logo' );
$storeup_header_dark_logo   = get_option( 'storeup_header_dark_logo' );
$storeup_page_slider 		= get_post_meta( $storeup_frontpageid, 'storeup_page_slider', true );

if ( ! is_front_page() ||  '' !== $storeup_page_slider ) {
	echo '<div class="header_section" ' . esc_attr( $storeup_sh_inline_style ) . '>';
}?>
	<div class="header_wrapper">
		<header class="header-style1">
			<div class="header">
				<div class="header-area">
					<div class="logo">
						<?php storeup_generator( 'storeup_logo', 'storeup_header_dark_logo' ); ?>
					</div><!-- /logo -->

					<div class="primarymenu menuwrap">
						<?php storeup_generator( 'storeup_primary_menu' ); ?>
						<?php if ( has_nav_menu( 'primary-menu' ) ) {  ?> <a href="#" class="iva-mobile-dropdown"></a> <?php } ?>
					</div>

					<!-- Header Widget Area -->
					<?php  if ( is_active_sidebar( 'header_widget_area_1' ) ) : dynamic_sidebar( 'header_widget_area_1' );  endif; ?>

					<div class="icn_wrap">
						<div id="ivaSearch" class="ivaSearch icnalign"><i class="fa fa-search fa-1"></i></div>
					</div>
				</div>

				<div id="ivaSearchbar" class="act">
					<div class="inner">
						<form  method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
							<input type="text" value="" name="s" id="s" placeholder="<?php echo esc_html__( 'Search here...', 'storeup' ); ?>" class="ivaInput headerSearch" />
							<span class="search-close"><i class="fa fa-close fa-1"></i></span>
						</form>
					</div>
				</div>
			<?php
			// Mobile menu
			storeup_generator( 'storeup_mobile_menu' );
			?>
			</div>
		</header><!-- #header -->

		<?php storeup_generator( 'storeup_mobile_menu' ); ?>

		<div id="ivaSearchbar" class="act">
			<div class="inner">
				<form  method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
					<input type="text" value="" name="s" id="s" placeholder="<?php echo esc_html__( 'Search here...', 'storeup' ); ?>" class="ivaInput headerSearch" />
					<span class="search-close"><i class="fa fa-close fa-1"></i></span>
				</form>
			</div>
		</div>
	</div><!-- .header_wrapper-->
<?php
