<?php
/**
 * Template Name: Custom Home Page
 */
get_header();

?>

<!-- slider section -->
<main id="maincontent" role="main">
  <?php do_action( 'repair_shop_above_slider' ); ?>
  
  <?php if (get_theme_mod('repair_shop_hide_show_slider_section', true)== 1 || get_theme_mod( 'repair_shop_resp_slider_hide_show', true) == 1) { ?>
  <?php 
    $repair_shop_number = get_theme_mod('repair_shop_slide_number');
    if($repair_shop_number != ''){
  ?>
    <section class="slider-section wow fadeInRightBig position-relative" data-wow-delay=".25s">
      <div id="slider" class="mw-100 m-auto p-0">
        <div id="carouselExampleIndicators" class="carousel slide carousel-fade" data-bs-ride="carousel">
          <!-- Slider Items -->
          <div class="carousel-inner" role="listbox">
            <?php for ($repair_shop_i = 1; $repair_shop_i <= $repair_shop_number; $repair_shop_i++) { ?>
              <div class="carousel-item <?php echo $repair_shop_i == 1 ? 'active' : ''; ?>">
                <?php if (get_theme_mod('repair_shop_slider_bg_img' . $repair_shop_i) != "") { ?>
                  <div class="slider-img position-relative">
                    <img class="slider-carousel-img" src="<?php echo esc_url(get_theme_mod('repair_shop_slider_bg_img' . $repair_shop_i)); ?>" alt="Slide <?php echo $repair_shop_i; ?>">
                    <div class="slider-overlay"></div>
                  </div>
                <?php } ?>
                <div class="carousel-caption">
                  <div class="container">
                    <div class="row">
                      <div class="col-xl-7 col-lg-7 col-md-7 col-12 align-self-center">
                        <div class="inner_carousel text-start">
                          <div class="row">
                            <div class="col-xl-2 col-lg-2 col-md-2 col-12 align-self-center d-flex justify-content-lg-end justify-content-md-end justify-content-center">
                              <?php if (get_theme_mod('repair_shop_slider_small_title' . $repair_shop_i) != '') { ?>
                                <p class="slider-small-title text-uppercase"><?php echo esc_html(get_theme_mod('repair_shop_slider_small_title' . $repair_shop_i)); ?></p>
                              <?php } ?>
                            </div>
                            <div class="col-xl-10 col-lg-10 col-md-10 col-12">
                              <?php if (get_theme_mod('repair_shop_slider_title' . $repair_shop_i) != '') { ?>
                                <h1 class="slider-title text-uppercase"><?php echo esc_html(get_theme_mod('repair_shop_slider_title' . $repair_shop_i)); ?></h1>
                              <?php } ?>
                              <?php if (get_theme_mod('repair_shop_slider_text' . $repair_shop_i) != '') { ?>
                                <p class="slider-text mt-3"><?php echo esc_html(get_theme_mod('repair_shop_slider_text' . $repair_shop_i)); ?></p>
                              <?php } ?>
                            </div>
                          </div>
                          <div class="d-flex justify-content-lg-start justify-content-md-start justify-content-center align-items-center gap-2 mt-3 slider-main-btn">
                            <?php 
                              for ($repair_shop_j = 1; $repair_shop_j <= 2; $repair_shop_j++) {
                              if( get_theme_mod('repair_shop_slider_button_text'.$repair_shop_i .$repair_shop_j) != '' ){ ?>
                                <div class="slider-btn text-center">
                                  <a href="<?php echo esc_html(get_theme_mod('repair_shop_slider_button_link'.$repair_shop_i .$repair_shop_j)); ?>"><span class="text-uppercase"><?php echo esc_html( get_theme_mod('repair_shop_slider_button_text'.$repair_shop_i .$repair_shop_j)); ?></span><span class="screen-reader-text"><?php echo esc_html( get_theme_mod('repair_shop_slider_button_text'.$repair_shop_i .$repair_shop_j)); ?></span></a>
                                </div>
                            <?php }} ?>
                            <!-- Navigation Controls -->
                            <?php if( get_theme_mod( 'repair_shop_display_slider_icons', true) == true ) { ?>
                              <div class="slider-arrows d-flex gap-2">
                                <a class="carousel-control-prev" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev" role="button">
                                  <span class="carousel-control-prev-icon w-auto h-auto" aria-hidden="true"><i class="<?php echo esc_attr(get_theme_mod('repair_shop_slider_previous_icon','fa-solid fa-angle-left')); ?>" ></i></span>
                                  <span class="screen-reader-text"><?php esc_html_e( 'Previous','repair-shop' );?></span>
                                </a>
                                <a class="carousel-control-next" data-bs-target="#carouselExampleIndicators" data-bs-slide="next" role="button">
                                  <span class="carousel-control-next-icon w-auto h-auto" aria-hidden="true"><i class="<?php echo esc_attr(get_theme_mod('repair_shop_slider_next_icon','fa-solid fa-angle-right')); ?>" ></i></span>
                                  <span class="screen-reader-text"><?php esc_html_e( 'Next','repair-shop' );?></span>
                                </a>  
                              </div>
                            <?php }?>
                          </div>
                        </div>
                      </div>
                      <div class="col-xl-5 col-lg-5 col-md-5 col-12 side-img">
                        <?php if ( get_theme_mod('repair_shop_featured_image_sec'.$repair_shop_i) != '' ) {?>
                          <img class="featured-img" src="<?php echo esc_url(get_theme_mod('repair_shop_featured_image_sec'.$repair_shop_i)); ?>" alt="" title="<?php echo esc_attr('#sliderimage'); ?>">
                        <?php }?>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            <?php } ?>
          </div>
          <!-- Indicators -->
          <div class="slider-indicator carousel-indicators">
            <div class="slider-dots">
              <?php for ($repair_shop_i = 1; $repair_shop_i <= $repair_shop_number; $repair_shop_i++) { ?>
                <button type="button"
                  data-bs-target="#carouselExampleIndicators"
                  data-bs-slide-to="<?php echo esc_html($repair_shop_i - 1); ?>"
                  class="<?php echo $repair_shop_i == 1 ? 'active' : ''; ?>">
                </button>
              <?php } ?>
            </div>
          </div>
        </div>
      </div>
    </section>
  <?php }}?>
  <?php do_action( 'repair_shop_below_slider' ); ?>

  <!-- Team Section -->
  <?php if (get_theme_mod('repair_shop_hide_show_team_section', true)) {?>
    <section id="team-sec" class="py-5">
      <div class="container">
        <div class="profile-slide position-relative pb-5">
          <div class="about-text pb-4">
            <div class="row">
              <div class="col-xl-1 col-lg-1 col-md-1 col-sm-12 col-12">
                <?php if(get_theme_mod('repair_shop_about_side_text') != ''){ ?>
                  <p class="side-text text-uppercase"><?php echo esc_html(get_theme_mod('repair_shop_about_side_text')); ?></p>
                <?php } ?>
              </div>
              <div class="col-xl-9 col-lg-9 col-md-9 col-sm-12 col-12 text-start about-main-text">
                <?php if(get_theme_mod('repair_shop_special_heading') != ''){ ?>
                  <h2 class="team-title text-capitalize position-relative mb-3 pb-3"><?php echo esc_html(get_theme_mod('repair_shop_special_heading')); ?></h2>
                <?php } ?>
                <?php if(get_theme_mod('repair_shop_special_text') != ''){ ?>
                  <p class="mb-2 team-text"><?php echo esc_html(get_theme_mod('repair_shop_special_text')); ?></p>
                <?php } ?>
              </div>
            </div>
          </div>
          <?php 
            $repair_shop_profile_count = get_theme_mod('repair_shop_profile_box');
            if($repair_shop_profile_count != ''){
          ?>
          <div class="owl-carousel">
            <?php for ($repair_shop_j = 1; $repair_shop_j <= $repair_shop_profile_count; $repair_shop_j++) { ?>
              <div class="row">
                <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 pe-0">
                  <?php if ( get_theme_mod('repair_shop_profile_image_sec' . $repair_shop_j) != '' ) {?>
                    <div class="profile-img">
                      <img src="<?php echo esc_url(get_theme_mod('repair_shop_profile_image_sec'. $repair_shop_j)); ?>" alt="" title="<?php echo esc_attr('#profile'); ?>">
                    </div>
                  <?php } ?>
                </div>
                <div class="col-xl-5 col-lg-5 col-md-5 col-sm-11 col-11 align-self-center profile-details text-start ps-4 py-3">
                  <div class="profile-main-details pb-3 mb-3 position-relative">
                    <?php if (get_theme_mod('repair_shop_profile_name'.$repair_shop_j) != '') { ?>
                      <a href="<?php echo esc_html(get_theme_mod('repair_shop_profile_name_link'.$repair_shop_j)); ?>"><p class="profile-name text-uppercase me-2 mb-0"><?php echo esc_html(get_theme_mod('repair_shop_profile_name'.$repair_shop_j)); ?></p></a>
                    <?php } ?>
                    <?php if (get_theme_mod('repair_shop_designate_name'.$repair_shop_j) != '') { ?>
                      <p class="designation text-capitalize mb-0"><?php echo esc_html(get_theme_mod('repair_shop_designate_name'.$repair_shop_j)); ?></p>
                    <?php } ?>
                  </div>
                  <?php if(get_theme_mod('repair_shop_phone_number'.$repair_shop_j) != ''){ ?>
                    <span class="phone-number">
                      <i class="<?php echo esc_attr( get_theme_mod('repair_shop_phone_icon'.$repair_shop_j, 'fa-solid fa-phone') ); ?> me-2"></i>
                      <a href="tel:<?php echo esc_attr( get_theme_mod('repair_shop_phone_number'.$repair_shop_j) ); ?>">
                        <?php echo esc_html( get_theme_mod('repair_shop_phone_number'.$repair_shop_j) ); ?>
                      </a>
                    </span>
                  <?php } ?>
                  <?php if(get_theme_mod('repair_shop_email_address'.$repair_shop_j) != ''){ ?>
                    <span class="mail my-2">
                      <a href="mailto:<?php echo esc_attr(get_theme_mod('repair_shop_email_address'.$repair_shop_j));?>"><i class="<?php echo esc_attr(get_theme_mod('repair_shop_email_address_icon'.$repair_shop_j,'fa-solid fa-envelope')); ?> me-2"></i><span><?php echo esc_html(get_theme_mod('repair_shop_email_address'.$repair_shop_j));?></span></a>
                    </span>
                  <?php } ?>
                  <div class="social-icons">

                    <?php if (is_active_sidebar('social-widget-' . $repair_shop_j )) : ?>
                      <?php dynamic_sidebar('social-widget-' . $repair_shop_j); ?>
                    <?php else : ?>
                      <!-- Default Social Icons Widgets -->
                      <div class="widget">
                        <div class="custom-social-icons" >
                          <a href="https://facebook.com" target="_blank"><i class="fab fa-facebook"></i></a> 
                          <a href="https://twitter.com" target="_blank"><i class="fab fa-twitter"></i></a> 
                          <a href="https://instagram.com" target="_blank"><i class="fab fa-instagram"></i></a> 
                          <a href="https://linkedin.com" target="_blank"><i class="fa-brands fa-linkedin-in"></i></a>
                          <a href="https://pinterest.com" target="_blank"><i class="fa-brands fa-pinterest-p"></i></a>
                          <a href="https://youtube.com" target="_blank"><i class="fa-brands fa-youtube"></i></a>
                        </div>
                      </div>
                    <?php endif; ?> 








                    <?php if ( is_active_sidebar( 'social-widget-' . $repair_shop_j ) ) : ?>
                      <?php dynamic_sidebar('social-widget-' . $repair_shop_j); ?>
                    <?php endif; ?>
                  </div>
                </div>
              </div> 
            <?php } ?>
          </div>
          <?php }?>
        </div>
      </div>
    </section>
  <?php }?>

  <div id="content-vw" class="entry-content">
    <div class="container">
      <?php while (have_posts()) : the_post(); ?>
        <?php the_content(); ?>
      <?php endwhile; // end of the loop. 
      ?>
    </div>
  </div>
  
</main>

<?php get_footer(); ?> 