<?php
/**
 * Template Part for displaying Services section in homepage
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package NDesign
 */

if ( get_theme_mod( 'service_title' ) || get_theme_mod( 'service_subtitle' ) || get_theme_mod( 'services' ) ) : ?>
	<section class="services-section grey-section page-section" id="services">
		<div class="container">
			<div class="row">
				<div class="col-12">
					<!-- Subtitle start -->
					<?php if ( get_theme_mod( 'service_subtitle' ) ) : ?>
						<h4 class="main-subtitle text-center">
							<?php echo esc_html( get_theme_mod( 'service_subtitle' ) ); ?>
						</h4>
					<?php endif ?>
					<!-- Subtitle end -->
					<!-- Title Start -->
					<?php if ( get_theme_mod( 'service_title' ) ) : ?>
						<h2 class="main-title text-center">
							<?php echo esc_html( get_theme_mod( 'service_title' ) ); ?>
						</h2>
					<?php endif ?>
					<!-- Title End -->
				</div>
			</div>
			<?php $ndesign_service_lists = get_theme_mod( 'services' ); ?>
			<?php if ( get_theme_mod( 'services' ) ) : ?>
				<div class="row">
					<div class="col-12 service-slider-wrap">
						<!-- Service Slider Start -->
						<div class="service-slider swiper-container">
							<div class="swiper-wrapper">
								<?php foreach ( $ndesign_service_lists as $ndesign_service_list ) : ?>
									<div class="swiper-slide">
										<!-- Service Content Block Start -->
										<div class="service-blk">
											<!-- Service Icon Start -->
											<div class="service-icon">
												<?php if ( wp_get_attachment_url( $ndesign_service_list['service_image'] ) ) { ?>
													<img src="<?php echo esc_url(wp_get_attachment_url( $ndesign_service_list['service_image'] )); ?>"  >
												<?php } ?>
											</div>
											<!-- Service Icon End -->
											<!-- Service Content Start -->
											<div class="service-content">
												<!-- Service Title Start -->
												<h2 class="service-title">
													<?php echo esc_html( $ndesign_service_list['service_name'] ); ?>
												</h2>
												<!-- Service Title End -->
												<!-- Service Description start -->
												<?php echo esc_html( $ndesign_service_list['service_description'] ); ?>
												<!-- Service Description end -->
											</div>
											<!-- Service Content end -->
										</div>
										<!-- Service Content Block End -->
									</div>
								<?php endforeach; ?>
							</div>
							<!-- Slider Pagination Start -->
							<div class="swiper-pagination"></div>
							<!-- Slider Pagination end -->
						</div>
						<!-- Service Slider End -->
						<!-- Slider Navigation start -->
						<div class="swiper-button-next"></div>
						<div class="swiper-button-prev"></div>
						<!-- Slider Navigation End -->
					</div>
				</div>
			<?php endif ?>
		</div>
	</div>
	</section>
<?php endif ?>
<!-- Service Section End -->
