<?php 
/**
 * Template part for displaying Choose Us Section
 *
 *@package Super Business
 */

?>

<?php
    $choose_us_image                  = super_business_get_option( 'choose_us_image' );
    $choose_us_section_subtitle       = super_business_get_option( 'choose_us_section_subtitle' );
    $choose_us_section_title          = super_business_get_option( 'choose_us_section_title' ); 
    $number_of_choose_us_items        = super_business_get_option( 'number_of_choose_us_items' );
?>

<div class="choose-us-wrapper">
    <div class="entry-container">
        <?php if( !empty( $choose_us_section_subtitle ) || !empty( $choose_us_section_title ) ) : ?>
            <div class="section-header">
                <?php if( !empty( $choose_us_section_subtitle ) ) : ?>
                    <h3 class="section-subtitle"><?php echo esc_html( $choose_us_section_subtitle ); ?></h3>
                <?php endif; ?>

                <?php if( !empty( $choose_us_section_title ) ) : ?>
                    <h2 class="section-title"><?php echo esc_html( $choose_us_section_title ); ?></h2>
                <?php endif; ?>
            </div><!-- .section-header -->
        <?php endif; ?>

        <?php for( $i=1; $i<=$number_of_choose_us_items; $i++ ) : 
            $choose_us_icon[$i]    = super_business_get_option( 'choose_us_icon_'. $i ); 
            $choose_us_title[$i]   = super_business_get_option( 'choose_us_title_'. $i ); 
            $choose_us_content[$i]  = super_business_get_option( 'choose_us_content_'. $i ); ?>
            
            <article>
                <?php if( !empty( $choose_us_icon[$i] ) ) : ?>
                    <div class="icon-container">
                        <i class="<?php echo esc_attr( $choose_us_icon[$i] )?>"></i>
                    </div><!-- .icon-container -->
                <?php endif; ?>

                <?php if( !empty( $choose_us_title[$i] ) ) : ?>
                    <header class="entry-header">
                        <h2 class="entry-title"><?php echo esc_html($choose_us_title[$i]); ?></h2>
                    </header>
                <?php endif; ?>

                <?php if( !empty( $choose_us_content[$i] ) ) : ?>
                    <div class="entry-content">
                        <?php echo esc_html($choose_us_content[$i]); ?>
                    </div><!-- .entry-content -->
                <?php endif; ?>
            </article>
        <?php endfor; ?>
        
    </div><!-- .entry-container -->

    <?php if( !empty( $choose_us_image ) ) : ?>
        <div class="featured-image">
            <img src="<?php echo esc_url( $choose_us_image ); ?>" alt="<?php echo esc_html( $choose_us_section_title ); ?>">
        </div><!-- .featured-image -->
    <?php endif; ?>
</div>