<?php
 if(get_theme_mod('offres_area_disable') != 'on' ){
?>
	<?php 
		if( get_theme_mod('offres_areaTpadding',true) ) {
			$offres_areaTpadding = 'padding-top:'.esc_attr(get_theme_mod('offres_areaTpadding')).';';
		}
		if( get_theme_mod('offres_areaBpadding',true) ) {
			$offres_areaBpadding = 'padding-bottom:'.esc_attr(get_theme_mod('offres_areaBpadding')).';';
		}

	?>			
<div class="offres-area " id="offres">		  		
		<?php
				// width 
				$c_width = get_theme_mod('offer_c_width', 'container');

			    if ($c_width === 'container') {
				    $c_alignment = 'container';
				} elseif ($c_width === 'container-fluid') {
				    $c_alignment = 'container-fluid';
				} else {
				    $text_alignment = 'container'; // Default to 'container' if the setting is invalid
				}

				// Heading Style
        	$heading_case = get_theme_mod('offer_maintitle_case', 'capitalize');

		    if ($heading_case === 'uppercase') {
					$text_case = 'uppercase';
				} elseif ($heading_case === 'lowercase') {
				    $text_case = 'lowercase';
				} elseif ($heading_case === 'capitalize') {
				    $text_case = 'capitalize';
				} else {
				    $text_case = 'capitalize'; // Default to 'left' if the setting is invalid
				}
				 
				// Alientment
        $heading_alignment = get_theme_mod('offers_maintitle_align', 'left');

		    if ($heading_alignment === 'left') {
				    $text_alignment = 'left';
				} elseif ($heading_alignment === 'center') {
				    $text_alignment = 'center';
				} elseif ($heading_alignment === 'right') {
				    $text_alignment = 'right';
				} else {
				    $text_alignment = 'left'; // Default to 'left' if the setting is invalid
				}
    ?>
		<?php							
				$offres_title = get_theme_mod('offres_title', 'Our Best Offers');
				$offres_subtitle = get_theme_mod('offres_subtitle', 'Tax Included Plans');
				$offres_txt = get_theme_mod('offres_txt', 'There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or which do not look even slightly believable.');
		?>

		<?php if( $offres_title || $offres_subtitle || $offres_txt ){ ?>	 
		<div class="section-title">
				<div class="<?php echo esc_attr($c_width); ?>">
						<div class="row">
								<div class="col-lg-6">
										<div class="titlebx">
												<h3 style="text-align: <?php echo esc_attr($text_alignment); ?>; text-transform: <?php echo esc_attr($heading_case); ?>;"><?php echo ($offres_title); ?></h3>
												<h5 style="text-align: <?php echo esc_attr($text_alignment); ?>;"><?php echo ($offres_subtitle); ?></h5>
												<div class="titlebrd"></div>
										</div>
								</div>
								<div class="col-lg-6">
										<p>
											<?php echo ($offres_txt); ?>	
										</p>
										<div class="clearfix"></div>
								</div>
						</div>
				</div>
		</div>
		<?php }?>

		<div class="<?php echo esc_attr($c_width); ?>">
				<div class="cont-bx">
						<div class="main-box">
								<?php
									$showStatic = true;
									for( $i = 1; $i < 11; $i++ ){
										$offresus_page_id = get_theme_mod('offresus_page_icon'.$i); 
										if(!empty($offresus_page_id)){
											$showStatic = false;
											break;
										}
									}
								?>
								<div class="offresus-post-wrap ">
										
										<?php
											$cols = get_theme_mod('offresus_npp_count', 3);
											$cols++;
											// echo '$cold: '.$cols;
											switch($cols){
												case 1:
												$colCls = 'col-lg-12 col-md-12 col-sm-12';
												break;
												case 2:	
												$colCls = 'col-lg-6 col-md-6 col-sm-12';
												break;
												case 3:
												case 5:
												case 6:
												case 9:
												case 11:
												case 13:
												case 15:
												$colCls = 'col-lg-6 col-md-6 col-sm-12';
												break;
												default: 
												$colCls = 'col-lg-6 col-md-6 col-sm-12';
												break;
											}
											$icons = array(1=>'heart', 2=>'star', 3=>'flash', 4=>'bell',5=>'heart', 6=>'star', 7=>'flash', 8=>'bell');
										?>
											
													<!-- <div class="row mr-0"> -->
										<div class="offresus-post-boxes">
												<div class="owl-carousel owl-theme">
														<?php
															for( $i = 1; $i <= $cols; $i++ ){
																if($showStatic === false){
															$url = get_theme_mod('luzuk_offres_page_url_'.$i, '#');	

															$offresus_title1 = get_theme_mod('offresus_title1'.$i, 'Industrial Electricians');
															$offres_price1 = get_theme_mod('offres_price1'.$i, '$15.80');

															$offresus_title2 = get_theme_mod('offresus_title2'.$i, 'Commercial Electrician');
															$offres_price2 = get_theme_mod('offres_price2'.$i, '$14.40');

															$offresus_title3 = get_theme_mod('offresus_title3'.$i, 'Residential Electrician');
															$offres_price3 = get_theme_mod('offres_price3'.$i, '$12.50');

															$offresus_title4 = get_theme_mod('offresus_title4'.$i, 'Maintenance Electrician');
															$offres_price4 = get_theme_mod('offres_price4'.$i, '$17.30');

															$offresus_title5 = get_theme_mod('offresus_title5'.$i, 'Master Electrician');
															$offres_price5 = get_theme_mod('offres_price5'.$i, '$13.80');

															$offres_btntxt = get_theme_mod('offres_btntxt'.$i, 'Book Now ');

															$offresus_page_id = get_theme_mod('offresus_page'.$i); 
															$offresus_page_icon = get_theme_mod('offresus_page_icon'.$i);
															if($offresus_page_icon){
																		
														?>
															<!-- <div class="</?php echo $colCls;?> offresbx">	 -->
														<div class="item offresbx">					
																<div class="offresus-single " data-wow-duration="1s">
																		<div class="offres-box"> 	
																				<div class="icnbx">									
																						<div class="hi-icon">
																								<img src="<?php echo esc_url($offresus_page_icon); ?>" class="img-responsive" />
																						</div>	
																				</div>														
																				<div class="conbx">
																					<?php if( $offres_price1 || $offresus_title1 ){ ?>
																						<div class="conbxinn">
																								<div class="row mr-0">
																										<div class="ofrtle"><h5><?php echo $offresus_title1; ?></h5></div>
																										<div class="ofrprice"><?php echo $offres_price1; ?></div>
																										<div class="ofrbrd"></div>
																								</div>
																						</div>
																						<?php }?>
																						<?php if( $offresus_title2 || $offres_price2 ){ ?>
																						<div class="conbxinn">
																								<div class="row mr-0">
																										<div class="ofrtle"><h5><?php echo $offresus_title2; ?></h5>  </div>
																										<div class="ofrprice"> <?php echo $offres_price2; ?> </div>
																										<div class="ofrbrd"></div>
																								</div>
																						</div>
																						<?php }?>
																						<?php if( $offresus_title3 || $offres_price3 ){ ?>
																						<div class="conbxinn">
																								<div class="row mr-0">
																										<div class="ofrtle"><h5><?php echo $offresus_title3; ?></h5>  </div>
																										<div class="ofrprice"> <?php echo $offres_price3; ?> </div>
																										<div class="ofrbrd"></div>
																								</div>
																						</div>
																						<?php }?>
																						<?php if( $offresus_title4 || $offres_price4 ){ ?>
																						<div class="conbxinn">
																								<div class="row mr-0">
																										<div class="ofrtle"><h5><?php echo $offresus_title4; ?></h5>  </div>
																										<div class="ofrprice"> <?php echo $offres_price4; ?> </div>
																										<div class="ofrbrd"></div>
																								</div>
																						</div>
																						<?php }?>
																						<?php if( $offres_price5 || $offres_price5 ){ ?>	 	
																						<div class="conbxinn">
																								<div class="row mr-0">
																										<div class="ofrtle"><h5><?php echo $offresus_title5; ?></h5>  </div>
																										<div class="ofrprice"> <?php echo $offres_price5; ?> </div>
																										<div class="ofrbrd"></div>
																								</div>
																						</div>	
																						<?php }?>
																						<?php if( $offres_btntxt ){ ?>	 	
																						<div class="bttn">
																								<a href="<?php echo esc_url(!empty($url)?$url:'#');?>">
																								 	<?php echo $offres_btntxt; ?>
																								</a>
																						</div>	
																						<?php }?>
																				</div>					
																		</div>
																</div>
														</div>
														<?php					
															}
														}else{?>
																<!-- <div class="</?php echo $colCls;?> offresbx"> -->
														<div class="item offresbx">
																<div class="offresus-single " data-wow-duration="1s">
																		<div class="offres-box "> 	
																				<div class=" icnbx">	
																						<div class="hi-icon">
																								<img src="<?php echo esc_html(get_template_directory_uri()); ?>/images/best_offer.jpg" class="img-responsive" />
																						</div>
																				</div>
																				<div class="conbx">	
																						<div class="conbxinn">	
																								<div class="row mr-0">
																										<div class="ofrtle"><h5>Industrial Electricians</h5></div>
																										<div class="ofrprice"> $15.80 </div>
																										<div class="ofrbrd"></div>
																								</div>
																						</div>
																						<div class="conbxinn">
																								<div class="row mr-0">
																										<div class="ofrtle"><h5>Commercial Electrician</h5>  </div>
																										<div class="ofrprice"> $14.40 </div>
																										<div class="ofrbrd"></div>
																								</div>
																						</div>
																						<div class="conbxinn">
																								<div class="row mr-0">
																										<div class="ofrtle"><h5>Residential Electrician</h5>  </div>
																										<div class="ofrprice"> $12.50 </div>
																										<div class="ofrbrd"></div>
																								</div>
																						</div>
																						<div class="conbxinn">
																								<div class="row mr-0">
																										<div class="ofrtle"><h5>Maintenance Electrician</h5>  </div>
																										<div class="ofrprice"> $17.30 </div>
																										<div class="ofrbrd"></div>
																								</div>
																						</div>
																						<div class="conbxinn">
																								<div class="row mr-0">
																										<div class="ofrtle"><h5>Master Electrician </h5>  </div>
																										<div class="ofrprice"> $13.80 </div>
																										<div class="ofrbrd"></div>
																								</div>
																						</div>	
																						<div class="bttn">
																							<a href="#"> Book Now </a>
																						</div>
																				</div>
																																							
																		</div> 
																		<div class="clearfix"></div>			
																</div>
														</div>
															<?php }

															}?>
												</div> 
										</div>
								</div>
						</div>
				</div>
		</div>
</div>

	 <script>
      $(document).ready(function() {
        $('.offres-area .owl-carousel').owlCarousel({
          refreshClass: 'owl-refresh',
          autoplayTimeout:5000,
          loop: true,
          margin: 30,
          autoHeight: false,
          autoWidth: false,
          autoplay: true,
          // rtl:true,
          navText: [
                    '<i class="fa fa-long-arrow-left"></i> ',
                    '<i class="fa fa-long-arrow-right" ></i>'
                ],
          responsiveClass: true,
          responsive: {
            0: {
              items: 1,
              nav: true,
              margin: 10
            },
            400: {
              items: 1,
              nav: true,
              margin: 10
            },
            500: {
              items: 1,
              nav: true,
              margin: 10
            },
            991: {
              items:1,
              nav: true,
              margin: 10
            },
            1000: {
              items:2,
              nav: true,
              loop: true,
              margin: 50
            }
          }
        })
      })
  </script>
<?php }  