<?php
/*
Template Name: coffee roaster software
*/

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 align-items-center">
            <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>
                    <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']; ?>
                        </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="536" class="img-fluid no-lazy" alt="">
					</picture>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- Certifications section start -->
<?php get_template_part('templates-parts/pages/certificates');?>
<!-- Certifications 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 -->


<section class="section coffee-roasting-inventory-management">
    <div class="container">

        <div class="text-content text-center">
            <h2 class="section-title mb-3">
                <?php echo get_field('coffee_inventory_section_title'); ?>
            </h2>

            <p class="section-content">
                <?php echo get_field('coffee_inventory_section_desc'); ?>
            </p>
        </div>

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

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

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

                        <?php if (have_rows('coffee_inventory_features')): ?>
                            <?php while (have_rows('coffee_inventory_features')): the_row(); ?>
                                <li>
                                    <span class="left">
                                        <?php echo get_sub_field('feature_number'); ?>
                                    </span>

                                    <span class="right">
                                        <h3>
                                            <?php echo get_sub_field('feature_title'); ?>
                                        </h3>

                                        <p>
                                            <?php echo get_sub_field('feature_desc'); ?>
                                        </p>
                                    </span>
                                </li>
                            <?php endwhile; ?>
                        <?php endif; ?>

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

        </div>

        <div class="demo-btn-wrapper text-center mt-5">
            <a href="<?php echo esc_url(get_field('coffee_inventory_demo_btn_url')); ?>" 
               class="primary animated-cta-btn">
                <?php echo get_field('coffee_inventory_demo_btn_text'); ?>
            </a>
        </div>

    </div>
</section>
<section class="section how-it-work bg-white">
    <div class="container">
        <div class="text-cont">
            <div class="row">
                <div class="col-lg-7">
                    <h2 class="section-title">
                        <?php echo get_field('coffee_how_it_works_title'); ?>
                    </h2>
                </div>
                <div class="col-lg-5">
                    <p class="section-content">
                        <?php echo get_field('coffee_how_it_works_desc'); ?>
                    </p>
                </div>
            </div>
        </div>
    </div>

    <div class="container-fluid gx-0">
        <div class="owl-carousel owl-theme how-it-work-slider">

            <?php if (have_rows('coffee_how_it_works_steps')): ?>
                <?php while (have_rows('coffee_how_it_works_steps')): the_row(); ?>
                    <div class="item">
                        <div class="card">

                            <?php 
                            $img = get_sub_field('step_image');
                            if ($img): ?>
                                <img src="<?php echo esc_url($img['url']); ?>"
                                     alt="<?php echo esc_attr($img['alt']); ?>"
                                     class="img-fluid"
                                     loading="lazy">
                            <?php endif; ?>

                            <div class="text-content">
                                <div class="top">
                                    <span>step</span>
                                    <h3><?php echo get_sub_field('step_number'); ?></h3>
                                </div>
                                <div class="bottom">
                                    <h4><?php echo get_sub_field('step_title'); ?></h4>
                                    <p><?php echo get_sub_field('step_desc'); ?></p>
                                </div>
                            </div>

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

        </div>

        <div class="container">
            <div class="demo-btn-wrapper mt-5">
                <a href="<?php echo esc_url(get_field('coffee_how_it_works_btn_url')); ?>"
                   class="primary animated-cta-btn">
                    <?php echo get_field('coffee_how_it_works_btn_text'); ?>
                </a>
            </div>
        </div>
    </div>
</section>


<section class="section replenishment-transform-business coffee-key-features">
    <div class="container">

        <div class="row gy-3">

            <div class="col-lg-6">
                <h2 class="section-title mb-3">
                    <?php echo get_field('coffee_key_features_title'); ?>
                </h2>

                <p class="section-content">
                    <?php echo get_field('coffee_key_features_desc'); ?>
                </p>

                <?php 
                $image = get_field('coffee_key_features_image');
                if ($image): ?>
                    <img src="<?php echo esc_url($image['url']); ?>"
                         alt="<?php echo esc_attr($image['alt']); ?>"
                         class="img-fluid">
                <?php endif; ?>
            </div>

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

                    <?php if (have_rows('coffee_key_features_cards')): ?>
                        <?php while (have_rows('coffee_key_features_cards')): the_row(); ?>
                            <div class="col-lg-6 col-md-6">
                                <div class="card">
                                    <div class="top">
                                        <h3><?php echo get_sub_field('card_title'); ?></h3>
                                        <span><?php echo get_sub_field('card_number'); ?></span>
                                    </div>
                                    <div class="bottom">
                                        <p><?php echo get_sub_field('card_desc'); ?></p>
                                    </div>
                                </div>
                            </div>
                        <?php endwhile; ?>
                    <?php endif; ?>

                </div>
            </div>

        </div>

        <div class="demo-btn-wrapper text-center mt-5">
            <a href="<?php echo esc_url(get_field('coffee_key_features_btn_url')); ?>"
               class="primary animated-cta-btn">
                <?php echo get_field('coffee_key_features_btn_text'); ?>
            </a>
        </div>

    </div>
</section>



<!--new section end-->

<?php
$heading = get_field('abw_heading');
$content = get_field('abw_content');
?>

<!-- Automate Brewery Work SEction Start -->
<section class="section automate-brewery-work coffee-roaster-inventory-work bg-white">
    <div class="container">
        <div class="text-cont">
		<?php if (!empty($heading)) : ?>
            <h2 class="section-title text-center"><?php echo wp_kses_post($heading); ?></h2>
			 <?php endif; ?>
			  <?php if (!empty($content)) : ?>
            <p class="section-content text-center">
                <?php echo wp_kses_post($content); ?>
            </p>
			 <?php endif; ?>
        </div>

        <div class="brewery-integrations-logos-wrapper">
		 <?php if (have_rows('abw_logos')) : ?>
                <?php while (have_rows('abw_logos')) : the_row();
                    $img = get_sub_field('abw_logo_image'); // array
                    $alt_override = get_sub_field('abw_logo_alt');

                    $img_url = !empty($img['url']) ? $img['url'] : '';
                    $img_alt = !empty($alt_override) ? $alt_override : (!empty($img['alt']) ? $img['alt'] : 'automate-brewery-work');
                ?>
				 <?php if (!empty($img_url)) : ?>
            <div class="img-wrapper">
                            <img src="<?php echo esc_url($img_url); ?>"
                                 alt="<?php echo esc_attr($img_alt); ?>"
                                 class="img-fluid">
                        </div>
            <?php endif; ?>
                <?php endwhile; ?>
            <?php endif; ?>
          
        </div>
		<?php 
            $cta_link = get_field('abw_logos__button');
            ?>
			  <?php if (!empty($cta_link)) : ?>
        <div class="demo-btn-wrapper text-center">
            <a href="<?php echo esc_url($cta_link['url']); ?>" class="primary animated-cta-btn"><?php echo $cta_link['title']; ?></a>
        </div>
		<?php endif; ?>
    </div>
</section>
<!-- Automate Brewery Work SEction End -->

<!-- pricing section start -->
<?php 
$pricing = [
    'class' => 'supply-chain-pricing-cards pt-5',
    'category' => 'home',
    'headingcon' => 'h2',
];
get_template_part('templates-parts/pages/pricing',null,$pricing)?>
<!-- pricing section end -->
<!-- case studies start -->
<?php 
$portfolio = ['class' => 'bg-white pt-lg-0'];
get_template_part('templates-parts/pages/case-studies',null,$portfolio);?>
<!-- case studies end -->
<!-- CTA start -->
<?php $ctas = ['class' => 'brewery-access-cta coffee-cta', 'button_class' => 'accent-btn']; get_template_part('templates-parts/pages/3pl-client-portal-cta',null,$ctas);?>
<!-- CTA end -->

<!-- Faqs start -->
<?php
    $args = [   
        'category'  => 'coffee-roaster',
    ];
    get_template_part('templates-parts/pages/faqs-new', null, $args);
?>



<script src="<?php echo get_template_directory_uri(); ?>/assets/js/owl.carousel.min.js"></script>
<?php
    get_footer();
?>
<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
            }
        }
    });
    $('.how-it-work-slider').owlCarousel({
        loop:false,
        margin:10,
        nav:true,
        navText: ["<img src='<?php echo get_template_directory_uri(); ?>/assets/img/left-arrow.webp'>", "<img src='<?php echo get_template_directory_uri(); ?>/assets/img/right-arrow.webp'>"],
        dots: false,
        center: true,
        stagePadding: 150,
        responsive:{
            0: {
                items: 1,
                stagePadding: 50
            },

            768: {
                items: 1.5,
                stagePadding: 100
            },

            1299: {
                items: 2,
                stagePadding: 200
            },

            1300: {
                items: 2.5,
            },
            1920: {
                items: 3.1,
            }
        }
    });

    $('.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
            }
        }
    });
</script>