/* Base menu styles — shared across all templates */
.menu-page {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: max-width 0.3s ease;
    background-repeat: no-repeat;
    position: relative;
}

/* Background image overlay — templates can override the overlay color */
.menu-page[style*="background-image"]::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.88);
    z-index: 0;
    pointer-events: none;
}
.menu-page[style*="background-image"] > * {
    position: relative;
    z-index: 1;
}

/* Loading */
.menu-loading {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
}
.menu-loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid #eee; border-top-color: var(--menu-accent, #1976d2);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Not found */
.menu-not-found {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 60vh; text-align: center; padding: 2rem; color: #666;
}
.menu-not-found h2 { font-size: 1.5rem; margin-bottom: 0.5rem; color: #333; }

/* Header */
.menu-header {
    text-align: center; padding: 2rem 1rem 1rem;
}
.menu-logo {
    width: 72px; height: 72px; object-fit: contain; border-radius: 50%; margin-bottom: 0.75rem;
}
.menu-title {
    font-size: 1.5rem; font-weight: 700; margin: 0; line-height: 1.2;
}
.menu-subtitle {
    font-size: 0.8rem; margin: 0.25rem 0 0; opacity: 0.7; letter-spacing: 1px; text-transform: uppercase;
}

/* Category Navigation */
.menu-nav {
    display: flex; overflow-x: auto; gap: 0;
    position: sticky; top: 0; z-index: 10;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.menu-nav::-webkit-scrollbar { display: none; }
.menu-nav-item {
    flex: 0 0 auto; padding: 0.6rem 1rem;
    font-size: 0.8rem; white-space: nowrap;
    text-decoration: none; transition: all 0.2s;
    cursor: pointer;
    border: none; background: none;
    font-family: inherit;
}

/* Content */
.menu-content { padding: 0 1rem 2rem; }

/* Category */
.menu-category { margin-bottom: 1.5rem; }

/* Category image */
.category-image-wrap {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    margin-top: 1.25rem;
}
.category-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.category-title {
    font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 0.25rem;
}
.category-description {
    font-size: 0.8rem; opacity: 0.6; margin: 0 0 0.75rem;
}

/* Items */
.menu-items { display: flex; flex-direction: column; }
.menu-item {
    display: flex; gap: 0.75rem; padding: 0.75rem 0;
}
.item-image {
    width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex-shrink: 0;
}
.item-content { flex: 1; min-width: 0; }
.item-header {
    display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem;
}
.item-name { font-size: 0.9rem; font-weight: 600; }
.item-price { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.item-description {
    font-size: 0.75rem; opacity: 0.6; margin: 0.15rem 0 0; line-height: 1.4;
}
.item-tags { display: flex; gap: 0.25rem; margin-top: 0.35rem; flex-wrap: wrap; }
.item-tag {
    font-size: 0.6rem; padding: 0.1rem 0.4rem; border-radius: 8px;
    font-weight: 500;
}

/* Specific tag colors */
.item-tag.tag-vegetarian, .item-tag.tag-vegan { background: #e8f5e9; color: #2e7d32; }
.item-tag.tag-spicy { background: #fce4ec; color: #c62828; }
.item-tag.tag-gluten-free { background: #fff3e0; color: #e65100; }
.item-tag.tag-new { background: #e3f2fd; color: #1565c0; }

/* Footer */
.menu-footer {
    text-align: center; padding: 1.5rem 1rem; font-size: 0.75rem; opacity: 0.5;
}
.footer-text { margin: 0 0 0.5rem; }
.footer-powered { margin: 0; font-size: 0.65rem; }

/* ─── Desktop enhancements (768px+) ─── */
@media (min-width: 768px) {
    .menu-page {
        max-width: 860px;
        box-shadow: 0 0 40px rgba(0,0,0,0.08);
    }

    .menu-header {
        padding: 3rem 2rem 1.5rem;
    }
    .menu-logo {
        width: 96px; height: 96px;
    }
    .menu-title {
        font-size: 2rem; letter-spacing: 1px;
    }
    .menu-subtitle {
        font-size: 0.9rem; margin-top: 0.5rem;
    }

    .menu-nav {
        justify-content: center;
        gap: 0.25rem;
        padding: 0.5rem 1rem;
    }
    .menu-nav-item {
        padding: 0.6rem 1.25rem;
        font-size: 0.85rem;
    }

    .menu-content {
        padding: 0 2.5rem 3rem;
    }

    .category-image {
        height: 200px;
    }
    .category-image-wrap {
        border-radius: 16px;
    }

    .category-title {
        font-size: 1.4rem;
        margin: 2rem 0 0.5rem;
    }
    .category-description {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .menu-items {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.25rem 2rem;
    }

    .menu-item {
        padding: 1rem 0;
    }
    .item-image {
        width: 64px; height: 64px;
    }
    .item-name {
        font-size: 1rem;
    }
    .item-price {
        font-size: 1rem;
    }
    .item-description {
        font-size: 0.8rem;
    }
    .item-tag {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }

    .menu-footer {
        padding: 2rem 2rem;
        font-size: 0.8rem;
    }
}

/* ─── Large desktop (1200px+) ─── */
@media (min-width: 1200px) {
    .menu-page {
        max-width: 960px;
        border-radius: 12px;
        margin-top: 2rem;
        margin-bottom: 2rem;
        min-height: calc(100vh - 4rem);
    }

    .menu-header {
        padding: 3.5rem 3rem 2rem;
    }
    .menu-title {
        font-size: 2.2rem;
    }

    .menu-content {
        padding: 0 3.5rem 3rem;
    }
}
