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

    $cards_direction = [
        'right',
        'up',
        'left'
    ];
?>

<section class="section <?php echo $style; ?>">
    <div class="container">
        <div class="text-cont slide-down">
            <h2 class="section-title"><?php echo get_field('advanced_inventory_management_heading'); ?></h2>
			<p class="section-content mt-3 mb-0">
			    <?php echo get_field('advanced_inventory_management_description'); ?>
			</p>
        </div>
        
        <?php $advanced_inventory_management_cards = get_field('advanced_inventory_management_cards'); ?>
        <?php if ( is_array($advanced_inventory_management_cards) && count($advanced_inventory_management_cards) ) : ?>
            <div class="row justify-content-center">
                <?php for ($i=0; $i < count($advanced_inventory_management_cards); $i++) : ?>
                    <div class="col-lg-4 col-md-6">
                        <div class="card slide-<?php echo $cards_direction[$i]; ?>">
                            <div class="img-content">
                                <img src="<?php echo $advanced_inventory_management_cards[$i]['icon']; ?>" alt="<?php echo $advanced_inventory_management_cards[$i]['heading']; ?>" class="img-fluid" loading="lazy">
                            </div>
                            <div class="text-content">
                                <h3><?php echo $advanced_inventory_management_cards[$i]['heading']; ?></h3>
                                <p><?php echo $advanced_inventory_management_cards[$i]['description']; ?></p>
                            </div>
                        </div>
                    </div>
                <?php endfor; ?>
            </div>
        <?php endif; ?>
    </div>
</section>