/* Sooqy — customer ordering.
   Visual language: warm sand canvas, deep pine green, saffron accents, and a
   quiet eight-point-star motif. Photo-first menu rows, one accent per action. */

:root{
  /* warm, sand-toned neutrals */
  --canvas:#FDFAF3;
  --surface:#F5EEDF;
  --surface-2:#EAE0CB;
  --divider:#E5DAC2;
  --ink:#1F2E29;
  --ink-2:#6C7268;
  --ink-3:#A6A492;

  /* deep pine green — the one action colour */
  --green:#0F5A4E;
  --green-press:#0A4339;
  --green-tint:#E2EFE9;

  /* saffron / brass — used for money and offers, never for buttons */
  --accent:#B9842B;
  --accent-ink:#7A4E10;
  --accent-tint:#F9EFD9;

  --amber:#B87514;
  --red:#AE3A2B;

  --r-sm:8px; --r:14px; --r-lg:18px;
  --shadow-bar:0 -2px 14px rgba(31,46,41,.16);
  --shadow-sheet:0 -8px 32px rgba(31,46,41,.22);

  /* eight-point star (two overlapped squares) — the one motif, kept quiet */
  --pattern-dark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Cg fill='none' stroke='%230F5A4E' stroke-opacity='0.16' stroke-width='1'%3E%3Crect x='6' y='6' width='14' height='14'/%3E%3Crect x='6' y='6' width='14' height='14' transform='rotate(45 13 13)'/%3E%3C/g%3E%3C/svg%3E");
  --pattern-light:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Cg fill='none' stroke='%23FDFAF3' stroke-opacity='0.22' stroke-width='1'%3E%3Crect x='6' y='6' width='14' height='14'/%3E%3Crect x='6' y='6' width='14' height='14' transform='rotate(45 13 13)'/%3E%3C/g%3E%3C/svg%3E");
  /* fainter, for narrow bars where the text must stay crisp */
  --pattern-faint:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Cg fill='none' stroke='%23FDFAF3' stroke-opacity='0.11' stroke-width='1'%3E%3Crect x='6' y='6' width='14' height='14'/%3E%3Crect x='6' y='6' width='14' height='14' transform='rotate(45 13 13)'/%3E%3C/g%3E%3C/svg%3E");
}

*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent}

/* class rules below set display:flex/block, which would otherwise beat the UA
   [hidden] rule — this keeps the hidden attribute authoritative. */
[hidden]{display:none !important}

body{
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  background:var(--canvas);
  color:var(--ink);
  font-size:15px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
img{display:block;max-width:100%}
button{font:inherit;color:inherit;cursor:pointer;border:none;background:none}
input,textarea{font:inherit}
a{color:inherit}

/* Arabic — used for the logo and small accents only. Reem Kufi keeps the
   geometric, signage feel without turning the page into a poster. */
.ar{
  font-family:'Reem Kufi','Inter',sans-serif;
  font-weight:500;
  direction:rtl;
  unicode-bidi:isolate;
}

/* ---------------------------------------------------------------- topbar */

.topbar{
  position:sticky;top:0;z-index:40;
  background:rgba(253,250,243,.97);
  backdrop-filter:saturate(180%) blur(12px);
  border-bottom:1px solid var(--divider);
}
/* slim geometric band — the pattern reads as a border, not wallpaper */
.topbar::before{
  content:"";display:block;height:6px;
  background-image:var(--pattern-dark);
  background-size:26px 26px;
  background-position:center top;
}
.topbar-inner{
  max-width:560px;margin:0 auto;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 16px;
}
.brand{display:flex;align-items:center;gap:11px;min-width:0}

/* the logo: an arch tile holding سوقي */
.brand-mark{
  width:44px;height:44px;flex:none;
  border-radius:22px 22px 10px 10px;      /* mihrab arch */
  background:var(--green);
  color:#FDFAF3;
  display:grid;place-items:center;
  font-family:'Reem Kufi','Inter',sans-serif;
  font-size:19px;font-weight:500;
  line-height:1;padding-bottom:5px;       /* optically centre the Arabic */
  letter-spacing:.5px;
}
.brand-text{min-width:0}
.eyebrow{
  display:block;font-size:11px;font-weight:700;letter-spacing:.7px;
  text-transform:uppercase;color:var(--ink-2);
}
.eyebrow-accent{color:var(--accent)}
.brand h1{
  font-size:20px;font-weight:700;letter-spacing:-.3px;line-height:1.15;
}

.cart-pill{
  display:flex;align-items:center;gap:8px;
  background:var(--green);color:#FDFAF3;
  padding:8px 14px;border-radius:999px;
  font-size:14px;font-weight:700;flex:none;
}
.cart-pill:active{background:var(--green-press)}
.cart-pill-count{
  background:#FDFAF3;color:var(--green);
  min-width:20px;height:20px;border-radius:999px;
  display:grid;place-items:center;font-size:12px;font-weight:700;
}

/* ---------------------------------------------------------------- layout */

.page{
  max-width:560px;margin:0 auto;
  padding:16px 16px calc(110px + env(safe-area-inset-bottom));
}

/* search */
.searchbar{
  display:flex;align-items:center;gap:10px;
  height:48px;padding:0 14px;border-radius:var(--r);
  background:var(--surface);
}
.searchbar svg{
  width:20px;height:20px;flex:none;
  fill:none;stroke:var(--ink-2);stroke-width:2;stroke-linecap:round;
}
.searchbar input{
  flex:1;min-width:0;border:none;background:none;outline:none;
  font-size:16px;color:var(--ink);
}
.searchbar input::placeholder{color:var(--ink-3)}

/* category pills */
.pillrow{
  display:flex;gap:8px;overflow-x:auto;
  margin:16px -16px 0;padding:0 16px 4px;
  scrollbar-width:none;-webkit-overflow-scrolling:touch;
}
.pillrow::-webkit-scrollbar{display:none}
.pill{
  flex:none;height:40px;padding:0 16px;border-radius:999px;
  background:var(--surface);
  font-size:14px;font-weight:500;white-space:nowrap;
  transition:background .15s,color .15s;
}
.pill.is-active{background:var(--green);color:#FDFAF3}

/* offer card — the one place the pattern gets to show off */
.offer{
  position:relative;overflow:hidden;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin-top:16px;padding:18px;border-radius:var(--r-lg);
  background:var(--green);
  color:#FDFAF3;
  background-image:var(--pattern-light);
  background-size:26px 26px;
}
.offer::after{
  /* filled arch in the corner, echoing the logo tile */
  content:"";position:absolute;right:-34px;bottom:-40px;
  width:104px;height:104px;
  border-radius:52px 52px 0 0;
  background:rgba(185,132,43,.30);
  pointer-events:none;
}
.offer-text{position:relative;display:flex;flex-direction:column;gap:3px;min-width:0}
.offer-text strong{font-size:17px;font-weight:700;letter-spacing:-.1px}
.offer-text span:last-child{font-size:14px;color:rgba(253,250,243,.82)}
.offer .eyebrow{color:var(--accent-tint)}
.offer-cta{
  position:relative;flex:none;
  background:var(--accent);color:#3A2708;
  padding:9px 15px;border-radius:999px;font-size:14px;font-weight:700;
}
.offer-cta:active{background:#A5731F}

/* ---------------------------------------------------------------- blocks */

.block{margin-top:28px}
.block-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:12px}
.block-head h2{font-size:22px;font-weight:700;letter-spacing:-.3px}
.head-titles{display:flex;align-items:baseline;gap:9px;min-width:0}
.ar-label{
  font-family:'Reem Kufi','Inter',sans-serif;
  direction:rtl;unicode-bidi:isolate;
  font-size:15px;font-weight:500;
  color:var(--ink-3);
}
.block-count{font-size:14px;color:var(--ink-2)}

/* menu rows */
.menu{display:flex;flex-direction:column}
.state{padding:32px 0;text-align:center;color:var(--ink-2);font-size:15px}

.item{
  display:flex;align-items:center;gap:14px;
  padding:16px 0;border-bottom:1px solid var(--divider);
}
.item:last-child{border-bottom:none}
.item-info{flex:1;min-width:0}
.item-name{font-size:16px;font-weight:500;letter-spacing:-.1px}
.item-meta{font-size:14px;color:var(--ink-2);margin-top:2px}
.item-price{font-size:15px;font-weight:700;margin-top:4px;color:var(--accent-ink)}
.item-price small{font-weight:400;color:var(--ink-2);font-size:13px}

/* stock status */
.stock{
  display:inline-block;margin-top:6px;padding:2px 9px;border-radius:999px;
  font-size:12px;font-weight:600;letter-spacing:.2px;
}
.stock-ok{background:var(--surface);color:var(--ink-2)}
.stock-low{background:var(--accent-tint);color:var(--accent-ink)}
.stock-out{background:#F7E7E3;color:var(--red)}

/* a sold-out row stays visible but reads as unusable */
.item.is-out .item-name,.item.is-out .item-price{color:var(--ink-3)}
.item.is-out .item-img{opacity:.4;filter:grayscale(1)}
.item-out-tag{
  position:absolute;left:50%;bottom:8px;transform:translateX(-50%);
  padding:2px 9px;border-radius:999px;white-space:nowrap;
  background:rgba(31,46,41,.72);color:#FDFAF3;
  font-size:10px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;
}
.item-media{position:relative;width:88px;flex:none}
/* arch-topped product frame */
.item-img{
  width:88px;height:88px;object-fit:cover;
  border-radius:44px 44px var(--r) var(--r);
  border:1px solid var(--divider);        /* keeps the arch legible on white-bg photos */
  background:var(--surface);
}
.item-add{
  position:absolute;right:-2px;bottom:2px;
  width:32px;height:32px;border-radius:999px;
  background:var(--green);color:#FDFAF3;
  display:grid;place-items:center;
  font-size:19px;font-weight:700;line-height:1;
  box-shadow:0 0 0 3px var(--canvas);
}
.item-add:active{background:var(--green-press)}
.item-stepper{
  display:flex;align-items:center;justify-content:space-between;
  width:88px;height:32px;margin-top:6px;
  background:var(--surface);border-radius:999px;padding:0 4px;
}
.item-stepper button{
  width:24px;height:24px;border-radius:999px;background:var(--canvas);color:var(--ink);
  display:grid;place-items:center;font-size:15px;font-weight:700;line-height:1;
}
.item-stepper span{font-size:14px;font-weight:700}
.item.is-out{opacity:.45}

/* ---------------------------------------------------------------- cart bar */

.cartbar{
  position:fixed;left:16px;right:16px;
  bottom:calc(16px + env(safe-area-inset-bottom));
  z-index:50;
  max-width:528px;margin:0 auto;
  display:flex;align-items:center;gap:12px;
  height:56px;padding:0 16px;border-radius:var(--r);
  background:var(--green);color:#FDFAF3;
  background-image:var(--pattern-faint);
  background-size:26px 26px;
  font-size:16px;font-weight:700;
  box-shadow:var(--shadow-bar);
  transform:translateY(120%);transition:transform .28s cubic-bezier(.22,1,.36,1);
}
.cartbar.is-up{transform:translateY(0)}
.cartbar-count{
  background:#FDFAF3;color:var(--green);
  min-width:24px;height:24px;border-radius:999px;
  display:grid;place-items:center;font-size:12px;font-weight:700;flex:none;
}
.cartbar-label{flex:1;text-align:left}
.cartbar-total{flex:none}

/* ---------------------------------------------------------------- sheets */

.sheet-wrap{position:fixed;inset:0;z-index:60;display:none}
.sheet-wrap.is-open{display:block}
.sheet-scrim{position:absolute;inset:0;background:rgba(31,46,41,.5);animation:fade .2s ease}
@keyframes fade{from{opacity:0}to{opacity:1}}

.sheet{
  position:absolute;left:0;right:0;bottom:0;
  max-width:560px;margin:0 auto;
  max-height:92vh;display:flex;flex-direction:column;
  background:var(--canvas);
  border-radius:var(--r-lg) var(--r-lg) 0 0;
  box-shadow:var(--shadow-sheet);
  animation:rise .3s cubic-bezier(.22,1,.36,1);
}
@keyframes rise{from{transform:translateY(100%)}to{transform:translateY(0)}}
.sheet-grab{width:36px;height:4px;border-radius:999px;background:var(--surface-2);margin:8px auto 0}
.sheet-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px 16px;border-bottom:1px solid var(--divider);
}
.sheet-head h2{font-size:20px;font-weight:700;letter-spacing:-.3px}
.icon-btn{
  width:36px;height:36px;border-radius:999px;background:var(--surface);
  display:grid;place-items:center;font-size:15px;color:var(--ink);
}
.sheet-body{flex:1;overflow-y:auto;padding:16px}
.sheet-foot{padding:16px;border-top:1px solid var(--divider);padding-bottom:calc(16px + env(safe-area-inset-bottom))}
.sheet-compact .done{padding:28px 24px 32px;text-align:center}

/* toggle */
.toggle-row{
  display:flex;align-items:center;gap:12px;
  margin-top:16px;padding:14px;border-radius:var(--r);background:var(--surface);
  cursor:pointer;
}
.toggle-copy{flex:1;display:flex;flex-direction:column}
.toggle-copy strong{font-size:15px;font-weight:700}
.toggle-copy span{font-size:13px;color:var(--ink-2)}
.toggle-input{position:absolute;opacity:0;pointer-events:none}
.toggle-track{
  position:relative;width:48px;height:28px;flex:none;
  border-radius:999px;background:var(--surface-2);transition:background .18s;
}
.toggle-track::after{
  content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;
  border-radius:999px;background:#fff;transition:transform .18s;
}
.toggle-input:checked ~ .toggle-track{background:var(--green)}
.toggle-input:checked ~ .toggle-track::after{transform:translateX(20px)}

/* totals */
.totals{margin-top:16px}
.totals div{display:flex;justify-content:space-between;padding:5px 0;font-size:15px}
.totals dt{color:var(--ink-2)}
.totals dd{font-weight:500}
.totals-grand{border-top:1px solid var(--divider);margin-top:6px;padding-top:10px !important}
.totals-grand dt{color:var(--ink);font-weight:700}
.totals-grand dd{font-size:18px;font-weight:700}

/* buttons */
.btn{
  width:100%;height:52px;border-radius:var(--r);
  font-size:16px;font-weight:700;letter-spacing:.2px;
  display:grid;place-items:center;
  transition:background .15s,transform .1s;
}
.btn-primary{background:var(--green);color:#FDFAF3}
.btn-primary:active{background:var(--green-press);transform:scale(.99)}
.btn-primary[disabled]{background:var(--surface-2);color:var(--ink-3);transform:none;cursor:not-allowed}
.btn-lg{height:56px}
.link-btn{margin-top:8px;font-size:14px;font-weight:700;color:var(--ink);text-decoration:underline}

/* form */
.form{display:flex;flex-direction:column;gap:18px}
.field label{display:block;font-size:15px;font-weight:700;margin-bottom:8px}
.field .optional{font-weight:400;color:var(--ink-3);font-size:13px}
.field input[type=text],.field input[type=number],.field textarea{
  width:100%;height:52px;padding:0 14px;
  border:1.5px solid var(--divider);border-radius:var(--r);
  font-size:16px;background:var(--canvas);
  transition:border-color .15s;
}
.field textarea{height:auto;padding:14px;resize:vertical;line-height:1.45}
.field input:focus,.field textarea:focus{outline:none;border-color:var(--green)}
.field input.is-bad{border-color:var(--red)}
.hint{font-size:13px;color:var(--ink-2)}
.hint.center{text-align:center}
.field-err{font-size:13px;color:var(--red);margin-top:6px}
.form-err{text-align:center;margin:0}

/* photo capture */
.capture{
  position:relative;border-radius:var(--r);overflow:hidden;
  background:var(--surface);
}
.capture-empty{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  height:150px;border:1.5px dashed var(--surface-2);border-radius:var(--r);
  font-size:15px;font-weight:500;color:var(--ink-2);cursor:pointer;
}
.capture-icon{font-size:30px}
#photoPreview{width:100%;max-height:260px;object-fit:contain;border-radius:var(--r);background:var(--surface)}

/* summary */
.summary{background:var(--surface);border-radius:var(--r);padding:14px}
.summary h3{font-size:16px;font-weight:700;margin-bottom:10px}
.summary-line{display:flex;justify-content:space-between;gap:12px;font-size:14px;padding:3px 0}
.summary-line span:last-child{color:var(--ink-2);flex:none}

/* cart lines */
.line{
  display:flex;align-items:center;gap:12px;
  padding:12px 0;border-bottom:1px solid var(--divider);
}
.line:last-child{border-bottom:none}
.line-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.line-name{font-size:15px;font-weight:500}
.line-meta{font-size:13px;color:var(--ink-2)}
.line-total{font-size:15px;font-weight:700;flex:none;min-width:46px;text-align:right}
.line .item-stepper{width:92px;margin-top:0;flex:none}

/* deal discount + "add one more" prompt */
.totals-deal dt,.totals-deal dd{color:var(--accent-ink)}
.totals-deal dd{font-weight:700}
.nudge{
  margin-top:12px;padding:11px 14px;border-radius:var(--r);
  background:var(--accent-tint);color:var(--accent-ink);font-size:14px;
}
.nudge strong{font-weight:700}
.summary-total{
  display:flex;justify-content:space-between;align-items:center;
  margin-top:10px;padding-top:10px;border-top:1px solid var(--divider);
  font-size:16px;
}
.summary-total strong{font-size:18px;font-weight:700}

/* success */
.done-tick{
  position:relative;overflow:hidden;
  width:64px;height:64px;margin:0 auto 16px;
  border-radius:32px 32px 14px 14px;      /* arch, same family as the logo */
  background:var(--green-tint);display:grid;place-items:center;
}
.done-tick svg{width:32px;height:32px;fill:none;stroke:var(--green);stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.done h2{font-size:24px;font-weight:700;letter-spacing:-.3px}
.done p{margin-top:6px}
.ordercode{
  margin:18px 0 22px;padding:16px;border-radius:var(--r);
  background:var(--surface);
  font-size:28px;font-weight:700;letter-spacing:1px;
  font-variant-numeric:tabular-nums;
}

/* toast */
.toast{
  position:fixed;left:50%;bottom:calc(84px + env(safe-area-inset-bottom));
  transform:translate(-50%,16px);
  background:var(--ink);color:#FDFAF3;font-size:14px;font-weight:500;
  padding:10px 18px;border-radius:999px;z-index:80;
  opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;
  max-width:88vw;text-align:center;
}
.toast.is-on{opacity:1;transform:translate(-50%,0)}

/* footer */
.footer{
  margin-top:32px;padding-top:18px;border-top:1px solid var(--divider);
  display:flex;flex-direction:column;gap:4px;
  font-size:12px;color:var(--ink-3);
}
.footer a{text-decoration:underline}
.footer-ar{color:var(--ink-2);letter-spacing:.3px;font-size:13px;text-align:left}

@media (min-width:600px){
  body{background:#F6F0E3}
  .topbar-inner,.page{background:var(--canvas)}
}
