<?php if (!defined('STORE_ROOT')) { http_response_code(403); exit; } $row = null; try { $row = Database::one("SELECT * FROM terms WHERE slug = 'terms' LIMIT 1"); } catch (\Throwable $e) { error_log('[Terms] ' . $e->getMessage()); } $subtitle = $row['subtitle'] ?? 'The terms governing your use of our platform, products, and services.'; ?>
<div class="legal-page">
<div class="page-banner sf-page-banner">
<img src="/uploads/banners/store.png" alt="" class="sf-page-banner-bg">
<div class="sf-page-banner-content">
<div class="page-banner-icon">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>
</div>
<div class="page-banner-text">
<h1 class="page-banner-title">Terms of Service</h1>
<p class="page-banner-sub"><?= htmlspecialchars($subtitle) ?></p>
</div>
</div>
</div>
<div class="legal-body">
<?php if ($row): ?>
<?php for ($i = 1; $i <= 30; $i++): ?>
<?php $n = str_pad($i, 2, '0', STR_PAD_LEFT); $type = $row["t{$n}"] ?? ''; $content = $row["c{$n}"] ?? ''; if (!$content) continue; ?>
<?php if ($type === 'h'): ?>
<h2 class="legal-heading"><?= htmlspecialchars($content) ?></h2>
<?php elseif ($type === 'ul'): ?>
<ul class="legal-list"><?= strip_tags($content, '<li>') ?></ul>
<?php elseif ($type === 'ol'): ?>
<ol class="legal-list legal-list-ordered"><?= strip_tags($content, '<li>') ?></ol>
<?php elseif ($type === 'note'): ?>
<div class="legal-note"><?= htmlspecialchars($content) ?></div>
<?php else: ?>
<p class="legal-p legal-p-<?= $n ?>"><?= htmlspecialchars($content) ?></p>
<?php endif; ?>
<?php endfor; ?>
<?php else: ?>
<p class="legal-p">Terms of Service content is being updated. Please check back shortly.</p>
<?php endif; ?>
</div>
</div>