/* Rasa Rimba — QR Menu Entry · Enhanced */
:root {
  --bg: #0c0a09;
  --bg-elev: #14110f;
  --bg-card: #1a1614;
  --bg-card-hover: #221c19;
  --line: rgba(245, 230, 200, 0.1);
  --text: #f5f0e8;
  --muted: #a89b8c;
  --gold: #d4a853;
  --gold-soft: rgba(212, 168, 83, 0.15);
  --gold-glow: rgba(212, 168, 83, 0.35);
  --green: #25d366;
  --open: #3ecf8e;
  --danger: #e07a5f;
  --radius: 18px;
  --radius-sm: 12px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --topbar-h: 56px;
  --fab-h: 76px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--fab-h) + var(--safe-b) + 16px);
  overflow-x: hidden;
}

body.rtl {
  direction: rtl;
}

.ambient {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 168, 83, 0.18), transparent 55%),
    radial-gradient(ellipse 40% 30% at 100% 40%, rgba(224, 122, 95, 0.08), transparent 50%),
    radial-gradient(ellipse 40% 30% at 0% 70%, rgba(62, 207, 142, 0.05), transparent 50%);
}

.topbar,
.hero,
.popular,
.cats,
.menu,
.footer,
.empty,
.fab-bar,
.sheet {
  position: relative;
  z-index: 1;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(12, 10, 9, 0.82);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 480px;
  margin: 0 auto;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 8px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mini {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold-glow);
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.icon-btn:hover,
.icon-btn.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--gold);
  color: #1a1208;
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

/* display:grid 会盖掉原生 [hidden]，空购物车时必须强制隐藏 */
.cart-badge[hidden] {
  display: none !important;
}

body.rtl .cart-badge {
  right: auto;
  left: -4px;
}

.lang-switch {
  display: flex;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: 600 0.8rem/1 var(--font);
  padding: 10px 11px;
  cursor: pointer;
  min-width: 36px;
}

.lang-btn.active {
  background: var(--gold-soft);
  color: var(--gold);
}

.search-panel {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 14px 12px;
}

.search-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-card);
  color: var(--text);
  font: 400 0.95rem/1.2 var(--font);
  padding: 12px 14px;
  outline: none;
}

.search-panel input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.search-panel input::placeholder {
  color: var(--muted);
}

/* Hero */
.hero {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 4px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid rgba(212, 168, 83, 0.25);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(2.4rem, 8vw, 3rem);
  font-weight: 600;
  line-height: 1.05;
  background: linear-gradient(180deg, #fff8eb 0%, #d4a853 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.pill {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
}

.pill.open {
  color: var(--open);
  border-color: rgba(62, 207, 142, 0.35);
  background: rgba(62, 207, 142, 0.1);
}

.table-bar {
  margin: 18px auto 0;
  max-width: 320px;
  display: grid;
  grid-template-columns: auto 72px;
  gap: 6px 10px;
  align-items: center;
  text-align: start;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}

.table-bar label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.table-bar input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--gold);
  font: 700 1rem/1 var(--font);
  text-align: center;
  padding: 8px;
  outline: none;
}

.table-bar input:focus {
  border-color: var(--gold);
}

.table-hint {
  grid-column: 1 / -1;
  font-size: 0.68rem;
  color: #6b6258;
}

/* Popular */
.popular {
  max-width: 480px;
  margin: 18px auto 0;
  padding: 0 0 4px;
}

.popular-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 16px 10px;
}

.popular-head h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 600;
}

.popular-head span {
  font-size: 0.75rem;
  color: var(--muted);
}

.popular-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 16px 8px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.popular-track::-webkit-scrollbar {
  display: none;
}

.pop-card {
  flex: 0 0 118px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  background: var(--bg-card);
  border-radius: 16px;
  padding: 8px;
  text-align: start;
  color: inherit;
  font: inherit;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s, transform 0.15s;
}

.pop-card:active {
  transform: scale(0.97);
}

.pop-card:hover {
  border-color: rgba(212, 168, 83, 0.35);
}

.pop-thumb {
  width: 100%;
  height: 78px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.pop-thumb img,
.item-thumb img,
.cart-thumb img,
.sheet-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-fallback {
  position: absolute;
  inset: 0;
  place-items: center;
  font-size: 1.8rem;
}

.pop-name {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.1em;
}

.pop-price {
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
}

.pop-add {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(12, 10, 9, 0.72);
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
  display: grid;
  place-items: center;
  line-height: 1;
  backdrop-filter: blur(4px);
}

body.rtl .pop-add {
  right: auto;
  left: 12px;
}

/* Categories */
.cats {
  position: sticky;
  top: var(--topbar-h);
  z-index: 30;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 480px;
  margin: 12px auto 0;
  padding: 10px 16px 12px;
  scrollbar-width: none;
  background: linear-gradient(180deg, rgba(12, 10, 9, 0.95) 60%, transparent);
}

.cats::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--muted);
  font: 600 0.82rem/1 var(--font);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.cat-btn:hover {
  color: var(--text);
  border-color: rgba(212, 168, 83, 0.35);
}

.cat-btn.active {
  color: #1a1208;
  background: linear-gradient(135deg, #e8c97a, #d4a853);
  border-color: transparent;
  box-shadow: 0 4px 16px var(--gold-glow);
}

/* Menu */
.menu {
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.cat-block {
  scroll-margin-top: calc(var(--topbar-h) + 58px);
}

.cat-heading {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.cat-heading span {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.item-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}

.item-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(212, 168, 83, 0.3);
}

.item-main {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 12px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: pointer;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}

.item-thumb {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.item-thumb .thumb-fallback {
  font-size: 2.2rem;
}

.item-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 2px 0;
}

.item-name {
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.3;
}

.item-desc {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-bottom {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.price {
  font-weight: 700;
  color: var(--gold);
  font-size: 0.95rem;
  white-space: nowrap;
}

.quick-add {
  width: 44px;
  border: none;
  border-inline-start: 1px solid var(--line);
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.quick-add:hover {
  background: rgba(212, 168, 83, 0.28);
}

.quick-add.pop {
  transform: scale(1.08);
  background: var(--gold);
  color: #1a1208;
}

.tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold);
}

.tag.spicy {
  background: rgba(224, 122, 95, 0.15);
  color: var(--danger);
}

.tag.veg {
  background: rgba(62, 207, 142, 0.12);
  color: var(--open);
}

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

.empty {
  max-width: 480px;
  margin: 40px auto;
  text-align: center;
  color: var(--muted);
  padding: 0 20px;
}

/* Footer */
.footer {
  max-width: 480px;
  margin: 12px auto 0;
  padding: 24px 20px 8px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.footer-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-brand {
  margin-top: 8px;
  font-size: 0.72rem;
  color: #6b6258;
}

.footer-brand strong {
  color: #8a8074;
  font-weight: 600;
}

.footer-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-link:hover {
  text-decoration: underline;
}

/* FAB */
.fab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: linear-gradient(180deg, transparent, rgba(12, 10, 9, 0.92) 28%);
  pointer-events: none;
}

.fab {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 16px;
  padding: 12px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.2s;
}

.fab:active {
  transform: scale(0.97);
}

.fab-call {
  color: var(--text);
  background: var(--bg-card);
  border-color: var(--line);
  min-width: 96px;
}

.fab-cart {
  flex: 1;
  max-width: 300px;
  color: #1a1208;
  background: linear-gradient(135deg, #e8c97a, #d4a853);
  box-shadow: 0 8px 28px var(--gold-glow);
  justify-content: space-between;
  padding-inline: 16px 12px;
}

.fab-bar.has-items .fab-cart {
  background: linear-gradient(135deg, #3ee07a, #25d366);
  box-shadow: 0 8px 28px rgba(37, 211, 102, 0.35);
  color: #062814;
}

.fab-cart-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: start;
}

.fab-total {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.85;
}

.fab-count {
  min-width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Sheets */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(110%);
  z-index: 70;
  width: min(100%, 480px);
  max-height: min(90dvh, 760px);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  overflow: auto;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: calc(12px + var(--safe-b));
}

.sheet.open {
  transform: translateX(-50%) translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 99px;
  background: rgba(245, 230, 200, 0.2);
  margin: 10px auto 6px;
}

.sheet-visual {
  height: 160px;
  margin: 0 16px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.sheet-visual img {
  position: absolute;
  inset: 0;
}

.sheet-emoji {
  position: relative;
  z-index: 1;
  font-size: 3.5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
  opacity: 0.92;
}

.sheet-visual:has(img[src]) .sheet-emoji {
  display: none;
}

.sheet-body {
  padding: 18px 20px 8px;
}

.sheet-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sheet-top h2 {
  font-family: var(--display);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.15;
}

.sheet-top .price {
  font-size: 1.15rem;
  padding-top: 4px;
}

.sheet-desc {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.sheet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.qty-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}

.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
}

.qty-ctrl button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.qty-ctrl button:hover {
  background: var(--gold-soft);
  color: var(--gold);
}

.qty-ctrl span {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  color: var(--text);
}

.qty-ctrl.sm button {
  width: 30px;
  height: 30px;
  font-size: 1.05rem;
}

.sheet-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.btn-primary,
.btn-secondary {
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 15px;
  font: 700 0.92rem/1 var(--font);
  cursor: pointer;
  transition: transform 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.98);
}

.btn-primary {
  color: #1a1208;
  background: linear-gradient(135deg, #e8c97a, #d4a853);
  box-shadow: 0 8px 24px var(--gold-glow);
}

.btn-primary.btn-wa {
  color: #062814;
  background: linear-gradient(135deg, #3ee07a, #25d366);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.3);
}

.btn-secondary {
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--line);
}

/* Cart sheet */
.cart-sheet {
  display: flex;
  flex-direction: column;
  max-height: min(92dvh, 800px);
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 20px 12px;
}

.cart-head h2 {
  font-family: var(--display);
  font-size: 1.6rem;
}

.text-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font: 600 0.85rem/1 var(--font);
  cursor: pointer;
  padding: 8px;
}

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

.cart-list {
  flex: 1;
  overflow: auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.cart-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.cart-line-name {
  font-weight: 600;
  font-size: 0.92rem;
}

.cart-line-price {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
  margin: 2px 0 6px;
}

.cart-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}

.cart-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.cart-footer {
  padding: 12px 20px 4px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}

.note-row label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.note-row textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text);
  font: 400 0.9rem/1.4 var(--font);
  padding: 10px 12px;
  resize: vertical;
  outline: none;
  min-height: 64px;
}

.note-row textarea:focus {
  border-color: var(--gold);
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  margin: 14px 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.cart-summary strong {
  display: block;
  margin-top: 2px;
  font-size: 1.05rem;
  color: var(--text);
}

.cart-summary .price {
  font-size: 1.15rem;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--fab-h) + var(--safe-b) + 12px);
  transform: translateX(-50%) translateY(12px);
  z-index: 100;
  background: #1f1a16;
  border: 1px solid rgba(212, 168, 83, 0.35);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  max-width: 90vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

@media (min-width: 520px) {
  body {
    background: #070605;
  }
}
