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

<section class="section comprehensive-furniture-inventory pt-4 <?php echo $class;?>">
    <div class="container">
        <div class="text-cont text-center">
            <h2 class="section-title mb-4"><?php echo get_field('comprehensive_cards__section_title');?></h2>
            <p class="section-content"><?php echo get_field('comprehensive_cards__section_text');?></p>
        </div>
        <?php if( have_rows('comprehensive_section__cards') ): ?>
        <div class="row justify-content-center gy-4 gx-3">
        <?php while( have_rows('comprehensive_section__cards') ): the_row(); ?>
            <div class="col-lg-4 col-md-6">
                <div class="card">
                    <img src="<?php echo get_sub_field('comprehensive__card_image');?>" alt="card" class="img-fluid">
                    <div class="text-content">
                        <h3><?php echo get_sub_field('comprehensive__card_heading');?></h3>
                        <p><?php echo get_sub_field('comprehensive__card_text');?></p>
                    </div>
                </div>
            </div>
        <?php endwhile; ?>
        </div>
        <?php endif; ?>
        <?php $cta = get_field('comprehensive_cards__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>