/* ScanServe — public menu, ordering and order tracking. Mobile first. */

:root {
    --bg: #faf7f2;
    --surface: #ffffff;
    --surface-2: #f6f1ea;
    --border: #ece5db;
    --text: #1f1813;
    --text-2: #4a3f37;
    --muted: #85786d;
    --green: #15803d;
    --red: #c81e1e;
    --radius: 18px;
    --shadow: 0 1px 2px rgba(40, 25, 12, .05), 0 6px 18px rgba(40, 25, 12, .05);
    --shadow-lg: 0 18px 50px rgba(40, 25, 12, .2);
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans Arabic", "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

/* Colour themes chosen in Settings */
.theme-saffron { --brand: #e8590c; --brand-dark: #9a3412; --brand-soft: #fff1e6; --brand-2: #fb923c; }
.theme-emerald { --brand: #059669; --brand-dark: #064e3b; --brand-soft: #e8f8f1; --brand-2: #34d399; }
.theme-crimson { --brand: #e11d48; --brand-dark: #881337; --brand-soft: #fff0f3; --brand-2: #fb7185; }
.theme-indigo { --brand: #4f46e5; --brand-dark: #312e81; --brand-soft: #eef0ff; --brand-2: #818cf8; }
.theme-teal { --brand: #0d9488; --brand-dark: #134e4a; --brand-soft: #e7f7f5; --brand-2: #2dd4bf; }
.theme-charcoal { --brand: #292524; --brand-dark: #0c0a09; --brand-soft: #f3f1ef; --brand-2: #78716c; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 130px; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; }
.icon-xs { width: 13px; height: 13px; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; overflow: hidden; background: linear-gradient(135deg, var(--brand-2), var(--brand) 45%, var(--brand-dark)); }
.hero-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .15) 0%, rgba(0, 0, 0, .55) 100%); }
.hero:not(.has-cover) .hero-shade { background: radial-gradient(600px 300px at 90% 10%, rgba(255, 255, 255, .18), transparent 70%); }
.hero-inner { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding-top: 56px; padding-bottom: 24px; }
.hero-logo { width: 76px; height: 76px; border-radius: 22px; object-fit: cover; background: #fff; border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); flex: none; }
.hero-logo-text { display: grid; place-items: center; color: var(--brand); font-family: var(--serif); font-size: 40px; font-weight: 700; }
.hero-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hero h1 { font-family: var(--serif); font-size: 32px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.hero-tagline { font-size: 15px; opacity: .92; font-weight: 500; }
.hero-meta { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; }
.hero-meta li { display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .28); backdrop-filter: blur(6px); padding: 5px 11px; border-radius: 999px; }
.hero-meta .icon { width: 14px; height: 14px; opacity: .9; }
.hero-meta a { text-decoration: none; }
.hero-meta a:hover { text-decoration: underline; }

/* ---------- Notices ---------- */
.notices { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.notices:empty { display: none; }
.notice { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 14px; font-size: 14px; text-decoration: none; }
.notice-table { background: var(--brand-soft); color: var(--brand-dark); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); }
.notice-warn { background: #fef6e4; color: #7c4a03; }
.notice-muted { background: var(--surface-2); color: var(--text-2); }
.notice-track { background: var(--text); color: #fff; }
.notice-track span { flex: 1; }

/* ---------- Category navigation ---------- */
.cat-nav { position: sticky; top: 0; z-index: 30; background: rgba(250, 247, 242, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); margin-top: 14px; }
.cat-nav-inner { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.menu-search { position: relative; display: flex; align-items: center; flex: none; width: 230px; }
.menu-search .icon { position: absolute; left: 12px; color: var(--muted); width: 16px; height: 16px; }
.menu-search input { width: 100%; height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); padding: 0 14px 0 36px; font: inherit; font-size: 14px; color: var(--text); }
.menu-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip { flex: none; padding: 8px 15px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--text-2); white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.cat-chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.cat-chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Menu ---------- */
.menu-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 22px; padding-bottom: 120px; }
.menu-sections { display: flex; flex-direction: column; gap: 34px; min-width: 0; }
.section-head { margin-bottom: 14px; }
.section-head h2 { font-family: var(--serif); font-size: 26px; font-weight: 700; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.section-head .alt { font-family: var(--font); font-size: 16px; font-weight: 600; color: var(--muted); }
.section-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.dish-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.dish { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s, border-color .2s; }
.dish.no-media { grid-template-columns: minmax(0, 1fr); }
.dish:hover { box-shadow: 0 2px 4px rgba(40, 25, 12, .05), 0 12px 28px rgba(40, 25, 12, .08); }
.dish.in-cart { border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.dish-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dish h3 { font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; }
.dish-alt { font-size: 13.5px; color: var(--muted); font-weight: 600; align-self: flex-start; }
.dish-desc { font-size: 13.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.dish-badges { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.dish-badges li { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge-popular { background: #fff4dc; color: #a35a00; }
.badge-new { background: #e8efff; color: #2747c7; }
.badge-spicy { background: #ffe9e6; color: #c2261a; }
.badge-veg { background: #e6f6ec; color: #187a3c; }
.badge-chef { background: #f1eaff; color: #6a2fd0; }
.dish-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; }
.dish-price { display: flex; align-items: baseline; gap: 7px; }
.dish-price strong { font-size: 16.5px; font-weight: 800; }
.dish-price s { color: var(--muted); font-size: 13px; }
.dish-media { width: 112px; height: 112px; border-radius: 14px; overflow: hidden; background: var(--surface-2); align-self: start; }
.dish-media img { width: 100%; height: 100%; object-fit: cover; }
.dish.is-soldout .dish-media img { filter: grayscale(1); opacity: .55; }
.dish.is-soldout h3, .dish.is-soldout .dish-price { color: var(--muted); }
.soldout-tag { font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 6px 12px; border-radius: 999px; }
.add-btn { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 15px 0 11px; border-radius: 999px; border: 0; background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 35%, transparent); transition: transform .12s, background .15s; }
.add-btn:hover { background: var(--brand-dark); }
.add-btn:active { transform: scale(.96); }
.stepper-mini { display: inline-flex; align-items: center; gap: 2px; background: var(--brand-soft); border-radius: 999px; padding: 3px; }
.stepper-mini button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface); color: var(--brand-dark); display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.stepper-mini button .icon { width: 15px; height: 15px; }
.stepper-mini output { min-width: 26px; text-align: center; font-weight: 800; color: var(--brand-dark); }
.menu-empty { color: var(--muted); text-align: center; padding: 40px 16px; }
.menu-notice { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; padding: 14px 16px; border: 1px dashed var(--border); border-radius: 14px; }

/* ---------- Cart ---------- */
.cart-panel { position: fixed; inset: auto 0 0 0; z-index: 50; max-height: 92vh; transform: translateY(105%); transition: transform .28s ease; }
body.cart-open .cart-panel { transform: none; }
body.cart-open::after { content: ""; position: fixed; inset: 0; background: rgba(20, 12, 6, .45); z-index: 45; }
.cart-inner { background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.cart-head { display: flex; align-items: center; gap: 10px; }
.cart-head h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.cart-head h2 .icon { color: var(--brand); }
.cart-count { color: var(--muted); font-size: 13px; font-weight: 600; margin-left: auto; }
.cart-close { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); display: grid; place-items: center; cursor: pointer; color: var(--text); }
.cart-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 10px 8px; color: var(--muted); font-size: 14px; }
.cart-empty-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.cart-empty-icon .icon { width: 26px; height: 26px; }
.cart-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cart-lines:empty { display: none; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); align-items: center; }
.cart-line-name { font-weight: 650; font-size: 14.5px; }
.cart-line-price { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.cart-line .stepper-mini { justify-self: start; }
.cart-line-unit { color: var(--muted); font-size: 12.5px; text-align: right; }
.checkout { display: flex; flex-direction: column; gap: 12px; }
.type-picker { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.type-picker legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; padding: 0; }
.type-option input { position: absolute; opacity: 0; pointer-events: none; }
.type-option span { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 10px 6px; border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; height: 100%; transition: border-color .15s, background .15s; }
.type-option strong { font-size: 13.5px; }
.type-option small { font-size: 11px; color: var(--muted); line-height: 1.25; }
.type-option .icon { color: var(--muted); }
.type-option input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.type-option input:checked + span .icon { color: var(--brand); }
.type-option input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; font-weight: 650; color: var(--text-2); }
.field em { font-style: normal; color: var(--muted); font-weight: 500; }
.field input, .field textarea { width: 100%; height: 44px; border: 1px solid var(--border); border-radius: 12px; padding: 0 13px; font: inherit; font-size: 15px; background: var(--surface); color: var(--text); }
.field textarea { height: auto; padding: 10px 13px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.field.has-error input, .field.has-error textarea { border-color: var(--red); }
.field-error { color: var(--red); font-size: 12.5px; font-weight: 600; }
.field-error:empty { display: none; }
.cart-totals { margin: 4px 0 0; padding: 12px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; }
.cart-totals div { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-2); }
.cart-totals dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.cart-total { font-size: 17px !important; color: var(--text) !important; font-weight: 800; padding-top: 4px; }
.cart-total dd { font-weight: 800; }
.form-message { background: #fdecec; color: #8a1c1c; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 600; }
.place-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 54px; border: 0; border-radius: 16px; padding: 0 20px; background: var(--brand); color: #fff; font-size: 16px; font-weight: 750; cursor: pointer; box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 35%, transparent); }
.place-btn:hover { background: var(--brand-dark); }
.place-btn:disabled { opacity: .7; cursor: progress; }
.checkout-hint { color: var(--muted); font-size: 12.5px; text-align: center; }
.cart-bar { position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40; display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 18px 0 10px; border: 0; border-radius: 18px; background: var(--text); color: #fff; font-weight: 700; font-size: 15.5px; cursor: pointer; box-shadow: var(--shadow-lg); animation: bar-in .25s ease; }
.cart-bar span:nth-child(2) { flex: 1; text-align: left; }
.cart-bar-count { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 12px; background: var(--brand); display: grid; place-items: center; }
@keyframes bar-in { from { transform: translateY(20px); opacity: 0; } }

/* ---------- Order tracking ---------- */
.track-page { min-height: 100vh; padding-bottom: 40px; background: linear-gradient(180deg, var(--brand-soft), var(--bg) 320px); }
.track-head { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; max-width: 620px; }
.track-back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 650; color: var(--brand-dark); }
.track-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-family: var(--serif); font-size: 17px; }
.track-brand img { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; }
.track-main { max-width: 620px; display: flex; flex-direction: column; gap: 16px; }
.track-card { background: var(--surface); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.track-card h2 { font-size: 17px; }
.track-label { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; text-align: center; }
.track-no { font-size: 56px; font-weight: 800; letter-spacing: -.03em; line-height: 1; text-align: center; color: var(--brand-dark); }
.track-type { text-align: center; color: var(--text-2); font-weight: 600; }
.track-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.track-steps li { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; color: var(--muted); text-align: center; position: relative; }
.track-steps li::before { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 3px; background: var(--border); z-index: 0; }
.track-steps li:first-child::before { display: none; }
.track-steps li span { width: 21px; height: 21px; border-radius: 50%; background: var(--surface); border: 3px solid var(--border); position: relative; z-index: 1; }
.track-steps li.is-done { color: var(--text-2); }
.track-steps li.is-done span, .track-steps li.is-current span { background: var(--brand); border-color: var(--brand); }
.track-steps li.is-done::before, .track-steps li.is-current::before { background: var(--brand); }
.track-steps li.is-current { color: var(--brand-dark); }
.track-steps li.is-current span { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 22%, transparent); animation: ping 1.6s infinite; }
@keyframes ping { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--brand) 6%, transparent); } }
.track-message { text-align: center; font-size: 15.5px; font-weight: 600; padding: 4px 8px; }
.track-cancelled { text-align: center; color: var(--red); font-weight: 800; font-size: 18px; }
.whatsapp-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border-radius: 16px; background: #1fa855; color: #fff; text-decoration: none; font-weight: 750; font-size: 16px; box-shadow: 0 10px 22px rgba(31, 168, 85, .3); }
.whatsapp-btn:hover { background: #178a45; }
.track-hint { color: var(--muted); font-size: 12.5px; text-align: center; }
.track-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.track-lines li { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; font-size: 14.5px; }
.track-lines b { color: var(--brand-dark); }
.track-lines em { font-style: normal; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.guest-footer { display: flex; justify-content: center; gap: 16px; color: var(--muted); font-size: 12.5px; padding: 18px 16px 100px; }
.guest-footer a { color: var(--muted); }

/* ---------- Larger screens ---------- */
@media (min-width: 720px) {
    .hero-inner { flex-direction: row; align-items: flex-end; padding-top: 120px; padding-bottom: 34px; gap: 24px; }
    .hero-logo { width: 108px; height: 108px; border-radius: 26px; }
    .hero h1 { font-size: 46px; }
    .hero-tagline { font-size: 17px; }
    .dish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .dish { grid-template-columns: minmax(0, 1fr) 124px; }
    .dish-media { width: 124px; height: 124px; }
    .container { padding-left: 24px; padding-right: 24px; }
}
@media (min-width: 1100px) {
    .menu-layout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; padding-bottom: 60px; }
    .cart-panel { position: sticky; inset: auto; top: 84px; transform: none; max-height: calc(100vh - 100px); z-index: 1; }
    .cart-inner { border-radius: 22px; max-height: calc(100vh - 100px); border: 1px solid var(--border); box-shadow: var(--shadow); }
    .cart-close, .cart-bar { display: none !important; }
    body.cart-open::after { display: none; }
    .guest-footer { padding-bottom: 30px; }
    .menu-search { width: 260px; }
}
@media (max-width: 560px) {
    .cat-nav-inner { flex-direction: column; align-items: stretch; gap: 8px; }
    .menu-search { width: 100%; }
    html { scroll-padding-top: 150px; }
    .dish { grid-template-columns: minmax(0, 1fr) 96px; padding: 12px; gap: 12px; }
    .dish-media { width: 96px; height: 96px; }
    .track-no { font-size: 48px; }
    .track-steps li { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}
