<?php
 if(get_theme_mod('facility_area_disable') != 'on' ){
?>
	<?php 
		if( get_theme_mod('facility_areaTpadding',true) ) {
			$facility_areaTpadding = 'padding-top:'.esc_attr(get_theme_mod('facility_areaTpadding')).';';
		}
		if( get_theme_mod('facility_areaBpadding',true) ) {
			$facility_areaBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('facility_areaBpadding')).';';
		}
	?>			
	<div class="facility-area " id="facility">		  
		<?php			
			$facility_heading = get_theme_mod('facility_heading', 'Become A Member');
			$facsubtext = get_theme_mod('facsubtext', 'Lorem ipsum dolor sit amet,magna aliqua.');
			$facbtn_text = get_theme_mod('facbtn_text', 'join Now');
			$facbtnlink = get_theme_mod('facbtnlink', '#');
 		?>
		<div class="container">
				<div class="main-box">
					<?php
						$showStatic = true;
						for( $i = 1; $i < 11; $i++ ){
							$facilityus_page_id1 = get_theme_mod('facilityus_list_icon'.$i); 
							if(!empty($facilityus_page_id1)){
								$showStatic = false;
								break;
							}
						}
					?>
				<div class="row mr-0">
						<div class="col-lg-6">
								<?php if($facility_heading || $facsubtext){ ?>	
										<div class="section-title">
												<h2><?php echo ($facility_heading);  ?></h2>
												<h5><?php echo ($facsubtext);  ?></h5>
										</div>
								<?php }?>
								<div class="facility-list">
									<?php
										$cols = get_theme_mod('facility_list_count', 3);
										$cols++;
										// echo '$cold: '.$cols;
										switch($cols){
											case 1:
											$colCls = 'col-md-12 col-sm-12';
											break;
											case 2:	
											$colCls = 'col-md-12 col-sm-12';
											
											case 3:
											case 4:
										
											case 5:
											case 6:

											case 9:
											case 11:
											case 13:
											case 15:
											$colCls = 'col-md-12 col-sm-12';
											break;
											default: 
											$colCls = 'col-md-12 col-sm-12';
											break;
										}
										$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
									?>
									<div class="facility-list-wrap">
											<?php
												for( $i = 1; $i <= $cols; $i++ ){
													if($showStatic === false){
												$facility_list_title = get_theme_mod('facility_list_title'.$i, 'Up to 40% Discount');
							 
												$facilityus_list_icon = get_theme_mod('facilityus_list_icon'.$i);
												if($facilityus_list_icon){
															
											?>
											<div class="facility-list-box">
													<div class="facility-list-icon">
															<span class="<?php echo $facilityus_list_icon; ?>"></span>
													</div>
												<div class="facility-list-single">
															<h4>
																<?php echo $facility_list_title; ?>
															</h4>
												</div>
											</div>
										<?php					
											}
										}else{?>
											<div class="facility-list-box">
													<div class="facility-list-icon">
															<span class="fa fa-hand-o-right"></span>
													</div>
													<div class="facility-list-single">
															<h4>Up to 40% Discount</h4>
													</div>
											</div>
											<?php }
											}?>
									</div>
								</div>
								<div class="fac-btn">
										<?php if($facbtn_text ){ ?>	
												<a href="<?php echo ($facbtnlink);  ?>">
														<?php echo ($facbtn_text);  ?>
														<svg viewBox="0 0 25 25" width="22" height="22">
														  <path d="m17.5 5.999-.707.707 5.293 5.293H1v1h21.086l-5.294 5.295.707.707L24 12.499l-6.5-6.5z" data-name="Right"/>
														</svg>
												</a>
										<?php }?>
								</div>
						</div>
						<div class="facilityus-post-wrap wow zoomIn col-lg-6">
							<?php
								$showStatic = true;
								for( $i = 1; $i < 11; $i++ ){
									$facilityus_page_id = get_theme_mod('facilityus_page_icon'.$i); 
									if(!empty($facilityus_page_id)){
										$showStatic = false;
										break;
									}
								}
							?>
							<?php
								$cols = get_theme_mod('facilityus_npp_count', 3);
								$cols++;
								// echo '$cold: '.$cols;
								switch($cols){
									case 1:
									$colCls = 'col-lg-6 col-md-6 col-sm-6';
									break;
									case 2:	
									$colCls = 'col-lg-6 col-md-6 col-sm-6';
									
									case 3:
									case 4:
								
									case 5:
									case 6:

									case 9:
									case 11:
									case 13:
									case 15:
									$colCls = 'col-lg-6 col-md-6 col-sm-6';
									break;
									default: 
									$colCls = 'col-lg-6 col-md-6 col-sm-6';
									break;
								}
								$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
							?>
							<div class="facilityus-post-boxes">
								<!-- <div class="owl-carousel owl-theme">  -->
								<div class="row mr-0">
								<?php
									for( $i = 1; $i <= $cols; $i++ ){
										if($showStatic === false){
									$url = get_theme_mod('luzuk_facility_page_url_'.$i, '#');	
									$facilityus_page_title = get_theme_mod('facilityus_page_title'.$i, 'Free Shipping');
									$facility_txt = get_theme_mod('facility_txt'.$i, 'Free Shipping On All Us Orders');
									$facilityus_page_id = get_theme_mod('facilityus_page'.$i); 
									$facilityus_page_icon = get_theme_mod('facilityus_page_icon'.$i);
									if($facilityus_page_icon){
												
								?>
								<div class="<?php echo $colCls;?> facilitybx">
										<div class="facilityus-single " data-wow-duration="1s">
												<div class="facility-box "> 
														<div class="hi-icon">
																<div class="icn-bx">
																	<span class="<?php echo $facilityus_page_icon; ?>"></span>
																</div>
														</div>
														<div class="facility-area-data">
																<div class="f-conbx">
																		<h4 class="inner-area-title"><?php echo $facilityus_page_title; ?></h4>
																		<p><?php echo $facility_txt; ?></p>
																</div>
														</div>
												</div> 			
										</div>
									</div>
								<?php					
									}
								}else{?>
									<div class="<?php echo $colCls;?> facilitybx">
											<div class="facilityus-single " data-wow-duration="1s">
													<div class="facility-box "> 
															<div class="hi-icon">
																	<div class="icn-bx">
																		<span class="fa fa-truck"></span>
																	</div>
															</div>
															<div class="facility-area-data">
																	<div class="f-conbx">
																			<h4 class="inner-area-title">Free Shipping</h4>
																			<p>Free Shipping On All Us Orders</p>
																	</div>
															</div>
													</div> 			
											</div>
									</div>
									<?php }

									}?>
								</div> 
							</div>
						</div>
				</div><!--row -->
			</div>
		</div>
	</div>
	<script type="text/javascript">
    var title = 0;
    jQuery(".service-area .facilityus-single-rhs").each(function(){
      if ($(this).height() > title) { title = $(this).height(); }
    });
    jQuery(".service-area .facilityus-single-rhs").height(title);


    // on Resize change height

    jQuery(window).resize(function(){
      jQuery(".facility-area .facilityus-single-rhs").height("");
      var title = 0;
      jQuery(".facility-area .facilityus-single-rhs").each(function(){
        if ($(this).height() > title) { title = $(this).height(); }
      });
      jQuery(".facility-area .facilityus-single-rhs").height(title);
    });
	</script>
	<script type="text/javascript">
    var title = 0;
    jQuery(".facility-area .facilityus-single").each(function(){
      if ($(this).height() > title) { title = $(this).height(); }
    });
    jQuery(".facility-area .facilityus-single").height(title);


    // on Resize change height

    jQuery(window).resize(function(){
      jQuery(".facility-area .facilityus-single").height("");
      var title = 0;
      jQuery(".facility-area .facilityus-single").each(function(){
        if ($(this).height() > title) { title = $(this).height(); }
      });
      jQuery(".facility-area .facilityus-single").height(title);
    });
	</script>
<?php }  