<?php
$class = isset($args['class']) ? $args['class'] : '';

?>

<section class="section furniture-inventory-management-process <?php echo $class; ?>">
    <div class="container">
        <div class="text-cont text-center">
            <?php if(get_field('supply_chain_process_mgmt_section_title')):?>
            <h2 class="section-title mb-4"><?php echo get_field('supply_chain_process_mgmt_section_title')?></h2>
            <?php endif;?>
            <?php if(get_field('supply_chain_process_mgmt_section_text')):?>
            <p class="section-content text-center"><?php echo get_field('supply_chain_process_mgmt_section_text') ?></p>
            <?php endif;?>

        </div>
        <?php if( have_rows('supply_chain_process_mgmt_steps') ): ;
            $i = 1;
            
            ?>
        <ul>
        <?php while( have_rows('supply_chain_process_mgmt_steps') ): the_row();
        ?>
            <li>
                <div class="number-content">
                    <span><span><?php echo $i < 10 ? '0'.$i : $i?></span></span>
                </div>
                <div class="text-content">
                    <p><?php echo get_sub_field('supply_chain_process_mgmt_step_heading');?></p>
                </div>
            </li>
            <?php
            $i++;
         endwhile; ?>
        </ul>
        <?php endif; ?>

        <?php
        $cta = get_field('supply_chain_process_mgmt_section__cta');
        if($cta) :
        ?>
        <div class="text-center mt-5">
            <a href="<?php echo esc_url($cta['url'])?>" class="primary animated-cta-btn"><?php echo $cta['title']?></a>
        </div>
        <?php endif;?>

    </div>
</section>