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

    $cards_direction = [
        'right',
        'up',
        'left',
        '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('inventory_allocation_heading'); ?></h2>
			<p class="section-content white-text mt-3 mb-0"><?php echo get_field('inventory_allocation_description'); ?></p>
        </div>
        <?php $inventory_allocation_cards = get_field('inventory_allocation_cards'); ?>
        <?php if ( is_array($inventory_allocation_cards) && count($inventory_allocation_cards) ) : ?>
            <div class="row">
                <?php for ($i=0; $i < count($inventory_allocation_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 $inventory_allocation_cards[$i]['icon']; ?>" alt="<?php echo $inventory_allocation_cards[$i]['heading']; ?>" class="img-fluid" loading="lazy">
                            </div>
                            <div class="text-content">
                                <h3><?php echo $inventory_allocation_cards[$i]['heading']; ?></h3>
                                <p><?php echo $inventory_allocation_cards[$i]['description']; ?></p>
                            </div>
                        </div>
                    </div>
                <?php endfor; ?>
            </div>
        <?php endif; ?>
    </div>
</section>