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

<section class="section affiliate-program-works <?php echo $class?>">
    <div class="container">
        <div class="text-cont text-center slide-down">
            <h2 class="section-title"><?php echo get_field('affiliate_program_section_heading');?></h2>
        </div>
        <?php if( have_rows('affiliate_steps_repeatar') ):
            $step_num = 1; ?>
            <div class="row gy-4">
                <?php while( have_rows('affiliate_steps_repeatar') ): the_row(); 
                    
                    $heading = get_sub_field('affiliate_step_heading');
                    $text = get_sub_field('affiliate_step__text');
                    ?>
                    <div class="col-lg-4 col-md-6">
                        <div class="card ">
                            <div class="step-content">
                                Step <?php echo $step_num;?>
                            </div>
                            <div class="text-content">
                                <h3><?php echo $heading;?></h3>
                                <?php echo wpautop( $text );?>
                            </div>
                        </div>
                    </div>
                <?php 
                   $step_num ++;
                    endwhile; 
                ?>
            </div>
        <?php endif; ?>
    </div>
</section>