<?php if (get_theme_mod('expert_construction_company_show_hide_sec', true)) : ?>
  <section id="service-sec" class="py-5 px-md-0 px-3">
    <div class="container">
      <div class="text-center">
        <?php if (get_theme_mod('expert_construction_company_serv_short_heading') != '') { ?>
          <p class="serv-short text-center d-inline-block text-capitalize mb-2"><?php echo esc_html(get_theme_mod('expert_construction_company_serv_short_heading', '')); ?></p>
        <?php } ?>
        <?php if (get_theme_mod('expert_construction_company_featured_section_title')) : ?>
          <h2 class="text-center mb-lg-5 mb-4 text-capitalize"><?php echo esc_html(get_theme_mod('expert_construction_company_featured_section_title', '')); ?></h2>
        <?php endif; ?>
      </div>
        <div class="services-carousel owl-carousel">
          <?php
            $expert_construction_company_post_category = get_theme_mod('expert_construction_company_featured_section_category','uncategorized');
            $expert_construction_company_num_posts = get_theme_mod('expert_construction_company_num_posts', 3); 

            if ($expert_construction_company_post_category) :
              $expert_construction_company_page_query = new WP_Query(array(
                'category_name' => esc_html($expert_construction_company_post_category),
                'posts_per_page' => $expert_construction_company_num_posts,
              ));

              if ($expert_construction_company_page_query->have_posts()) :
                while ($expert_construction_company_page_query->have_posts()) : $expert_construction_company_page_query->the_post(); ?>
                  <div class="item wow fadeInUp" data-wow-delay="0.5s">
                    <div class="position-relative mb-4">
                      <div class="cat-inner-box">
                        <?php if (has_post_thumbnail()) : ?>
                            <img src="<?php echo esc_url(get_the_post_thumbnail_url(null, 'full')); ?>" alt="<?php the_title_attribute(); ?>" />
                        <?php else : ?>
                            <img src="<?php echo esc_url(get_template_directory_uri() . '/assets/images/services1.png'); ?>" alt="<?php the_title_attribute(); ?>" />
                        <?php endif; ?>
                        <div class="inner-content">
                          <div class="row">
                            <div class="col-lg-9 col-md-9 col-9 post-content p-0">
                              <div class="post-title">
                                <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                              </div>
                              <div class="more-details">
                                <a href="<?php the_permalink(); ?>"><?php esc_html_e('View Details', 'expert-construction-company'); ?><i class="fas fa-arrow-right ms-2"></i></a>
                              </div>
                            </div>
                            <div class="col-lg-3 col-md-3 col-3 post-icon">
                              <?php 
                              $expert_construction_company_services_icon = get_theme_mod('expert_construction_company_services_icon', 'fas fa-house-user');

                              if (!empty($expert_construction_company_services_icon)) : ?>
                              <div class="icon">
                                  <i class="<?php echo esc_attr($expert_construction_company_services_icon); ?> main-icon"></i>
                              </div>
                              <?php endif; ?>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                <?php endwhile;
                wp_reset_postdata();
              endif;
            endif;
          ?>
        </div>
    </div>
  </section>
<?php endif; ?>