	<?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	
 			$features_maintitle = get_theme_mod('features_maintitle', 'JOIN OUR CLASSES');
		?>

		<div class="container">
			<div class=" justify-content-center">
				<?php if($features_maintitle ){ ?>
				<div class="section-title">
                  	<h2><?php echo ($features_maintitle);  ?></h2> 
              	</div> 
              	<?php }?>
			</div>
		</div>

		<?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">  	
			<div class="features-inn">

			<?php
				$cols = get_theme_mod('luzuk_features_npp_count', 5);
				$cols++;
							// echo '$cold: '.$cols;
				switch($cols){
					case 1:
					$colCls = 'col-md-12 col-sm-12';
					break;
					case 2:	
					$colCls = 'col-md-6 col-sm-6';
					break;
					case 3:
					case 5:
					case 6:
					case 9:
					case 11:
					case 13:
					case 15:
					$colCls = 'col-md-4 col-sm-6';
					break;
					default: 
					$colCls = 'col-md-3 col-sm-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, 'Sport Conditioning');
				$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="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" />
									 <div class="fea-olay"></div>
								</a>
							</div> 
							<div class="features-content">
								<a href="<?php echo esc_url(!empty($url)?$url:'#');?>">
									<h3 class="inner-area-title"><?php echo $features_page_title; ?></h3>
								</a>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="clearfix"></div>
					</div>
							<?php
						}
					}else{?>
					<div class="item ">
						<div class="mem-inn">
							<div class="sec-icn">
								<a href="<?php echo esc_url(!empty($url)?$url:'#');?>">
									<!-- <span class="fa fa-camera"></span> -->
									<img class="img-responsive" src="<?php echo esc_url(get_template_directory_uri().'/images/classes2.jpg');?>" alt="features" />
									<div class="fea-olay"></div>
								</a>
							</div>
							<div class="features-content">
								<a href="<?php echo esc_url(!empty($url)?$url:'#');?>">
									<h3 class="inner-area-title">Sport Conditioning</h3>
								</a>	
							</div>
							<div class="clearfix"></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 } 