<?php
/**
 * Landing Page Section
 *
 * يعتمد على الصفحة المفعّلة من لوحة التحكم
 */

use Core\System\ThemeManager;
use Core\App\Models\Pages;

$pageId = ThemeManager::getSetting('active_product_page');

if (!$pageId) {
    return;
}

$pagesModel = new Pages();
$page = $pagesModel->getById((int)$pageId);

if (!$page || (int)$page['is_published'] !== 1) {
    return;
}
?>

<section class="home-section landing-page-section">
    <div class="container">

        <div class="landing-page-inner">

            <?php if (!empty($page['title'])): ?>
                <h2 class="landing-page-title">
                    <?= htmlspecialchars($page['title'], ENT_QUOTES, 'UTF-8') ?>
                </h2>
            <?php endif; ?>

            <?php if (!empty($page['content'])): ?>
                <div class="landing-page-content">
                    <?= $page['content'] ?>
                </div>
            <?php endif; ?>

        </div>

    </div>
</section>
