<?php

if(get_theme_mod('feature_area_disable') != 'on' ){
	?>
	<?php 
		if( get_theme_mod('feature_areaTpadding',true) ) {
			$feature_areaTpadding = 'padding-top:'.esc_attr(get_theme_mod('feature_areaTpadding')).';';
		}
		if( get_theme_mod('feature_areaBpadding',true) ) {
			$feature_areaBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('feature_areaBpadding')).';';
		}
	
?>	 	
<div class="feature-area" id="feature" >
	  <?php
        $showStatic = true;
        for( $i = 1; $i < 9; $i++ ){
          $feature_page_id = get_theme_mod('feature_page_title'.$i); 
          if(!empty($feature_page_id)){
            $showStatic = false;
            break;
          }
        }
    ?>
    <div class="fea-content">
			<div class="feature-area-data">
				<div class="container">
					<div class="row"> 
							<div class="col-xl-4 col-lg-4">
									<div class="feature-single-area">  
											<?php
											$cols = get_theme_mod('feature_npp_count', 2);
											$cols++;
														// echo '$cold: '.$cols;
											switch($cols){
												case 1:
												$colCls = 'col-lg-12 col-md-12 col-sm-6 col-xs-12';
												break;
												case 2:	
												$colCls = 'col-lg-12 col-md-12 col-sm-12 col-xs-12';
												break;
												case 3:
												case 5:
												case 6:
												case 9:
												case 11:
												case 13:
												case 15:
												$colCls = 'col-lg-12 col-md-12 col-sm-6 col-xs-12';
												break;
												default: 
												$colCls = 'col-lg-12 col-md-12 col-sm-12 col-xs-12';
												break;
											}
											$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
											?>
											<div class="feature-post-boxes">
								            <?php
									            for( $i = 1; $i <= $cols; $i++ ){
									              if($showStatic === false){
									               	$feature_page_id = get_theme_mod('feature_page'.$i);
									                	$feature_page_title = get_theme_mod('feature_page_title'.$i, 'Quality Products');
									                	$feature_page_txt = get_theme_mod('feature_page_txt'.$i, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, magna aliqua.');
									             		$feature_page_icon = get_theme_mod('feature_page_icon'.$i);
									              if($feature_page_title){
								             ?>
							              <div class="f-leftbx fea-single">
				                      	<div class="fea-box">
				                      			<div class="fea-title inner-area-title">
				                      					<?php echo $feature_page_title; ?>
				                      			</div>
				                      			<p><?php echo $feature_page_txt; ?></p>
				                      	</div>
							                  <div class="clearfix"></div>
							              </div>
					                <?php
					                      }  
					                }else{?>
													<div class="f-leftbx fea-single">
																<div class="fea-box">
																		<div class="fea-title inner-area-title">Quality Products </div>
																		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, magna aliqua.</p>
																</div>
															<div class="clearfix"></div>
													</div>
					                <?php }
					              }?>
					             <div class="clearfix"></div>
					        </div>
							</div>
						</div>
						<div class="col-xl-4 col-lg-4">
							  <div class="fea-img">
										<?php 
												$feature_image = get_theme_mod('feature_image');
												if(!empty($feature_image)){
													echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($feature_image).'" class="img-responsive secondry-bg-img" />';
												}else{
													echo '<img src="'.get_template_directory_uri().'/images/feature.png" class="img-responsive" />';
												}
										?>
										<?php 
												$feature_imgtxt = get_theme_mod('feature_imgtxt', 'premium wine brand. premium wine brand.');
												if($feature_imgtxt){
										?>
											 <svg width="143" height="137" viewBox="0 0 143 137">
									        <defs>
									            <path id="circlePath" d="M 71.5,68.5 m -60,0 a 60,60 0 1,1 120,0 a 60,60 0 1,1 -120,0" />
									        </defs>
									        <text font-size="17" text-anchor="middle">
									            <textPath href="#circlePath" startOffset="50%">
									                <?php echo $feature_imgtxt; ?>
									            </textPath>
									        </text>
									    </svg>
									  <?php } ?>
								</div>
						</div>
						<div class="col-xl-4 col-lg-4">
								<div class="feature-single-area">  
											 <?php
									        $showStatic = true;
									        for( $i = 1; $i < 9; $i++ ){
									          $feature_page_id1 = get_theme_mod('feature_page_title_right'.$i); 
									          if(!empty($feature_page_id1)){
									            $showStatic = false;
									            break;
									          }
									        }
									    ?>
											<?php
											$cols = get_theme_mod('feature_npp_rightcount', 2);
											$cols++;
														// echo '$cold: '.$cols;
											switch($cols){
												case 1:
												$colCls = 'col-lg-12 col-md-12 col-sm-6 col-xs-12';
												break;
												case 2:	
												$colCls = 'col-lg-12 col-md-12 col-sm-12 col-xs-12';
												break;
												case 3:
												case 5:
												case 6:
												case 9:
												case 11:
												case 13:
												case 15:
												$colCls = 'col-lg-12 col-md-12 col-sm-6 col-xs-12';
												break;
												default: 
												$colCls = 'col-lg-12 col-md-12 col-sm-12 col-xs-12';
												break;
											}
											$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
											?>
											<div class="feature-post-boxesright">
								            <?php
									            for( $i = 1; $i <= $cols; $i++ ){
									              if($showStatic === false){
									               	$feature_page_id1 = get_theme_mod('feature_page'.$i);
								                	$feature_page_title_right = get_theme_mod('feature_page_title_right'.$i, 'Quality Products');
								                	$feature_page_txt_right = get_theme_mod('feature_page_txt_right'.$i, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, magna aliqua.');
									             if($feature_page_title_right){
								             ?>
							              <div class="f-righttbx fea-single">
				                      	<div class="fea-box">
				                      			<div class="fea-title inner-area-title">
				                      					<?php echo $feature_page_title_right; ?>
				                      			</div>
				                      			<p><?php echo $feature_page_txt_right; ?></p>
				                      	</div>
							                  <div class="clearfix"></div>
							              </div>
					                <?php
					                      }  
					                }else{?>
														<div class="f-righttbx fea-single">
																<div class="fea-box">
																		<div class="fea-title inner-area-title">Quality Products </div>
																		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, magna aliqua.</p>
																</div>
														</div>
							                <?php }
							              }?>
					             <div class="clearfix"></div>
					        </div>
							</div>
						</div>
					</div>
				</div>
		</div>
		</div>
</div> 
	<!-- feature Area Start -->
<script type="text/javascript">
    var title = 0;
    jQuery("#feature .fea-single").each(function(){
      if ($(this).height() > title) { title = $(this).height(); }
    });
    jQuery("#feature .fea-single").height(title);

    jQuery(window).resize(function(){
      jQuery("#feature .fea-single").height("");
      var title = 0;
      jQuery("#feature .fea-single").each(function(){
        if ($(this).height() > title) { title = $(this).height(); }
      });
      jQuery("#feature .fea-single").height(title);
    });
</script>

<?php } 