/* ROAD DERAKHT online menu — dark, warm, with a gold accent (all colours and photos are set in the cafe's program). */
:root {
  --accent: #c9a063;
  --overlay: rgba(6, 16, 11, 0.82);
  --header: #142a1f;
  --card: rgba(22, 52, 37, 0.78);
  --card-border: rgba(201, 160, 99, 0.22);
  --text: #fffaf0;
  --muted: rgba(255, 250, 240, 0.72);
  --sheet: #f6f0e3;
  --sheet-text: #23301f;
  --danger: #ffb4a2;
  --radius: 18px;
  color-scheme: dark;
}
body.theme-wood { --overlay: rgba(22, 11, 6, 0.84); --header: #2a170e; --card: rgba(72, 32, 20, 0.78); }
body.theme-night { --overlay: rgba(0, 0, 0, 0.84); --header: #101010; --card: rgba(34, 34, 34, 0.82); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; font-family: "Vazirmatn", Tahoma, sans-serif; color: var(--text);
  background: #0b140f; line-height: 1.7; -webkit-tap-highlight-color: transparent; padding-bottom: 96px;
}
#bg {
  position: fixed; inset: 0; z-index: -1; background-color: #0b140f; background-size: cover; background-position: center;
}
#bg::after { content: ""; position: absolute; inset: 0; background: var(--overlay); }
button, input, select, textarea { font: inherit; }

/* header */
.top { background: var(--header); padding: 14px 18px calc(14px); padding-top: max(14px, env(safe-area-inset-top)); box-shadow: 0 2px 14px rgba(0,0,0,.35); }
.brand { display: flex; align-items: center; justify-content: center; gap: 14px; }
.brand h1 { margin: 0; color: var(--accent); font-size: 1.75rem; font-weight: 700; letter-spacing: .5px; }
.logo {
  width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--accent); display: grid; place-items: center;
  overflow: hidden; color: var(--accent); font-weight: 700; font-size: 1.3rem; flex: none; background: rgba(0,0,0,.2);
}
.logo img { width: 100%; height: 100%; object-fit: cover; }

.ornament { display: flex; align-items: center; gap: 12px; margin: 18px 22px 6px; color: var(--text); }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.75); }
.welcome { text-align: center; margin: 6px 24px 0; color: var(--muted); }
.banner { margin: 12px 16px 0; padding: 10px 14px; border-radius: 12px; background: rgba(0,0,0,.45); border: 1px solid var(--accent); color: var(--text); text-align: center; }

/* categories: round photos, then sticky chips while scrolling */
.circles { display: flex; gap: 18px; overflow-x: auto; padding: 14px 18px 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.circles::-webkit-scrollbar { display: none; }
.circle { flex: none; width: 104px; text-align: center; color: var(--text); text-decoration: none; scroll-snap-align: start; }
.circle .ph {
  width: 100px; height: 100px; border-radius: 50%; border: 3px solid rgba(255,255,255,.9); overflow: hidden; margin: 0 auto 6px;
  background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 2rem; color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.circle img { width: 100%; height: 100%; object-fit: cover; }
.circle span { font-size: .95rem; }

.chips {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px; scrollbar-width: none;
  background: linear-gradient(var(--header), rgba(0,0,0,0)); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.chips.show { opacity: 1; pointer-events: auto; background: var(--header); box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 5px 16px; border-radius: 10px; border: 2px solid var(--accent); background: rgba(201,160,99,.92); color: #fff;
  font-weight: 700; text-decoration: none; text-shadow: 0 1px 2px rgba(0,0,0,.35); white-space: nowrap;
}
.chip.active { background: var(--header); color: var(--accent); }

/* sections */
main { padding: 0 14px; max-width: 760px; margin: 0 auto; }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
section { scroll-margin-top: 64px; padding-top: 8px; }
.sec-title { text-align: center; font-size: 1.85rem; margin: 26px 0 4px; font-weight: 700; color: var(--text); }
.divider { display: flex; align-items: center; gap: 10px; margin: 0 6px 16px; color: var(--text); font-size: .9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1.5px; background: rgba(255,255,255,.85); }

/* items */
.card {
  position: relative; background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 14px 16px 16px;
  margin-bottom: 16px; backdrop-filter: blur(3px); box-shadow: 0 8px 24px rgba(0,0,0,.28); cursor: pointer;
}
.card h3 { margin: 0 0 8px; text-align: center; font-size: 1.35rem; font-weight: 700; color: var(--text); }
.card .row { display: flex; align-items: center; gap: 14px; }
.card .thumb { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid rgba(255,255,255,.2); background: rgba(0,0,0,.25); }
.card .desc { flex: 1; margin: 0; color: var(--muted); font-size: .92rem; }
.card .price {
  flex: none; min-width: 84px; text-align: center; font-weight: 700; color: var(--text); border-right: 1.5px solid rgba(255,255,255,.55);
  padding-right: 12px; line-height: 1.5;
}
.card .price small { display: block; font-weight: 700; font-size: .9rem; }
.card .tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.card .tag { font-size: .75rem; padding: 1px 10px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); }
.card .add {
  position: absolute; left: 12px; top: 12px; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--accent);
  color: #1d150b; font-size: 1.4rem; line-height: 1; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.card .in-cart { position: absolute; left: 12px; top: 50px; min-width: 34px; text-align: center; color: var(--accent); font-weight: 700; font-size: .85rem; }
.card.soldout { opacity: .62; cursor: default; }
.card .soldout-badge { position: absolute; left: 10px; top: 14px; font-size: .8rem; padding: 2px 10px; border-radius: 999px; background: rgba(0,0,0,.55); color: var(--danger); }

/* large photo cards */
body.card-large .card .row { display: block; }
body.card-large .card .thumb { display: block; width: 100%; height: 190px; border-radius: 14px; margin: 4px 0 10px; border: none; }
body.card-large .card .price { border: none; padding: 0; margin-top: 10px; text-align: right; min-width: 0; font-size: 1.15rem; }
body.card-large .card .price small { display: inline; margin-right: 4px; }

/* call button and cart bar */
.call {
  position: fixed; left: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%;
  background: #b27a4b; color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.45); z-index: 20;
}
body.has-cart .call { bottom: calc(86px + env(safe-area-inset-bottom)); }
.cartbar {
  position: fixed; right: 12px; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 19; display: flex; align-items: center;
  gap: 10px; padding: 12px 16px; border-radius: 16px; border: none; background: var(--accent); color: #1d150b; font-weight: 700; font-size: 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); cursor: pointer; max-width: 736px; margin: 0 auto;
}
.cartbar strong { margin-right: auto; }
.cartbar-count { background: #1d150b; color: var(--accent); border-radius: 999px; min-width: 28px; padding: 0 8px; text-align: center; }

/* sheets (light, easy to read) */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-panel {
  position: relative; background: var(--sheet); color: var(--sheet-text); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(22px + env(safe-area-inset-bottom)); color-scheme: light;
}
.sheet-panel.tall { min-height: 70vh; }
.sheet-panel h2 { margin: 0 0 6px; font-size: 1.35rem; }
.sheet-panel h3 { margin: 18px 0 6px; font-size: 1.05rem; color: #2e5b3c; }
.sheet-close {
  position: absolute; left: 12px; top: 10px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: none; line-height: 1;
  background: rgba(255,255,255,.92); box-shadow: 0 2px 8px rgba(0,0,0,.2); font-size: 1.7rem; color: #4b4b40; cursor: pointer;
}
.sheet-photo { width: 100%; max-height: 230px; object-fit: cover; border-radius: 16px; margin-bottom: 10px; }
.muted { color: #6f6a5c; }
.error { color: #a33b2b; font-weight: 700; }
.field { display: block; margin: 10px 0; }
.field span { display: block; font-size: .88rem; color: #6f6a5c; margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid #d8cdb5; background: #fffdf8; color: #23301f; font-size: 1rem;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #2e5b3c; border-color: transparent; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.opt-group { margin: 12px 0; }
.opt-group legend { font-weight: 700; margin-bottom: 6px; }
.opt-group label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid #d8cdb5; border-radius: 12px; margin-bottom: 6px; background: #fffdf8; cursor: pointer; }
.opt-group label b { margin-right: auto; font-weight: 400; color: #6f6a5c; }
.opt-group input { accent-color: #2e5b3c; width: 18px; height: 18px; }
.qty-row { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.qty { display: flex; align-items: center; border: 1px solid #d8cdb5; border-radius: 14px; overflow: hidden; background: #fffdf8; }
.qty button { width: 46px; height: 46px; border: none; background: transparent; font-size: 1.4rem; cursor: pointer; color: #2e5b3c; }
.qty span { min-width: 34px; text-align: center; font-weight: 700; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; border-radius: 14px; border: 1px solid #c9b994; background: #fffdf8; color: #2e5b3c; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.primary { background: #2e5b3c; border-color: #2e5b3c; color: #fff; flex: 1; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .55; cursor: wait; }
.segmented { display: flex; gap: 8px; flex-wrap: wrap; }
.segmented button { flex: 1; min-width: 96px; padding: 10px; border-radius: 12px; border: 1px solid #c9b994; background: #fffdf8; color: #23301f; cursor: pointer; font-weight: 700; }
.segmented button[aria-pressed="true"] { background: #2e5b3c; color: #fff; border-color: #2e5b3c; }
.cart-lines { list-style: none; padding: 0; margin: 8px 0; }
.cart-lines li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #e3d9c3; }
.cart-lines .name { flex: 1; }
.cart-lines .name small { display: block; color: #6f6a5c; }
.cart-lines .qty button { width: 34px; height: 34px; font-size: 1.1rem; }
.pay-box { background: #fffdf8; border: 1px solid #e3d9c3; border-radius: 14px; padding: 12px; margin-top: 10px; }
.copy-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed #e3d9c3; }
.copy-row span { color: #6f6a5c; min-width: 70px; }
.copy-row bdi, .copy-row b { flex: 1; font-weight: 700; letter-spacing: .5px; word-break: break-all; min-width: 0; }
.copy-row #sheba { font-size: .85rem; letter-spacing: 0; }
.file-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 12px; border: 1px dashed #b9a676; background: #fffdf8; color: #2e5b3c; font-weight: 700; cursor: pointer; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.copy { border: 1px solid #c9b994; background: #f3ead5; border-radius: 10px; padding: 3px 12px; cursor: pointer; color: #2e5b3c; }
.greet { background: #e3efe2; color: #2e5b3c; border-radius: 12px; padding: 8px 12px; font-weight: 700; }
.totals { margin-top: 14px; border-top: 1px solid #e3d9c3; padding-top: 10px; }
.totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.totals .sum { font-weight: 700; font-size: 1.15rem; color: #2e5b3c; }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: #2e5b3c; color: #fff; font-size: 2rem; display: grid; place-items: center; margin: 0 auto 8px; }
#done h2, .done-number { text-align: center; }
.done-number { font-size: 1.4rem; font-weight: 700; color: #2e5b3c; }
.status-line { background: #f3ead5; border-radius: 12px; padding: 8px 12px; text-align: center; font-weight: 700; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; z-index: 60; background: #23301f; color: #fff; padding: 10px 18px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-panel { border-radius: 22px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .chips { transition: none; } }
