<?php if ( get_theme_mod( 'expert_ac_repair_show_hide_sec', false ) ) : ?>
  <section id="service-sec" class="py-5 px-md-0 px-3">
    <div class="container">
      <div class="text-center">
        <div class="serv-icon"></div>
        <?php
        // Short heading
        $expert_ac_repair_short_heading = get_theme_mod( 'expert_ac_repair_serv_short_heading', '' );
        if ( $expert_ac_repair_short_heading ) :
          ?>
          <p class="serv-short d-inline-block text-capitalize my-0 mb-2">
            <?php echo esc_html( $expert_ac_repair_short_heading ); ?>
          </p>
        <?php endif; ?>

        <?php
        // Section title
        $expert_ac_repair_section_title = get_theme_mod( 'expert_ac_repair_featured_section_title', '' );
        if ( $expert_ac_repair_section_title ) :
          ?>
          <h2 class="mb-lg-5 mb-4 text-capitalize">
            <?php echo esc_html( $expert_ac_repair_section_title ); ?>
          </h2>
        <?php endif; ?>
      </div>
      <?php
      // Posts query
      $expert_ac_repair_category_slug  = get_theme_mod( 'expert_ac_repair_featured_section_category', 'uncategorized' );
      $expert_ac_repair_posts_per_page = absint( get_theme_mod( 'expert_ac_repair_num_posts', 3 ) );

      $query = new WP_Query( array(
        'category_name'  => sanitize_title( $expert_ac_repair_category_slug ),
        'posts_per_page' => $expert_ac_repair_posts_per_page,
      ) );

      if ( $query->have_posts() ) : ?>
        <div class="services-carousel owl-carousel">
          <?php while ( $query->have_posts() ) : $query->the_post(); ?>
            <div class="item wow bounceIn" data-wow-delay="0.5s">
              <div class="cat-inner-box">
                <?php if ( has_post_thumbnail() ) : ?>
                  <?php the_post_thumbnail( 'full', array(
                    'alt' => esc_attr( get_the_title() ),
                  ) ); ?>
                <?php else : ?>
                  <div class="serv-img">
                    <img src="<?php echo esc_url( get_template_directory_uri() . '/assets/images/custom-header.png' ); ?>" alt="Default Image" />
                  </div>
                <?php endif; ?>

                <div class="inner-content text-center">
                  <h3 class="mb-0">
                    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                  </h3>
                </div>
              </div>
            </div>
          <?php endwhile; wp_reset_postdata(); ?>
        </div>
      <?php endif; ?>
    </div>
  </section>
<?php endif; ?>