:root {
    --bg: #f7f1e8;
    --surface: #fffaf4;
    --surface-strong: #fff;
    --ink: #20140f;
    --muted: #77635a;
    --line: rgba(76, 43, 31, 0.12);
    --brand: #ff0000;
    --brand-deep: #ff0000;
    --green: #246a54;
    --accent: #ffd48f;
    --shadow: 0 18px 40px rgba(90, 42, 24, 0.12);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --shell-width: 480px;
    --shell-gutter: 12px;
    --header-width: calc(var(--shell-width) - (var(--shell-gutter) * 2));
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top right, rgba(255, 0, 0, 0.16), transparent 30%),
        linear-gradient(90deg, rgba(36, 106, 84, 0.08), transparent 44%),
        linear-gradient(180deg, #fff7ec 0%, var(--bg) 42%, #f3eadf 100%);
}

body.cart-overlay-open {
    overflow: hidden;
}

[hidden] {
    display: none !important;
}

button,
input,
select {
    font: inherit;
}

button,
select,
input,
a {
    -webkit-tap-highlight-color: transparent;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.mobile-shell {
    width: min(100%, var(--shell-width));
    margin: 0 auto;
    padding: var(--shell-gutter) var(--shell-gutter) calc(112px + env(safe-area-inset-bottom));
}

.hero-card {
    display: grid;
    gap: 14px;
    padding: 14px;
    position: sticky;
    top: 0;
    z-index: 40;
    border-radius: 0;
    color: #fff8f0;
    background: #000;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(14px);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: contain;
    padding: 4px;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.5), 0 8px 18px rgba(0, 0, 0, 0.34);
}

.brand-copy {
    display: grid;
    gap: 4px;
}

.brand-copy strong {
    font-size: 0.95rem;
    color: rgba(255, 248, 240, 0.82);
}

.table-actions {
    display: grid;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.table-actions__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.table-actions__header strong {
    color: #fff8f0;
    font-size: 0.95rem;
    white-space: nowrap;
}

.table-actions__controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.eyebrow,
.section-kicker {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-copy h1,
.section-heading h2,
.section-heading h3 {
    margin: 8px 0 0;
}

.hero-copy h1 {
    font-size: clamp(2rem, 7vw, 2.8rem);
    line-height: 1;
}

.hero-copy p {
    margin: 12px 0 0;
    max-width: 24rem;
    color: rgba(255, 248, 240, 0.82);
    line-height: 1.55;
}

.table-pill {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.table-switcher {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.table-switcher span {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(255, 248, 240, 0.86);
    text-align: left;
}

.table-switcher select {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(36, 20, 15, 0.2);
    color: #fff8f0;
    text-overflow: ellipsis;
}

.scan-location {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
}

.scan-location span,
.scan-location small {
    color: rgba(255, 248, 240, 0.76);
}

.scan-location span {
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.scan-location strong {
    color: #fff8f0;
    font-size: 1rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.scan-location small {
    font-size: 1.15rem;
    font-weight: 900;
}

.table-pill span,
.table-pill small,
.section-meta {
    color: rgba(255, 248, 240, 0.78);
}

.table-pill strong {
    font-size: 1.15rem;
}

.screen-content {
    display: grid;
    gap: 22px;
    margin-top: 16px;
}

.section-block {
    display: grid;
    gap: 14px;
}

.section-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.section-heading > div {
    min-width: 0;
}

.section-meta {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(60, 23, 16, 0.08);
    color: var(--ink);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.menu-grid,
.summary-card,
.form-card {
    display: grid;
    gap: 14px;
}

.menu-sections {
    display: grid;
    gap: 22px;
}

.menu-section {
    display: grid;
    gap: 10px;
}

.menu-section__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.menu-section__heading h3 {
    margin: 0;
    font-size: 1rem;
}

.menu-section__heading span {
    font-size: 0.8rem;
    color: var(--muted);
}

.menu-toolbar {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 250, 244, 0.78);
}

.menu-search {
    display: grid;
    gap: 6px;
}

.menu-search span {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--ink);
}

.menu-search__control {
    position: relative;
    display: grid;
}

.menu-search input {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
    padding: 10px 54px 10px 12px;
    border: 1px solid rgba(76, 43, 31, 0.14);
    border-radius: 12px;
    background: var(--surface-strong);
    color: var(--ink);
}

.voice-search-button {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 10px;
    background: rgba(255, 0, 0, 0.12);
    color: var(--brand);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.voice-search-button.is-listening {
    background: var(--brand);
    color: #ffffff;
}

.voice-search-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.voice-search-status {
    min-height: 1em;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.3;
}

.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 2px 4px;
    scrollbar-width: thin;
}

.category-tab {
    flex: 0 0 auto;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid rgba(76, 43, 31, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--ink);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 800;
}

.category-tab.is-active {
    border-color: rgba(36, 106, 84, 0.28);
    background: rgba(36, 106, 84, 0.12);
    color: var(--green);
}

.summary-card--warning p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.menu-empty {
    padding: 22px 16px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
    background: rgba(17, 17, 17, 0.78);
    text-align: center;
}

.menu-empty h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.menu-empty p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.food-card,
.summary-card,
.form-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 250, 244, 0.92);
    box-shadow: var(--shadow);
}

.food-card {
    display: grid;
    grid-template-columns: minmax(92px, 30%) minmax(0, 1fr);
    padding: 10px;
    gap: 12px;
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.food-card.is-out-of-stock {
    opacity: 0.72;
}

.food-card.is-out-of-stock img {
    filter: grayscale(0.65);
}

.food-card:hover,
.food-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(90, 42, 24, 0.16);
}

.food-card__media {
    position: relative;
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
}

.food-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    max-height: 128px;
    object-fit: cover;
    border-radius: 12px;
    background: #f2e8dc;
    display: block;
}

.stock-badge {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 2;
    padding: 6px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(36, 20, 15, 0.16);
}

.stock-badge--available {
    background: rgba(237, 255, 246, 0.94);
    color: var(--green);
}

.stock-badge--out {
    background: rgba(255, 244, 237, 0.96);
    color: #a2291d;
}

.food-tooltip {
    position: static;
    display: grid;
    gap: 2px;
    padding: 7px 8px;
    border-radius: 10px;
    background: rgba(32, 20, 15, 0.86);
    color: #fff8f0;
    margin-top: 8px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    overflow-wrap: anywhere;
}

.food-tooltip strong {
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.food-tooltip span {
    font-size: 0.66rem;
    line-height: 1.25;
}

.food-card:hover .food-tooltip,
.food-card:focus-within .food-tooltip,
.food-card:focus .food-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.food-info {
    display: grid;
    align-content: space-between;
    gap: 8px;
    min-width: 0;
}

.food-copy h3 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.2;
}

.food-copy p {
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.3;
    font-size: 0.8rem;
}

.food-footer {
    display: grid;
    align-items: stretch;
    gap: 8px;
}

.food-footer strong {
    font-size: 0.92rem;
}

.food-footer button,
.submit-button,
.cart-bar {
    border: 0;
    cursor: pointer;
}

.food-footer button,
.submit-button {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand) 0%, #ff0000 100%);
    box-shadow: 0 12px 24px rgba(255, 0, 0, 0.28);
}

.food-footer button {
    font-size: 0.86rem;
    white-space: nowrap;
}

.food-footer button:disabled {
    background: #8f8179;
    box-shadow: none;
    opacity: 1;
}

.menu-grid {
    grid-template-columns: 1fr;
    gap: 12px;
}

.food-footer button:active,
.submit-button:active,
.cart-bar:active {
    transform: translateY(1px);
}

.cart-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cart-item,
.cart-empty {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-strong);
    border: 1px solid rgba(76, 43, 31, 0.08);
}

.cart-item .cart-item__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    text-align: right;
}

.cart-item .cart-item__actions button {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(76, 43, 31, 0.16);
    border-radius: 10px;
    background: rgba(255, 250, 244, 0.94);
    color: var(--ink);
    font-weight: 900;
    cursor: pointer;
}

.cart-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.cart-item div {
    display: grid;
    gap: 4px;
}

.cart-item span,
.cart-empty {
    color: var(--muted);
}

.cart-empty {
    justify-content: center;
    text-align: center;
}

.totals-panel {
    display: grid;
    gap: 10px;
}

.checkout-block {
    margin-top: 2px;
    padding-top: 14px;
    border-top: 1px solid rgba(76, 43, 31, 0.14);
    display: grid;
    gap: 10px;
}

.section-heading--tight {
    align-items: start;
}

.checkout-block .form-card {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.total-row strong {
    color: var(--ink);
}

.total-row--grand {
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px dashed rgba(76, 43, 31, 0.16);
    font-size: 1.05rem;
}

.field {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.94rem;
}

.field span {
    font-weight: 700;
    color: var(--ink);
}

.field select,
.field input {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(76, 43, 31, 0.14);
    border-radius: 14px;
    background: var(--surface-strong);
    color: var(--ink);
}

.field input[type="file"] {
    padding: 10px 12px;
}

.submit-button {
    width: 100%;
    margin-top: 4px;
}

.secondary-button {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(76, 43, 31, 0.22);
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
}

.checkout-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.checkout-actions .submit-button,
.checkout-actions .secondary-button {
    margin-top: 0;
}

.cart-bar {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 0;
    transform: translateX(-50%);
    width: min(calc(100% - (var(--shell-gutter) * 2)), var(--header-width));
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    border-radius: 0;
    color: white;
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.32);
    z-index: 30;
}

.cart-bar__copy {
    display: grid;
    justify-items: left;
    text-align: center;
}

.cart-bar__copy small {
    color: rgba(255, 248, 240, 0.74);
}

.cart-overlay[hidden] {
    display: none;
}

.cart-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: var(--shell-gutter);
    padding-bottom: calc(var(--shell-gutter) + env(safe-area-inset-bottom));
}

.cart-overlay__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(23, 13, 10, 0.72);
}

.cart-overlay__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, var(--header-width));
    max-height: calc(100dvh - 24px);
    overflow: auto;
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 250, 244, 0.98);
    box-shadow: 0 24px 48px rgba(23, 13, 10, 0.34);
}

.cart-overlay__top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 10px;
}

.cart-overlay__close {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(76, 43, 31, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 380px) {
    :root {
        --shell-gutter: 10px;
    }

    .mobile-shell {
        padding-inline: var(--shell-gutter);
    }

    .brand-copy strong {
        font-size: 0.86rem;
    }

    .food-card {
        grid-template-columns: 86px minmax(0, 1fr);
        gap: 10px;
    }

    .food-card img {
        max-height: 108px;
    }

    .food-tooltip {
        padding: 6px;
    }

    .food-tooltip strong {
        font-size: 0.58rem;
    }

    .food-tooltip span {
        font-size: 0.6rem;
    }

    .cart-item {
        flex-direction: column;
    }

    .cart-item .cart-item__actions {
        width: 100%;
        justify-content: space-between;
    }

    .table-switcher select,
    .menu-search input,
    .field select,
    .field input {
        min-height: 46px;
    }
}

@media (min-width: 640px) {
    .mobile-shell {
        width: min(100%, var(--shell-width));
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .food-card {
        grid-template-columns: minmax(112px, 34%) minmax(0, 1fr);
    }

    .food-card img {
        height: auto;
        aspect-ratio: 1 / 1;
        max-height: 132px;
        min-height: 0;
    }

    .food-tooltip {
        position: static;
        margin-top: 0;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .checkout-actions {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 900px) {
    .mobile-shell {
        width: min(100%, var(--shell-width));
        padding: var(--shell-gutter) var(--shell-gutter) calc(112px + env(safe-area-inset-bottom));
    }

    .hero-card {
        padding: 14px;
        gap: 14px;
    }

    .brand-lockup {
        gap: 10px;
    }

    .brand-logo {
        width: 52px;
        height: 52px;
        border-radius: 14px;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .screen-content {
        grid-template-columns: 1fr;
    }

    #cartSection {
        position: static;
    }
}
