<?php
if(get_theme_mod('process_area_disable') != 'on' ){ ?>
<section id="process" class="our-process">
		<?php
		// width 
			$c_width = get_theme_mod('process_c_width', 'container-fluid');

		    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
			}
		// Sub Heading Style
	    	$subheading_case = get_theme_mod('process_subtitle_case', 'uppercase');

		    if ($subheading_case === 'uppercase') {
				$text_case = 'uppercase';
			} elseif ($subheading_case === 'lowercase') {
			    $text_case = 'lowercase';
			} elseif ($subheading_case === 'capitalize') {
			    $text_case = 'capitalize';
			} else {
			    $text_case = 'capitalize'; // Default to 'left' if the setting is invalid
			}
		// Heading Style
	    	$heading_case = get_theme_mod('process_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
			}
  	?>
	<?php
		$process_page_id = get_theme_mod('process_page');
		$process_subtitle = get_theme_mod('process_subtitl', 'strategic flow');
		$process_title = get_theme_mod('process_title', 'Our process');
		$process_txt = get_theme_mod('process_txt', "We started with a simple mission — to create meaningful solutions that empower people and drive change. ");

	?>		
    <div class="<?php echo esc_attr($c_width); ?> cf-ps">
        <div class="our-process-row">
            <div class="titles-block">
                <div class="our-process-title">
                    <?php if( $process_subtitle ){ ?>
											<h3 style="text-transform: <?php echo esc_attr($subheading_case); ?>;>"><?php echo ($process_subtitle); ?></h3>
											<?php }?>
											<h2 style="text-transform: <?php echo esc_attr($heading_case); ?>;>"><?php echo ($process_title); ?></h2>	
											<p><?php echo ($process_txt); ?></p>
                    <div class="imgbx">
											<?php 
												$proces_imglh = get_theme_mod('proces_imglh');
												if(!empty($proces_imglh)){
													echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($proces_imglh).'" class="img-responsive secondry-bg-img" />';
												}else{
													echo '<img src="'.get_template_directory_uri().'/images/ser2.jpg" class="img-responsive" />';
												}
											?>	
										</div>
                </div>
            </div>
            <?php
			          $showStatic = true;
			          for( $i = 1; $i < 9; $i++ ){
			          	//$url = get_theme_mod('processprocessd_page_url_'.$i, '#');
			            $process_page_id = get_theme_mod('process_page_icon'.$i); 
			            if(!empty($process_page_id)){
			              $showStatic = false;
			              break;
			            }
			          }
			      	?>
            <div class="our-process-main processbx">
                <div class="cards-list">
                	<?php
													$cols = get_theme_mod('process_npp_count', 4);
													$cols++;
																// echo '$cold: '.$cols;
													switch($cols){
														case 1:
														$colCls = 'col-lg-12 col-md-12 col-sm-12 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-12 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');
												?>
														 						
									      <?php
									          for( $i = 1; $i <= $cols; $i++ ){
									            if($showStatic === false){
									            	//$url = get_theme_mod('processprocessd_page_url_'.$i, '#');
													//$process_page_id = get_theme_mod('process_page'.$i);
													$process_page_title = get_theme_mod('process_page_title'.$i, 'Discovery Call');
													$process_page_txt = get_theme_mod('process_page_txt'.$i, 'We begin by understanding your goals, challenges, and vision through a collaborative consultation.');
													$process_title_img = get_theme_mod('process_title_img'.$i); 
													$process_page_icon = get_theme_mod('process_page_icon'.$i);
													$process_page_icon = get_theme_mod('process_page_icon'.$i);
													if($process_page_icon){
									              
									      ?>
									      <div class=" process-card ">
							                <div class="process-single ">	                	
									            		<div class="process-icon">
								                  		<span class="<?php echo $process_page_icon; ?>"></span>         
								                	</div> 
								                	<div class="process-conbx">	
								                			<div class="process-title inner-area-title">
								                				<?php echo $process_page_title; ?>
								                			</div>	
								                			<p><?php echo $process_page_txt; ?></p>
								                	</div>	                	
															</div>
							          	</div>

									   <?php   }
												                          
												}else{?>
                    <div class="process-card">
      									<div class="process-single " >
		                      <div class="process-icon">
															<span class="fa fa-comments-o" ></span>
													</div>
													<div class="process-conbx">
			                        <div class="process-title inner-area-title">
			                            Assessing the Needs
			                        </div>
			                        <p>
			                            We communicate with you to identify needs for IT services and implement the
			                            solution.
			                        </p>
		                      </div>
		                    </div>
                    </div>
                     <?php }
									          }?>
                    
                </div>
            </div>
        </div>
    </div>
</section>
<?php }  