<?php   
if (get_theme_mod('dinero_features_enable', true) == true) { ?>

	<div class="features-area text-center" id="features">
		<div class="features-bg"></div>
			<div class="<?php if(get_theme_mod('dinero_features_section_width','Box Width') == 'Box Width'){ ?>container <?php } elseif(get_theme_mod('dinero_features_section_width','Box Width') == 'Full Width'){ ?> container-fluid <?php }?>">
			<?php
			$showStatic = true;
			for( $i = 1; $i < 7; $i++ ){
				$url = get_theme_mod('dinero_features_page_url_'.$i, '#');
				$link = get_theme_mod('dinero_features_page_link'.$i);
				$dinero_features_page_id = get_theme_mod('dinero_features_page_icon'.$i); 
				if(!empty($dinero_features_page_id)){
					$showStatic = false;
					break;
				}
			}
			$dinero_features_page_id = get_theme_mod('dinero_features_page');	
			$dinero_features_maintitle = get_theme_mod('dinero_features_maintitle', 'OUR FEATURES');
			$dinero_features_subtitle = get_theme_mod('dinero_features_subtitle', 'What We Provide To You');
			
			?>
			
			<div class="row ">
				<?php if($dinero_features_maintitle || $dinero_features_subtitle){ ?>
					<div class="col-xl-12 col-lg-12 col-sm-12">
					<div class="dinero-section-head" style="text-align: <?php if(get_theme_mod('dinero_features_head_align','Left') == 'Left'){ ?> left <?php } elseif(get_theme_mod('dinero_features_head_align','Center') == 'Center'){ ?> center <?php } elseif(get_theme_mod('dinero_features_head_align','Right') == 'Right'){ ?> right <?php } ?> ">
						
						<?php if($dinero_features_maintitle){ ?>
		                        <h2><?php echo ($dinero_features_maintitle);  ?></h2>
		                        <?php }?>
						   <?php if( get_theme_mod('dinero_features_head_icon_enable','No') == 'Yes'){ ?>
      						<div class="dinero-section-head-icon">
  								<i class="<?php echo esc_attr(get_theme_mod('dinero_features_head_icon', 'fa fa-bell')); ?>"></i>
  							</div>
  							<?php }?>
						<h3><?php echo ($dinero_features_subtitle);  ?></h3>
						<!-- <p><?php echo ($dinero_features_text);  ?></p>		 -->					
					</div>
				</div>
				<?php }?>
			</div>

			<div class="dinero-features-area">  
				<?php
				$cols = get_theme_mod('dinero_features_npp_count', 5);
				$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-12';
					break;
					case 3:
					case 5:
					case 6:
					case 9:
					case 11:
					case 13:
					case 15:
					$colCls = 'col-md-4 col-sm-6 col-xs-12';
					break;
					default: 
					$colCls = 'col-md-3 col-sm-6 col-xs-12';
					break;
				}
				$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
				?>

				<?php
				for( $i = 1; $i <= $cols; $i++ ){
					
					if($showStatic === false){
						$url = get_theme_mod('dinero_features_page_url_'.$i, '#');

						$dinero_features_page_title = get_theme_mod('dinero_features_page_title_'.$i, 'Business Analysis');
						$dinero_features_page_description = get_theme_mod('dinero_features_page_description_'.$i, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt');
						$dinero_features_page_id = get_theme_mod('dinero_features_page'.$i); 
						$dinero_features_page_icon = get_theme_mod('dinero_features_page_icon'.$i);
						if($dinero_features_page_icon){
							?>
							<div class="<?php echo $colCls;?> dinero-features-b">
								<div feature-match-height="groupName" class="dinero-features-single <?php echo esc_attr(get_theme_mod('dinero_features_box_onload_effects','wow zoomIn')); ?>" data-wow-duration="2s" style="text-align : <?php if(get_theme_mod('dinero_features_box_align','Center') == 'Center'){ ?> center <?php } elseif(get_theme_mod('dinero_features_box_align','Left') == 'Left'){ ?> left <?php } elseif(get_theme_mod('dinero_features_box_align','Right') == 'Right'){ ?> right <?php } ?> ">
										<a href="<?php echo esc_url(!empty($url)?$url:'#');?>" class="ficon">
											<div class="dinero-features-icon"><span class="<?php echo $dinero_features_page_icon; ?>"></span></div>
										</a>
																				
										<div class="dinero-features-content">
											<h4 class="dinero-features-title inner-area-title" style="text-transform : <?php if(get_theme_mod('dinero_features_title_case','Uppercase') == 'Uppercase'){ ?> uppercase <?php } elseif(get_theme_mod('dinero_features_title_case','Lowercase') == 'Lowercase'){ ?> lowercase <?php } elseif(get_theme_mod('dinero_features_title_case','Capitalize') == 'Capitalize'){ ?> capitalize <?php } ?>">
												<?php echo $dinero_features_page_title; ?>
											</h4>
											<p class="dinero-features-text inner-area-text">
												<?php echo $dinero_features_page_description; ?>
											</p>
											<div class="clearfix"></div>
										</div>
									</div>
								</div>
							<?php
						}
					}else{?>
						<div class="<?php echo $colCls;?> dinero-features-b">
								<div feature-match-height="groupName" class="dinero-features-single <?php echo esc_attr(get_theme_mod('dinero_features_box_onload_effects','wow zoomIn')); ?>" data-wow-duration="2s" style="text-align : <?php if(get_theme_mod('dinero_features_box_align','Center') == 'Center'){ ?> center <?php } elseif(get_theme_mod('dinero_features_box_align','Left') == 'Left'){ ?> left <?php } elseif(get_theme_mod('dinero_features_box_align','Right') == 'Right'){ ?> right <?php } ?> ">
										<a href="#" class="ficon">
											<div class="dinero-features-icon"><span class="fa fa-bar-chart"></span></div>
										</a>
										<div class="dinero-features-content">
											<h4 class="dinero-features-title inner-area-title" style="text-transform : <?php if(get_theme_mod('dinero_features_title_case','Uppercase') == 'Uppercase'){ ?> uppercase <?php } elseif(get_theme_mod('dinero_features_title_case','Lowercase') == 'Lowercase'){ ?> lowercase <?php } elseif(get_theme_mod('dinero_features_title_case','Capitalize') == 'Capitalize'){ ?> capitalize <?php } ?>">
												Business Analysis
											</h4>
											<p class="dinero-features-text inner-area-text">
												Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
											</p>
											<div class="clearfix"></div>
										</div>
									</div>
								</div>
					<?php }

				}?>

			</div>
	      
			</div>
		<div class="clearfix"></div>
	</div>
<script>
	var matchHeight = function () {
	
	function init() {
		eventListeners();
		matchHeight();
	}
	
	function eventListeners(){
		$(window).on('resize', function() {
			matchHeight();
		});
	}
	
	function matchHeight(){
		var groupName = $('[feature-match-height]');
		var groupHeights = [];
		
		groupName.css('min-height', 'auto');
		
		groupName.each(function() {
			groupHeights.push($(this).outerHeight());
		});
		
		var maxHeight = Math.max.apply(null, groupHeights);
		groupName.css('min-height', maxHeight);
	};
	
	return {
		init: init
	};
	
} ();

$(document).ready(function() {
	matchHeight.init();
});
</script>
<?php }