/* Ludus Café — luxury dark theme, mobile-first, RTL-aware */
:root {
  /* Ludus blue palette (from luduscafe.com): #002e5d signature · #0d2130 navy · #58758c steel.
     Liquid-glass surfaces are translucent + blurred so the blue reads through them. */
  --bg: #061523;                       /* deep navy base */
  --blue-deep: #002e5d;                /* Ludus signature blue */
  --steel: #58758c;                    /* Ludus steel blue */
  --bg-soft: rgba(11, 30, 46, .55);    /* frosted base (sheets) — see-through */
  --card: rgba(96, 138, 182, .16);     /* liquid glass surface — transparent */
  --card-2: rgba(52, 90, 130, .24);
  --line: rgba(160, 198, 228, .18);
  --glass-hi: rgba(255, 255, 255, .18);/* specular top highlight */
  --gold: #2f6fb0;                     /* primary accent (Ludus blue, lifted for UI) */
  --gold-soft: #7cb3e6;                /* light blue accent / highlight text */
  --text: #eaf2fb;
  --muted: #9bb2c8;
  --danger: #e0894f;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 10, 24, .55);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 720px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
/* The [hidden] attribute must always win, even over class rules that set
   display (e.g. .staff-login/.sheet-backdrop). Prevents invisible overlays. */
[hidden] { display: none !important; }
body {
  background:
    radial-gradient(120% 70% at 50% -8%, #0c3a63 0%, rgba(6,21,35,0) 55%),
    radial-gradient(90% 60% at 100% 100%, rgba(88,117,140,.18) 0%, rgba(6,21,35,0) 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 40px;
}
body[data-lang="zh"] { --sans: "Noto Sans SC", system-ui, sans-serif; }
a { color: var(--gold-soft); text-decoration: none; }
img { max-width: 100%; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: rgba(6,20,33,.42);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.brand { text-align: center; line-height: 1; }
.brand-name { font-family: var(--serif); font-weight: 700; letter-spacing: .34em; font-size: 19px; color: var(--text); padding-inline-start: .34em; }
.brand-sub { display: block; font-size: 10px; letter-spacing: .3em; color: var(--gold); margin-top: 3px; text-transform: uppercase; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 12px; font: inherit; font-size: 13px; cursor: pointer;
  min-width: 44px; min-height: 40px; justify-content: center;
}
.icon-btn:active { transform: scale(.96); }
.cart-btn { position: relative; }
.cart-badge {
  position: absolute; top: -6px; inset-inline-end: -6px;
  background: var(--gold); color: #ffffff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px;
}

/* ---- hero ---- */
.hero { text-align: center; padding: 40px 20px 26px; }
.hero-mark {
  font-family: var(--serif); font-weight: 700; font-size: 46px; letter-spacing: .28em;
  padding-inline-start: .28em;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-tag { font-family: var(--serif); font-size: 17px; font-style: italic; color: var(--text); margin: 8px 0 4px; }
.hero-loc { font-size: 12px; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; margin: 0; }

/* ---- chips ---- */
.chips {
  position: sticky; top: 65px; z-index: 30;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 12px 16px; background: rgba(6,20,33,.48);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; white-space: nowrap; cursor: pointer;
  background: var(--card); color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 15px; font: inherit; font-size: 13px;
}
.chip-active { color: #ffffff; background: linear-gradient(180deg, var(--gold-soft), var(--gold)); border-color: transparent; font-weight: 600; }

/* ---- menu ---- */
.menu { max-width: var(--max); margin: 0 auto; padding: 8px 16px 20px; }
.cat { scroll-margin-top: 120px; padding-top: 22px; }
.cat-title {
  font-family: var(--serif); font-size: 25px; font-weight: 600; color: var(--gold-soft);
  margin: 0 0 14px; display: flex; align-items: center; gap: 12px;
}
.cat-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
[dir="rtl"] .cat-title::after { background: linear-gradient(270deg, var(--line), transparent); }

.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: 1fr 1fr; } }

.card {
  position: relative; display: flex; gap: 14px; padding: 12px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  transition: border-color .2s, transform .1s;
}
.card:active { transform: scale(.99); }
.card:hover { border-color: rgba(124,179,230,.4); }
.card-thumb {
  flex: 0 0 74px; width: 74px; height: 74px; border-radius: 12px;
  display: grid; place-items: center; position: relative;
  font-family: var(--serif); font-size: 24px; font-weight: 600; color: rgba(124,179,230,.55);
  background:
    radial-gradient(60% 60% at 30% 25%, rgba(124,179,230,.16), transparent),
    linear-gradient(135deg, #0e3358, #08192a);
  border: 1px solid var(--line);
}
.card-thumb, .product-hero, .cart-item-thumb { overflow: hidden; position: relative; }
.thumb-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .35s;
}
.has-img .thumb-img { opacity: 1; }
/* Expanded product photo: large full-bleed image (uncropped source, filled). */
.product-hero .thumb-img { object-fit: cover; }
.thumb-badge {
  position: absolute; top: -6px; inset-inline-end: -6px; width: 22px; height: 22px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: #ffffff;
  border-radius: 999px; display: grid; place-items: center; font-size: 12px; box-shadow: var(--shadow);
}
.card-body { flex: 1; min-width: 0; }
.card-name { font-size: 15px; font-weight: 600; margin: 2px 0 4px; color: var(--text); }
.card-desc {
  font-size: 12.5px; color: var(--muted); margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-price { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--gold-soft); }
.card-tags { display: flex; gap: 5px; }
.tag { font-size: 10px; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag-vegetarian { color: #9fd18a; border-color: #2f4327; }
.tag-vegan { color: #7fd6b0; border-color: #234238; }
.card-add {
  align-self: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--gold); color: var(--gold-soft);
  font-size: 22px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.card-add:active { transform: scale(.9); background: var(--gold); color: #ffffff; }

/* ---- footer ---- */
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 30px 16px; border-top: 1px solid var(--line); margin-top: 24px; }
.footer-brand { font-family: var(--serif); letter-spacing: .3em; color: var(--gold-soft); font-size: 15px; margin: 0 0 8px; padding-inline-start: .3em; }
.footer p { margin: 3px 0; }

/* ---- sheets ---- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .24s;
}
/* When closed, fully remove from the layout — otherwise the class rule's
   display:flex overrides the [hidden] attribute and this invisible overlay
   would keep intercepting every tap on the page. */
.sheet-backdrop[hidden] { display: none; }
.sheet-backdrop.open { opacity: 1; }
.sheet {
  width: 100%; max-width: var(--max); max-height: 88vh; overflow-y: auto;
  background: var(--bg-soft); border: 1px solid var(--line); border-bottom: none;
  border-radius: 22px 22px 0 0; padding: 10px 18px 26px;
  transform: translateY(100%); transition: transform .28s cubic-bezier(.22,.61,.36,1);
  box-shadow: var(--shadow);
}
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet-handle { width: 42px; height: 4px; border-radius: 4px; background: var(--line); margin: 4px auto 14px; }
.sheet-title { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 0 0 14px; color: var(--gold-soft); }
.sheet-close {
  position: absolute; margin: 0; inset-inline-end: 18px; top: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 999px; background: rgba(0,0,0,.4);
  border: 1px solid var(--line); color: var(--text); font-size: 14px; cursor: pointer;
}
.product-sheet { position: relative; padding: 0; overflow: hidden; }

/* language options */
.lang-option {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 16px; margin-bottom: 10px; color: var(--text); font: inherit; font-size: 16px; cursor: pointer;
}
.lang-option:active { border-color: var(--gold); }
.lang-flag { font-size: 12px; color: var(--gold); letter-spacing: .1em; }

/* product sheet — full-bleed photo with overlaid text and an inline action bar */
.product-hero {
  height: 60vh; max-height: 560px; min-height: 340px; width: 100%;
  border-radius: 0; margin: 0; display: grid; place-items: center; position: relative;
  font-family: var(--serif); font-size: 76px; color: rgba(124,179,230,.5);
  background:
    radial-gradient(70% 70% at 30% 20%, rgba(124,179,230,.2), transparent),
    linear-gradient(135deg, #0e3358, #061523);
}
/* gradient fade rising from the bottom of the photo for a luxurious blend */
.product-scrim {
  position: absolute; left: 0; right: 0; bottom: 0; height: 68%; z-index: 1; pointer-events: none;
  background: linear-gradient(to top,
    var(--bg-soft) 4%, rgba(23,19,15,.92) 26%, rgba(23,19,15,.55) 55%, rgba(23,19,15,0) 100%);
}
.product-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 22px 18px;
}
.product-name { font-family: var(--serif); font-size: 32px; font-weight: 600; margin: 8px 0 8px; color: var(--text); }
.product-desc { color: rgba(244,239,230,.82); font-size: 14.5px; margin: 0 0 12px; max-width: 92%; }
.product-tags { display: flex; gap: 6px; }
.product-price { font-family: var(--serif); font-size: 27px; color: var(--gold-soft); font-weight: 600; }
/* inline action bar under the photo */
.product-cta {
  display: flex; align-items: stretch; gap: 12px;
  padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); background: var(--bg-soft);
}
.product-cta .btn-primary { flex: 1; }
.qty-row { display: flex; align-items: center; gap: 6px; }
.product-cta .qty-row {
  flex: 0 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 4px;
}
.qty-btn {
  width: 42px; height: 54px; border-radius: 12px; background: transparent; border: none;
  color: var(--text); font-size: 24px; cursor: pointer; display: grid; place-items: center;
}
.qty-btn.small { width: 32px; height: 32px; font-size: 18px; border-radius: 9px; background: var(--card); border: 1px solid var(--line); }
.qty-btn:active { border-color: var(--gold); }
.qty-num { font-size: 18px; min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.product-cta { margin-top: 20px; }

.btn-primary {
  width: 100%; padding: 16px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; cursor: pointer;
  font: inherit; font-size: 16px; font-weight: 700; color: #ffffff; letter-spacing: .01em;
  background: rgba(47, 111, 176, .82);            /* flat translucent Ludus blue */
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}
.btn-primary:active { transform: scale(.99); background: rgba(47, 111, 176, .95); }
.btn-primary:disabled { opacity: .7; cursor: default; }

/* cart */
.cart-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item-thumb {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--serif); color: rgba(124,179,230,.6); background: linear-gradient(135deg, #0e3358, #08192a); border: 1px solid var(--line);
}
.cart-item-main { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 600; }
.cart-item-price { font-size: 12px; color: var(--muted); }
.cart-qty { display: flex; align-items: center; gap: 10px; }
.cart-empty { color: var(--muted); text-align: center; padding: 30px 0; }
.cart-foot { padding-top: 16px; }
.cart-total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; font-family: var(--serif); font-size: 22px; color: var(--gold-soft); }
.cart-note { font-size: 11px; color: var(--muted); text-align: center; margin: 10px 0 0; }

/* toast */
.toast {
  position: fixed; z-index: 80; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: #2a2118; color: var(--text); border: 1px solid var(--gold); border-radius: 999px;
  padding: 11px 20px; font-size: 14px; opacity: 0; transition: opacity .25s, transform .25s; box-shadow: var(--shadow);
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- dine-in: table pill, order bar, status steps ---- */
.table-pill {
  display: inline-block; margin-top: 14px; padding: 6px 16px; border-radius: 999px;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-soft);
  border: 1px solid var(--gold); background: rgba(124,179,230,.08);
}
.order-bar {
  display: block; width: calc(100% - 32px); max-width: var(--max); box-sizing: border-box;
  margin: 14px auto 0; padding: 13px 16px; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 13.5px; text-align: center; color: var(--text);
  background: var(--card); border: 1px solid var(--line);
}
.order-bar.active { color: #ffffff; background: linear-gradient(180deg, var(--gold-soft), var(--gold)); border-color: transparent; font-weight: 600; }
.order-bar:active { transform: scale(.99); }

.cart-qty-fixed { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 40px; text-align: center; }

.cart-status { margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.status-label { font-family: var(--serif); font-size: 18px; color: var(--gold-soft); margin-bottom: 12px; text-align: center; }
.status-label.paid { color: #7fd6b0; }
.status-steps { display: flex; gap: 6px; }
.status-step { flex: 1; text-align: center; opacity: .4; transition: opacity .3s; }
.status-step.done { opacity: 1; }
.status-dot {
  width: 26px; height: 26px; border-radius: 999px; margin: 0 auto 6px; display: grid; place-items: center;
  font-size: 12px; border: 1px solid var(--line); color: var(--muted); background: var(--bg-soft);
}
.status-step.done .status-dot { color: #ffffff; background: linear-gradient(180deg, var(--gold-soft), var(--gold)); border-color: transparent; }
.status-step-label { font-size: 10.5px; color: var(--muted); line-height: 1.3; }

.btn-ghost {
  width: 100%; padding: 14px; border: 1px solid var(--gold); border-radius: 14px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--gold-soft); background: transparent; margin-top: 10px;
}
.btn-ghost:active { transform: scale(.99); }

/* ===================== Liquid glass ===================== */
/* Real frosted blur on overlays, sticky bars & staff surfaces (kept off the 90
   menu cards for performance — they get translucency + a highlight instead). */
.sheet, .topbar, .chips, .staff-top, .order-bar, .tile, .ocard,
.cart-status, .lang-option, .pin-key, .edit-add {
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
}
.sheet { -webkit-backdrop-filter: blur(34px) saturate(170%); backdrop-filter: blur(34px) saturate(170%); }
.sheet-backdrop { background: rgba(3, 12, 22, .52); }

/* Specular top-edge highlight + soft depth = the glass "sheen". */
.card, .sheet, .order-bar, .cart-status, .tile, .ocard, .lang-option, .chip {
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 10px 30px rgba(0, 10, 24, .32);
}

/* Flat solid Ludus blue for small accents (no gloss/bevel). */
.chip-active, .badge.submitted, .status-step.done .status-dot, .thumb-badge {
  background: var(--gold);
}

/* Discounts & custom tags */
.price-was { color: var(--muted); text-decoration: line-through; font-size: .8em; margin-inline-end: 8px; font-weight: 400; }
.price-now { color: var(--gold-soft); }
.tag-custom { color: var(--gold-soft); border-color: var(--gold); }

/* ---- category-first menu ---- */
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: var(--max); margin: 0 auto; padding: 10px 16px 26px; }
@media (min-width: 620px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-tile { position: relative; display: block; padding: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  cursor: pointer; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #0e3358, #08192a); text-align: start;
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 10px 30px rgba(0,10,24,.3); }
.cat-tile:active { transform: scale(.99); }
.cat-tile-photo { position: absolute; inset: 0; }
.cat-tile-img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(6,21,35,.92) 8%, rgba(6,21,35,.15) 55%, rgba(6,21,35,.35)); }
.cat-tile-label { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 12px 14px; }
.cat-tile-name { display: block; font-family: var(--serif); font-size: 20px; font-weight: 600; color: #fff; line-height: 1.15; }
.cat-tile-count { font-size: 11px; color: var(--gold-soft); letter-spacing: .04em; }
.cat-detail-head { display: flex; align-items: center; gap: 12px; max-width: var(--max); margin: 0 auto; padding: 14px 16px 2px; flex-wrap: wrap; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 15px; font: inherit; font-size: 13px; cursor: pointer; }
.back-btn:active { border-color: var(--gold); }
.back-arrow { font-size: 18px; line-height: 1; margin-top: -2px; }
[dir="rtl"] .back-arrow { transform: scaleX(-1); }
.cat-detail-title { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--gold-soft); }

/* brand logo (real Ludus wordmark) */
.brand-logo { height: 30px; width: auto; display: block; }
.hero-logo { width: min(300px, 70%); height: auto; display: block; margin: 0 auto 2px; }
