/* ============================================================
   Lutong Bahay - minimalist theme
   Monochrome ink on white, hairline rules, generous whitespace.
   ============================================================ */

:root {
    --bg: #ffffff;
    --bg-alt: #fafafa;
    --ink: #111111;
    --ink-soft: #3d3d3d;
    --muted: #767676;
    --line: #e6e6e6;
    --line-strong: #111111;
    --accent: #b4552d;      /* used sparingly: prices, focus, "hot" */
    --danger: #a8321f;
    --radius: 6px;
    --shadow: none;
}

* { box-sizing: border-box; }

/* The HTML hidden attribute must always beat display rules below;
   otherwise class rules like .modal-backdrop { display: grid } override it. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

.container {
    width: min(1080px, 90%);
    margin-inline: auto;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-block;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 13px 28px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-decoration: none;
    background: transparent;
    color: var(--ink);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.btn-primary:hover { background: var(--ink-soft); border-color: var(--ink-soft); }

.btn-block { width: 100%; }

.btn-ghost {
    border-color: var(--line);
    color: var(--ink-soft);
}

.btn-ghost:hover { border-color: var(--line-strong); }

.btn-danger {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--bg);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.icon-btn {
    border: 1px solid var(--line);
    background: transparent;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--ink);
    line-height: 1;
    transition: border-color 0.2s ease;
}

.icon-btn:hover { border-color: var(--line-strong); }

/* ── Header ──────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 18px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }

.brand-text strong {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-text small {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.58rem;
}

.main-nav {
    margin-left: auto;
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    transition: color 0.2s ease;
}

.main-nav a:hover { color: var(--ink); }

.cart-toggle {
    position: relative;
    border: 1px solid var(--line);
    background: transparent;
    border-radius: var(--radius);
    padding: 9px 16px;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    color: var(--ink);
    transition: border-color 0.2s ease;
}

.cart-toggle:hover { border-color: var(--line-strong); }

.cart-count {
    position: absolute;
    top: -9px;
    right: -9px;
    background: var(--ink);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 600;
    min-width: 19px;
    height: 19px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    padding: 0 5px;
}

.cart-count.bump { animation: bump 0.35s ease; }

@keyframes bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 96px 0;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 72px;
    align-items: center;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--muted);
    margin: 0 0 22px;
}

.hero h1 {
    font-size: clamp(2.4rem, 5.5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 600;
    margin: 0 0 24px;
    color: var(--ink);
}

.lede {
    font-size: 1.02rem;
    color: var(--muted);
    margin: 0 0 36px;
    max-width: 44ch;
}

.hero-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
}

.special-label {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    width: 100%;
}

.special-emoji { font-size: 2.6rem; margin: 30px 0 14px; }

.hero-card h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.hero-card p {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.special-price {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: baseline;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.special-price .old {
    text-decoration: line-through;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 400;
}

.special-price strong {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.02em;
}

/* ── Menu section ────────────────────────────────────────── */
.menu-section { padding: 96px 0 40px; }

.section-head { text-align: center; margin-bottom: 48px; }

.section-head h2 {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: -0.02em;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--ink);
}

.section-head p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.menu-controls {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
}

.search-input {
    flex: 1;
    min-width: 240px;
    padding: 13px 2px;
    border: none;
    border-bottom: 1px solid var(--line);
    background: transparent;
    font-size: 1rem;
    color: var(--ink);
    outline: none;
    border-radius: 0;
    transition: border-color 0.2s ease;
}

.search-input::placeholder { color: #a5a5a5; }

.search-input:focus { border-bottom-color: var(--line-strong); }

.sort-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
    font-weight: 500;
}

.sort-label select {
    padding: 9px 12px;
    border: 1px solid var(--line);
    background: transparent;
    font-size: 0.85rem;
    color: var(--ink);
    cursor: pointer;
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s ease;
}

.sort-label select:focus { border-color: var(--line-strong); }

.category-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.pill {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.pill:hover { border-color: var(--line-strong); color: var(--ink); }

.pill.active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

/* ── Menu grid ───────────────────────────────────────────── */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.menu-loading,
.menu-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted);
    padding: 70px 0;
    font-size: 0.95rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.menu-card {
    background: var(--bg);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: background 0.2s ease;
    animation: fadeIn 0.4s ease both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.menu-card:hover { background: var(--bg-alt); }

/* Dish illustration: bleeds to the card edges. The emoji sits behind it
   as a fallback whenever the image is missing or fails to load. */
.card-media {
    position: relative;
    aspect-ratio: 8 / 5;
    margin: -32px -28px 0;
    overflow: hidden;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
}

.card-media .card-emoji {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 3.2rem;
    filter: none;
}

.card-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.menu-card:hover .card-img { transform: scale(1.045); }

.card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.card-price {
    font-weight: 600;
    color: var(--ink);
    font-size: 1rem;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.menu-card h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.menu-card p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.6;
    flex: 1;
}

.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 4px 9px;
    border-radius: 999px;
}

.tag.hot { border-color: var(--accent); color: var(--accent); }

.add-btn {
    margin-top: 8px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    border-radius: var(--radius);
    padding: 10px 16px;
    font-weight: 500;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.add-btn:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.add-btn.added { background: var(--ink); border-color: var(--ink); color: #fff; }

.add-btn:disabled,
.add-btn:disabled:hover {
    background: transparent;
    border-color: var(--line);
    color: var(--muted);
    cursor: not-allowed;
}

/* ── Out of order (pulled from the menu by the kitchen) ─── */
.out-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 999px;
}

.menu-card.is-out .card-media { filter: grayscale(1); opacity: 0.65; }

.menu-card.is-out h3,
.menu-card.is-out .card-price,
.menu-card.is-out p,
.menu-card.is-out .tag-row { color: var(--muted); }

.menu-card.is-out p,
.menu-card.is-out .tag-row { opacity: 0.7; }

.menu-card.is-out:hover { background: var(--bg); }

/* ── Visit section ───────────────────────────────────────── */
.visit-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0;
    padding: 70px 0 100px;
    border-top: 1px solid var(--line);
    margin-top: 60px;
}

.visit-card {
    background: transparent;
    border: none;
    border-right: 1px solid var(--line);
    border-radius: 0;
    padding: 48px 40px;
}

.visit-card:last-child { border-right: none; }

.visit-card h2 {
    margin: 0 0 22px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink);
}

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

.visit-list li {
    color: var(--muted);
    font-size: 0.93rem;
}

.steps {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 14px;
    color: var(--muted);
    font-size: 0.93rem;
}

.steps::marker { color: var(--ink); }

/* ── Cart drawer ─────────────────────────────────────────── */
.drawer-backdrop,
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.35);
    z-index: 50;
    animation: fadeIn 0.25s ease;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(420px, 100%);
    background: var(--bg);
    z-index: 60;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid var(--line);
}

.cart-drawer.open { transform: translateX(0); }

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--line);
}

.drawer-head h2 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
}

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

.cart-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 16px 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
}

.ci-thumb {
    position: relative;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    flex: 0 0 auto;
}

.ci-emoji { font-size: 1.1rem; }

.ci-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ci-name { font-weight: 500; font-size: 0.92rem; color: var(--ink); }

.ci-price { font-size: 0.78rem; color: var(--muted); }

.qty-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
}

.qty-btn {
    border: none;
    background: transparent;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 500;
    color: var(--muted);
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

.qty-btn:hover { background: var(--ink); color: #fff; }

.qty-value {
    min-width: 16px;
    text-align: center;
    font-weight: 500;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.ci-line {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}

.cart-empty {
    text-align: center;
    color: var(--muted);
    padding: 60px 10px;
    font-size: 0.9rem;
}

.cart-summary {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line-strong);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--muted);
    padding: 6px 0;
    font-variant-numeric: tabular-nums;
}

.summary-row.discount {
    color: var(--accent);
    font-weight: 500;
}

.summary-row.total {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ink);
    border-top: 1px solid var(--line);
    margin-top: 10px;
    padding-top: 16px;
}

.order-form { margin-top: 32px; display: grid; gap: 18px; }

.order-form h3 {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.order-form label {
    display: grid;
    gap: 7px;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.order-form label small {
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: none;
    color: #a5a5a5;
}

.order-form input,
.order-form textarea {
    padding: 12px 2px;
    border: none;
    border-bottom: 1px solid var(--line);
    background: transparent;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--ink);
    outline: none;
    border-radius: 0;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.order-form input:focus,
.order-form textarea:focus { border-bottom-color: var(--line-strong); }

.form-error {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: var(--radius);
    padding: 11px 14px;
    font-size: 0.85rem;
    margin: 0;
}

.drawer-foot {
    padding: 20px 28px;
    border-top: 1px solid var(--line);
    background: var(--bg);
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-backdrop {
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 70;
}

.modal {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 48px 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: fadeIn 0.25s ease;
}

.modal-eyebrow {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
    display: block;
}

.modal h2 {
    margin: 26px 0 10px;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.modal p { margin: 0 0 6px; color: var(--muted); font-size: 0.92rem; }

.modal-total {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--ink);
    margin: 20px 0 28px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* ── Toasts ──────────────────────────────────────────────── */
.toast-stack {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    gap: 8px;
    z-index: 80;
    width: min(340px, 92%);
}

.toast {
    background: var(--ink);
    color: #fff;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    animation: toastIn 0.3s ease both;
    text-align: center;
}

.toast.error { background: var(--danger); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast.out { animation: toastOut 0.3s ease both; }

@keyframes toastOut {
    to { opacity: 0; transform: translateY(12px); }
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
    background: var(--bg);
    border-top: 1px solid var(--line);
    color: var(--muted);
    padding: 32px 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.footer-inner p { margin: 0; }

.footer-links { display: flex; gap: 22px; }

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--ink); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 860px) {
    .hero { padding: 64px 0; }

    .hero-inner { grid-template-columns: 1fr; gap: 48px; }

    .menu-section { padding: 64px 0 32px; }

    .visit-card {
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding: 36px 0;
    }

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

    .main-nav { display: none; }
}

/* ============================================================
   Theme: dark mode
   ============================================================ */
:root {
    --on-ink: #ffffff;      /* text on top of --ink fills (buttons, pills) */
    color-scheme: light;
}

:root[data-theme='dark'] {
    --bg: #101010;
    --bg-alt: #171717;
    --ink: #f2f2f2;
    --ink-soft: #cfcfcf;
    --muted: #9b9b9b;
    --line: #2b2b2b;
    --line-strong: #f2f2f2;
    --accent: #e08a5f;
    --danger: #e0705a;
    --on-ink: #101010;
    color-scheme: dark;
}

:root[data-theme='dark'] .site-header { background: rgba(16, 16, 16, 0.94); }

:root[data-theme='dark'] .drawer-backdrop,
:root[data-theme='dark'] .modal-backdrop { background: rgba(0, 0, 0, 0.62); }

/* These fills follow --ink, so their text must flip with it. */
:root[data-theme='dark'] .btn-primary,
:root[data-theme='dark'] .pill.active,
:root[data-theme='dark'] .cart-count,
:root[data-theme='dark'] .toast,
:root[data-theme='dark'] .qty-btn:hover,
:root[data-theme='dark'] .add-btn:hover,
:root[data-theme='dark'] .add-btn.added { color: var(--on-ink); }

:root[data-theme='dark'] .search-input,
:root[data-theme='dark'] .sort-label select,
:root[data-theme='dark'] .order-form input,
:root[data-theme='dark'] .order-form textarea {
    background: var(--bg);
    color: var(--ink);
}

.theme-btn { font-size: 1rem; }

/* ============================================================
   Modal actions + printable receipt
   ============================================================ */
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.receipt { display: none; } /* screen-only hiding; print block reveals it */

.receipt-inner {
    max-width: 300px;
    margin: 0 auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12.5px;
    line-height: 1.55;
    color: #000;
    background: #fff;
}

.r-center { text-align: center; }

.r-shop {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 0 0 4px;
}

.r-rule {
    border: none;
    border-top: 1px dashed #000;
    margin: 10px 0;
}

.r-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    font-variant-numeric: tabular-nums;
}

.r-row span:last-child { text-align: right; }

.r-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 5px;
    font-variant-numeric: tabular-nums;
}

.r-items li { display: flex; justify-content: space-between; gap: 14px; }

.r-total {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.r-foot { text-align: center; font-size: 11px; line-height: 1.7; }

@media print {
    body { visibility: hidden; }

    .receipt,
    .receipt * { visibility: visible; }

    .receipt {
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
    }

    .receipt-inner {
        max-width: 300px;
        margin: 0 auto;
        filter: none !important;
    }
}

@page { margin: 14mm; }

/* ============================================================
   Order tracking
   ============================================================ */
.track-section {
    padding: 56px 0;
    margin-top: 40px;
    border-top: 1px solid var(--line);
}

.track-form {
    display: flex;
    gap: 10px;
    max-width: 440px;
    margin: 0 auto 16px;
}

.track-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 1rem;
    background: var(--bg);
    color: var(--ink);
}

.track-form input:focus {
    border-color: var(--line-strong);
    outline: none;
}

.track-error {
    max-width: 440px;
    margin: 0 auto 16px;
    text-align: center;
}

.track-result {
    max-width: 620px;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    padding: 26px 28px;
    animation: fadeIn 0.3s ease both;
}

.track-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.track-no {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

.track-when {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
}

.track-chip {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 13px;
    white-space: nowrap;
}

.track-chip.received { border-color: var(--line-strong); color: var(--ink); }
.track-chip.preparing { border-color: var(--accent); color: var(--accent); }
.track-chip.served { border-color: #4f8a5b; color: #4f8a5b; }
.track-chip.cancelled { border-color: var(--danger); color: var(--danger); opacity: 0.7; }

.track-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.track-steps li {
    position: relative;
    padding-top: 40px;
    text-align: center;
}

/* Connector line reaching back to the previous dot. */
.track-steps li:not(:first-child)::before {
    content: '';
    position: absolute;
    top: 14px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: var(--line);
}

.track-steps li.done:not(:first-child)::before,
.track-steps li.active::before { background: var(--ink); }

.ts-dot {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--bg);
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    z-index: 1;
}

.track-steps li.done .ts-dot {
    background: var(--ink);
    border-color: var(--ink);
}

.track-steps li.done .ts-dot::after {
    content: '✓';
    color: var(--on-ink, #fff);
    font-weight: 700;
}

.track-steps li.active .ts-dot {
    border-color: var(--accent);
    animation: trackPulse 1.4s ease-in-out infinite;
}

.track-steps li.done .ts-label { color: var(--muted); }

@keyframes trackPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(180, 85, 45, 0.35); }
    50% { box-shadow: 0 0 0 7px rgba(180, 85, 45, 0); }
}

.ts-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
}

.ts-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 2px;
}

.track-cancelled {
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: var(--radius);
    padding: 14px 16px;
    text-align: center;
    font-size: 0.9rem;
    margin: 4px 0 0;
}

.track-live {
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
    margin: 20px 0 0;
}

.track-cancel {
    margin-top: 20px;
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--bg-alt);
    text-align: center;
}

.track-cancel-copy {
    margin: 0 0 12px;
    font-size: 0.82rem;
    color: var(--muted);
}

.track-cancel-error {
    max-width: 420px;
    margin: 0 auto 12px;
    text-align: left;
}

.track-meta {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
}

.track-meta div { display: grid; }

.track-meta span {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
}

.track-meta b {
    font-weight: 600;
    font-size: 0.95rem;
}

.track-items {
    list-style: none;
    margin: 14px 0 0;
    padding: 14px 0 0;
    border-top: 1px dashed var(--line);
    display: grid;
    gap: 6px;
    font-size: 0.88rem;
}

.track-items li {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
    .track-form { flex-direction: column; }
    .ts-hint { display: none; }
    .track-result { padding: 20px 16px; }

    /* Tighter section chrome so the compact menu starts sooner. */
    .menu-section { padding: 44px 0 24px; }
    .section-head { margin-bottom: 28px; }
    .section-head p { font-size: 0.86rem; }
    .menu-controls { gap: 14px; margin-bottom: 18px; padding-bottom: 18px; }
    .category-pills { gap: 6px; margin-bottom: 20px; }
    .pill { padding: 7px 14px; font-size: 0.68rem; }

    /* Compact menu: one dish per horizontal row instead of a tall card. */
    .menu-grid {
        grid-template-columns: 1fr;
        border-left: none;
    }

    .menu-card {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr) auto;
        grid-template-areas:
            'media top add'
            'media desc add';
        align-items: center;
        column-gap: 14px;
        row-gap: 3px;
        padding: 12px 0;
        border-right: none;
    }

    .card-media {
        grid-area: media;
        width: 76px;
        height: 76px;
        aspect-ratio: auto;
        margin: 0;
        border: 1px solid var(--line);
        border-radius: var(--radius);
    }

    .card-media .card-emoji { font-size: 1.8rem; }

    .card-top { grid-area: top; }

    .menu-card h3 { font-size: 0.92rem; }

    .card-price { font-size: 0.9rem; }

    .menu-card p {
        grid-area: desc;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        overflow: hidden;
        font-size: 0.74rem;
        line-height: 1.35;
    }

    .tag-row { display: none; }

    .add-btn {
        grid-area: add;
        margin: 0;
        padding: 8px 12px;
        font-size: 0.62rem;
        letter-spacing: 0.08em;
        white-space: nowrap;
    }

    .out-badge {
        top: 4px;
        right: 4px;
        left: 4px;
        padding: 2px 4px;
        text-align: center;
        font-size: 0.45rem;
        letter-spacing: 0.04em;
        white-space: nowrap;
    }
}
