<?php
/*
Template Name: Serial Number Tracking
*/

get_header('new');
?>
<section class="section banner supply-chain-banner pb-5 no-lazy">
    <div class="container">
        <div class="row mt-xl-5 mt-lg-0">
            <div class="col-lg-6">
                <div class="text-cont mt-0">
                    <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">
						<?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']; ?>
                            <!-- <svg width="14" height="12" viewBox="0 0 14 12" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M5.598 0.799999H8.19L13.59 6.2L8.19 11.6H5.598L10.062 7.136H0.9V5.264H10.062L5.598 0.799999Z" fill="white"/>
                            </svg> -->
                        </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>
            <div class="col-lg-6">
                <div class="img-cont">
					<?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="636" height="392" class="img-fluid no-lazy" alt="Banner Image">
    </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" decoding="async" class="img-fluid">
                            </div>
                        <?php endif; ?>
                    <?php endwhile; ?>
                <?php endif; ?>
            </div>
        </div>
    </div>
</section>

<section class="section understanding-3pl-industry bg-white">
    <div class="container">
        <div class="row gy-5 align-items-lg-center">
            <div class="col-lg-6">
                <div class="text-content text-center text-lg-start slide-right">
                    <h2 class="section-innertitle mb-5"><?php echo get_field('features_understanding_section_heading'); ?></h2>
                    <p class="section-content">
                       <?php echo get_field('features_understanding_section_text'); ?>
                    </p>
                    <div class="buttons-wrapper">
                        <a href="<?php echo get_field('features_understanding_section_button_link'); ?>" class="demo-btn animated-btn d-inline-block mt-4"><?php echo get_field('features_understanding_section_button_text'); ?></a>
                    </div>
                </div>
            </div>
            <div class="col-lg-6">
                <div class="img-content slide-left">
                    <img src="<?php echo get_field('features_understanding_section_image'); ?>" alt="industry-management" class="img-fluid" loading="lazy" width="546" height="411">
                </div>
            </div>
        </div>
    </div>
</section>
<!-- Icons Cards Start start -->
 <?php
 $counters = ['class' => 'pt-5 '];
 get_template_part('templates-parts/pages/counter-new',null,$counters)?>
<!-- Icons Cards Start end -->

<!-- client portal tools section -->
 <?php
  $counters1 = ['class' => 'serial-tracking-tools bg-white'];
  get_template_part('templates-parts/pages/client-portal-tools',null,$counters1)?>
<!-- client portal tools section end -->

<?php if (have_rows('tabs')): ?>
<section class="section why-small-businesses">
    <div class="container">
        <div class="text-cont text-center">
            <h2 class="section-title mb-5">
                <?php echo get_field('section_title'); ?>
            </h2>
            <p class="section-content"><?php echo get_field('section_subtitle'); ?></p>
        </div>

        <div class="responsive-tabs">
            <div class="row">
                <div class="col-lg-4">
                    <ul class="nav nav-tabs" role="tablist">
                        <?php $i = 0; while (have_rows('tabs')): the_row(); 
                            $icon = get_sub_field('icon_image');
                            $title = get_sub_field('tab_title');
                        ?>
                        <li class="nav-item">
                            <a id="tab-<?php echo $i; ?>" href="#pos-<?php echo $i; ?>" class="nav-link <?php echo ($i == 0) ? 'active' : ''; ?>" data-bs-toggle="tab" role="tab">
                                <img src="<?php echo esc_url($icon['url']); ?>" alt="icon" class="img-fluid">
                                <?php echo esc_html($title); ?>
                            </a>
                        </li>
                        <?php $i++; endwhile; ?>
                    </ul>
                </div>

                <div class="col-lg-8">
                    <div id="content" class="tab-content" role="tablist">
                        <?php $j = 0; while (have_rows('tabs')): the_row(); 
                            $image = get_sub_field('content_image');
                            $percent = get_sub_field('highlight_percent');
                            $highlight = get_sub_field('highlight_text');
                            $heading = get_sub_field('heading');
                            $desc = get_sub_field('description');
                            $btn = get_sub_field('button_link');
                            $btn_text = get_sub_field('button_text');
                        ?>
                        <div id="pos-<?php echo $j; ?>" class="card tab-pane fade <?php echo ($j == 0) ? 'show active' : ''; ?>" role="tabpanel" aria-labelledby="tab-<?php echo $j; ?>">
                            <div class="card-header" role="tab" id="heading-<?php echo $j; ?>">
                                <h5 class="mb-0">
                                    <a data-bs-toggle="collapse" href="#pos-collapse-<?php echo $j; ?>" aria-expanded="<?php echo ($j == 0) ? 'true' : 'false'; ?>" aria-controls="collapse-<?php echo $j; ?>">
                                        <?php echo esc_html($heading); ?>
                                    </a>
                                </h5>
                            </div>
                            <div id="pos-collapse-<?php echo $j; ?>" class="collapse <?php echo ($j == 0) ? 'show' : ''; ?>" data-bs-parent="#content" role="tabpanel" aria-labelledby="heading-<?php echo $j; ?>">
                                <div class="card-body">
                                    <div class="row align-items-center">
                                        <div class="col-xl-5 col-lg-12">
                                            <div class="img-content">
                                                <img src="<?php echo esc_url($image['url']); ?>" alt="..." class="img-fluid">
                                            </div>
                                        </div>
                                        <div class="col-xl-7 col-lg-12">
                                            <div class="text-content">
                                                <h3><?php echo esc_html($heading); ?></h3>
                                                <?php echo $desc; ?>
                                                <?php if ($btn): ?>
                                                    <a href="<?php echo esc_url($btn['url']); ?>" class="primary animated-btn" target="<?php echo esc_attr($btn['target']); ?>">
                                                        <?php echo esc_html($btn_text); ?>
                                                    </a>
                                                <?php endif; ?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <?php $j++; endwhile; ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<?php endif; ?>

<!-- System Integrations section -->
<?php get_template_part('templates-parts/pages/system-integrations')?>
<!-- System Integrations section end -->


<!-- Real Results section -->
<?php get_template_part('templates-parts/pages/real-results')?>
<!-- Real Results section end -->


<!-- Book Demo section -->
<?php 
$ctaOne = [
    'show_section' => 1,
    'class' => 'pt-0',
];
get_template_part('templates-parts/pages/all-ctas', null,$ctaOne);
?>
<!-- Book Demo section end -->


<!-- Faqs Start -->
<?php
    $args = [
        'category'  => 'serial-number-tracking',
        'heading'   => 'Frequently Asked <span>Questions</span>',
		'class'     => 'pt-0 bg-gray',
    ];
    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();
?>
<style>
.serial-tracking-tools .bg-wrapper .box .text-content h3 {
    letter-spacing: 1px;
}
</style>
<script>
    $('.banner-logos-slider').owlCarousel({
        loop: false,
        margin: 10,
        nav: false,
        autoplay: true,
        dots: false,
        responsive: {
            0: {
                items: 1
            },
            600: {
                items: 2
            },
            1000: {
                items: 4
            }
        }
    });
    $('.portfolio-slider').owlCarousel({
        loop:false,
        margin:40,
        nav:false,
        dots:false,
        dotsData:true,
        responsive:{
            0:{
                items:1
            },
            600:{
                items:2,
                margin:20
            },
            1000:{
                items:2
            }
        }
    });
    $('.more-industries-slider').owlCarousel({
    loop: false, 
    margin: 20,
    nav: true,
    navText: ["<img src='assets/img/left-arrow.webp'>", "<img src='assets/img/right-arrow.webp'>"],
    dots: false,
    // stagePadding: 90, 
    responsive: {
        0: {
            items: 1, 
            stagePadding: 1, 
        },
        480: {
            items: 1, 
            stagePadding: 5, 
        },
        600: {
            items: 2, 
            stagePadding: 0, 

        },
        1200: {
            items : 3 ,
            // stagePadding: 35,
        },
    }
});
$('.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
            }
        }
    });


    // 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>
    var more_industries_slider = $('.industry-specific-slider');

    $('.slide-next-button').click(function() {
        more_industries_slider.trigger('next.owl.carousel');
    });

    $('.slide-prev-button').click(function() {
        more_industries_slider.trigger('prev.owl.carousel');
    });
    $('.industry-specific-slider').owlCarousel({
        loop: true,
        autoplay:false,
        margin: 20,
        nav: false,
        stagePadding: 50,
        dots: false,
        responsive: {
            0: {
                items: 1,
                stagePadding: 1,
            },
            480: {
                items: 1
            },
            600: {
                items: 2

            },
            1400: {
                items : 2
            },
        }
    });
</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>
    // *********************** 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>