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

$price        = $product['price'] ?? null;
$old_price    = $product['old_price'] ?? null;
$currency     = $product['currency'] ?? '';
$offer_note   = $product['offer_note'] ?? __('pricing.default_note', 'Limited time offer');
?>

<section class="home-section pricing-section" id="pricing">
    <div class="container">

        <div class="section-head">
            <h2><?= __('sections.pricing', 'Pricing') ?></h2>
        </div>

        <div class="pricing-box">

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

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

            <div class="pricing-note">
                <?= htmlspecialchars($offer_note, ENT_QUOTES, 'UTF-8') ?>
            </div>

            <a href="#checkout" class="btn-primary pricing-btn">
                <?= __('actions.order_now', 'Order Now') ?>
            </a>

        </div>

    </div>
</section>
