<?php
/*
Template Name: Netsuite Integration
*/

get_header('new');
?>
<section class="section banner netsuite-banner  mb-4 mb-lg-0 no-lazy">
    <div class="container">
        <div class="row mt-xl-5 mt-lg-0 justify-content-center">
            <div class="col-lg-10 col-xl-9">
                <div class="text-cont mt-4 mt-lg-0 text-center">
                    <h1 class="banner-heading"><?php echo get_field('banner_heading'); ?></h1>
                    <p class="banner-content">
                        <?php echo get_field('banner_description'); ?>
                    </p>
                    <?php $highlights = get_field('banner_highlights'); ?>
                    <ul>
                        <?php if ($highlights && is_array($highlights)) : ?>
                            <?php foreach ($highlights as $highlight) : ?>
                                <li>
                                    <img src="<?php echo get_template_directory_uri(); ?>/assets/img/apparel-inventory-management/tick.webp" alt="tick" class="img-fluid">
                                    <?php echo $highlight['item']; ?>
                                </li>
                            <?php endforeach; ?>
                        <?php endif; ?>
                    </ul>
                    <div class="banner-btns flex-lg-row  justify-content-center">
                        <?php $cta_1 = get_field('banner_cta_1'); ?>
                         <?php if (!is_null($cta_1)) : ?>
                        <a href="<?php echo esc_url($cta_1['url']); ?>" class="primary animated-cta-btn <?php echo is_modal_link($cta_1['url']); ?>"><?php echo $cta_1['title']; ?>
                        </a>
                        <?php endif; ?>
                        <?php $cta_2 = get_field('banner_cta_2'); ?>
                        <?php if (!is_null($cta_2)) : ?>
                        <a href="<?php echo esc_url($cta_2['url']); ?>" class="border-gradient-btn animated-btn <?php echo is_modal_link($cta_2['url']); ?>"><?php echo $cta_2['title']; ?>
                            <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 class="bottom-img text-center">
					<?php
	$desktop_img_url = get_field('banner_image');
	$mobile_img_url  = get_field('banner_mobile_image');
?>
    <picture>
        <source class="no-lazy" media="(max-width: 767px)" srcset="<?php echo $mobile_img_url ? $mobile_img_url : $desktop_img_url ?>">
        <img src="<?php echo $desktop_img_url;?>" loading="eager" fetchpriority="high" decoding="async" width="686" height="262" class="img-fluid no-lazy" alt="<?php echo strip_tags(get_field('banner_heading')); ?>">
    </picture>
                </div>
            </div>
        </div>
    </div>
</section>

<section class="section about-our-product">
    <div class="container">
        <div class="text-cont text-center">
            <h2 class="section-title"><?php echo get_field('certificates_title'); ?></h2>
        </div>
        <div class="logos-wrapper">
            <div class="owl-carousel owl-theme about-our-product-slider">
                <?php if (have_rows('certificates')): ?>
                    <?php while (have_rows('certificates')): the_row(); 
                        $image = get_sub_field('image');
                        if ($image): ?>
                            <div class="item">
                                <img src="<?php echo $image; ?>" alt="certificate" width="120" height="150" loading="lazy" class="img-fluid">
                            </div>
                        <?php endif; ?>
                    <?php endwhile; ?>
                <?php endif; ?>
            </div>
        </div>
    </div>
</section>

<!-- Why Choose Wms warego Section Start -->
<section class="section why-choose-wms-warego warego-netsuite-wms bg-white pt-lg-4">
    <div class="container">
        <div class="amazon-warehouse-content-wrapper">
            <div class="row align-items-center gy-3 gy-lg-4 flex-column-reverse flex-lg-row-reverse">
                <div class="col-lg-6">
                    <div class="img-cont">
                        <img src="<?php echo get_field('wms_for_netsuite_section_image');?>" alt="<?php echo esc_attr( wp_strip_all_tags( get_field('wms_for_netsuite_section_title' ) ))?>" loading="lazy" class="img-fluid" width="586" height="580">
                    </div>
                </div>

                <div class="col-lg-6">
                    <div class="text-cont">
                        <h2 class="section-title"><?php echo get_field('wms_for_netsuite_section_title');?></h2>
                        <p class="section-content"><?php echo get_field('wms_for_netsuite_section_text');?></p>
                        <?php if( have_rows('wms_for_netsuite_section__list') ): ?>
                        <ul>
                        <?php while( have_rows('wms_for_netsuite_section__list') ): the_row();?>
                            <li>
                                <?php echo get_sub_field('wms_for_netsuite_section__list_item');?>
                            </li>
                            <?php endwhile; ?>
                        </ul>
                        <?php endif; ?>
                        <?php $wms_button = get_field('wms_for_netsuite_section__button');
                        if($wms_button) :
                        ?>
                        <div class="req-demo-btn-wrapper">
                            <a href="<?php echo esc_url($wms_button['url'])?>" class="demo-btn animated-cta-btn">
                                <?php echo $wms_button['title']?>
                            </a>
                        </div>
                        <?php endif;?>
                    </div>
                </div>

            </div>
        </div>
    </div>
</section>
<!-- Why Choose Wms warego Section End -->

<!-- Features Netsuite Tabs Section Start -->
<section class="section features-netsuite-tabs-section bg-white">
    <div class="container">
        <div class="text-cont mb-5">
            <h2 class="section-title text-center mb-4"><?php echo get_field('features_netsuite_integrations_section_title');?></h2>
            <p class="section-content text-center"><?php echo get_field('features_netsuite_integrations_section_text');?></p>
        </div>

        <div class="row align-items-center">
            <div class="col-lg-5 col-xl-6">
                <?php if( have_rows('features_netsuite_integrations_section__tabs') ): ?>
                <ul class="nav nav-tabs" role="tablist">
                <?php $f = 1; while( have_rows('features_netsuite_integrations_section__tabs') ): the_row(); ?>
                   <li class="nav-item">
                       <a id="tab-A<?php echo $f?>" href="#pos-A<?php echo $f?>" class="nav-link <?php echo $f == 1 ? 'active' : '' ?> " data-bs-toggle="tab" role="tab">
                        <div class="icon">
                            <?php echo get_sub_field('features_netsuite_integrations_section__tab_icon');?>
                        </div>
                        <span class="tab-title"><?php echo get_sub_field('features_netsuite_integrations_section__tab_name');?></span>
                       </a>
                   </li>
                   <?php $f++; endwhile; ?>
               </ul>
               <?php endif; ?>
            </div>
            <div class="col-lg-7 col-xl-6">
            <?php if( have_rows('features_netsuite_integrations_section__tabs') ): ?>
                <div class="netsuite-tabs-wrapper">
                    <!-- Tabs Start Here -->
                    <div class=" responsive-tabs">
                        <div id="content" class="tab-content" role="tablist">
                            <?php $fs = 1; while( have_rows('features_netsuite_integrations_section__tabs') ): the_row(); ?>
                    
                            <div id="pos-A<?php echo $fs?>" class="card tab-pane fade <?php echo $fs == 1 ? 'show active' : '';?>" role="tabpanel" aria-labelledby="tab-A<?php echo $fs?>">
                                <div class="card-header" role="tab" id="heading-A<?php echo $fs?>">
                                    <h5 class="mb-0">
                                        <a data-bs-toggle="collapse" href="#pos-collapse-A<?php echo $fs?>" aria-expanded="<?php echo $fs == 1 ? 'true' : 'false';?>" aria-controls="collapse-A<?php echo $fs?>">
                                            <div class="icon">
                                                <?php echo get_sub_field('features_netsuite_integrations_section__tab_icon');?>
                                            </div>
                                            <span><?php echo get_sub_field('features_netsuite_integrations_section__tab_name');?></span>
                                        </a>
                                    </h5>
                                </div>
                                <div id="pos-collapse-A<?php echo $fs?>" class="collapse <?php echo $fs == 1 ? 'show' : '';?>" data-bs-parent="#content" role="tabpanel"
                                    aria-labelledby="heading-A<?php echo $fs?>">
                                    <div class="card-body">
                                        <div class="netsuite-tabs-content-wrapper">
                                            <div class="img-cont">
                                                <img src="<?php echo get_sub_field('features_netsuite_integrations_section__tab_image');?>" class="img-fluid" loading="lazy" alt="<?php echo esc_attr(wp_strip_all_tags( get_sub_field('features_netsuite_integrations_section__tab_name')));?>">
                                            </div>
                                            <div class="netsuite-tabs-content">
                                                <h2 class="netsuite-challanges-title"><?php echo get_sub_field('features_netsuite_integrations_section__tab_name');?></h2>
                                                <?php if( have_rows('features_netsuite_integrations_section__tab_lists') ): ?>
                                                <ul class="netsuite-features-lists">
                                                <?php while( have_rows('features_netsuite_integrations_section__tab_lists') ): the_row();?>
                                                    <li><?php echo get_sub_field('features_netsuite_integrations_section__tab_list_item');?></li>
                                                    <?php endwhile; ?>
                                                </ul>
                                                <?php endif; ?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <?php $fs++; endwhile;?>
                        </div>
                    </div>
                    <!-- Tabs END Here -->
                </div>
            <?php endif;?>
            </div>
        </div>
        <?php $f_button = get_field('features_netsuite_integrations_section__tab_button');
        if($f_button) :
        ?>
        <div class="text-center mt-4 mt-lg-5">
            <a href="<?php echo esc_url($f_button['url']);?>" class="primary animated-cta-btn"><?php echo $f_button['title']?></a>
        </div>
        <?php endif;?>
    </div>
</section>
<!-- Features Netsuite Tabs Section End -->


<!-- Netsuite Benefit Section Start -->
<section class="section netsuite-benefits-secion">
    <div class="container">
        <div class="text-cont text-center mb-5">
            <h2 class="section-title mb-4"><?php echo get_field('netsuite_benefits_integration_cards_section_title');?></h2>
            <p class="section-content"><?php echo get_field('netsuite_benefits_integration_cards_section_text');?></p>
        </div>
        <?php if( have_rows('netsuite_benefits_integration_cards_section__cards') ): ?>
        <div class="row gy-4">
        <?php $card = 1;  while( have_rows('netsuite_benefits_integration_cards_section__cards') ): the_row();?>
            <div class="col-md-6">
                <div class="card">
                    <div class="number">
                        <?php echo $card < 10 ? '0' . $card : $card ?>
                    </div>
                    <div class="text-box">
                        <h3 class="card-title"><?php echo get_sub_field('netsuite_benefits_integration_cards_section__card_title');?></h3>
                        <p class="card-text"><?php echo get_sub_field('netsuite_benefits_integration_cards_section__card_text');?></p>
                    </div>
                </div>
            </div>
            <?php $card++; endwhile; ?>
        </div>
        <?php endif; ?>
        <?php $btn = get_field('netsuite_benefits_integration_cards_section_button');
        if($btn) :
            ?>
        <div class="text-center mt-5">
            <a href="<?php echo esc_url($btn['url'])?>" class="primary animated-cta-btn"><?php echo $btn['title']?></a>
        </div>
        <?php endif; ?>
    </div>
 </section>
<!-- Netsuite Benefit Section End -->

<!-- Start Free Trial Cta Section Start -->
<section class="section free-trial-cta-section netsuite-trial-cta-section  bg-white">
    <div class="container">
        <div class="free-trial-cta-wrapper">
            <div class="row gy-3 align-items-center">
                <div class="col-lg-3">
                    <div class="img-wrapper">
                        <img src="<?php echo get_field('affiliate_cta_image');?>" alt="..." loading="lazy" class="img-fluid" width="360" height="213">
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="text-cont">
                        <h2 class="risk-free-text"><?php echo get_field('affiliate_cta_heading');?></h2>
                        <h2 class="ware-fit-business"><?php echo get_field('affiliate_cta_text');?></h2>
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="free-trial-btn text-center text-lg-start">
                        <a href="<?php echo get_field('affiliate_cta_button')['url']?>" class="border-gradient-btn animated-btn"><?php echo get_field('affiliate_cta_button')['title']?></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!-- Start Free Trial Cta Section End -->


<!-- wms Netsuite integration Section Start -->
<section class="section wms-netsuite-integration-section light-grey">
    <div class="container">
        <div class="text-cont mb-lg-5 text-lg-start text-center">
            <div class="row">
                <div class="col-lg-6">
                    <h2 class="section-title mb-4">
                        <?php echo get_field('netsuite_benefits_integration_tabs_section_title'); ?>
                    </h2>
                </div>
                <div class="col-lg-6">
                    <p class="section-content">
                        <?php echo get_field('netsuite_benefits_integration_tabs_section_text'); ?>
                    </p>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-lg-5 col-xl-4">
                <?php if (have_rows('netsuite_benefits_integration_tabs_section__tabs')) : ?>
                    <ul class="nav nav-tabs" role="tablist">
                        <?php $wms = 1;
                        while (have_rows('netsuite_benefits_integration_tabs_section__tabs')) : the_row(); ?>
                            <li class="nav-item">
                                <a id="tab-AA<?php echo $wms; ?>" href="#pos-AA<?php echo $wms; ?>"
                                    class="nav-link <?php echo $wms == 1 ? 'active' : ''; ?>" data-bs-toggle="tab" role="tab">
                                    <span class="num"><?php echo $wms < 10 ? '0' . $wms : $wms; ?></span>
                                    <?php echo get_sub_field('netsuite_benefits_integration_tabs_section__tab_name'); ?>
                                    <div class="arrow">
                                        <svg width="25" height="16" viewBox="0 0 25 16" fill="none"
                                            xmlns="http://www.w3.org/2000/svg">
                                            <path
                                                d="M24.7071 8.70711C25.0976 8.31658 25.0976 7.68342 24.7071 7.29289L18.3431 0.928932C17.9526 0.538408 17.3195 0.538408 16.9289 0.928932C16.5384 1.31946 16.5384 1.95262 16.9289 2.34315L22.5858 8L16.9289 13.6569C16.5384 14.0474 16.5384 14.6805 16.9289 15.0711C17.3195 15.4616 17.9526 15.4616 18.3431 15.0711L24.7071 8.70711ZM0 8V9H24V8V7H0V8Z"
                                                fill="#444444" />
                                        </svg>
                                    </div>
                                </a>
                            </li>
                        <?php $wms++;
                        endwhile; ?>
                    </ul>
                <?php endif; ?>
            </div>

            <div class="col-lg-7 col-xl-8">
                <?php if (have_rows('netsuite_benefits_integration_tabs_section__tabs')) : ?>
                    <div class="wms-netsuite-integration-wrapper">
                        <!-- Tabs Start Here -->
                        <div class="responsive-tabs">
                            <div id="wms-netsuite-content" class="tab-content" role="tablist">
                                <?php $wmsc = 1;
                                while (have_rows('netsuite_benefits_integration_tabs_section__tabs')) : the_row(); ?>
                                    <div id="pos-AA<?php echo $wmsc; ?>"
                                        class="card tab-pane fade <?php echo $wmsc == 1 ? 'show active' : ''; ?>"
                                        role="tabpanel" aria-labelledby="tab-AA<?php echo $wmsc; ?>">

                                        <div class="card-header" role="tab" id="heading-AA<?php echo $wmsc; ?>">
                                            <h5 class="mb-0">
                                                <a data-bs-toggle="collapse"
                                                    href="#pos-collapse-AA<?php echo $wmsc; ?>"
                                                    aria-expanded="<?php echo $wmsc == 1 ? 'true' : 'false'; ?>"
                                                    aria-controls="collapse-AA<?php echo $wmsc; ?>">
                                                    <span class="num"><?php echo $wmsc < 10 ? '0' . $wmsc : $wmsc; ?></span>
                                                    <?php echo get_sub_field('netsuite_benefits_integration_tabs_section__tab_name'); ?>
                                                    <div class="arrow">
                                                        <svg width="25" height="16" viewBox="0 0 25 16" fill="none"
                                                            xmlns="http://www.w3.org/2000/svg">
                                                            <path
                                                                d="M24.7071 8.70711C25.0976 8.31658 25.0976 7.68342 24.7071 7.29289L18.3431 0.928932C17.9526 0.538408 17.3195 0.538408 16.9289 0.928932C16.5384 1.31946 16.5384 1.95262 16.9289 2.34315L22.5858 8L16.9289 13.6569C16.5384 14.0474 16.5384 14.6805 16.9289 15.0711C17.3195 15.4616 17.9526 15.4616 18.3431 15.0711L24.7071 8.70711ZM0 8V9H24V8V7H0V8Z"
                                                                fill="#444444" />
                                                        </svg>
                                                    </div>
                                                </a>
                                            </h5>
                                        </div>

                                        <div id="pos-collapse-AA<?php echo $wmsc; ?>"
                                            class="collapse <?php echo $wmsc == 1 ? 'show' : ''; ?>"
                                            data-bs-parent="#wms-netsuite-content" role="tabpanel"
                                            aria-labelledby="heading-AA<?php echo $wmsc; ?>">
                                            <div class="card-body">
                                                <div class="wms-netsuite-integration-content-wrapper">
                                                    <div class="row gx-lg-0 align-items-center">
                                                        <div class="col-xl-6 col-lg-5">
                                                            <div class="img-cont">
                                                                <img src="<?php echo get_sub_field('netsuite_benefits_integration_tabs_section__tab_image'); ?>"
                                                                    class="img-fluid" loading="lazy"
                                                                    alt="...">
                                                            </div>
                                                        </div>
                                                        <div class="col-xl-6 col-lg-7">
                                                            <div class="wms-netsuite-tabs-content ps-lg-5">
                                                                <h2 class="wms-netsuite-challanges-title">
                                                                    <?php echo get_sub_field('netsuite_benefits_integration_tabs_section__tab_name'); ?>
                                                                </h2>
                                                                <p class="wms-netsuite-challanges-text">
                                                                    <?php echo get_sub_field('netsuite_benefits_integration_tabs_section__tab_text'); ?>
                                                                </p>
                                                                <?php if(get_sub_field('netsuite_benefits_integration_tabs_section__tab_cta')) : ?>
                                                                <div class="text-center text-lg-start mt-lg-4">
                                                                    <a href="<?php echo get_sub_field('netsuite_benefits_integration_tabs_section__tab_cta')['url']?>" class="primary animated-cta-btn"><?php echo get_sub_field('netsuite_benefits_integration_tabs_section__tab_cta')['title']?></a>
                                                                </div>
                                                                <?php endif?>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                <?php $wmsc++;
                                endwhile; ?>
                            </div>
                        </div>
                        <!-- Tabs END Here -->
                    </div>
                <?php endif; ?>
            </div>
        </div>

        <?php
        $wms__button = get_field('netsuite_benefits_integration_tabs_section_button');
        if ($wms__button) :
        ?>
            <div class="text-center mt-4 mt-lg-5">
                <a href="<?php  echo esc_url($wms__button['url']); ?>" class="primary animated-cta-btn">
                    <?php echo $wms__button['title']; ?>
                </a>
            </div>
        <?php endif; ?>
    </div>
</section>
<!-- Features Netsuite Tabs Section End -->

<!-- Top WMS Process For Netsuite Section Start -->
<section class="section netsuite-wms-process bg-white pb-lg-5">
    <div class="container">
        <div class="text-cont">
            <h2 class="section-title text-center"><?php echo get_field('top_wms_process_netsuite_section_title');?></h2>
            <p class="section-content text-center"><?php echo get_field('top_wms_process_netsuite_section_text');?></p>
        </div>
        <?php if( have_rows('top_wms_process_netsuite_cards') ): ?>
        <div class="netsuite-process-cards-wrapper">
            <div class="row gy-4">
            <?php $pca = 1; while( have_rows('top_wms_process_netsuite_cards') ): the_row();?>
                <div class="col-md-6 col-lg-4">
                    <div class="netsuite-card">
                        <div class="number-wrapper">
                            <span class="number"><?php echo $pca < 10 ? '0' . $pca : $pca?></span>
                        </div>

                        <h2 class="netsuite-process-card-title"><?php echo get_sub_field('top_wms_process_netsuite_cards_card_title');?></h2>
                        <p class="netsuite-process-card-content"><?php echo get_sub_field('top_wms_process_netsuite_cards_card_text');?></p>
                    </div>
                </div>
            <?php $pca++; endwhile?>
            </div>
        </div>
        <?php endif?>

        <?php $pca_button = get_field('top_wms_process_netsuite_section_button');
        if($pca_button) :
        ?>
        <div class="text-center mt-4 mt-lg-5">
            <a href="<?php echo esc_url($pca_button['url'])?>" class="primary animated-cta-btn"><?php echo $pca_button['title']?></a>
        </div>
        <?php endif?>
    </div>
</section>
<!-- Top WMS Process For Netsuite Section End -->

<!-- Netsuite integration table Section Start -->
<section class="section netsuite-integration-table-sec bg-white">
  <div class="container">
    <div class="text-cont text-center mb-5">
      <h2 class="section-title mb-4">
        <?php echo get_field('netsuite_integration_table_section_title'); ?>
      </h2>
      <p class="section-content">
        <?php echo get_field('netsuite_integration_table_section_text'); ?>
      </p>
    </div>

    <div class="table-responsive">
      <?php if (have_rows('netsuite_integration_section_table_repeater')) : ?>
        <table class="table table-borderless">
          <?php while (have_rows('netsuite_integration_section_table_repeater')) : the_row(); ?>
            <?php $index = get_row_index(); ?>

            <?php if ($index == 1) : ?>
              <!-- TABLE HEAD -->
              <?php if (have_rows('netsuite_integration_section_table_row')) : ?>
                <thead>
                  <tr>
                    <?php while (have_rows('netsuite_integration_section_table_row')) : the_row(); ?>
                      <th>
                        <?php echo get_sub_field('netsuite_integration_section_table_td'); ?>
                      </th>
                    <?php endwhile; ?>
                  </tr>
                </thead>
              <?php endif; ?>

            <?php else : ?>
              <!-- TABLE BODY -->
              <?php if (have_rows('netsuite_integration_section_table_row')) : ?>
                <tbody>
                  <tr>
                    <?php while (have_rows('netsuite_integration_section_table_row')) : the_row(); ?>
                      <td>
                        <?php echo get_sub_field('netsuite_integration_section_table_td'); ?>
                      </td>
                    <?php endwhile; ?>
                  </tr>
                </tbody>
              <?php endif; ?>
            <?php endif; ?>

          <?php endwhile; ?>
        </table>
      <?php endif; ?>
    </div>
  </div>
</section>

<!-- Netsuite integration table Section End -->


<!-- testimonials start -->
<section class="section say-about-warego client-say-about-warego">
    <div class="container">
        <div class="text-center text-cont">
            <h2 class="section-title mb-5"><?php echo get_field('reviews_heading'); ?></h2>
            <p class="section-content"><?php echo get_field('reviews_description'); ?></p>
        </div>

        <?php if( have_rows('reviews') ): ?>
        <div class="row gy-4">
        <?php while( have_rows('reviews') ): the_row();?>
            <div class="col-lg-6 right-sight">
                <div class="card">
                    <p><?php echo get_sub_field('quote');?></p>
                    <ul>
                        <li>
                            <img src="<?php echo get_sub_field('image');?>" alt="Sarah Johnson" class="img-fluid">
                        </li>
                        <li>
                            <h3><?php echo get_sub_field('name');?></h3>
                            <p><?php echo get_sub_field('position');?></p>
                        </li>
                    </ul>
                </div>
            </div>
            <?php endwhile; ?>
        </div>
        <?php endif; ?>
    </div>
</section>
<!-- testimonials end -->

<?php
$cta_text = get_field('dashboard_access_cta_text');
$btn_text = get_field('dashboard_access_cta_button_text');
$btn_url  = get_field('dashboard_access_cta_button_url');
$cta_img  = get_field('dashboard_access_cta_image');

$img_url = '';
$img_alt = '';

if (is_array($cta_img)) {
  $img_url = $cta_img['url'] ?? '';
  $img_alt = $cta_img['alt'] ?? '';
} elseif (is_numeric($cta_img)) {
  // IMPORTANT: handle numeric-string like "4505" too
  $img_id  = (int) $cta_img;
  $img_url = wp_get_attachment_url($img_id);
  $img_alt = get_post_meta($img_id, '_wp_attachment_image_alt', true);
} elseif (is_string($cta_img)) {
  // real URL string
  $img_url = $cta_img;
}

if (!empty(trim((string)$cta_text))) : ?>
<section class="section dashboard-access-cta wms-business-cta">
  <div class="container">
    <div class="box">
      <div class="row align-items-center">
        <div class="col-lg-6">
          <div class="img-cont slide-right">
            <?php if (!empty($img_url)): ?>
              <img src="<?php echo esc_url($img_url); ?>"
                   alt="<?php echo esc_attr($img_alt); ?>"
                   class="img-fluid" loading="lazy">
            <?php endif; ?>
          </div>
        </div>
        <div class="col-lg-6">
          <div class="text-cont slide-left">
            <p><?php echo wp_kses_post($cta_text); ?></p>

            <?php if (!empty($btn_text) && !empty($btn_url)): ?>
              <a href="<?php echo esc_url($btn_url); ?>" class="primary animated-cta-btn">
                <?php echo esc_html($btn_text); ?>
              </a>
            <?php endif; ?>

          </div>
        </div>
      </div>
    </div>
  </div>
</section>
<?php endif; ?>

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


<!-- Faqs Start -->
<?php
    $args = [
        'category'  => 'netsuite-integration',
        'heading'   => 'Frequently Asked <span>Questions</span>',
		'class'     => 'pt-0 bg-white',
    ];
    get_template_part('templates-parts/pages/faqs-new', null, $args);
?>
<!-- Faqs End -->

<script src="<?php echo get_template_directory_uri(); ?>/assets/js/owl.carousel.min.js"></script>
<?php
    get_footer();
?>
<script>
    // Inventory accuracy rate Card animation Script Start ************
    const card = document.querySelector('.improve-warehouse-card');

    card.addEventListener('mouseenter', () => {
        gsap.to('.order-picking-wrapper ul', {
            bottom: '85px',
            duration: 0.7,
            ease: 'power2.out',
        });
    });

    card.addEventListener('mouseleave', () => {
        gsap.to('.order-picking-wrapper ul', {
            bottom: '0px',
            duration: 0.7,
            ease: 'power2.out',
        });
    });
    // Inventory accuracy rate Card animation Script End ************


    // data accuracy Card animation Script Start ************
    const uniqueness_wrapper = document.querySelector('.data-accuracy-integrity');

    uniqueness_wrapper.addEventListener('mouseenter', () => {

        gsap.to('.timeliness', {
            top: '80px',
            right: '45px',
            rotation: -12,
            duration: 0.5,
            ease: 'power2.out',
        });

        gsap.to('.consistency', {
            top: '60px',
            left: '20px',
            rotation: 5,
            duration: 0.5,
            ease: 'power2.out',
        });

        gsap.to('.validity', {
            top: '40px',
            right: '20px',
            rotation: -8,
            duration: 0.5,
            ease: 'power2.out',
        });

        gsap.to('.uniqueness', {
            scale: 1.3,
            rotation: 3,
            duration: 0.5,
            ease: 'power2.out',
        });

        gsap.to('.completeness', {
            top: '25px',
            left: '35px',
            rotation: 15,
            duration: 0.5,
            ease: 'power2.out',
        });
    });

    uniqueness_wrapper.addEventListener('mouseleave', () => {
        gsap.to('.timeliness', {
            top: '70px',
            right: '35px',
            rotation: -7.41,
            duration: 0.5,
            ease: 'power2.out',
        });

        gsap.to('.consistency', {
            top: '68px',
            left: '12px',
            rotation: -7.41,
            duration: 0.5,
            ease: 'power2.out',
        });

        gsap.to('.validity', {
            top: '35px',
            right: '12px',
            rotation: 10.37,
            duration: 0.5,
            ease: 'power2.out',
        });

        gsap.to('.uniqueness', {
            scale: 1,
            rotation: -0.17,
            duration: 0.5,
            ease: 'power2.out',
        });

        gsap.to('.completeness', {
            top: '28px',
            left: '30px',
            rotation: 10.37,
            duration: 0.5,
            ease: 'power2.out',
        });
    });
    // data accuracy Card animation Script End ************


    // message card animation Script Start ************
    const cardWrapper = document.querySelector('.multiwarehouse-card');

    cardWrapper.addEventListener('mouseenter', () => {
        gsap.to('.message', {
            top: '20px',
            left: '25%',
            opacity: 1,
            duration: 0.5,
            scale: 1.8,
            ease: 'power2.out',
        });

        gsap.to('.message-two', {
            top: '30px',
            left: '25%',
            opacity: 1,
            duration: 0.5,
            scale: 1.8,
            ease: 'power2.out',
            delay: 0.5,
        });
    });

    cardWrapper.addEventListener('mouseleave', () => {
        gsap.to('.message', {
            top: '-100px',
            opacity: 0,
            duration: 0.5,
            ease: 'power2.in',
        });

        gsap.to('.message-two', {
            top: '-120px',
            opacity: 0,
            duration: 0.5,
            ease: 'power2.in',
            delay: 0.2,
        });
    });
    // message card animation Script End ************


    // Elipse Chart Image card animation Script Start ************
    const handLineImg = document.querySelector('.hand-line-img');

    document.querySelector('.advanced-reporting').addEventListener('mouseenter', () => {
        gsap.to(handLineImg, {
            left : "73%",
            bottom : "53%" ,
            scale: 1,
            duration: 0.6,
            ease: 'power2.out'
        });
    });

    document.querySelector('.advanced-reporting').addEventListener('mouseleave', () => {
        gsap.to(handLineImg, {
            bottom: "40%",
            left: "34%",
            scale: 1,
            duration: 0.5,
            ease: 'power2.in'
        });
    });
    // Elipse Chart Image card animation Script Start ************


    // Order Pick Accuracy Card Aniation Start ************
    const parentCard = document.querySelector('.order-picking-parent');

    parentCard.addEventListener('mouseenter', () => {
        gsap.timeline()
            .to('.order-picking-cards li:nth-child(1)', {
                x: 10,
                y: -5,
                left : 0 ,
                rotation: 0,
                duration: 0.3,
                ease: 'power2.out',
            })
            .to('.order-picking-cards li:nth-child(2)', {
                x: 20,
                y: -20,
                left : 20 ,
                rotation: 0,
                duration: 0.3,
                ease: 'power2.out',
            }, "-=0.2")
            .to('.order-picking-cards li:nth-child(3)', {
                x: 30,
                y: -30,
                left : 40 ,
                rotation: 0,
                duration: 0.3,
                ease: 'power2.out',
            }, "-=0.2");
    });

    parentCard.addEventListener('mouseleave', () => {
        gsap.timeline()
            .to('.order-picking-cards li:nth-child(1)', {
                x: 0,
                y: 0,
                left: 75 ,
                rotation: -12.42,
                duration: 0.3,
                ease: 'power2.in',
            })
            .to('.order-picking-cards li:nth-child(2)', {
                x: 0,
                y: 0,
                left: 116 ,
                rotation: -12.42,
                duration: 0.3,
                ease: 'power2.in',
            }, "-=0.2")
            .to('.order-picking-cards li:nth-child(3)', {
                x: 0,
                y: 0,
                left: 182 ,
                rotation: -12.42,
                duration: 0.3,
                ease: 'power2.in',
            }, "-=0.2");
    });
    // Order Pick Accuracy Card Aniation End ************


    // Real time visibility card ainimation start ************
    const visibilityCard = document.querySelector('.real-time-visibility-wrapper');

    visibilityCard.addEventListener('mouseenter', () => {
        gsap.to('.hand-line', {
            left : "76%" ,
            duration: 0.8,
            ease: 'power2.out',
        });
    });

    visibilityCard.addEventListener('mouseleave', () => {

        gsap.to('.hand-line', {
            left : "12%" ,
            duration: 0.8,
            ease: 'power2.out',
        });
    });
    // Real time visibility card ainimation End ************

</script>

<script>
    $('.about-our-product-slider').owlCarousel({
        loop:false,
        margin:10,
        nav:false,
        dots: false,
        responsive:{
            0:{
                items:1
            },
            600:{
                loop:true,
                items:3
            },
            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>
    document.addEventListener("DOMContentLoaded", function () {
    const scrollList = document.querySelector(".inventory-process-steps-wrapper"); // ✅ Fix
    const scrollTrack = document.querySelector(".scroll-height-control");
    const trackDiv = scrollTrack.querySelector(".track-div");

    function updateScrollIndicator() {
        const contentHeight = scrollList.scrollHeight;
        const visibleHeight = scrollList.clientHeight;
        const scrollTop = scrollList.scrollTop;
        const trackHeight = scrollTrack.offsetHeight;

        // thumb height
        const thumbHeight = Math.max(
            (visibleHeight / contentHeight) * trackHeight,
            30
        );
        trackDiv.style.height = thumbHeight + "px";

        // thumb position
        const maxThumbTop = trackHeight - thumbHeight;
        const thumbTop =
            (scrollTop / (contentHeight - visibleHeight)) * maxThumbTop;

        trackDiv.style.top = thumbTop + "px";
    }

    // initial
    updateScrollIndicator();

    // on scroll
    scrollList.addEventListener("scroll", updateScrollIndicator);

    // on resize
    window.addEventListener("resize", updateScrollIndicator);
});

