<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}Store{% endblock %} - Minimal WSGI Example</title>
    <style>
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            background-color: #f5f5f5;
        }

        header {
            background: #8e44ad;
            color: white;
            padding: 1rem;
        }

        header h1 {
            max-width: 1200px;
            margin: 0 auto;
        }

        header h1 a {
            color: white;
            text-decoration: none;
        }

        main {
            max-width: 1200px;
            margin: 2rem auto;
            padding: 0 1rem;
        }

        .product-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 2rem;
        }

        .product-card {
            background: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .product-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }

        .product-image {
            width: 100%;
            height: 200px;
            object-fit: cover;
        }

        .product-info {
            padding: 1rem;
        }

        .product-title {
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
        }

        .product-title a {
            color: #8e44ad;
            text-decoration: none;
        }

        .product-title a:hover {
            color: #9b59b6;
        }

        .product-price {
            font-size: 1.25rem;
            font-weight: bold;
            color: #27ae60;
        }

        .product-detail {
            background: white;
            border-radius: 8px;
            padding: 2rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .back-link {
            display: inline-block;
            margin-bottom: 1rem;
            color: #8e44ad;
            text-decoration: none;
        }

        .back-link:hover {
            text-decoration: underline;
        }

        .error-page {
            text-align: center;
            padding: 4rem 1rem;
        }

        .error-page h2 {
            font-size: 3rem;
            color: #e74c3c;
            margin-bottom: 1rem;
        }

        footer {
            text-align: center;
            padding: 2rem;
            color: #666;
            font-size: 0.9rem;
        }

    </style>
    {% block extra_head %}{% endblock %}
</head>
<body>
    <header>
        <h1><a href="/">Space Quest Store</a></h1>
    </header>

    <main>
        {% block content %}{% endblock %}
    </main>

    <footer>
        <p>Minimal WSGI Example - wilco Component Framework</p>
    </footer>

    <!-- wilco component loader -->
    <script src="/wilco-static/wilco/loader.js" defer></script>
    {% block extra_scripts %}{% endblock %}
</body>
</html>
