<?php
/*
Template Name: Inventory replenishment
*/

get_header('new');
?>

<!-- Banner Section -->
<?php
// Banner content
$banner_heading         = get_field('ir_banner_heading');
$banner_description     = get_field('ir_banner_description');

$primary_btn_text       = get_field('ir_primary_btn_text');
$primary_btn_url        = get_field('ir_primary_btn_url');

$secondary_btn_text     = get_field('ir_secondary_btn_text');
$secondary_btn_url      = get_field('ir_secondary_btn_url');

// Client trust images
$left_worker_image      = get_field('ir_left_worker_image');
$right_worker_image     = get_field('ir_right_worker_image');

// Cost reduction stats
$reduction_percentage   = get_field('ir_reduction_percentage');
$reduction_label        = get_field('ir_reduction_label');

// Trusted clients section
$trusted_clients_title  = get_field('ir_trusted_clients_title');
$community_text         = get_field('ir_community_text');
?>

<section class="section banner inventory-replenishment-banner pb-5 no-lazy">
  <div class="container">
    <div class="row mt-xl-5 mt-lg-0">
      <div class="col-lg-12">
        <div class="text-cont text-center slide-right mt-0">

          <?php if (!empty($banner_heading)) : ?>
            <h1 class="banner-heading mb-4">
              <?php echo wp_kses_post($banner_heading); ?>
            </h1>
          <?php endif; ?>

          <?php if (!empty($banner_description)) : ?>
            <p class="banner-content">
              <?php echo wp_kses_post($banner_description); ?>
            </p>
          <?php endif; ?>

          <div class="banner-btns justify-content-center">
            <?php if (!empty($primary_btn_text)) : ?>
              <a href="<?php echo esc_url($primary_btn_url ?: 'javascript:;'); ?>" class="primary animated-cta-btn">
                <?php echo esc_html($primary_btn_text); ?>
              </a>
            <?php endif; ?>

            <?php if (!empty($secondary_btn_text)) : ?>
              <a href="<?php echo esc_url($secondary_btn_url ?: 'javascript:;'); ?>" class="border-gradient-btn animated-btn">
                <?php echo esc_html($secondary_btn_text); ?>
                <svg width="14" height="11" viewBox="0 0 14 11" fill="none" xmlns="http://www.w3.org/2000/svg">
                  <path d="M5.35816 0.0996094H7.95016L13.3502 5.49961L7.95016 10.8996H5.35816L9.82216 6.43561H0.660156V4.56361H9.82216L5.35816 0.0996094Z" fill="black"/>
                </svg>
              </a>
            <?php endif; ?>
          </div>

        </div>
      </div>
    </div>

    <div class="client-trust">
      <div class="left-img-wrapper">
        <?php if (!empty($left_worker_image) && !empty($left_worker_image['url'])) : ?>
          <img src="<?php echo esc_url($left_worker_image['url']); ?>"
               class="img-fluid"
               alt="<?php echo esc_attr($left_worker_image['alt'] ?? 'client-trust'); ?>">
        <?php endif; ?>
      </div>

      <div class="trusted-delights-content">
        <div class="cost-reduction">
          <?php if (!empty($reduction_percentage)) : ?>
            <h2 class="percent-title"><?php echo esc_html($reduction_percentage); ?></h2>
          <?php endif; ?>

          <?php if (!empty($reduction_label)) : ?>
            <p class="reduction-text"><?php echo esc_html($reduction_label); ?></p>
          <?php endif; ?>
        </div>

        <div class="delighted-clients-content">
          <?php if (!empty($trusted_clients_title)) : ?>
            <h2 class="delighted-title"><?php echo esc_html($trusted_clients_title); ?></h2>
          <?php endif; ?>

          <div class="avatar-group">
            <div class="d-flex">
              <?php if (have_rows('ir_client_avatars')) : ?>
                <?php while (have_rows('ir_client_avatars')) : the_row();
                  $avatar = get_sub_field('ir_avatar_image');
                  if (empty($avatar) || empty($avatar['url'])) continue;
                ?>
                  <div class="avatar">
                    <img src="<?php echo esc_url($avatar['url']); ?>"
                         alt="<?php echo esc_attr($avatar['alt'] ?? 'Avatar'); ?>">
                  </div>
                <?php endwhile; ?>
              <?php endif; ?>
            </div>

            <?php if (!empty($community_text)) : ?>
              <p class="join-community">
                <?php echo $community_text; ?>
              </p>
            <?php endif; ?>
          </div>
        </div>
      </div>

      <div class="right-img-wrapper">
        <?php if (!empty($right_worker_image) && !empty($right_worker_image['url'])) : ?>
          <img src="<?php echo esc_url($right_worker_image['url']); ?>"
               class="img-fluid"
               alt="<?php echo esc_attr($right_worker_image['alt'] ?? 'client-trust'); ?>">
        <?php endif; ?>
      </div>
    </div>

  </div>
</section>

<!-- Banner Section End -->



<!-- Certificates Section Start -->
<?php get_template_part('templates-parts/pages/certificates'); ?>
<!-- Certificates Section End -->

<!-- Icons Cards Start start -->
<?php
 $counters = ['class' => 'pt-5 '];
 get_template_part('templates-parts/pages/counter-new',null,$counters)?>
<!-- Icons Cards Start end -->


<!-- Replenishment Transform Business section start -->
<?php
// ===== ACF Fields: Replenishment Transform Business Section (ir2_*) =====
$ir2_section_title        = get_field('ir2_section_title');

$ir2_top_left_image       = get_field('ir2_top_left_image');
$ir2_top_right_image      = get_field('ir2_top_right_image');

$ir2_main_image           = get_field('ir2_main_image');

$ir2_section_description  = get_field('ir2_section_description');

$ir2_cta_button_text      = get_field('ir2_cta_button_text');
$ir2_cta_button_url       = get_field('ir2_cta_button_url');
?>

<section class="section replenishment-transform-business">
  <div class="container pt-4 pb-4">

    <div class="row gy-3">
      <div class="col-lg-6">
        <?php if (!empty($ir2_section_title)) : ?>
          <h2 class="section-title">
            <?php echo wp_kses_post($ir2_section_title); ?>
          </h2>
        <?php endif; ?>
      </div>

      <div class="col-lg-6">
        <div class="row gy-3">

          <div class="col-lg-6">
            <div class="img-wrapper">
              <?php if (!empty($ir2_top_left_image) && !empty($ir2_top_left_image['url'])) : ?>
                <img
                  src="<?php echo esc_url($ir2_top_left_image['url']); ?>"
                  class="img-fluid"
                  alt="<?php echo esc_attr($ir2_top_left_image['alt'] ?? 'replenishment-transform-img'); ?>"
                >
              <?php endif; ?>
            </div>
          </div>

          <div class="col-lg-6">
            <div class="img-wrapper">
              <?php if (!empty($ir2_top_right_image) && !empty($ir2_top_right_image['url'])) : ?>
                <img
                  src="<?php echo esc_url($ir2_top_right_image['url']); ?>"
                  class="img-fluid"
                  alt="<?php echo esc_attr($ir2_top_right_image['alt'] ?? 'replenishment-transform-img'); ?>"
                >
              <?php endif; ?>
            </div>
          </div>

        </div>
      </div>
    </div>

    <div class="row gy-3 mt-1 mt-xl-4">
      <div class="col-lg-6">
        <div class="img-cont">
          <?php if (!empty($ir2_main_image) && !empty($ir2_main_image['url'])) : ?>
            <img
              src="<?php echo esc_url($ir2_main_image['url']); ?>"
              class="img-fluid"
              alt="<?php echo esc_attr($ir2_main_image['alt'] ?? 'replenishment-transform-img'); ?>"
            >
          <?php endif; ?>
        </div>
      </div>

      <div class="col-lg-6">
        <div class="text-cont">

          <?php if (!empty($ir2_section_description)) : ?>
            <p class="section-content mb-0">
              <?php echo nl2br(esc_html($ir2_section_description)); ?>
            </p>
          <?php endif; ?>

          <?php if (have_rows('ir2_feature_list')) : ?>
            <ul>
              <?php
              $ir2_total = count(get_field('ir2_feature_list'));
              $ir2_i = 0;
              while (have_rows('ir2_feature_list')) : the_row();
                $ir2_i++;
                $ir2_feature_text = get_sub_field('ir2_feature_text');
                if (empty($ir2_feature_text)) continue;
              ?>
                <li><?php echo wp_kses_post($ir2_feature_text); ?></li>

                <?php if ($ir2_i < $ir2_total) : ?>
                  <div class="svg-wrapper">
                    <svg width="2" height="66" viewBox="0 0 2 66" fill="none" xmlns="http://www.w3.org/2000/svg">
                      <rect width="2" height="66" fill="#A8A8A8" />
                    </svg>
                  </div>
                <?php endif; ?>

              <?php endwhile; ?>
            </ul>
          <?php endif; ?>

          <?php if (!empty($ir2_cta_button_text)) : ?>
            <div class="demo-btn-wrapper">
              <a href="<?php echo esc_url($ir2_cta_button_url ?: 'javascript:;'); ?>" class="primary animated-cta-btn">
                <?php echo esc_html($ir2_cta_button_text); ?>
              </a>
            </div>
          <?php endif; ?>

        </div>
      </div>
    </div>

  </div>
</section>

<!-- Replenishment Transform Business section End -->

<?php
$ir3_main_title = get_field('ir3_main_title');
$ir3_cta_text   = get_field('ir3_cta_text');
$ir3_cta_url    = get_field('ir3_cta_url');

// Repeater: ir3_steps
?>

<section class="section how-it-works-replenishment">
  <div class="container">
    <div class="row gy-3 align-items-center flex-column-reverse flex-lg-row">

      <div class="col-lg-12">
        <div class="tab-content" id="howItWorksTabsContent">

          <?php if (have_rows('ir3_steps')) : ?>
            <?php $i = 0; ?>
            <?php while (have_rows('ir3_steps')) : the_row(); $i++; ?>

              <?php
                // Unique tab ids
                $tab_id = 'ir3_step_' . $i;

                // Step fields
                $step_label = get_sub_field('ir3_step_label');       // e.g. Step 01
                $step_title = get_sub_field('ir3_step_title');       // e.g. Stock Receiving
                $step_desc  = get_sub_field('ir3_step_description'); // textarea
                $step_img   = get_sub_field('ir3_step_image');       // image array
              ?>

              <div class="tab-pane fade <?php echo ($i === 1) ? 'show active' : ''; ?>"
                   id="<?php echo esc_attr($tab_id); ?>"
                   role="tabpanel">

                <div class="row align-items-center gy-4">

                  <div class="col-lg-6">

                    <?php if (!empty($ir3_main_title)) : ?>
                      <h2 class="section-title">
                        <?php echo wp_kses_post($ir3_main_title); ?>
                      </h2>
                    <?php endif; ?>

                    <?php if (!empty($step_title)) : ?>
                      <h6 class="stock-receiving-title">
                        <?php echo esc_html($step_title); ?>
                      </h6>
                    <?php endif; ?>

                    <?php if (!empty($step_desc)) : ?>
                      <p class="section-content">
                        <?php echo nl2br(esc_html($step_desc)); ?>
                      </p>
                    <?php endif; ?>

                    <?php if (!empty($ir3_cta_text)) : ?>
                      <div class="demo-btn-wrapper mt-4">
                        <a href="<?php echo esc_url($ir3_cta_url ?: 'javascript:;'); ?>" class="primary animated-cta-btn">
                          <?php echo esc_html($ir3_cta_text); ?>
                        </a>
                      </div>
                    <?php endif; ?>

                  </div>

                  <div class="col-lg-6">
                    <div class="how-it-works-replenishment__media">
                      <?php if (!empty($step_img) && !empty($step_img['url'])) : ?>
                        <img src="<?php echo esc_url($step_img['url']); ?>"
                             class="img-fluid"
                             loading="lazy"
                             alt="<?php echo esc_attr($step_img['alt'] ?? ''); ?>">
                      <?php endif; ?>
                    </div>
                  </div>

                </div>
              </div>

            <?php endwhile; ?>
          <?php endif; ?>

        </div>
      </div>

      <div class="col-lg-6 mt-4">
        <ul class="nav how-it-works-replenishment__tabs" role="tablist">

          <?php if (have_rows('ir3_steps')) : ?>
            <?php $j = 0; ?>
            <?php while (have_rows('ir3_steps')) : the_row(); $j++; ?>

              <?php
                $tab_id    = 'ir3_step_' . $j;
                $step_label = get_sub_field('ir3_step_label');
              ?>

              <li class="nav-item" role="presentation">
                <button class="nav-link <?php echo ($j === 1) ? 'active' : ''; ?>"
                        data-bs-toggle="tab"
                        data-bs-target="#<?php echo esc_attr($tab_id); ?>"
                        type="button"
                        role="tab">
                  <?php echo esc_html($step_label ?: ('Step ' . str_pad($j, 2, '0', STR_PAD_LEFT))); ?>
                </button>
              </li>

            <?php endwhile; ?>
          <?php endif; ?>

          <span class="how-it-works-replenishment__track"></span>
        </ul>
      </div>

    </div>
  </div>
</section>



<!-- Risk Free Warego section start  -->
<?php
$ir4_section_title = get_field('ir4_section_title');

$ir4_video_file    = get_field('ir4_video_file');   // file array
$ir4_video_poster  = get_field('ir4_video_poster'); // image array (optional)

$ir4_cta_text      = get_field('ir4_cta_text');
$ir4_cta_url       = get_field('ir4_cta_url');
?>

<section class="section risk-free-software">
  <div class="container">
    <div class="text-cont text-center">

      <?php if (!empty($ir4_section_title)) : ?>
        <h2 class="section-title">
          <?php echo $ir4_section_title; ?>
        </h2>
      <?php endif; ?>

      <?php if (have_rows('ir4_paragraphs')) : ?>
        <?php while (have_rows('ir4_paragraphs')) : the_row(); ?>
          <?php $p = get_sub_field('ir4_paragraph_text'); ?>
          <?php if (!empty($p)) : ?>
            <p class="section-content">
              <?php echo nl2br($p); ?>
            </p>
          <?php endif; ?>
        <?php endwhile; ?>
      <?php endif; ?>

      <div class="risk-free-video-wrapper">
        <div class="risk-free-video-wrapper__box">

          <?php
            $video_url   = (!empty($ir4_video_file) && !empty($ir4_video_file['url'])) ? $ir4_video_file['url'] : '';
            $poster_attr = (!empty($ir4_video_poster) && !empty($ir4_video_poster['url'])) ? ' poster="' . esc_url($ir4_video_poster['url']) . '"' : '';
          ?>

          <?php if (!empty($video_url)) : ?>
            <video id="riskFreeVideo"
                   class="risk-free-video-wrapper__video"
                   muted
                   playsinline
                   preload="metadata"
                   loop<?php echo $poster_attr; ?>>
              <source src="<?php echo esc_url($video_url); ?>" type="<?php echo esc_attr($ir4_video_file['mime_type'] ?? 'video/webm'); ?>">
            </video>
          <?php endif; ?>

          <a href="javascript:;" class="risk-free-video-wrapper__play" aria-label="Play Video">
            <svg width="88" height="88" viewBox="0 0 88 88" fill="none" xmlns="http://www.w3.org/2000/svg">
              <g filter="url(#filter0_d_2051_2639)">
                <circle cx="44" cy="44" r="40" fill="black" fill-opacity="0.5" shape-rendering="crispEdges"/>
              </g>
              <path d="M59.6791 39.5915C60.4796 40.0171 61.1491 40.6526 61.6161 41.4298C62.083 42.2069 62.3297 43.0965 62.3297 44.0031C62.3297 44.9098 62.083 45.7993 61.6161 46.5765C61.1491 47.3536 60.4796 47.9891 59.6791 48.4148L38.3257 60.0265C34.8874 61.8965 30.6641 59.4631 30.6641 55.6165V32.3915C30.6641 28.5415 34.8874 26.1098 38.3257 27.9781L59.6791 39.5915Z" fill="white"/>
              <defs>
                <filter id="filter0_d_2051_2639" x="0" y="0" width="88" height="88" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
                  <feFlood flood-opacity="0" result="BackgroundImageFix"/>
                  <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
                  <feOffset/>
                  <feGaussianBlur stdDeviation="2"/>
                  <feComposite in2="hardAlpha" operator="out"/>
                  <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0"/>
                  <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2051_2639"/>
                  <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2051_2639" result="shape"/>
                </filter>
              </defs>
            </svg>
          </a>

        </div>
      </div>

      <?php if (!empty($ir4_cta_text)) : ?>
        <div class="demo-btn-wrapper text-center mt-4 mt-xl-5">
          <a href="<?php echo esc_url($ir4_cta_url ?: 'javascript:;'); ?>" class="primary animated-cta-btn">
            <?php echo esc_html($ir4_cta_text); ?>
          </a>
        </div>
      <?php endif; ?>

    </div>
  </div>
</section>

<!-- Risk Free Warego section End -->


<?php
$ir5_section_title    = get_field('ir5_section_title');
$ir5_section_subtitle = get_field('ir5_section_subtitle');
$ir5_cta_text         = get_field('ir5_cta_text');
$ir5_cta_url          = get_field('ir5_cta_url');
?>

<section class="section replenishment-real-benefits bg-white">
  <div class="container">

    <div class="text-cont text-center">
      <?php if (!empty($ir5_section_title)) : ?>
        <h2 class="section-title"><?php echo esc_html($ir5_section_title); ?></h2>
      <?php endif; ?>

      <?php if (!empty($ir5_section_subtitle)) : ?>
        <p class="section-content">
          <?php echo wp_kses_post($ir5_section_subtitle); ?>
        </p>
      <?php endif; ?>
    </div>

    <!-- Tabs Start Here -->
    <?php if (have_rows('ir5_tabs')) : ?>
      <div class="responsive-tabs">
        <div class="row">

          <!-- Tab Links -->
          <div class="col-lg-12">
            <ul class="nav nav-tabs" role="tablist">
              <?php $i = 0; while (have_rows('ir5_tabs')) : the_row(); $i++; 
                $tab_label = get_sub_field('ir5_tab_label');
                // unique slug ids (same style like tab-link-ai-tools)
                $slug = sanitize_title($tab_label ?: 'tab-' . $i);
              ?>
                <li class="nav-item">
                  <a
                    id="tab-link-<?php echo esc_attr($slug); ?>"
                    href="#tab-pane-<?php echo esc_attr($slug); ?>"
                    class="nav-link <?php echo ($i === 1) ? 'active' : ''; ?>"
                    data-bs-toggle="tab"
                    role="tab"
                  >
                    <?php echo esc_html($tab_label); ?>
                  </a>
                </li>
              <?php endwhile; ?>
            </ul>
          </div>

          <div class="col-lg-12">
            <div id="tab-content-container" class="tab-content" role="tablist">

              <?php
              // reset repeater loop
              $j = 0;
              while (have_rows('ir5_tabs')) : the_row(); $j++;

                $tab_label = get_sub_field('ir5_tab_label');
                $review    = get_sub_field('ir5_review_text');
                $name      = get_sub_field('ir5_reviewer_name');
                $image     = get_sub_field('ir5_reviewer_image');

                $slug = sanitize_title($tab_label ?: 'tab-' . $j);

                // collapse ids like collapse-ai-tools
                $collapse_id = 'collapse-' . $slug;
                $heading_id  = 'heading-' . $slug;
              ?>

                <!-- Tab Panel -->
                <div
                  id="tab-pane-<?php echo esc_attr($slug); ?>"
                  class="card tab-pane fade <?php echo ($j === 1) ? 'show active' : ''; ?>"
                  role="tabpanel"
                  aria-labelledby="tab-link-<?php echo esc_attr($slug); ?>"
                >
                  <div class="card-header" role="tab" id="<?php echo esc_attr($heading_id); ?>">
                    <h5 class="mb-0">
                      <a
                        data-bs-toggle="collapse"
                        href="#<?php echo esc_attr($collapse_id); ?>"
                        aria-expanded="<?php echo ($j === 1) ? 'true' : 'false'; ?>"
                        aria-controls="<?php echo esc_attr($collapse_id); ?>"
                      >
                        <?php echo esc_html($tab_label); ?>
                      </a>
                    </h5>
                  </div>

                  <div
                    id="<?php echo esc_attr($collapse_id); ?>"
                    class="collapse <?php echo ($j === 1) ? 'show' : ''; ?>"
                    data-bs-parent="#tab-content-container"
                    role="tabpanel"
                    aria-labelledby="<?php echo esc_attr($heading_id); ?>"
                  >
                    <div class="card-body">
                      <div class="powered-tools-wrapper">
                        <div class="row gy-2 align-items-center">

                          <div class="col-lg-6">
                            <div class="replenishment-clients-content">
                              <?php if (!empty($review)) : ?>
                                <p class="replenishment-review-text">
                                  <?php echo nl2br(esc_html($review)); ?>
                                </p>
                              <?php endif; ?>

                              <?php if (!empty($name)) : ?>
                                <p class="ceos-names"><?php echo esc_html($name); ?></p>
                              <?php endif; ?>
                            </div>
                          </div>

                          <div class="col-lg-6">
                            <div class="img-cont">
                              <?php if (!empty($image) && !empty($image['url'])) : ?>
                                <img
                                  src="<?php echo esc_url($image['url']); ?>"
                                  alt="<?php echo esc_attr($image['alt'] ?? 'client'); ?>"
                                  class="img-fluid"
                                  loading="lazy"
                                >
                              <?php endif; ?>
                            </div>
                          </div>

                        </div>
                      </div>
                    </div>
                  </div>
                </div>

              <?php endwhile; ?>

            </div>
          </div>

        </div>
      </div>
    <?php endif; ?>
    <!-- Tabs END Here -->

    <?php if (!empty($ir5_cta_text)) : ?>
      <div class="demo-btn-wrapper text-center mt-4 mt-xl-5">
        <a href="<?php echo esc_url($ir5_cta_url ?: 'javascript:;'); ?>" class="primary animated-cta-btn">
          <?php echo esc_html($ir5_cta_text); ?>
        </a>
      </div>
    <?php endif; ?>

  </div>
</section>



<?php
$ir6_section_title       = get_field('ir6_section_title');
$ir6_section_description = get_field('ir6_section_description');

$ir6_cta_text            = get_field('ir6_cta_text');
$ir6_cta_url             = get_field('ir6_cta_url');
?>

<section class="section inventory-replenishment-features bg-white">
  <div class="container">

    <div class="text-cont text-center">
      <?php if (!empty($ir6_section_title)) : ?>
        <h2 class="section-title"><?php echo $ir6_section_title; ?></h2>
      <?php endif; ?>

      <?php if (!empty($ir6_section_description)) : ?>
        <p class="section-content"><?php echo nl2br(esc_html($ir6_section_description)); ?></p>
      <?php endif; ?>
    </div>

    <?php if (have_rows('ir6_features')) : ?>
      <div class="row gy-4 gy-xl-5">

        <?php while (have_rows('ir6_features')) : the_row(); 
          $title  = get_sub_field('ir6_feature_title');
          $number = get_sub_field('ir6_feature_number');
          $text   = get_sub_field('ir6_feature_text');
        ?>
          <div class="col-lg-4 col-md-6">
            <div class="replenishment-feature-card-wrapper">
              <div class="replenishment-feature-card">

                <div class="replenishment-card__header">
                  <?php if (!empty($title)) : ?>
                    <h3 class="replenishment-card__title">
                      <?php echo wp_kses_post($title); ?>
                    </h3>
                  <?php endif; ?>

                  <?php if (!empty($number)) : ?>
                    <div class="card-numbering">
                      <?php echo $number; ?>
                    </div>
                  <?php endif; ?>
                </div>

                <?php if (!empty($text)) : ?>
                  <p class="replenishment-card__text">
                    <?php echo $text; ?>
                  </p>
                <?php endif; ?>

              </div>
            </div>
          </div>
        <?php endwhile; ?>

      </div>
    <?php endif; ?>

    <?php if (!empty($ir6_cta_text)) : ?>
      <div class="demo-btn-wrapper text-center mt-4 mt-xl-5">
        <a href="<?php echo esc_url($ir6_cta_url ?: 'javascript:;'); ?>" class="primary animated-cta-btn">
          <?php echo esc_html($ir6_cta_text); ?>
        </a>
      </div>
    <?php endif; ?>

  </div>
</section>


<!-- 100% Optimized WMS With 50+ Integrations Starts -->
<?php  get_template_part('templates-parts/pages/optimized-integrations');?>
<!-- 100% Optimized WMS With 50+ Integrations Ends -->


<!-- pricing section start -->
<?php 
$pricing = [
    'class' => 'supply-chain-pricing-cards pt-5',
    'headingcon' => 'h2',
];
get_template_part('templates-parts/pages/pricing',null,$pricing)?>
<!-- pricing section end -->

<!-- Smart Brand Choose Us Section Start -->
<?php
$ir7_section_title        = get_field('ir7_section_title');
$ir7_section_description  = get_field('ir7_section_description');
$ir7_section_image        = get_field('ir7_section_image');

$ir7_achievements_title   = get_field('ir7_achievements_title');

$ir7_cta_text             = get_field('ir7_cta_text');
$ir7_cta_url              = get_field('ir7_cta_url');
?>

<section class="section replenishment-brands-choose">
  <div class="container">

    <div class="text-cont text-center">
      <?php if (!empty($ir7_section_title)) : ?>
        <h2 class="section-title"><?php echo $ir7_section_title; ?></h2>
      <?php endif; ?>

      <?php if (!empty($ir7_section_description)) : ?>
        <p class="section-content"><?php echo nl2br($ir7_section_description); ?></p>
      <?php endif; ?>
    </div>

    <div class="row gy-4">
      <div class="col-lg-6">
        <div class="img-wrapper">
          <?php if (!empty($ir7_section_image) && !empty($ir7_section_image['url'])) : ?>
            <img src="<?php echo esc_url($ir7_section_image['url']); ?>"
                 alt="<?php echo esc_attr($ir7_section_image['alt'] ?? 'replenishment-brands-choose'); ?>"
                 class="img-fluid"
                 loading="lazy">
          <?php endif; ?>
        </div>
      </div>

      <div class="col-lg-6">
        <div class="brands-acheivements">

          <?php if (!empty($ir7_achievements_title)) : ?>
            <h3 class="expect-acheive-title"><?php echo $ir7_achievements_title; ?></h3>
          <?php endif; ?>

          <?php if (have_rows('ir7_achievements_list')) : ?>
            <ul>
              <?php while (have_rows('ir7_achievements_list')) : the_row();
                $label = get_sub_field('ir7_achievement_label');
                $value = get_sub_field('ir7_achievement_value');
                if (empty($label) && empty($value)) continue;
              ?>
                <li>
                  <?php echo esc_html($label); ?>
                  <?php if (!empty($value)) : ?>
                    <span><?php echo esc_html($value); ?></span>
                  <?php endif; ?>
                </li>
              <?php endwhile; ?>
            </ul>
          <?php endif; ?>

        </div>
      </div>
    </div>

    <?php if (!empty($ir7_cta_text)) : ?>
      <div class="demo-btn-wrapper text-center mt-4 mt-xl-5">
        <a href="<?php echo esc_url($ir7_cta_url ?: 'javascript:;'); ?>" class="primary animated-cta-btn">
          <?php echo esc_html($ir7_cta_text); ?>
        </a>
      </div>
    <?php endif; ?>

  </div>
</section>

<!-- Smart Brand Choose Us End-->


<!-- case studies start -->
<?php 
$portfolio = ['class' => 'bg-white pt-4 mt-5'];
get_template_part('templates-parts/pages/case-studies',null,$portfolio);?>
<!-- case studies end -->

<?php
    $args = [
        'category'  => 'inventory-replenishment',
        'class'  => 'pt-5',
    ];
    get_template_part('templates-parts/pages/faqs-new', null, $args);
?>

<?php
$heading   = get_field('heading');
$text      = get_field('text');
$btn_text  = get_field('button_text');
$btn_link  = get_field('button_link');

// fallback
$heading  = $heading ?: 'Have questions about our Pick and Pack software?';
$btn_text = $btn_text ?: 'Talk with Experts!';
$btn_link = $btn_link ?: 'javascript:;';
?>

<section class="section invemtory-management-software-cta pick-pack-software-cta bg-white pt-3">
    <div class="container">
        <div class="box">
            <h2><?php echo $heading; ?></h2>

            <?php if (!empty($text)) : ?>
                <p><?php echo wp_kses_post($text); ?></p>
            <?php endif; ?>

            <a href="<?php echo esc_url($btn_link); ?>" class="primary animated-cta-btn">
                <?php echo esc_html($btn_text); ?>
            </a>
        </div>
    </div>
</section>

<?php get_footer(); ?>

<!-- <script src="<?php // echo get_template_directory_uri();?>/assets/js/food-beverage-section.js"></script> -->

<script>
    $('.about-our-product-slider').owlCarousel({
        loop: false,
        margin: 10,
        nav: false,
        dots: false,
        responsive: {
            0: {
                items: 1,
                autoplay: true
            },
            600: {
                loop: true,
                items: 3,
                autoplay: true
            },
            1000: {
                items: 5
            }
        }
    });
    $('.real-feedback-slider').owlCarousel({
        loop: false,
        margin: 40,
        nav: false,
        dots: false,
        dotsData: true,
        responsive: {
            0: {
                items: 1
            },
            768: {
                items: 2,
                margin: 20
            },
            1000: {
                items: 2
            }
        }
    });
</script>
<script>
    // $('.tracking-serves-industries-slider').owlCarousel({
    //     loop: true,
    //     margin: 10,
    //     nav: true,
    //     center: true,
    //     dots: false,
    //     responsive: {
    //         0: {
    //             items: 1
    //         },
    //         600: {
    //             items: 2
    //         },
    //         1000: {
    //             items: 3
    //         }
    //     }
    // });
    $('.warego-real-result-slider').owlCarousel({
        loop: true,
        margin: 10,
        nav: true,
        center: true,
        // autoWidth:true,
        responsive: {
            0: {
                items: 1
            },
            600: {
                items: 2
            },
            1000: {
                items: 3
            }
        }
    })
</script>

<script>
    // case study slider with merge option
    $(function () {
    var $owl = $('.tracking-serves-industries-slider');

    function applyMergeAttrs() {

        if (window.innerWidth < 1200) {
            $owl.find('.owl-item .item').removeAttr('data-merge');
            return;
        }

        var $allItems = $owl.find('.owl-item .item');
        $allItems.attr('data-merge', '1');

        var $centerItem = $owl.find('.owl-item.center .item');
        if ($centerItem.length) {
            $centerItem.attr('data-merge', '3');
        }
    }

    $owl.on('initialized.owl.carousel translated.owl.carousel', applyMergeAttrs);

    $owl.owlCarousel({
        loop: true,
        center: true,
        margin: 20,
        nav: true,
        dots: false,
        items: 3,
        navText: ['<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.0938 6.09375C14.0938 6.65625 13.6562 7.09375 13.125 7.09375H3.53125L6.8125 10.4062C7.21875 10.7812 7.21875 11.4375 6.8125 11.8125C6.625 12 6.375 12.0938 6.125 12.0938C5.84375 12.0938 5.59375 12 5.40625 11.8125L0.40625 6.8125C0 6.4375 0 5.78125 0.40625 5.40625L5.40625 0.40625C5.78125 0 6.4375 0 6.8125 0.40625C7.21875 0.78125 7.21875 1.4375 6.8125 1.8125L3.53125 5.09375H13.125C13.6562 5.09375 14.0938 5.5625 14.0938 6.09375Z" fill="white"/></svg>', '<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m13.688 6.813-5 5a.97.97 0 0 1-.688.28 1 1 0 0 1-.719-.28.964.964 0 0 1 0-1.407l3.282-3.312H1c-.562 0-1-.438-1-1 0-.532.438-1 1-1h9.563L7.28 1.812a.964.964 0 0 1 0-1.406.964.964 0 0 1 1.407 0l5 5a.964.964 0 0 1 0 1.407" fill="#fff"/></svg>'],

        responsive: {
            0: {
                items: 1,
                merge: false,
            },
            600: {
                items: 1,
                merge: false
            },
            1200: {
                items: 3,
                merge: true,  
                mergeFit: false
            }
        }
    });
});
</script>

<script>
    // case study slider with merge option
    $(function () {
    var $owl = $('.case-slilder');

    function applyMergeAttrs() {

        if (window.innerWidth < 1200) {
            $owl.find('.owl-item .item').removeAttr('data-merge');
            return;
        }

        var $allItems = $owl.find('.owl-item .item');
        $allItems.attr('data-merge', '1');

        var $centerItem = $owl.find('.owl-item.center .item');
        if ($centerItem.length) {
            $centerItem.attr('data-merge', '3');
        }
    }

    $owl.on('initialized.owl.carousel translated.owl.carousel', applyMergeAttrs);

    $owl.owlCarousel({
        loop: true,
        center: true,
        margin: 20,
        nav: true,
        dots: false,
        items: 3,
        navText: ['<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M14.0938 6.09375C14.0938 6.65625 13.6562 7.09375 13.125 7.09375H3.53125L6.8125 10.4062C7.21875 10.7812 7.21875 11.4375 6.8125 11.8125C6.625 12 6.375 12.0938 6.125 12.0938C5.84375 12.0938 5.59375 12 5.40625 11.8125L0.40625 6.8125C0 6.4375 0 5.78125 0.40625 5.40625L5.40625 0.40625C5.78125 0 6.4375 0 6.8125 0.40625C7.21875 0.78125 7.21875 1.4375 6.8125 1.8125L3.53125 5.09375H13.125C13.6562 5.09375 14.0938 5.5625 14.0938 6.09375Z" fill="white"/></svg>', '<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="m13.688 6.813-5 5a.97.97 0 0 1-.688.28 1 1 0 0 1-.719-.28.964.964 0 0 1 0-1.407l3.282-3.312H1c-.562 0-1-.438-1-1 0-.532.438-1 1-1h9.563L7.28 1.812a.964.964 0 0 1 0-1.406.964.964 0 0 1 1.407 0l5 5a.964.964 0 0 1 0 1.407" fill="#fff"/></svg>'],

        responsive: {
            0: {
                items: 1,
                merge: false
            },
            600: {
                items: 1,
                merge: false
            },
            1200: {
                items: 3,
                merge: true,  
                mergeFit: false
            }
        }
    });
});
</script>

<script>
$(document).ready(function () {
  var $video = $('.risk-free-software .risk-free-video-wrapper__video');
  var $btn   = $('.risk-free-software .risk-free-video-wrapper__play');

  $video.get(0).pause();

  $btn.on('click', function (e) {
    e.preventDefault();

    if ($video.get(0).paused) {
      $video.get(0).play();
      $(this).hide();
    } else {
      $video.get(0).pause();
      $(this).show();
    }
  });

  $video.on('click', function () {
    this.pause();
    $btn.show();
  });
});
</script>
<script>
    // *********************** Optimized Warehouse Gsap Animation Start ***********************
    gsap.registerPlugin();

    function startCircularScroll(wrapper, scrollSpeed) {
    const originalContent = wrapper.innerHTML; 
    wrapper.innerHTML += originalContent;

    const totalHeight = wrapper.scrollHeight / 2;

    const duration = totalHeight / scrollSpeed;

    gsap.to(wrapper, {
        y: `-${totalHeight}px`,
        duration: duration, 
        ease: "linear",
        repeat: -1,
    });
    }

    const firstSlideWrapper = document.querySelector('.first-slide-wrapper');
    const thirdSlideWrapper = document.querySelector('.third-slide-wrapper');

    if (firstSlideWrapper) {
    startCircularScroll(firstSlideWrapper, 30);
    }
    if (thirdSlideWrapper) {
    startCircularScroll(thirdSlideWrapper, 30);
    }


    const secondSlideWrapper = document.querySelector('.second-slide-wrapper');

    function startSeamlessTopToBottomScroll(wrapper, scrollSpeed) {
        
    const duplicate = wrapper.innerHTML;
    wrapper.innerHTML += duplicate;

    const totalHeight = wrapper.scrollHeight / 2;

    const duration = totalHeight / scrollSpeed;

    gsap.fromTo(
        wrapper,
        { y: `-${totalHeight}px` }, 
        {
        y: 0, 
        duration: duration,
        ease: "linear", 
        repeat: -1,
        }
    );
    }

    if (secondSlideWrapper) {
    startSeamlessTopToBottomScroll(secondSlideWrapper, 30);
    }
    // *********************** Optimized Warehouse Gsap Animation End ***********************
</script>