<?php

require_once __DIR__ . '/../app/config/config.php';
require_once __DIR__ . '/../app/config/database.php';
require_once __DIR__ . '/../app/helpers/functions.php';
require_once __DIR__ . '/../app/helpers/auth.php';
require_once __DIR__ . '/../app/helpers/cart.php';
require_once __DIR__ . '/../app/helpers/settings.php';

$siteName = get_setting('site_name', APP_NAME);
$contactEmail = get_setting('contact_email', '');

$pageTitle = 'Terms & Conditions | ' . $siteName;
$pageDescription = 'Read the terms and conditions for shopping with ' . $siteName . '.';

require_once __DIR__ . '/includes/header.php';
?>

<section class="shop-hero">
    <div class="container">
        <div class="eyebrow">Legal</div>
        <h1>Terms & Conditions</h1>
        <p>Please read these terms before using our website or placing an order.</p>
    </div>
</section>

<section class="section">
    <div class="container" style="max-width:900px;">
        <div class="checkout-form">
            <h2>1. Website Use</h2>
            <p>
                By using this website, you agree to use it only for lawful purposes and in a way that does not
                harm the website, business, or other customers.
            </p>

            <h2>2. Products</h2>
            <p>
                We aim to display product details, prices, images, stock status, and descriptions accurately.
                However, product appearance may vary slightly due to lighting, screen settings, or product updates.
            </p>

            <h2>3. Orders</h2>
            <p>
                Orders placed through this website are subject to acceptance, stock availability, and successful payment confirmation.
                An order may remain pending until payment is confirmed.
            </p>

            <h2>4. Pricing</h2>
            <p>
                Prices are shown in the selected/default currency. We reserve the right to correct pricing errors
                and update product prices when needed.
            </p>

            <h2>5. Coupons and Discounts</h2>
            <p>
                Coupon codes may be limited by expiry date, minimum order value, usage limit, or other conditions.
                Discounts cannot always be combined unless specifically allowed.
            </p>

            <h2>6. Customer Accounts</h2>
            <p>
                Customers are responsible for keeping account login details secure. We reserve the right to suspend
                accounts involved in misuse, fraud, or policy violations.
            </p>

            <h2>7. Loyalty Points and Referrals</h2>
            <p>
                Loyalty points and referral benefits are promotional features. Points may be added after payment confirmation
                and may be adjusted if an order is refunded or cancelled.
            </p>

            <h2>8. Gift Orders</h2>
            <p>
                Gift order messages and recipient details must be accurate and appropriate. We may remove inappropriate
                or harmful gift messages.
            </p>

            <h2>9. Limitation of Liability</h2>
            <p>
                We are not responsible for indirect losses resulting from website downtime, delivery delays,
                third-party payment issues, or circumstances outside our reasonable control.
            </p>

            <h2>10. Contact</h2>
            <p>
                For questions about these terms, contact us
                <?php if ($contactEmail): ?>
                    at <strong><?= e($contactEmail); ?></strong>.
                <?php else: ?>
                    through our contact page.
                <?php endif; ?>
            </p>

            <p style="color:#777; font-size:14px;">
                Last updated: <?= e(date('d M Y')); ?>
            </p>
        </div>
    </div>
</section>

<?php require_once __DIR__ . '/includes/footer.php'; ?>