:root {
    --bg: #d4cdcd;
    --text-primary: #000000;
    --text-secondary: #666666;
    --accent: #000000;
    --divider: #e0dcdc;
    --card-bg: #f0ebeb;
    --section-bg: #e8e3e3;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Alegreya Sans', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

/* Header & Brand */
.header {
    background: var(--bg);
    padding: 3rem 1.5rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--divider);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}



.logo {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    line-height: 1;
}

.tagline {
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.flag-btn {
    background: none;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
}

.flag-btn img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.flag-btn:hover {
    opacity: 1;
}

.flag-btn.active {
    opacity: 1;
    border-color: var(--accent);
}

/* Sticky Category Nav Container */
.nav-outer-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(212, 205, 205, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: center;
}

.category-nav {
    flex: 1;
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 2rem 0 0;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

/* Scroll Buttons */
.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 100%;
    background: rgba(212, 205, 205, 0.8);
    backdrop-filter: blur(4px);
    border: none;
    cursor: pointer;
    display: none;
    /* JS will toggle */
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.scroll-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.scroll-btn.left {
    left: 0;
}

.scroll-btn.right {
    right: 0;
}

.scroll-btn.visible {
    display: flex;
}

/* Faded Masks */
.nav-mask-left,
.nav-mask-right {
    position: absolute;
    top: 0;
    height: 100%;
    width: 60px;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-mask-left {
    left: 0;
    background: linear-gradient(to right, #d4cdcd, transparent);
}

.nav-mask-right {
    right: 0;
    background: linear-gradient(to left, #d4cdcd, transparent);
}

.nav-mask-left.visible,
.nav-mask-right.visible {
    opacity: 1;
}

.nav-item {
    position: relative;
    flex: 0 0 auto;
    padding: 1rem 0;
    white-space: nowrap;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    scroll-snap-align: start;
}

.nav-item.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.nav-item--with-image {
    min-width: 176px;
    height: 112px;
    padding: 0;
    border: none;
    border-radius: 18px;
    overflow: hidden;
    color: #fff;
    display: block;
    box-shadow: var(--shadow-soft);
    isolation: isolate;
    background: #cfc7c7;
}

.nav-item__media {
    position: absolute;
    inset: 0;
}

.nav-item__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nav-item__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.18) 42%, rgba(0, 0, 0, 0.54) 100%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 36%);
    box-shadow: inset 0 -28px 40px rgba(0, 0, 0, 0.14);
    z-index: 1;
}

.nav-item__content {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
}

.nav-item__title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.85rem 0.9rem 0.8rem;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.nav-item--with-image:hover,
.nav-item--with-image.active {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.nav-item--with-image.active {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: -2px;
}

@media (max-width: 768px) {
    .nav-item--with-image {
        min-width: 148px;
        height: 96px;
    }
}

/* Menu Content */
main {
    padding: 1.5rem;
}

.category {
    margin-bottom: 4rem;
    scroll-margin-top: 100px;
    /* Accounts for the sticky header height */
}

.category-header {
    margin-bottom: 2rem;
    padding-top: 2rem;
}

.category-header h2 {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 2.2rem;
    text-transform: capitalize;
    margin-bottom: 0.5rem;
}

.category-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-style: italic;
}

/* Product Card & Dotted Leaders */
.products {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.product-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 0.25rem;
}

.product-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    flex-shrink: 1;
    /* Allow the name to shrink/wrap if needed */
}

.price-dots {
    flex: 1;
    /* Claim all available middle space */
    border-bottom: 2px dotted #e0e0e0;
    margin-bottom: 4px;
    min-width: 1rem;
    /* Ensure some dots always show */
}

.product-price {
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
    /* Keep the price together */
    flex-shrink: 0;
    /* Never squish the price */
    text-align: right;
}

.product-card {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--divider);
    transition: border-color 0.3s ease;
}

.product-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--section-bg);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.product-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-gluten-free {
    background-color: #ffd700;
    color: #333;
}

.badge-vegan {
    background-color: #90ee90;
    color: #333;
}

.badge-vegetarian {
    background-color: #87ceeb;
    color: #333;
}

.product-card:last-child {
    border-bottom: none;
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--text-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
    pointer-events: none;
}

.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.scroll-top-btn:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.scroll-top-btn svg {
    width: 20px;
    height: 20px;
}

/* Category Animations */
.category-header h2 {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 2.2rem;
    text-transform: capitalize;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.category:hover .category-header h2 {
    transform: translateX(10px);
}

/* Footer & Global Polish */
.footer {
    text-align: center;
    padding: 4rem 1.5rem;
    border-top: 1px solid var(--divider);
    color: var(--text-secondary);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Remove old animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading {
    text-align: center;
    font-family: 'Alegreya Sans', sans-serif;
    font-style: italic;
    padding: 4rem;
    color: var(--text-secondary);
}

/* PWA Install Prompt */
.pwa-install {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, calc(100% - 24px));
    background: #ffffff;
    border: 1px solid var(--divider);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    border-radius: 14px;
    padding: 14px 14px 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
    z-index: 1200;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.pwa-install--hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
}

.pwa-install__text h4 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.pwa-install__text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.4;
}

.pwa-install__hint {
    margin-top: 6px;
    font-size: 0.85rem;
}

.pwa-install__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pwa-btn {
    border: 1px solid var(--text-primary);
    background: #fff;
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pwa-btn--primary {
    background: var(--text-primary);
    color: #fff;
}

.pwa-btn--ghost {
    border-color: var(--divider);
}

.pwa-btn:hover {
    border-color: var(--text-primary);
    background: rgba(0,0,0,0.05);
}

.pwa-btn--primary:hover {
    background: #111;
}

.pwa-install__close {
    border: none;
    background: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    justify-self: end;
}

@media (max-width: 540px) {
    .pwa-install {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .pwa-install__actions {
        width: 100%;
    }

    .pwa-btn {
        flex: 1;
        text-align: center;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .header {
        padding: 2rem 1rem 1rem;
    }

    .logo {
        font-size: 2.2rem;
    }

    .category {
        scroll-margin-top: 60px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 2.2rem;
    }

    .product-card {
        display: flex;
        gap: 1rem;
    }

    .product-image {
        width: 100px;
        height: 100px;
    }

    .category-header h2 {
        font-size: 1.8rem;
    }

    .scroll-top-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 3rem;
        height: 3rem;
    }
}