/*
 * Restaurant styles. Mobile-first, no frameworks, no web fonts (system fonts
 * cover Latin, Devanagari and Gurmukhi on phones). No animations.
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: #f7f4ef;
    --surface: #ffffff;
    --text: #1f1d1a;
    --muted: #5f5a52;
    --border: #e4ddd2;
    --accent: #b5471b;
    --accent-dark: #8f3612;
    --accent-soft: #fbeee6;
    --takeaway: #1f5f8b;
    --takeaway-soft: #e6f0f7;
    --ok: #1d6b3a;
    --ok-soft: #e4f3ea;
    --warn-bg: #fff6dc;
    --warn-border: #e2b93b;
    --info-bg: #eef3f8;
    --info-border: #b7c9dc;
    --danger: #a32014;
    --focus: #1d4ed8;
    --radius: 14px;
    --radius-small: 10px;
    --shadow: 0 1px 2px rgba(31, 29, 26, 0.06), 0 4px 14px rgba(31, 29, 26, 0.06);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Gurmukhi",
        "Nirmala UI", "Kohinoor Devanagari", "Mukta Mahee", sans-serif;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: 64px; /* keep anchored sections clear of the sticky category bar */
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
}

:lang(hi),
:lang(pa) {
    line-height: 1.65;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent-dark);
}

h1,
h2,
h3 {
    margin: 0 0 0.5rem;
    line-height: 1.25;
}

p {
    margin: 0 0 0.75rem;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 0.5rem;
    top: -4rem;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-radius: var(--radius-small);
}

.skip-link:focus {
    top: 0.5rem;
}

.muted {
    color: var(--muted);
}

.fineprint {
    color: var(--muted);
    font-size: 0.875rem;
}

/* --- Layout -------------------------------------------------------------- */

.container,
.page {
    width: 100%;
    max-width: 40rem;
    margin: 0 auto;
    padding: 1rem;
}

.page:focus {
    outline: none;
}

.has-cart-bar .page {
    padding-bottom: 6.5rem; /* room for the fixed cart bar */
}

.page-title {
    font-size: 1.5rem;
    margin: 0.25rem 0 0.75rem;
}

.lead {
    color: var(--muted);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.card__title {
    font-size: 1.1rem;
}

.actions {
    display: grid;
    gap: 0.6rem;
    margin: 1rem 0;
}

/* --- Header ---------------------------------------------------------------- */

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1rem;
}

/* The header's content lines up with the page content below (page width minus its padding). */
.topbar__row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 38rem;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    min-height: 44px;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}

.brand__logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}

.brand__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip {
    flex-shrink: 0;
    margin-left: auto;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.chip--takeaway {
    background: var(--takeaway-soft);
    color: var(--takeaway);
}

.lang-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-width: 38rem;
    margin: 0.4rem auto 0;
}

.lang-switch a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.2rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
}

.lang-switch a[aria-current="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0.55rem 1.1rem;
    border: 2px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn--block {
    display: flex;
    width: 100%;
}

.btn--large {
    min-height: 52px;
    font-size: 1.05rem;
}

.btn--primary {
    background: var(--accent);
    color: #ffffff;
}

.btn--primary:hover {
    background: var(--accent-dark);
}

.btn--secondary {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.btn--ghost {
    background: transparent;
    color: var(--accent-dark);
}

.btn--add {
    min-width: 5.5rem;
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.btn--choice {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
    font-size: 1.05rem;
}

.btn--choice[aria-current="true"] {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    background: #ece8e1;
    border-color: #ece8e1;
    color: #6f6a62;
    cursor: not-allowed;
}

/* --- Landing --------------------------------------------------------------- */

.hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.hero__eyebrow {
    margin: 0 0 0.25rem;
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 0.95rem;
}

.hero__title {
    font-size: 1.75rem;
}

.hero__text {
    font-size: 1.05rem;
}

.hero__meta {
    font-weight: 700;
}

.hero--compact {
    text-align: center;
}

.lang-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: 0.6rem;
}

/* --- Notices --------------------------------------------------------------- */

.notice {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-small);
    border: 1px solid var(--info-border);
    background: var(--info-bg);
}

.notice p:last-child,
.notice ul:last-child {
    margin-bottom: 0;
}

.notice ul {
    margin: 0.25rem 0 0;
    padding-left: 1.2rem;
}

.notice--warning {
    border-color: var(--warn-border);
    background: var(--warn-bg);
}

.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
}

.empty-state--inline {
    padding: 1rem 0;
}

/* --- Menu ------------------------------------------------------------------ */

.search {
    width: 100%;
    min-height: 48px;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font: inherit;
}

.menu-tools {
    margin-bottom: 0.75rem;
}

.category-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0 -1rem 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.category-nav ul {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.category-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.3rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.category-nav a.is-current {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.menu-section {
    padding-top: 0.75rem;
}

.menu-section__title {
    font-size: 1.25rem;
    margin: 0.5rem 0 0.75rem;
}

.menu-list {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.menu-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    padding: 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.menu-item__name {
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}

.menu-item__open {
    /* Invisible padding makes the tap area at least 44px tall without changing the look. */
    padding: 0.75rem 0;
    margin: -0.75rem 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.menu-item__desc {
    color: var(--muted);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.menu-item__price {
    margin: 0;
    font-weight: 700;
}

.menu-item__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
}

.menu-item__img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: var(--radius-small);
    background: var(--bg);
}

.menu-item.is-sold-out .menu-item__name,
.menu-item.is-sold-out .menu-item__price {
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge--sold-out {
    background: #ece8e1;
    color: #57524a;
}

/* Quantity stepper: [−] 2 [+] */
.stepper {
    display: inline-flex;
    align-items: center;
    border: 2px solid var(--accent);
    border-radius: 999px;
    background: var(--surface);
}

.stepper__btn {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--accent-dark);
    font: inherit;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.stepper__btn:disabled {
    color: #b8b2a9;
    cursor: not-allowed;
}

.stepper__value {
    min-width: 2rem;
    text-align: center;
    font-weight: 700;
}

.stepper--large .stepper__btn {
    width: 52px;
    height: 52px;
}

/* --- Item sheet (dialog) --------------------------------------------------- */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(20, 18, 15, 0.5);
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
}

.sheet__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.sheet__title {
    font-size: 1.3rem;
}

.sheet__close {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: var(--bg);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.sheet__img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: var(--radius-small);
    margin-bottom: 0.75rem;
}

.sheet__price {
    font-weight: 700;
    font-size: 1.1rem;
}

.sheet__form {
    display: grid;
    gap: 0.75rem;
    justify-items: start;
}

.sheet__form .btn,
.sheet__form .field__input {
    justify-self: stretch;
}

body.sheet-open {
    overflow: hidden;
}

/* --- Forms ----------------------------------------------------------------- */

.field {
    margin-bottom: 1rem;
}

.field__label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 700;
}

.field__input {
    width: 100%;
    min-height: 48px;
    padding: 0.6rem 0.8rem;
    border: 1px solid #b9b1a5;
    border-radius: var(--radius-small);
    background: var(--surface);
    font: inherit;
}

textarea.field__input {
    min-height: 4.5rem;
    resize: vertical;
}

.field__input[aria-invalid="true"] {
    border-color: var(--danger);
}

.field__hint {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.field__error {
    margin: 0.3rem 0 0;
    color: var(--danger);
    font-weight: 700;
    font-size: 0.9rem;
}

/* --- Cart and checkout ----------------------------------------------------- */

.cart-lines,
.summary-lines,
.bill__orders,
.bill__lines {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cart-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.4rem 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
}

.cart-line:last-child {
    border-bottom: 0;
}

.cart-line__name {
    font-weight: 700;
}

.cart-line__note,
.cart-line__problem,
.summary-line__note {
    grid-column: 1 / -1;
    font-size: 0.9rem;
    color: var(--muted);
}

.cart-line__problem {
    color: var(--danger);
    font-weight: 700;
}

.cart-line__amount {
    font-weight: 700;
    text-align: right;
}

.cart-line__controls {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.cart-line.is-unavailable .cart-line__name {
    color: var(--muted);
    text-decoration: line-through;
}

.summary-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.summary-line.is-unavailable .summary-line__name {
    color: var(--muted);
    text-decoration: line-through;
}

.summary-line__amount {
    font-weight: 700;
    text-align: right;
}

.totals {
    margin: 0.75rem 0 0;
}

.totals__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 0;
}

.totals dt,
.totals dd {
    margin: 0;
}

.totals__row--grand {
    margin-top: 0.3rem;
    padding-top: 0.6rem;
    border-top: 2px solid var(--text);
    font-size: 1.15rem;
    font-weight: 700;
}

.totals__row--tax {
    color: var(--muted);
    font-size: 0.95rem;
}

.totals__row--due {
    font-weight: 700;
    color: var(--accent-dark);
}

/* --- Payment ----------------------------------------------------------------- */

.pay-panel {
    border-left: 4px solid var(--info-border);
}

.pay-panel--failed,
.pay-panel--expired,
.pay-panel--problem,
.pay-panel--unavailable {
    border-left-color: var(--danger);
}

.pay-panel--pending,
.pay-panel--slow,
.pay-panel--verifying,
.pay-panel--paid {
    border-left-color: var(--warn-border);
}

.pay-panel--confirmed {
    border-left-color: var(--ok);
}

.pay-panel__message {
    font-size: 1.05rem;
    font-weight: 600;
}

.pay-panel--confirmed .pay-panel__message {
    color: var(--ok);
}

.pay-panel__actions {
    display: grid;
    gap: 0.5rem;
}

.pay-panel__actions:empty {
    display: none;
}

.menu-tax-note {
    margin: 0 0 0.75rem;
}

.bill-sheet__head {
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed var(--border);
    text-align: center;
}

.bill-sheet__head p {
    margin: 0;
    font-size: 0.9rem;
}

.bill-sheet__table {
    margin-top: 0.4rem !important;
    font-weight: 700;
}

.bill-sheet__footer {
    margin-top: 0.75rem;
    text-align: center;
}

.bill__order-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
}

.retry {
    margin-top: 0.75rem;
}

/* --- Table bill and order status ------------------------------------------ */

.bill__order {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.bill__order.is-cancelled .bill__lines {
    color: var(--muted);
    text-decoration: line-through;
}

.bill__order-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.bill__lines li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
}

.bill__total {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.75rem 0 0.25rem;
    font-size: 1.1rem;
}

.status {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--info-bg);
    font-size: 0.85rem;
    font-weight: 700;
}

.status--ready,
.status--completed {
    background: var(--ok-soft);
    color: var(--ok);
}

.status--cancelled {
    background: #ece8e1;
    color: #57524a;
}

.status--held {
    background: var(--warn-bg);
}

.order-code {
    margin: 0.25rem 0 0.5rem;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.status-now .status {
    font-size: 1.05rem;
    padding: 0.35rem 0.9rem;
}

.steps {
    margin: 0.75rem 0;
    padding: 0;
    list-style: none;
}

.steps__item {
    position: relative;
    padding: 0.35rem 0 0.35rem 2rem;
    color: var(--muted);
}

.steps__item::before {
    content: "";
    position: absolute;
    left: 0.35rem;
    top: 0.75rem;
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
}

.steps__item.is-done,
.steps__item.is-current {
    color: var(--text);
}

.steps__item.is-done::before {
    border-color: var(--ok);
    background: var(--ok);
}

.steps__item.is-current {
    font-weight: 700;
}

.steps__item.is-current::before {
    border-color: var(--accent);
    background: var(--accent);
}

/* --- Cart bar -------------------------------------------------------------- */

.cart-bar {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 38.5rem;
    min-height: 58px;
    margin: 0 auto;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(143, 54, 18, 0.35);
}

.cart-bar__count {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

.cart-bar__cta {
    margin-left: auto;
}

/* --- Staff error page (templates/error.php) -------------------------------- */

.debug pre {
    overflow-x: auto;
    font-size: 0.75rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* --- Larger screens -------------------------------------------------------- */

@media (min-width: 48rem) {
    .page {
        max-width: 46rem;
    }

    .topbar__row,
    .lang-switch {
        max-width: 44rem;
    }

    .page--menu {
        max-width: 64rem;
    }

    .page-menu .topbar__row,
    .page-menu .lang-switch {
        max-width: 62rem;
    }

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

    .sheet {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        width: 32rem;
        transform: translate(-50%, -50%);
        border-radius: 18px;
    }

    .cart-bar {
        max-width: 30rem;
    }
}

/* --- Final bill (Prompt 8) ------------------------------------------------- */

.get-bill-row {
    margin: 0 0 0.75rem;
    text-align: right;
}

.bill-intro {
    margin: 0 0 0.75rem;
    color: var(--muted);
}

.bill-done {
    border: 2px solid var(--ok);
    background: var(--ok-soft);
}

.bill-done__title {
    margin: 0 0 0.5rem;
    color: var(--ok);
    font-size: 1.3rem;
}

.bill-done p {
    margin: 0.35rem 0;
}

.bill-sheet__doc {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bill-lines {
    width: 100%;
    margin: 0.5rem 0;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.bill-lines th,
.bill-lines td {
    padding: 0.3rem 0.25rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.bill-lines th {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.bill-lines .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.bill-lines__note {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
}

.bill__order.is-cancelled .bill-lines {
    color: var(--muted);
    text-decoration: line-through;
}

.bill-waiting {
    border: 1px dashed var(--warn-border);
    background: var(--warn-bg);
}

/* Printing shows the bill only: no navigation, buttons or payment controls. */
@media print {
    body {
        background: #fff;
        color: #000;
    }

    .skip-link,
    .topbar,
    .lang-switch,
    .cart-bar,
    .pay-panel,
    .bill-intro,
    .bill-waiting,
    [data-print],
    .get-bill-row {
        display: none !important;
    }

    .card {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .bill-done {
        border: 1px solid #000;
        background: #fff;
        padding: 0.5rem;
    }

    .bill-done__title {
        color: #000;
    }
}

/* Takeaway order page: the pickup token is the biggest thing on the screen; "ready" stands out. */
.order-type {
    margin: 0 0 0.5rem;
}

.order-code--pickup {
    font-size: 3.2rem;
    letter-spacing: 0.06em;
    color: var(--takeaway);
}

.notice--success {
    border-color: var(--ok);
    background: var(--ok-soft);
    color: var(--ok);
}

.order-ready {
    font-size: 1.15rem;
    font-weight: 700;
}