/* Smart Idea demo — Zaytoon Kitchen. Warm cream and olive for the guest menu,
   a darker, high-contrast board for the kitchen (read from a distance, in a hot room).
   Logical properties throughout so Arabic (rtl) and English (ltr) both work. */
:root {
  --bg: #F4EEE3;
  --paper: #FFFCF6;
  --ink: #2A2117;
  --ink-2: #5C4E3E;
  --mut: #8A7A66;
  --line: #E6DCCB;
  --olive: #3F4A1F;
  --olive-2: #56632C;
  --leaf: #C9D48A;
  --clay: #B4471C;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.55 Inter, system-ui, sans-serif; }
:lang(ar) body { font-family: Cairo, Inter, system-ui, sans-serif; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.25; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font-weight: 700; cursor: pointer;
}
.btn:hover { border-color: var(--olive); }
.btn.primary { background: var(--olive); border-color: var(--olive); color: #fff; }
.btn.primary:hover { background: var(--olive-2); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Guest / kitchen switch ── */
.views { display: flex; justify-content: center; gap: 4px; padding: 12px 16px 0; }
.views button {
  height: 40px; padding: 0 18px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper);
  color: var(--ink-2); font-weight: 700; cursor: pointer;
}
.views button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── Guest layout: a phone-sized menu, with "how it works" beside it on wide screens ── */
.guest { display: grid; grid-template-columns: 420px minmax(0, 360px); justify-content: center; gap: 40px; padding: 20px 16px 40px; align-items: start; }
.phone {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 30px;
  height: min(820px, calc(100dvh - 140px)); overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 0 30px 60px -20px rgba(42, 33, 23, .35), 0 0 0 8px #2A2117;
  scrollbar-width: thin;
}
.g-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 18px 6px; }
.g-brand { display: flex; align-items: center; gap: 10px; }
.g-brand b { display: block; font-size: 17px; }
.g-brand small { display: block; color: var(--mut); font-size: 12px; }
.g-table { padding: 6px 12px; border-radius: 99px; background: var(--olive); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; }
.g-welcome { padding: 4px 18px 12px; color: var(--ink-2); font-size: 14px; }
.g-search { display: flex; align-items: center; gap: 8px; margin: 0 18px 10px; padding: 0 14px; height: 44px; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--mut); }
.g-search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; color: var(--ink); outline: none; }
.g-cats {
  position: sticky; top: 0; z-index: 3; display: flex; gap: 8px; overflow-x: auto; padding: 10px 18px;
  background: var(--paper); border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.g-cats::-webkit-scrollbar { display: none; }
.g-cats a { flex: none; padding: 6px 14px; border-radius: 99px; background: #F1E9DA; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.g-cats a:hover { background: var(--leaf); }
.g-sec { padding: 6px 18px 4px; scroll-margin-top: 60px; }
.g-sec h2 { font-size: 18px; margin: 14px 0 6px; }
.dish { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.g-sec .dish:last-child { border-bottom: 0; }
.art { flex: none; width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; color: hsl(var(--h) 55% 30%); background: linear-gradient(140deg, hsl(var(--h) 70% 88%), hsl(var(--h) 60% 76%)); }
.dish-txt { flex: 1; min-width: 0; }
.dish h3 { font-size: 15.5px; }
.dish p { color: var(--mut); font-size: 13px; }
.dish-tags { display: flex; gap: 6px; margin-top: 4px; }
.dish-tags span { padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; }
.t-popular { background: #FDECC8; color: #8A5300; }
.t-spicy { background: #FBD9CC; color: #9A3412; }
.t-veg { background: #E3EDC4; color: #3F4A1F; }
.dish-end { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; flex: none; }
.dish-end b { font-size: 14.5px; white-space: nowrap; }
.add { height: 34px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--olive); background: transparent; color: var(--olive); font-weight: 700; cursor: pointer; }
.add:hover { background: var(--olive); color: #fff; }
.qty { display: inline-flex; align-items: center; gap: 2px; height: 34px; border-radius: 99px; background: var(--olive); color: #fff; }
.qty button { width: 34px; height: 34px; border: 0; background: transparent; color: #fff; font-size: 18px; font-weight: 700; cursor: pointer; border-radius: 50%; }
.qty b { min-width: 18px; text-align: center; }
.dish.is-off { opacity: .55; }
.dish.is-off .art { filter: grayscale(1); }
.sold { font-size: 12px; font-weight: 700; color: var(--clay); white-space: nowrap; }
.g-none { padding: 30px 18px; color: var(--mut); text-align: center; }

.g-bar { position: sticky; bottom: 0; z-index: 4; padding: 12px 14px 14px; background: linear-gradient(transparent, var(--paper) 30%); }
.g-bar button {
  width: 100%; height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 18px;
  border: 0; border-radius: 16px; background: var(--olive); color: #fff; font-weight: 600; cursor: pointer;
  box-shadow: 0 10px 24px -8px rgba(63, 74, 31, .7);
}
.g-bar b { padding: 4px 12px; border-radius: 99px; background: var(--leaf); color: var(--olive); }

/* Order status */
.g-track { margin: 12px 18px 4px; padding: 16px; border-radius: 18px; background: #F1F4E3; border: 1px solid #DCE3B8; scroll-margin-top: 60px; }
.tr-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tr-head h2 { font-size: 16px; }
.tr-head span { font-size: 13px; color: var(--ink-2); }
.tr-steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin: 14px 0 6px; }
.tr-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--mut); }
.tr-steps i { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid #C9CFAE; position: relative; z-index: 1; }
.tr-steps li + li::before { content: ""; position: absolute; top: 8px; inset-inline-end: 50%; width: 100%; height: 2px; background: #C9CFAE; }
.tr-steps li.done, .tr-steps li.now { color: var(--ink); }
.tr-steps li.done i { background: var(--olive); border-color: var(--olive); }
.tr-steps li.done::before, .tr-steps li.now::before { background: var(--olive) !important; }
.tr-steps li.now i { border-color: var(--olive); box-shadow: 0 0 0 4px rgba(63, 74, 31, .18); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(63, 74, 31, 0); } }
.tr-tip { font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.tr-actions { margin-top: 10px; }
.tr-ok { font-size: 13px; color: var(--olive); font-weight: 600; margin-top: 6px; }
.tr-ok:empty { display: none; }

/* Order sheet */
.sheet { position: fixed; inset: 0; z-index: 60; display: grid; align-items: end; justify-items: center; background: rgba(42, 33, 23, .45); }
.sheet-panel { width: min(460px, 100%); max-height: 88dvh; overflow-y: auto; background: var(--paper); border-radius: 24px 24px 0 0; padding: 20px; display: grid; gap: 14px; }
.sheet-panel header { display: flex; justify-content: space-between; align-items: center; }
.sheet-panel h2 { font-size: 19px; }
.sheet-panel h2:focus { outline: none; }
.x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 22px; cursor: pointer; }
#sheet-lines { list-style: none; display: grid; gap: 10px; }
#sheet-lines li { display: flex; align-items: center; gap: 10px; }
.sl-name { flex: 1; font-weight: 600; }
.fld { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.fld textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 16px; font-weight: 400; resize: vertical; }
.sheet-total { display: flex; justify-content: space-between; font-size: 17px; padding-top: 10px; border-top: 1px dashed var(--line); }
.sheet-note { font-size: 12.5px; color: var(--mut); margin-top: -8px; }

.g-aside { padding-top: 40px; }
.g-aside h2 { font-size: 24px; margin-bottom: 14px; }
.qr { color: var(--ink); background: #fff; padding: 10px; border-radius: 14px; border: 1px solid var(--line); margin-bottom: 16px; }
.g-aside ol { padding-inline-start: 20px; display: grid; gap: 10px; margin-bottom: 20px; color: var(--ink-2); }
.g-aside li::marker { color: var(--clay); font-weight: 700; }

/* ── Kitchen ── */
.kitchen { max-width: 1240px; margin: 0 auto; padding: 18px 16px 50px; }
.k-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.k-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #E9E0D0; }
.k-tabs button { height: 38px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.k-tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.k-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 12px 16px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.kpi span { display: block; font-size: 13px; color: var(--mut); font-weight: 600; }
.kpi b { font-size: 22px; font-variant-numeric: tabular-nums; }
.k-alert { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 10px; border-radius: 12px; background: #FDECC8; color: #6B4100; }
.k-alert .btn { margin-inline-start: auto; }
.k-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.k-col { background: #2A2117; border-radius: 18px; padding: 12px; min-height: 300px; }
.k-col h2 { display: flex; justify-content: space-between; align-items: center; color: #F4EEE3; font-size: 16px; padding: 4px 6px 12px; }
.k-col h2 span { min-width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); font-size: 13px; }
.k-new h2 { color: #FCD9A0; }
.k-ready h2 { color: var(--leaf); }
.ticket { background: var(--paper); border-radius: 14px; padding: 14px; margin-bottom: 10px; display: grid; gap: 6px; border-top: 5px solid #E6DCCB; }
.k-new .ticket { border-top-color: #F59E0B; }
.k-cooking .ticket { border-top-color: var(--clay); }
.k-ready .ticket { border-top-color: #7C8C3A; }
.ticket.is-mine { box-shadow: 0 0 0 3px #F59E0B; }
.ticket header { display: flex; justify-content: space-between; font-size: 17px; }
.ticket header span { color: var(--mut); font-size: 14px; }
.tk-time { font-size: 12.5px; color: var(--mut); }
.tk-time em { font-style: normal; color: #B45309; font-weight: 700; }
.ticket ul { list-style: none; display: grid; gap: 2px; font-size: 15px; }
.ticket li b { display: inline-block; min-width: 28px; }
.tk-notes { padding: 6px 10px; border-radius: 8px; background: #FDECC8; font-size: 13.5px; font-weight: 600; }
.ticket .btn { margin-top: 4px; }
.k-none { color: rgba(244, 238, 227, .5); text-align: center; padding: 30px 0; font-size: 14px; }

.k-menu { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 20px; max-width: 720px; }
.k-menu > p { color: var(--ink-2); margin-bottom: 8px; }
.k-menu h3 { font-size: 15px; margin: 16px 0 6px; color: var(--mut); }
.sw-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.sw-row small { color: var(--mut); }
.sw { display: inline-flex; align-items: center; gap: 10px; }
.sw input { position: absolute; opacity: 0; }
.sw i { width: 44px; height: 26px; border-radius: 99px; background: #D6CBB8; position: relative; transition: background .15s; }
.sw i::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
.sw input:checked + i { background: var(--olive); }
.sw input:checked + i::after { inset-inline-start: 21px; }
.sw input:focus-visible + i { outline: 2px solid var(--clay); outline-offset: 2px; }
.sw em { font-style: normal; font-size: 13px; font-weight: 600; min-width: 80px; color: var(--ink-2); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .guest { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
  .phone { height: auto; overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
  .g-cats { top: 0; }
  .g-aside { padding: 24px 18px 40px; border-top: 1px solid var(--line); }
  .views { padding: 10px 12px; background: var(--paper); border-bottom: 1px solid var(--line); }
  .views button { flex: 1; }
  .k-board { grid-template-columns: 1fr; }
  .k-col { min-height: 0; }
}
@media (max-width: 560px) {
  .k-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px; }
  .kpi b { font-size: 17px; }
  .k-head .btn { width: 100%; }
}
