<?php
/**
 * Template Name: Home Template
 */

get_header(); ?>

<main id="skip-content">
<?php if (get_theme_mod('water_delivery_services_slider_section_setting', true) != '') { ?>
  <section id="top-slider">
    <div class="row m-0">
      <div class="col-xl-7 col-lg-6 col-md-6 col- p-0 banner-left align-self-center">
        <?php if(get_theme_mod('water_delivery_services_slider_heading') != '' || get_theme_mod('water_delivery_services_slider_short_heading') != '' || get_theme_mod('water_delivery_services_slider_btn_url') != '' || get_theme_mod('water_delivery_services_slider_btn_text') != ''){ ?>
          <div class="banner-left-content">
            <?php if(get_theme_mod('water_delivery_services_slider_heading') != ''){ ?>
              <h3 class="slider-heading mb-3"><?php echo esc_html(get_theme_mod('water_delivery_services_slider_heading')); ?></h3>
            <?php }?>
            <?php if(get_theme_mod('water_delivery_services_slider_short_heading') != ''){ ?>
              <h6 class="main-content mb-3"><?php echo esc_html(get_theme_mod('water_delivery_services_slider_short_heading')); ?></h6>
            <?php }?>
            <?php if(get_theme_mod('water_delivery_services_slider_btn_url') != '' || get_theme_mod('water_delivery_services_slider_btn_text') != ''){ ?>
              <a class="banner-btn mb-5" href="<?php echo esc_url(get_theme_mod('water_delivery_services_slider_btn_url')); ?>"><?php echo esc_html(get_theme_mod('water_delivery_services_slider_btn_text')); ?></a>
            <?php }?>
          </div>
        <?php }?>
        <?php if(get_theme_mod('water_delivery_services_slider_counter_number_1') != '' || get_theme_mod('water_delivery_services_slider_counter_text_1') != '' || get_theme_mod('water_delivery_services_slider_counter_number_2') != '' || get_theme_mod('water_delivery_services_slider_counter_text_2') != '' || get_theme_mod('water_delivery_services_slider_counter_number_3') != '' || get_theme_mod('water_delivery_services_slider_counter_text_3') != ''){ ?>
          <div class="counter-box"  style="background-image: url(<?php echo esc_url(get_theme_mod('water_delivery_services_slider_counter_background_image')); ?>)">
            <div class="row">
              <div class="col-lg-4 col-md-4 col-sm-4 ps-5 counter-content-box">
                <?php if(get_theme_mod('water_delivery_services_slider_counter_number_1') != ''){ ?>
                  <h6 class="counter-number">
                    <?php echo esc_html(get_theme_mod('water_delivery_services_slider_counter_number_1')); ?>
                  </h6>
                <?php }?>
                <?php if(get_theme_mod('water_delivery_services_slider_counter_text_1') != ''){ ?>
                  <h5 class="counter-text">
                    <?php echo esc_html(get_theme_mod('water_delivery_services_slider_counter_text_1')); ?>
                  </h5>
                <?php }?>
              </div>
              <div class="col-lg-4 col-md-4 col-sm-4 ps-5 counter-content-box">
                <?php if(get_theme_mod('water_delivery_services_slider_counter_number_2') != ''){ ?>
                  <h6 class="counter-number">
                    <?php echo esc_html(get_theme_mod('water_delivery_services_slider_counter_number_2')); ?>
                  </h6>
                <?php }?>
                <?php if(get_theme_mod('water_delivery_services_slider_counter_text_2') != ''){ ?>
                  <h5 class="counter-text">
                    <?php echo esc_html(get_theme_mod('water_delivery_services_slider_counter_text_2')); ?>
                  </h5>
                <?php }?>
              </div>
              <div class="col-lg-4 col-md-4 col-sm-4 ps-5 counter-content-box">
                <?php if(get_theme_mod('water_delivery_services_slider_counter_number_3') != ''){ ?>
                  <h6 class="counter-number">
                    <?php echo esc_html(get_theme_mod('water_delivery_services_slider_counter_number_3')); ?>
                  </h6>
                <?php }?>
                <?php if(get_theme_mod('water_delivery_services_slider_counter_text_3') != ''){ ?>
                  <h5 class="counter-text">
                    <?php echo esc_html(get_theme_mod('water_delivery_services_slider_counter_text_3')); ?>
                  </h5>
                <?php }?>
              </div>
            </div>
          </div>
        <?php }?>
      </div>
      <div class="col-xl-5 col-lg-6 col-md-6 p-0 banner-right align-self-center">
        <?php if(get_theme_mod('water_delivery_services_banner_right_heading') != ''|| get_theme_mod('water_delivery_services_banner_right_list_heading_1') != '' || get_theme_mod('water_delivery_services_banner_right_list_text_1') != ''|| get_theme_mod('water_delivery_services_banner_right_list_heading_2') != '' || get_theme_mod('water_delivery_services_banner_right_list_text_2') != '' || get_theme_mod('water_delivery_services_banner_right_list_heading_3') != '' || get_theme_mod('water_delivery_services_banner_right_list_text_3') != ''){ ?>
          <div class="banner-right-box" style="background-image: url(<?php echo esc_url(get_template_directory_uri()) ?>/assets/img/banner-right.png)">
            <div class="right-content-box">
              <?php if(get_theme_mod('water_delivery_services_banner_right_heading') != ''){ ?>
                <h3 class="right-heading mb-4"><?php echo esc_html(get_theme_mod('water_delivery_services_banner_right_heading')); ?></h3>
              <?php }?>
              <div class="slider-right-points">
                <?php if(get_theme_mod('water_delivery_services_banner_right_list_heading_1') != '' || get_theme_mod('water_delivery_services_banner_right_list_text_1') != ''){ ?>
                  <div class="point-box mb-4">
                    <div class="row m-0">
                      <div class="col-lg-2 col-md-3 col-sm-3 col-3 align-self-center ps-0">
                        <div class="point-number">
                          1
                        </div>
                      </div>
                      <div class="col-lg-10 col-md-9 col-sm-9 col-9 align-self-center">
                        <?php if(get_theme_mod('water_delivery_services_banner_right_list_heading_1') != ''){ ?>
                          <h5 class="list-heading">
                            <?php echo esc_html(get_theme_mod('water_delivery_services_banner_right_list_heading_1')); ?>
                          </h5>
                        <?php }?>
                        <?php if(get_theme_mod('water_delivery_services_banner_right_list_text_1') != ''){ ?>
                          <p class="list-text m-0">
                            <?php echo esc_html(get_theme_mod('water_delivery_services_banner_right_list_text_1')); ?>
                        </p>
                        <?php }?>
                      </div>
                    </div>
                  </div>
                <?php }?>
                <?php if(get_theme_mod('water_delivery_services_banner_right_list_heading_2') != '' || get_theme_mod('water_delivery_services_banner_right_list_text_2') != ''){ ?>
                  <div class="point-box mb-4">
                    <div class="row m-0">
                      <div class="col-lg-2 col-md-3 col-sm-3 col-3 align-self-center ps-0">
                        <div class="point-number">
                          2
                        </div>
                      </div>
                      <div class="col-lg-10 col-md-9 col-sm-9 col-9 align-self-center">
                      <?php if(get_theme_mod('water_delivery_services_banner_right_list_heading_2') != ''){ ?>
                        <h5 class="list-heading">
                          <?php echo esc_html(get_theme_mod('water_delivery_services_banner_right_list_heading_2')); ?>
                        </h5>
                      <?php }?>
                      <?php if(get_theme_mod('water_delivery_services_banner_right_list_text_2') != ''){ ?>
                        <p class="list-text m-0">
                          <?php echo esc_html(get_theme_mod('water_delivery_services_banner_right_list_text_2')); ?>
                      </p>
                      <?php }?>
                      </div>
                    </div>
                  </div>
                <?php }?>
                <?php if(get_theme_mod('water_delivery_services_banner_right_list_heading_3') != '' || get_theme_mod('water_delivery_services_banner_right_list_text_3') != ''){ ?>
                  <div class="point-box mb-4">
                    <div class="row m-0">
                      <div class="col-lg-2 col-md-3 col-sm-3 col-3 align-self-center ps-0">
                        <div class="point-number">
                          3
                        </div>
                      </div>
                      <div class="col-lg-10 col-md-9 col-sm-9 col-9 align-self-center">
                      <?php if(get_theme_mod('water_delivery_services_banner_right_list_heading_3') != ''){ ?>
                        <h5 class="list-heading">
                          <?php echo esc_html(get_theme_mod('water_delivery_services_banner_right_list_heading_3')); ?>
                        </h5>
                      <?php }?>
                      <?php if(get_theme_mod('water_delivery_services_banner_right_list_text_3') != ''){ ?>
                        <p class="list-text m-0">
                          <?php echo esc_html(get_theme_mod('water_delivery_services_banner_right_list_text_3')); ?>
                      </p>
                      <?php }?>
                      </div>
                    </div>
                    
                  </div>
                <?php }?>
              </div>
              <?php if(get_theme_mod('water_delivery_services_banner_right_btn_url') != '' || get_theme_mod('water_delivery_services_banner_right_btn_text') != ''){ ?>
                <a class="banner-right-btn mb-4" href="<?php echo esc_url(get_theme_mod('water_delivery_services_banner_right_btn_url')); ?>"><?php echo esc_html(get_theme_mod('water_delivery_services_banner_right_btn_text')); ?></a>
              <?php }?>
              <div class="row m-0 slider-contact-box">
                <div class="col-lg-6 col-md-12 col-sm-6">
                  <?php if ( get_theme_mod('water_delivery_services_topbar_phone_number') != "" ) {?>
                    <div class="text-start py-2">
                      <p class="topbar-text">
                        <i class="fas fa-phone me-2"></i><?php esc_html_e('Quick Contact:','water-delivery-services');?>
                        <a href="tell:<?php echo esc_attr(get_theme_mod('water_delivery_services_topbar_phone_number')); ?>"><?php echo esc_html(get_theme_mod('water_delivery_services_topbar_phone_number')); ?></a>
                      </p>
                    </div>
                  <?php }?>
                </div>
                <div class="col-lg-6 col-md-12 col-sm-6">
                  <?php if ( get_theme_mod('water_delivery_services_topbar_email_id') != "" ) {?>
                    <div class="text-start py-2">
                      <p class="topbar-text m-0">
                        <i class="fas fa-envelope me-2"></i>
                        <a href="mailto:<?php echo esc_attr(get_theme_mod('water_delivery_services_topbar_email_id')); ?>"><?php echo esc_html(get_theme_mod('water_delivery_services_topbar_email_id')); ?></a>
                      </p>  
                    </div>
                  <?php }?>
                </div>
              </div>
            </div>
          </div>
        <?php }?>
      </div>
    </div>
    <?php if(get_theme_mod('water_delivery_services_banner_center_image') != ''){ ?>
      <div class="banner-center-image">
        <?php if(get_theme_mod('water_delivery_services_banner_center_image') != ''){ ?>
          <img src="<?php echo esc_url( get_theme_mod( 'water_delivery_services_banner_center_image' )); ?>" alt="Banner Center Image">
        <?php }?>
      </div>
      <div class="svg-of-circle">
        <svg width="740" height="792" viewBox="0 0 740 792" fill="none" xmlns="http://www.w3.org/2000/svg">
            <mask id="mask0_27_51" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="375" y="0" width="365" height="792">
                <rect x="375" width="365" height="792" fill="#D9D9D9"></rect>
            </mask>
            <g mask="url(#mask0_27_51)">
                <circle cx="375" cy="396" r="364.5" stroke="white" stroke-opacity="0.4" stroke-dasharray="10 10"></circle>
            </g>
            <mask id="mask1_27_51" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="365" height="792">
                <rect width="365" height="792" fill="#D9D9D9"></rect>
            </mask>
            <g mask="url(#mask1_27_51)">
                <circle cx="365" cy="396" r="364.5" stroke="#0771E3" stroke-opacity="0.4" stroke-dasharray="10 10"></circle>
            </g>
        </svg>
      </div>
    <?php }?>
  </section>
<?php }?>
<?php if (get_theme_mod('water_delivery_services_activities_section_setting', true) != '') { ?>
  <section class="featured py-5">
    <div class="container ">
      <div class="row m-0">
        <div class="col-lg-6 col-md-6 col-sm-12 col-12 align-self-center product-left-box">
          <?php if(get_theme_mod('water_delivery_services_left_image') != ''){ ?>
            <img src="<?php echo esc_url( get_theme_mod( 'water_delivery_services_left_image' )); ?>" alt="Services Image">
          <?php }?>
          <div class="heading-box text-start mb-4">
            <?php if(get_theme_mod('water_delivery_services_services_heading') != ''){ ?>
              <h3 class="main-heading mb-3"><?php echo esc_html(get_theme_mod('water_delivery_services_services_heading')); ?></h3>
            <?php }?>
            <?php if(get_theme_mod('water_delivery_services_services_content') != ''){ ?>
              <p class="main-content mb-4 pb-3"><?php echo esc_html(get_theme_mod('water_delivery_services_services_content')); ?></p>
            <?php }?>
            <?php if(get_theme_mod('water_delivery_services_product_btn_url_1') != '' || get_theme_mod('water_delivery_services_product_btn_text_1') != ''){ ?>
              <a class="product-btn" href="<?php echo esc_url(get_theme_mod('water_delivery_services_product_btn_url_1')); ?>"><?php echo esc_html(get_theme_mod('water_delivery_services_product_btn_text_1')); ?></a>
            <?php }?>
            <?php if(get_theme_mod('water_delivery_services_product_btn_url_2') != '' || get_theme_mod('water_delivery_services_product_btn_text_2') != ''){ ?>
              <a class="product-btn-1" href="<?php echo esc_url(get_theme_mod('water_delivery_services_product_btn_url_2')); ?>"><?php echo esc_html(get_theme_mod('water_delivery_services_product_btn_text_2')); ?></a>
            <?php }?>
          </div>
        </div>
        <div class="col-lg-6 col-md-6 col-sm-12 col-12 align-self-center">
          <div class="title-box mb-3">
            <?php if(get_theme_mod('water_delivery_services_section_right_heading') != ''){ ?>
              <h3 class="product-title"><?php echo esc_html(get_theme_mod('water_delivery_services_section_right_heading')); ?></h3>
            <?php }?>
          </div>
          <div class="owl-carousel product-home-box">
            <?php
            if ( class_exists( 'WooCommerce' ) ) {
              $water_delivery_services_args = array(
                'post_type' => 'product',
                'posts_per_page' => 6,
                'product_cat' => get_theme_mod('water_delivery_services_home_product'),
                'order' => 'ASC'
              );
              $loop = new WP_Query( $water_delivery_services_args );
              while ( $loop->have_posts() ) : $loop->the_post(); global $product; 
                $product_cats = wc_get_product_category_list( $product->get_id(), ', ', '<span class="woo-cat">', '</span>' );
                $product_cats_array = explode( ', ', strip_tags( $product_cats ) );
                ?>
                <div class="products-box mb-4">
                  <div class="product-image">
                    <a href="<?php echo esc_url(get_permalink( $loop->post->ID )); ?>"> <?php if (has_post_thumbnail( $loop->post->ID )) echo get_the_post_thumbnail($loop->post->ID, 'shop_catalog'); else echo '<img src="'.esc_url(woocommerce_placeholder_img_src()).'" />'; ?></a>
                    <div class="cart-btn"><?php if( $product->is_type( 'simple' ) ) { woocommerce_template_loop_add_to_cart(  $loop->post, $product );} ?> <i class="fas fa-shopping-cart ms-2"></i></div>
                  </div>
                  <div class="product-content mb-3 pt-3 text-start">
                    <h3 class="mb-2"><a href="<?php echo esc_url(get_permalink( $loop->post->ID )); ?>"><?php the_title(); ?></a></h3>
                    <div class="<?php echo esc_attr( apply_filters( 'woocommerce_product_price_class', 'price' ) ); ?> mb-2">
                      <?php echo $product->get_price_html(); ?><span class="default-text"><?php esc_html_e('( Inclusive Of All Taxes )','water-delivery-services');?></span>
                    </div>
                    <div class="row mb-3">
                      <div class="col-xl-5 col-lg-6 col-md-4 col-sm-5 col-6 align-self-center">
                        <a class="get-btn" href="<?php the_permalink(); ?>"><?php esc_html_e('Show Details','water-delivery-services'); ?></a>
                      </div>
                      <div class="col-xl-7 col-lg-6 col-md-8 col-sm-7 col-6 align-self-center text-end">
                        <?php if( $product->is_type( 'simple' ) ){ woocommerce_template_loop_rating( $loop->post, $product ); } ?>
                      </div>
                    </div>
                  </div>
                </div>
              <?php endwhile; wp_reset_postdata(); ?>
            <?php } ?>
          </div>
          <?php if(get_theme_mod('water_delivery_services_product_btn_url') != '' || get_theme_mod('water_delivery_services_product_btn_text') != ''){ ?>
            <a class="product-section-btn" href="<?php echo esc_url(get_theme_mod('water_delivery_services_product_btn_url')); ?>"><?php echo esc_html(get_theme_mod('water_delivery_services_product_btn_text')); ?></a>
          <?php }?>
        </div>
      </div>
    </div>
  </section>
<?php }?>
<section id="page-content">
  <div class="container">
    <div class="py-5">
      <?php
        if ( have_posts() ) :
          while ( have_posts() ) : the_post();
            the_content();
          endwhile;
        endif;
      ?>
    </div>
  </div>
</section>
</main>

<?php get_footer(); ?>