<?php
if (!isset($section_settings)) {
    return;
}

$title       = $section_settings['title']       ?? __('sections.banner.title', 'Limited Time Offer');
$subtitle    = $section_settings['subtitle']    ?? __('sections.banner.subtitle', 'Get this product now at a special price');
$old_price   = $section_settings['old_price']   ?? null;
$new_price   = $section_settings['new_price']   ?? null;
$currency    = $section_settings['currency']    ?? 'DA';
$badge       = $section_settings['badge']       ?? __('sections.banner.badge', 'Best Deal');
$button_text = $section_settings['button_text'] ?? __('actions.order_now', 'Order Now');
$button_url  = $section_settings['button_url']  ?? '#checkout';
?>

<section class="home-section banner-section" id="offer">
    <div class="container">

        <div class="banner-box">

            <?php if ($badge): ?>
                <div class="banner-badge">
                    <?= htmlspecialchars($badge, ENT_QUOTES, 'UTF-8') ?>
                </div>
            <?php endif; ?>

            <div class="banner-content">

                <h2 class="banner-title">
                    <?= htmlspecialchars($title, ENT_QUOTES, 'UTF-8') ?>
                </h2>

                <p class="banner-subtitle">
                    <?= htmlspecialchars($subtitle, ENT_QUOTES, 'UTF-8') ?>
                </p>

                <div class="banner-pricing">

                    <?php if ($old_price): ?>
                        <span class="price-old">
                            <?= htmlspecialchars($old_price . ' ' . $currency, ENT_QUOTES, 'UTF-8') ?>
                        </span>
                    <?php endif; ?>

                    <?php if ($new_price): ?>
                        <span class="price-new">
                            <?= htmlspecialchars($new_price . ' ' . $currency, ENT_QUOTES, 'UTF-8') ?>
                        </span>
                    <?php endif; ?>

                </div>

                <a href="<?= htmlspecialchars($button_url, ENT_QUOTES, 'UTF-8') ?>"
                   class="btn-primary banner-btn">
                    <?= htmlspecialchars($button_text, ENT_QUOTES, 'UTF-8') ?>
                </a>

            </div>

        </div>

    </div>
</section>

