<?php 
$class = isset($args['class']) ? $args['class'] : '';
$row_class = isset($args['row_class']) ? $args['row_class'] : '';
$button_class = isset($args['button_class']) ? $args['button_class'] : 'purple-outline-btn';
?>
<section class="section optimized-integrations mt-5 mt-lg-0 pt-0 <?php echo $class;?>">
    <div class="container">
        <div class="row align-items-center gy-5 gy-lg-0 <?php echo $row_class;?>">
            <div class="col-lg-6 mt-0">
                <div class="company-logos-slide-wrapper">
                    <div class="first-slide-wrapper">
                        <ul>
                        <?php if( have_rows('optimized_repeater') ): ?>
                            <?php while( have_rows('optimized_repeater') ): the_row(); 
            $optimized_images = get_sub_field('optimized_images'); 
            if (is_valid_image_array($optimized_images)) :
            
        ?>
                            <li>
                                <div class="img-wrapper">
                                    <img src="<?php echo $optimized_images['url']; ?>" class="img-fluid" alt="<?php echo $optimized_images['alt']; ?>">
                                </div>
                            </li>

                            <?php endif; ?>
                            <?php endwhile; ?>
                            <?php endif; ?>
                            
                        </ul>
                    </div>
                    <div class="second-slide-wrapper">
                        <ul>
                            <?php if( have_rows('optimized_repeater2') ): ?>
                                <?php while( have_rows('optimized_repeater2') ): the_row(); 
                                    $optimized_images2 = get_sub_field('optimized_images2'); 
                                    if (is_valid_image_array($optimized_images2)) :
                                ?>
                                    <li>
                                        <div class="img-wrapper">
                                            <img src="<?php echo $optimized_images2['url']; ?>" class="img-fluid" alt="<?php echo $optimized_images2['alt']; ?>">
                                        </div>
                                    </li>
                                <?php endif; ?>
                                <?php endwhile; ?>
                            <?php endif; ?>
                            
                        </ul>
                    </div>
                    <div class="third-slide-wrapper">
                        <ul>
                            <?php if( have_rows('optimized_repeater3') ): ?>
                                <?php while( have_rows('optimized_repeater3') ): the_row(); 
                                    $optimized_images3 = get_sub_field('optimized_images3'); 
                                    if (is_valid_image_array($optimized_images3)) :
                                    
                                    ?>
                                        <li>
                                            <div class="img-wrapper">
                                                <img src="<?php echo $optimized_images3['url']; ?>" class="img-fluid" alt="<?php echo $optimized_images3['alt']; ?>">
                                            </div>
                                        </li>
                                    <?php endif; ?>
                                <?php endwhile; ?>
                            <?php endif; ?>
                            
                        </ul>
                    </div>
                </div>
            </div>
            <div class="col-lg-6">
                <div class="text-cont">
                    <h2 class="section-title"><?php echo get_field('optimized_title'); ?></h2>
                    <p><?php echo get_field('optimized_content'); ?></p>
                    <a href="<?php echo get_field('optimized_link'); ?>" class="animated-btn <?php echo $button_class;?>"><?php echo get_field('optimized_button_text'); ?></a>
                </div>
            </div>
        </div>
    </div>
</section>