:root {
    --ink: #201a17;
    --muted: #716760;
    --line: #e8e1dc;
    --paper: #fffaf6;
    --panel: #ffffff;
    --accent: #b6402b;
    --accent-dark: #7f2e22;
    --fresh: #1f7a5f;
    --gold: #d49b39;
    --shadow: 0 16px 38px rgba(44, 31, 24, .14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

button {
    font: inherit;
}

.menu-shell {
    min-height: 100vh;
    padding-bottom: 88px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 250, 246, .96);
    border-bottom: 1px solid rgba(232, 225, 220, .86);
    backdrop-filter: blur(18px);
}

.topbar.hidden {
    display: none;
}

.topbar-inner {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 16px 18px 12px;
    transition: padding .2s ease;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-height: 58px;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    transition: max-height .22s ease, opacity .18s ease, transform .22s ease;
}

.language-switcher,
.home-language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .82);
}

.home-language-switcher {
    justify-self: start;
}

.language-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.language-link.active {
    background: var(--ink);
    color: #fff;
}

.topbar.compact .topbar-inner {
    padding-top: 8px;
    padding-bottom: 8px;
}

.topbar.compact .brand-row {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.brand-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.05;
    font-weight: 800;
}

.brand-subtitle {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.group-tabs,
.category-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.group-tabs::-webkit-scrollbar,
.category-rail::-webkit-scrollbar {
    display: none;
}

.group-tabs {
    margin-top: 15px;
    padding-bottom: 2px;
    transition: margin .2s ease;
}

.topbar.compact .group-tabs {
    margin-top: 0;
}

.group-tab,
.category-tab {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    transition: .18s ease;
}

.group-tab {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 800;
}

.group-tab.active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    box-shadow: 0 9px 22px rgba(32, 26, 23, .18);
}

.menu-content {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 18px;
}

.group-section {
    display: none;
}

.group-section.active {
    display: block;
}

.group-picker {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.group-picker.hidden {
    display: none;
}

.group-picker-title {
    grid-column: 1 / -1;
    margin: 4px 0 2px;
}

.group-picker-title h1 {
    margin: 0;
    font-size: 30px;
    line-height: 1.04;
    font-weight: 850;
}

.group-picker-title p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 15px;
    font-weight: 650;
}

.group-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 168px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    cursor: pointer;
    text-align: left;
    box-shadow: var(--shadow);
}

.group-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .72;
}

.group-card::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, rgba(32, 26, 23, .05), rgba(32, 26, 23, .82));
}

.group-card-body {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 14px;
}

.group-card-title {
    display: block;
    font-size: 20px;
    line-height: 1.08;
    font-weight: 850;
}

.group-card-count {
    display: block;
    margin-top: 6px;
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
    font-weight: 750;
}

.category-sticky {
    position: sticky;
    top: var(--topbar-height, 112px);
    z-index: 10;
    margin: 0 -18px;
    padding: 10px 18px;
    background: rgba(255, 250, 246, .95);
    border-bottom: 1px solid rgba(232, 225, 220, .74);
    backdrop-filter: blur(16px);
}

.category-tab {
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 750;
}

.category-tab.active {
    background: #fff0e7;
    border-color: #efc8b7;
    color: var(--accent-dark);
}

.category-block {
    padding-top: 22px;
    scroll-margin-top: calc(var(--topbar-height, 112px) + 58px);
}

.category-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.category-heading h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
}

.category-heading span {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: inherit;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 10px 26px rgba(44, 31, 24, .07);
}

.product-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / .82;
    object-fit: cover;
}

.product-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 92px;
    gap: 9px;
    padding: 10px;
}

.product-title-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.product-title {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.18;
    font-weight: 800;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.product-price {
    color: var(--accent);
    font-size: 14px;
    font-weight: 850;
    white-space: nowrap;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.2;
}

.product-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 7px;
    border: 1px solid rgba(232, 225, 220, .9);
    border-radius: 8px;
    background: #fffaf6;
}

.new-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    align-self: flex-start;
    padding: 4px 7px;
    border-radius: 8px;
    background: rgba(231, 244, 239, .94);
    color: var(--fresh);
    font-size: 11px;
    font-weight: 850;
    box-shadow: 0 7px 18px rgba(31, 122, 95, .2);
}

.empty-menu {
    display: grid;
    place-items: center;
    min-height: 70vh;
    padding: 32px 20px;
    text-align: center;
}

.empty-menu h1 {
    margin: 0;
    font-size: 28px;
}

.empty-menu p {
    max-width: 420px;
    margin: 10px 0 0;
    color: var(--muted);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    background: rgba(24, 18, 15, .42);
}

.modal-backdrop.open {
    display: block;
    touch-action: none;
}

.product-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 50;
    width: min(88vw, 440px);
    max-height: 86vh;
    overflow: auto;
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 24px 70px rgba(24, 18, 15, .34);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -46%) scale(.96);
    transition: transform .2s ease, opacity .2s ease;
    overscroll-behavior: contain;
}

.product-modal.open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.modal-image {
    width: 100%;
    height: min(45vh, 320px);
    object-fit: cover;
    background: #f3eee9;
}

.modal-body {
    padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
}

.modal-kicker {
    margin: 0 0 8px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.modal-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.modal-title {
    margin: 0;
    font-size: 26px;
    line-height: 1.08;
}

.modal-price {
    color: var(--accent);
    font-size: 20px;
    font-weight: 900;
    white-space: nowrap;
}

.modal-meta {
    display: none;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.modal-meta span {
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffaf6;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.modal-description {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .62);
    border-radius: 8px;
    background: rgba(32, 26, 23, .72);
    color: #fff;
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
}

@media (min-width: 680px) {
    .topbar-inner {
        padding: 18px 24px 14px;
    }

    .menu-content {
        padding: 24px;
    }

    .group-card {
        min-height: 230px;
    }

    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }

    .product-card img {
        aspect-ratio: 1 / .78;
    }

    .product-info {
        min-height: 104px;
        padding: 13px;
    }

    .product-title {
        font-size: 16px;
        -webkit-line-clamp: 2;
    }

    .product-modal {
        width: min(540px, 82vw);
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
