<?php $bauen_options = get_option('bauen'); ?>

	<?php if(get_post_meta($post->ID,'bauen_main_slider_speed',true)):?>
	<?php $bauen_slider_speed = get_post_meta($post->ID,'bauen_main_slider_speed',true);?>
	<?php else: ?>
	<?php $bauen_slider_speed = '5000';?>
	<?php endif;?>	

	<!-- Slider -->
	<header class="header slider-fade main-slider" data-scroll-index="0">
		<div class="owl-carousel owl-theme" data-speed="<?php echo esc_attr($bauen_slider_speed);?>">
		  
 		    <?php if( function_exists( 'rwmb_meta' ) ) { ?> 
			<?php
			$bauen_main_slider = rwmb_meta( 'bauen_main_slider_opt' );
			if ( ! empty( $bauen_main_slider ) ) {
			foreach ( $bauen_main_slider as $bauen_main_sliders ) { ;?>
			
			<?php $bauen_main_slider_title = isset( $bauen_main_sliders['bauen_main_slider_title_opt'] ) ? $bauen_main_sliders['bauen_main_slider_title_opt'] : ''; ?>
			
			<?php $bauen_main_slider_title_tag = isset( $bauen_main_sliders['bauen_main_slider_title_tag_opt'] ) ? $bauen_main_sliders['bauen_main_slider_title_tag_opt'] : ''; ?>
			
			<?php $bauen_main_slider_subtitle = isset( $bauen_main_sliders['bauen_main_slider_sub_title_opt'] ) ? $bauen_main_sliders['bauen_main_slider_sub_title_opt'] : ''; ?>
			
			<?php $bauen_main_slider_buttontxt = isset( $bauen_main_sliders['bauen_main_slider_buttontxt_opt'] ) ? $bauen_main_sliders['bauen_main_slider_buttontxt_opt'] : ''; ?>
			
			<?php $bauen_main_slider_buttonurl = isset( $bauen_main_sliders['bauen_main_slider_buttonurl_opt'] ) ? $bauen_main_sliders['bauen_main_slider_buttonurl_opt'] : ''; ?>
			
			<?php $bauen_main_slider_button_target = isset( $bauen_main_sliders['bauen_main_slider_button_target_opt'] ) ? $bauen_main_sliders['bauen_main_slider_button_target_opt'] : ''; ?>	
			
			<?php $bauen_main_slider_overlay = isset( $bauen_main_sliders['bauen_main_slider_overlay_opt'] ) ? $bauen_main_sliders['bauen_main_slider_overlay_opt'] : ''; ?>		
			
			<?php $bauen_main_slider_float = isset( $bauen_main_sliders['bauen_main_slider_float_opt'] ) ? $bauen_main_sliders['bauen_main_slider_float_opt'] : ''; ?>		
			
			<?php $bauen_main_slider_img_ids = isset( $bauen_main_sliders['bauen_main_slider_img_id_opt'] ) ? $bauen_main_sliders['bauen_main_slider_img_id_opt'] : array();
			foreach ( $bauen_main_slider_img_ids as $bauen_main_slider_img_id ) {
			$bauen_image = RWMB_Image_Field::file_info( $bauen_main_slider_img_id, array( 'size' => '' ) ); ?>	

			<?php 
			if ($bauen_main_slider_float =='st2'){ 
			   $bauen_main_slider_align_opt ="text-left";
			   $bauen_main_slider_offset_opt ="offset-md-2";
			} 
			else {
			   $bauen_main_slider_align_opt ="text-right";
			   $bauen_main_slider_offset_opt ="offset-md-5";
			}; ?>			
			
			<div class="<?php echo esc_attr($bauen_main_slider_align_opt);?> item bg-img" data-overlay-dark="<?php if ( !empty( $bauen_main_slider_overlay ) ) { ?><?php echo esc_attr($bauen_main_slider_overlay);?><?php } else { ?>3<?php } ?>" data-background="<?php echo esc_url(($bauen_image['url']));?>">
				<div class="v-middle caption mt-30">
					<div class="container">
						<div class="row">
							<div class="col-md-7 <?php echo esc_attr($bauen_main_slider_offset_opt);?>">
								<div class="o-hidden">
								    <?php if ( !empty( $bauen_main_slider_title ) ) { ?>
										<?php if ($bauen_main_slider_title_tag =='st2'){?>
											<h2><?php echo esc_html($bauen_main_slider_title);?></h2>
										<?php } else if ($bauen_main_slider_title_tag =='st3'){?>
											<h3><?php echo esc_html($bauen_main_slider_title);?></h3>
										<?php } else if ($bauen_main_slider_title_tag =='st4'){?>
											<h4><?php echo esc_html($bauen_main_slider_title);?></h4>
										<?php } else if ($bauen_main_slider_title_tag =='st5'){?>
											<h5><?php echo esc_html($bauen_main_slider_title);?></h5>
										<?php } else if ($bauen_main_slider_title_tag =='st6'){?>
											<h6><?php echo esc_html($bauen_main_slider_title);?></h6>	
										<?php } else { ?>
											<h1><?php echo esc_html($bauen_main_slider_title);?></h1>
										<?php } ?>
									<?php } ?>
									<?php if ( !empty( $bauen_main_slider_subtitle ) ) { ?>
									<p><?php echo balanceTags($bauen_main_slider_subtitle);?></p>
									<?php } ?>	
									<?php if ( !empty( $bauen_main_slider_buttontxt ) ) { ?>
							        <?php if ( !empty( $bauen_main_slider_buttonurl ) ) { ?>
									<div class="butn-light mt-30 mb-30"><a href="<?php echo esc_url($bauen_main_slider_buttonurl);?>" <?php if ( !empty( $bauen_main_slider_button_target ) ) { ?>target="<?php echo esc_attr($bauen_main_slider_button_target);?>"<?php } ?>><span><?php echo esc_html($bauen_main_slider_buttontxt);?></span></a></div>
									<?php } ?>
							        <?php } ?>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<?php } ?>
            <?php } } ;?> 
            <?php } ;?> 
		</div>
		<!-- Corner -->
		<?php if(get_post_meta($post->ID,'bauen_main_slider_corner',true)!='st2'){ ?>
		<div class="hero-corner"></div>
		<div class="hero-corner3"></div>
		<?php } ?>
		<!-- Left Panel -->
		<?php if(get_post_meta($post->ID,'bauen_page_header_menu_style_opt',true)=='st1'){ ?>
			<?php if(get_post_meta($post->ID,'bauen_main_slider_social',true)=='st2'){ ?>
			<div class="left-panel">
				<ul class="social-left clearfix">
				    <?php if( function_exists( 'rwmb_meta' ) ) { ?> 
					<?php
					$bauen_full_slider_social = rwmb_meta( 'bauen_full_slider_social_opt' );
					if ( ! empty( $bauen_full_slider_social ) ) {
					foreach ( $bauen_full_slider_social as $bauen_full_slider_socials ) { ;?>
					
					<?php $bauen_full_slider_social_icon_opt = isset( $bauen_full_slider_socials['bauen_full_slider_social_icon_opt'] ) ? $bauen_full_slider_socials['bauen_full_slider_social_icon_opt'] : ''; ?>
					
					<?php $bauen_full_slider_social_url_opt = isset( $bauen_full_slider_socials['bauen_full_slider_social_url_opt'] ) ? $bauen_full_slider_socials['bauen_full_slider_social_url_opt'] : ''; ?>	
					
						<?php if ( !empty( $bauen_full_slider_social_icon_opt ) ) { ?>
						<?php if ( !empty( $bauen_full_slider_social_url_opt ) ) { ?>			    
						<li><a href="<?php echo esc_url($bauen_full_slider_social_url_opt);?>" target="_blank"><i class="<?php echo esc_attr($bauen_full_slider_social_icon_opt);?>"></i></a></li>
						<?php } ?>
						<?php } ?>				
					<?php } } ;?> 				
					<?php };?> 				
				</ul>
			</div>
			<?php } ;?> 
			
		<?php } 
		else if(get_post_meta($post->ID,'bauen_page_header_menu_style_opt',true)=='st2'){ ?>
		
			<?php if(get_post_meta($post->ID,'bauen_main_slider_social',true)=='st2'){ ?>
			<div class="left-panel">
				<ul class="social-left clearfix">
				    <?php if( function_exists( 'rwmb_meta' ) ) { ?> 
					<?php
					$bauen_full_slider_social = rwmb_meta( 'bauen_full_slider_social_opt' );
					if ( ! empty( $bauen_full_slider_social ) ) {
					foreach ( $bauen_full_slider_social as $bauen_full_slider_socials ) { ;?>
					
					<?php $bauen_full_slider_social_icon_opt = isset( $bauen_full_slider_socials['bauen_full_slider_social_icon_opt'] ) ? $bauen_full_slider_socials['bauen_full_slider_social_icon_opt'] : ''; ?>
					
					<?php $bauen_full_slider_social_url_opt = isset( $bauen_full_slider_socials['bauen_full_slider_social_url_opt'] ) ? $bauen_full_slider_socials['bauen_full_slider_social_url_opt'] : ''; ?>	
					
						<?php if ( !empty( $bauen_full_slider_social_icon_opt ) ) { ?>
						<?php if ( !empty( $bauen_full_slider_social_url_opt ) ) { ?>			    
						<li><a href="<?php echo esc_url($bauen_full_slider_social_url_opt);?>" target="_blank"><i class="<?php echo esc_attr($bauen_full_slider_social_icon_opt);?>"></i></a></li>
						<?php } ?>
						<?php } ?>				
					<?php } } ;?> 				
					<?php } ;?> 				
				</ul>
			</div>
			<?php } ;?> 
		<?php } 
		else { ?>	
            <div class="left-panel-no"></div>		
		<?php } ?>		
	</header>
		
	<!-- Content -->
	<div class="content-wrapper">	
		<!-- Lines -->
		<?php if(get_post_meta($post->ID,'bauen_content_lines',true)=='st2'){ ?>
		<section class="content-lines-wrapper">
			<div class="content-lines-inner">
				<div class="content-lines"></div>
			</div>
		</section>
		<?php } ;?> 		
		
		<!-- Header Banner -->		