<?php

if(get_theme_mod('features_section_disable') != 'on' ){
	?>
	<?php 
		if( get_theme_mod('sec_featuresTpadding',true) ) {
			$sec_featuresTpadding = 'padding-top:'.esc_attr(get_theme_mod('sec_featuresTpadding')).';';
		}
		if( get_theme_mod('sec_featuresBpadding',true) ) {
			$sec_featuresBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('sec_featuresBpadding')).';';
		}
	?>
	<section id="features-section" class="ht-section features-area"  style="<?php echo esc_attr($sec_featuresTpadding); ?>" "<?php echo esc_attr($sec_featuresBpadding); ?>">

		<?php
			$showStatic = true;
			for( $i = 1; $i < 3; $i++ ){
				$url = get_theme_mod('luzuk_features_page_url_'.$i, '#');
				$luzuk_features_page_id = get_theme_mod('features_page_icon1'.$i); 
							if(!empty($luzuk_features_page_id)){
								$showStatic = false;
								break;
				}
			}
		?>

		<div class="container pd-0"> 	
			<div class="features-inn">

			<?php
				$cols = get_theme_mod('luzuk_features_npp_count', 3);
				$cols++;
							// echo '$cold: '.$cols;
				switch($cols){
					case 1:
					$colCls = 'col-md-12 col-sm-12 col-xs-12';
					break;
					case 2:	
					$colCls = 'col-md-6 col-sm-6 col-xs-6';
					break;
					case 3:
					case 5:
					case 6:
					case 9:
					case 11:
					case 13:
					case 15:
					$colCls = 'col-md-4 col-sm-6 col-xs-6';
					break;
					default: 
					$colCls = 'col-md-3 col-sm-6 col-xs-6';
					break;
				}
				$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
				?>
		<!-- <div class="owl-carousel owl-theme">  --> 
			<?php
			for( $i = 1; $i <= $cols; $i++ ){

				if($showStatic === false){
				$url = get_theme_mod('luzuk_features_page_url_'.$i, '#');
				$features_page_title = get_theme_mod('features_page_title_'.$i, 'Safety Protocols');
				$fea_page_text = get_theme_mod('fea_page_text'.$i, 'Vivamus est lacus, pretium et vitae, congue euismod quam. Vivamus quis tortor neque.');
				$luzuk_features_page_id = get_theme_mod('features_b_page'.$i);
				
				$features_page_icon1 = get_theme_mod('features_page_icon1'.$i);
				if($features_page_icon1){
							
			?>
					<!-- <div class="item"> -->
					<div class="<?php echo $colCls;?> feabx">
						<div class="mem-inn ">
							<div class="sec-icn">
								<!-- <a href="</?php echo esc_url(!empty($url)?$url:'#');?>"> -->
									<span class="<?php echo $features_page_icon1; ?>"></span>
									<!-- <img src="<?php //echo esc_url($features_page_icon1); ?>" class="img-responcive" /> -->
								<!-- </a> -->
							</div> 
							<div class="features-content">
								<h3 class="inner-area-title"><?php echo $features_page_title; ?></h3>
								<p><?php echo $fea_page_text; ?></p>

								<?php
									
									$featurednew_page_button_title = get_theme_mod('featurednew_page_button_title_'.$i, 'Read More');
								?>
									<?php if($featurednew_page_button_title){ ?>
										<div class="readmore">
											<a href="<?php echo esc_url(!empty($url)?$url:'#');?>"><?php echo $featurednew_page_button_title; ?><i class="fa fa-angle-double-right"></i>
											</a>
											
										</div>
									<?php } ?>

							</div>
							<div class="clearfix"></div>
						</div>
						<div class="clearfix"></div>
					</div>
							<?php
						}
					}else{?>
						<!-- <div class="item "> -->
						<div class="<?php echo $colCls;?> feabx">
							<div class="mem-inn">
								<div class="sec-icn">
									<!-- <a href="</?php echo esc_url(!empty($url)?$url:'#');?>"> -->
										<span class="fa fa-shield"></span>
										<!-- <img class="img-responsive" src="<?php echo esc_url(get_template_directory_uri().'/images/Feature1.jpg');?>" alt="features" /> -->
									<!-- </a>  -->
								</div>
								<div class="features-content">
									<h3 class="inner-area-title">Safety Protocols</h3>
									<p>Vivamus est lacus, pretium et vitae, congue euismod quam. Vivamus quis tortor neque.</p>
									<div class="readmore">
										<a href="#">Read More <i class="fa fa-angle-double-right"></i></a>
									</div> 
								</div>
							</div>
							<div class="clearfix"></div>
						</div>
					<?php }

				}?>
			<!-- </div>  -->
			<div class="clearfix"></div>
			</div>
		</div> 
	</section> 
	<script type="text/javascript">
		var title = 0;
		jQuery("#features-section .mem-inn").each(function(){
		if ($(this).height() > title) { title = $(this).height(); }
		});
		jQuery("#features-section .mem-inn").height(title);


		// on Resize change height

		jQuery(window).resize(function(){
		jQuery("#features-section .mem-inn").height("");
		var title = 0;
		jQuery("#features-section .mem-inn").each(function(){
		if ($(this).height() > title) { title = $(this).height(); }
		});
		jQuery("#features-section .mem-inn").height(title);
		});
	</script>
	
<?php } 