<?php
/**
 * Tom's Java Jive - Footer Include
 */
?>
    </main>
    
    <footer class="footer">
        <div class="container">
            <div class="footer-grid">
                <div class="footer-brand">
                    <a href="/" class="logo">
                        <img src="/assets/images/logo.png?v=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/assets/images/logo.png') ?>" alt="<?= SITE_NAME ?>" style="height: 50px;">
                    </a>
                    <p>Premium artisan coffee beans freshly roasted and delivered to your door. Experience the perfect cup, every time.</p>
                </div>
                
                <div>
                    <h4>Shop</h4>
                    <ul class="footer-links">
                        <li><a href="/shop.php">All Products</a></li>
                        <?php
                        $footerCategories = db()->fetchAll(
                            "SELECT DISTINCT category FROM products WHERE category IS NOT NULL AND category != '' AND is_active = 1 ORDER BY category"
                        );
                        foreach ($footerCategories as $fc): ?>
                            <li><a href="/shop.php?category=<?= urlencode($fc['category']) ?>"><?= htmlspecialchars(ucfirst($fc['category'])) ?></a></li>
                        <?php endforeach; ?>
                    </ul>
                </div>

                <div>
                    <h4>Help</h4>
                    <ul class="footer-links">
                        <li><a href="/#about">About Us</a></li>
                        <li><a href="/contact.php">Contact</a></li>
                        <li><a href="/faq.php">FAQ</a></li>
                        <li><a href="/shipping.php">Shipping</a></li>
                        <li><a href="/returns.php">Returns</a></li>
                        <li><a href="/track-order.php">Track Order</a></li>
                        <li><a href="/privacy.php">Privacy Policy</a></li>
                    </ul>
                </div>
            </div>
            
            <div class="footer-bottom">
                <p>&copy; <?= date('Y') ?> Tom's Java Jive. All rights reserved.</p>
                <div class="footer-social">
                    <a href="#" title="Facebook"><i class="fab fa-facebook-f"></i></a>
                    <a href="#" title="Instagram"><i class="fab fa-instagram"></i></a>
                    <a href="#" title="Twitter"><i class="fab fa-twitter"></i></a>
                </div>
            </div>
        </div>
    </footer>
    
    <script src="/assets/js/main.js?v=<?= filemtime($_SERVER['DOCUMENT_ROOT'] . '/assets/js/main.js') ?>"></script>

    <?php if (isset($extraScripts)) echo $extraScripts; ?>
</body>
</html>
