<?php
/**
 * Template part for displaying Banner section.
 *
 * @package appliances_store
 */

$appliances_store_banner_main_sec = get_theme_mod('appliances_store_banner_main_sec', 'true');

if ($appliances_store_banner_main_sec) : ?>
    <div id="main-banner-sec" class="my-md-5 my-0">
        <div class="container">
            <div class="row">
                <div class="col-lg-4 col-md-4 align-self-center">
                    <?php if (get_theme_mod('appliances_store_product_banner_one') != '') { ?>
                        <div class="banner-1 mb-3 mb-md-0 position-relative">
                            <div class="product-img">
                                <img src="<?php echo esc_url(get_theme_mod('appliances_store_product_banner_one')); ?>" alt="<?php esc_attr_e( 'Banner Product Image One','appliances-store' ); ?>" />
                                <div class="product-content first">
                                    <?php if (get_theme_mod('appliances_store_product_banner_one_title1') !== '') : ?>
                                        <h2 class="my-2"><?php echo esc_html(get_theme_mod('appliances_store_product_banner_one_title1')); ?></h2>
                                    <?php endif; ?>
                                    <div class="product-btn mt-md-5 mt-3" data-wow-duration="2s">
                                        <?php if (get_theme_mod('appliances_store_product_banner_one_btn_text1') != '') { ?>
                                            <a href="<?php echo esc_url(get_theme_mod('appliances_store_product_banner_one_btn_link1')); ?>">
                                                <?php echo esc_html(get_theme_mod('appliances_store_product_banner_one_btn_text1')); ?>
                                                <span class="screen-reader-text"><?php echo esc_html(get_theme_mod('appliances_store_product_banner_one_btn_text1')); ?></span>
                                            </a>
                                        <?php } ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php } ?>
                </div>

                <div class="col-lg-4 col-md-4 align-self-center">
                    <?php if (get_theme_mod('appliances_store_product_banner_two') != '') { ?>
                        <div class="banner-1 mb-3 mb-md-0 position-relative">
                            <div class="product-img">
                                <img src="<?php echo esc_url(get_theme_mod('appliances_store_product_banner_two')); ?>" alt="<?php esc_attr_e( 'Banner Product Image Two','appliances-store' ); ?>" />
                                <div class="product-content second">
                                    <?php if (get_theme_mod('appliances_store_product_banner_two_title1') !== '') : ?>
                                        <h2 class="my-2"><?php echo esc_html(get_theme_mod('appliances_store_product_banner_two_title1')); ?></h2>
                                    <?php endif; ?>
                                </div>
                                <?php if (get_theme_mod('appliances_store_banner_sec_discount') !== '') : ?>
                                    <div class="top-discount">
                                        <p class="discount-text mb-0">
                                            <?php 
                                            $appliances_store_banner_sec_discount = get_theme_mod('appliances_store_banner_sec_discount');
                                            if ($appliances_store_banner_sec_discount) : ?>
                                                <span class="offer-text text-start"><?php echo esc_html__('Offer', 'appliances-store'); ?></span><br>
                                                <span class="discount-value text-center"><?php echo esc_html($appliances_store_banner_sec_discount); ?></span><br>
                                                <span class="off-text text-end"><?php echo esc_html__('OFF', 'appliances-store'); ?></span>
                                            <?php endif; ?>
                                        </p>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>
                    <?php } ?>
                </div>

                <div class="col-lg-4 col-md-4 align-self-center">
                    <?php if (get_theme_mod('appliances_store_product_banner_three') != '') { ?>
                        <div class="banner-1 banner-third mb-3 mb-md-0 position-relative">
                            <div class="product-img">
                                <img src="<?php echo esc_url(get_theme_mod('appliances_store_product_banner_three')); ?>" alt="<?php esc_attr_e( 'Banner Product Image Three','appliances-store' ); ?>" />
                                <div class="product-content first">
                                    <?php if (get_theme_mod('appliances_store_product_banner_three_title1') !== '') : ?>
                                        <h2 class="my-2"><?php echo esc_html(get_theme_mod('appliances_store_product_banner_three_title1')); ?></h2>
                                    <?php endif; ?>
                                    <div class="product-btn mt-md-5 mt-3" data-wow-duration="2s">
                                        <?php if (get_theme_mod('appliances_store_product_banner_three_btn_text1') != '') { ?>
                                            <a href="<?php echo esc_url(get_theme_mod('appliances_store_product_banner_three_btn_link1')); ?>">
                                                <?php echo esc_html(get_theme_mod('appliances_store_product_banner_three_btn_text1')); ?>
                                                <span class="screen-reader-text"><?php echo esc_html(get_theme_mod('appliances_store_product_banner_three_btn_text1')); ?></span>
                                            </a>
                                        <?php } ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>
<?php endif; ?>