<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= htmlspecialchars($config['store_name'] ?? 'Loja') ?></title>
    <link rel="stylesheet" href="/css/theme.css">
    <link rel="stylesheet" href="/ecommerce/templates/alimentos/style.css">
</head>
<body class="template-alimentos">
    <header class="store-header">
        <div class="header-container">
            <div class="logo-section">
                <?php if (!empty($config['logo_url'])): ?>
                    <img src="<?= htmlspecialchars($config['logo_url']) ?>" alt="<?= htmlspecialchars($config['store_name'] ?? 'Loja') ?>" class="logo-img">
                <?php else: ?>
                    <h1 class="logo-text"><?= htmlspecialchars($config['store_name'] ?? 'Loja') ?></h1>
                <?php endif; ?>
            </div>
            <nav class="main-nav">
                <a href="/loja">Início</a>
                <a href="/loja/carrinho" class="cart-link">
                    Carrinho <span id="cart-count" class="cart-badge">0</span>
                </a>
            </nav>
        </div>
    </header>

    <main class="store-main">
        <div class="container">
            <section class="hero-section">
                <h1>Alimentos Frescos e Orgânicos</h1>
                <p>Qualidade e sabor em cada produto</p>
            </section>

            <section class="products-section">
                <h2>Nossos Produtos</h2>
                <div id="products-grid" class="products-grid">
                    <p>Carregando produtos...</p>
                </div>
            </section>
        </div>
    </main>

    <footer class="store-footer">
        <div class="footer-container">
            <div class="footer-info">
                <h3><?= htmlspecialchars($config['store_name'] ?? 'Loja') ?></h3>
                <?php if (!empty($config['whatsapp'])): ?>
                    <p><strong>WhatsApp:</strong> <a href="https://wa.me/<?= preg_replace('/\D/', '', $config['whatsapp']) ?>" target="_blank"><?= htmlspecialchars($config['whatsapp']) ?></a></p>
                <?php endif; ?>
                <?php if (!empty($config['email_contato'])): ?>
                    <p><strong>E-mail:</strong> <a href="mailto:<?= htmlspecialchars($config['email_contato']) ?>"><?= htmlspecialchars($config['email_contato']) ?></a></p>
                <?php endif; ?>
            </div>
            <div class="footer-copyright">
                <p>&copy; <?= date('Y') ?> <?= htmlspecialchars($config['store_name'] ?? 'Loja') ?>. Todos os direitos reservados.</p>
            </div>
        </div>
    </footer>

    <script src="/ecommerce/templates/alimentos/script.js"></script>
</body>
</html>

