/* Faseelah menu. See DESIGN.md for the direction. */
:root {
  --green: #3B674E; --green-d: #2C4F3B; --green-t: rgba(59, 103, 78, .08);
  --gold: #A89574; --gold-l: #E3D7C1; --gold-t: rgba(168, 149, 116, .16);
  --clay: #B4643F;
  --cream: #F6F1E7; --paper: #FBF8F2; --ink: #1F2A24; --muted: #6E756F; --line: rgba(31, 42, 36, .1);
  --shadow: 0 10px 30px -12px rgba(44, 79, 59, .28), 0 2px 6px rgba(44, 79, 59, .06);
  --ar: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --display: 'Alexandria', 'IBM Plex Sans Arabic', sans-serif;
  --latin: 'Jost', system-ui, sans-serif;
  --top: 112px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--cream); color: var(--ink); font-family: var(--ar); }
html[lang="en"] body { font-family: var(--latin), var(--ar); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.latin { font-family: var(--latin); letter-spacing: .14em; text-transform: uppercase; }

/* The brand mark repeated, like the pattern on the tea cup. */
.pattern, .feed-end::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round' stroke-width='5'%3E%3Cpath d='M20 18l18 18M38 18L20 36' stroke='%233B674E'/%3E%3Cpath d='M20 46l9 9 9-9' stroke='%23A89574'/%3E%3Cpath d='M80 78l18 18M98 78L80 96' stroke='%233B674E'/%3E%3Cpath d='M80 106l9 9 9-9' stroke='%23A89574'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 26px; border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 16px; transition: transform .15s, background .2s, box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 10px 24px -10px rgba(59, 103, 78, .7); }
.btn-green:hover { background: var(--green-d); }
.btn-line { border: 1.5px solid var(--gold); color: var(--green-d); background: rgba(251, 248, 242, .7); }
.btn-ghost { color: var(--green); font-weight: 600; font-family: var(--display); padding: 10px 14px; }
.lang-btn { min-width: 42px; height: 42px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-family: var(--latin); font-weight: 500; font-size: 14px; color: var(--green-d); }
html[lang="en"] .lang-btn { font-family: var(--ar); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); color: var(--green); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.mini-mark { width: 14px; height: 22px; background: url(/assets/mark.svg) center / contain no-repeat; }

/* Shared bits used by the sheets (the dish feed itself lives in feed.css). */
.price { display: flex; align-items: baseline; gap: 6px; font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--green); }
.sar { width: .72em; height: .8em; fill: currentColor; transform: translateY(1px); }
.g-item img[src$="mark.svg"], .l-row img[src$="mark.svg"] { padding: 28%; opacity: .25; }
.l-note { margin: -6px 4px 14px; font-size: 13px; color: var(--clay); }
@keyframes pop { 50% { transform: scale(1.2); } }

/* ---------- My list button ---------- */
.mylist-btn { position: fixed; bottom: calc(18px + var(--safe-b)); inset-inline-end: 16px; z-index: 12; display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 18px; border-radius: 999px; background: var(--clay); color: #fff; font-weight: 600; box-shadow: 0 12px 26px -10px rgba(180, 100, 63, .8); }
.mylist-btn.bump { animation: pop .35s; }
#mylistCount { min-width: 22px; height: 22px; border-radius: 11px; background: #fff; color: var(--clay); font-size: 13px; display: grid; place-items: center; }

/* ---------- Sheets and full dialogs ---------- */
dialog { border: 0; padding: 0; color: inherit; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(31, 42, 36, .45); backdrop-filter: blur(3px); }
.sheet { position: fixed; inset: auto 0 0; width: 100%; max-height: 88dvh; margin: 0; border-radius: 28px 28px 0 0; background: var(--cream); overflow: auto; padding: 0 18px calc(24px + var(--safe-b)); }
.sheet[open] { animation: up .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes up { from { transform: translateY(40%); opacity: 0; } }
.sheet-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 18px 0 12px; background: var(--cream); }
.sheet-h::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line); }
.sheet-h h3 { margin: 0; font-family: var(--display); font-size: 20px; color: var(--green-d); }
.x { width: 38px; height: 38px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); font-size: 18px; color: var(--muted); }
.full { position: fixed; inset: 0; width: 100%; height: 100%; margin: 0; background: var(--cream); overflow: auto; }
.full[open] { animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }

/* Grid of everything */
.g-sec { margin: 14px 0 8px; font-family: var(--display); font-size: 15px; color: var(--gold); }
.g-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.g-item { text-align: start; background: var(--paper); border-radius: 20px; padding: 10px 10px 12px; border: 1px solid var(--line); }
.g-item img { width: 100%; aspect-ratio: 1; object-fit: contain;  }
.g-item b { display: block; margin-top: 6px; font-size: 14.5px; font-weight: 600; color: var(--green-d); }
.g-item span { font-size: 13px; color: var(--green); font-weight: 600; display: inline-flex; align-items: baseline; gap: 4px; }

/* My list */
.l-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; background: var(--paper); margin-bottom: 8px; }
.l-row img { width: 60px; height: 60px; object-fit: contain;  }
.l-row div { flex: 1; min-width: 0; }
.l-row b { display: block; font-weight: 600; color: var(--green-d); }
.l-row small { color: var(--green); font-weight: 600; display: inline-flex; gap: 4px; align-items: baseline; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--cream); font-size: 18px; color: var(--green); }
.qty span { min-width: 16px; text-align: center; font-weight: 600; }
.l-empty { text-align: center; color: var(--muted); line-height: 1.9; padding: 30px 10px; }
.l-total { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 4px; font-family: var(--display); font-size: 18px; color: var(--green-d); }
.l-total .price { font-size: 24px; }
.sheet .btn { width: 100%; }

/* Quiz */
.q-wrap { min-height: 100%; display: flex; flex-direction: column; padding: calc(16px + env(safe-area-inset-top, 0px)) 20px calc(24px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.q-top { display: flex; justify-content: space-between; align-items: center; }
.q-steps { display: flex; gap: 6px; }
.q-steps i { width: 26px; height: 5px; border-radius: 3px; background: var(--gold-l); }
.q-steps i.on { background: var(--green); }
.q-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px 0; }
.q-body h2 { font-family: var(--display); font-size: clamp(26px, 7vw, 34px); color: var(--green-d); margin: 0 0 22px; line-height: 1.35; }
.q-opts { display: grid; gap: 10px; }
.q-opt { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 20px; background: var(--paper); border: 1.5px solid var(--line); text-align: start; transition: .2s; animation: rise .4s ease backwards; }
.q-opt:nth-child(2) { animation-delay: .06s; } .q-opt:nth-child(3) { animation-delay: .12s; } .q-opt:nth-child(4) { animation-delay: .18s; }
.q-opt:active, .q-opt.on { border-color: var(--green); background: var(--green-t); }
.q-opt .e { font-size: 28px; }
.q-opt b { display: block; font-size: 17px; font-weight: 600; color: var(--green-d); }
.q-opt small { color: var(--muted); }

/* The breakfast tray result */
.res h2 { margin-bottom: 6px; }
.res .sub { color: var(--muted); margin: 0 0 18px; }
.big-tray { isolation: isolate; position: relative; overflow: hidden; width: min(84vw, 380px); aspect-ratio: 1; margin: 6px auto 22px; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #fff 0%, #FBF7EF 60%, #F3EBDC 100%); box-shadow: inset 0 0 0 8px var(--gold-l), inset 0 0 0 10px #fff, 0 22px 30px -18px rgba(44, 79, 59, .45); }
.big-tray button { position: absolute; border-radius: 50%; animation: land .6s cubic-bezier(.2, .9, .3, 1.3) backwards; }
.big-tray img { width: 100%; height: 100%; object-fit: contain;  }
.big-tray .p0 { width: 56%; aspect-ratio: 1; top: 7%; left: 22%; animation-delay: .1s; }
.big-tray .p1 { width: 40%; aspect-ratio: 1; bottom: 9%; left: 10%; animation-delay: .35s; }
.big-tray .p2 { width: 32%; aspect-ratio: 1; bottom: 12%; right: 13%; animation-delay: .6s; }
@keyframes land { from { transform: translateY(-40px) scale(.8); opacity: 0; } }
.res-list { display: grid; gap: 8px; }
.res-list button { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: 16px; background: var(--paper); text-align: start; }
.res-list b { font-weight: 600; color: var(--green-d); }
.res-list small { color: var(--muted); display: block; font-size: 12px; }
.res-list .price { font-size: 17px; }
.res-actions { display: grid; gap: 10px; margin-top: 18px; }

/* Show the waiter */
.w-wrap { min-height: 100%; padding: calc(20px + env(safe-area-inset-top, 0px)) 22px calc(28px + var(--safe-b)); max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; }
.w-head { text-align: center; padding: 20px 0 16px; border-bottom: 2px dashed var(--gold-l); }
.w-head img { width: 28px; margin: 0 auto 10px; }
.w-head h2 { margin: 0; font-family: var(--display); color: var(--green-d); font-size: 26px; }
.w-head .t { display: inline-block; margin-top: 10px; padding: 6px 16px; border-radius: 999px; background: var(--green); color: #fff; font-weight: 600; }
.w-head p { color: var(--muted); margin: 10px 0 0; }
.w-items { flex: 1; padding: 14px 0; }
.w-items div { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
.w-items b { color: var(--clay); font-family: var(--latin); }
.w-items small { display: block; color: var(--muted); font-size: 12px; }

/* Toast and loading */
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); z-index: 50; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; opacity: 0; pointer-events: none; transition: .3s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: #07140F; transition: opacity .4s; }
.loading img { width: 34px; animation: breathe 1.4s ease-in-out infinite; }
.loading.done { opacity: 0; pointer-events: none; }
@keyframes breathe { 50% { transform: scale(.85); opacity: .6; } }

@media (min-width: 900px) {
  .dish { grid-template-columns: 1fr minmax(360px, 460px); grid-template-rows: 1fr; align-items: center; gap: 40px; padding-inline: 6vw; }
  .tray { width: min(40vw, 62vh, 560px); }
  .card { margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
