<?php
/**
 * Privacy Policy Page
 * Digital Product Store
 */

require_once __DIR__ . '/config/database.php';

$page_title = 'Privacy Policy';

// Try to get from CMS pages
$page = get_page_by_slug('privacy-policy');

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

<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-lg-8">
            <h1 class="mb-4">Privacy Policy</h1>
            
            <?php if ($page && !empty($page['content'])): ?>
                <div class="page-content">
                    <?php echo $page['content']; ?>
                </div>
            <?php else: ?>
                <div class="page-content">
                    <p class="lead">We respect your privacy and are committed to protecting your personal information.</p>
                    
                    <h4 class="mt-4">1. Information We Collect</h4>
                    <p>We collect information you provide directly to us, including:</p>
                    <ul>
                        <li>Name and contact information</li>
                        <li>Email address</li>
                        <li>Billing and shipping addresses</li>
                        <li>Payment information (processed securely by third-party providers)</li>
                        <li>Purchase history</li>
                    </ul>
                    
                    <h4 class="mt-4">2. How We Use Your Information</h4>
                    <p>We use your information to:</p>
                    <ul>
                        <li>Process and fulfill your orders</li>
                        <li>Communicate with you about your orders and account</li>
                        <li>Send you marketing communications (with your consent)</li>
                        <li>Improve our products and services</li>
                        <li>Prevent fraud and ensure security</li>
                    </ul>
                    
                    <h4 class="mt-4">3. Information Sharing</h4>
                    <p>We do not sell or rent your personal information to third parties. We may share your information with:</p>
                    <ul>
                        <li>Service providers who assist in our operations</li>
                        <li>Payment processors to complete transactions</li>
                        <li>Law enforcement when required by law</li>
                    </ul>
                    
                    <h4 class="mt-4">4. Data Security</h4>
                    <p>We implement appropriate security measures to protect your data, including:</p>
                    <ul>
                        <li>SSL encryption for data transmission</li>
                        <li>Secure server infrastructure</li>
                        <li>Regular security assessments</li>
                    </ul>
                    
                    <h4 class="mt-4">5. Cookies</h4>
                    <p>We use cookies to enhance your browsing experience, remember your preferences, and analyze website traffic. You can control cookies through your browser settings.</p>
                    
                    <h4 class="mt-4">6. Your Rights</h4>
                    <p>You have the right to:</p>
                    <ul>
                        <li>Access your personal information</li>
                        <li>Correct inaccurate information</li>
                        <li>Request deletion of your information</li>
                        <li>Opt-out of marketing communications</li>
                    </ul>
                    
                    <h4 class="mt-4">7. Third-Party Links</h4>
                    <p>Our website may contain links to third-party websites. We are not responsible for the privacy practices of these websites.</p>
                    
                    <h4 class="mt-4">8. Changes to This Policy</h4>
                    <p>We may update this privacy policy from time to time. Changes will be posted on this page with an updated effective date.</p>
                    
                    <h4 class="mt-4">9. Contact Us</h4>
                    <p>If you have any questions about this Privacy Policy, please contact us at:</p>
                    <p><strong>Email:</strong> <?php echo get_setting('site_email', 'support@digitalstore.com'); ?></p>
                </div>
            <?php endif; ?>
        </div>
    </div>
</div>

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