<?php 
/**
 * Home Section 1 Template
 *
 * @package Logistics Express
 */

$logistics_express_section_one = get_theme_mod('logistics_express_section_banner');
if ('Disable' === $logistics_express_section_one) {
    return;
}

// Get all banner data
$background_image = get_theme_mod('logistics_express_section_bannerimage_section');
$title           = get_theme_mod('logistics_express_section_bannerimage_section_title');
$text            = get_theme_mod('logistics_express_section_bannerimage_section_text');
$btn_text        = get_theme_mod('logistics_express_banner_btn_text');
$btn_url         = get_theme_mod('logistics_express_banner_btn_text_url');

// Check if there's any content to display
if (empty($background_image) && empty($title) && empty($text) && empty($btn_text)) {
    return; // No content, skip section
}
?>

<section id="banner-section" 
    <?php if (!empty($background_image)) : ?>
        style="background-image: url('<?php echo esc_url($background_image); ?>');"
    <?php endif; ?>
>
    <div class="overlay"></div>
    <div class="banner-content">
        <div class="glass-box">
            <?php if (!empty($title)) : ?>
                <h2><?php echo esc_html($title); ?></h2>
            <?php endif; ?>

            <?php if (!empty($text)) : ?>
                <p><?php echo esc_html($text); ?></p>
            <?php endif; ?>

            <?php if (!empty($btn_text)) : ?>
                <div class="btn-container">
                    <a href="<?php echo esc_url($btn_url); ?>" class="cta-btn">
                        <?php echo esc_html($btn_text); ?>
                    </a>
                </div>
            <?php endif; ?>
        </div>
    </div>
</section>
