/* Layout: RTL, chat mockup beside the headline in the hero, then plain bands of content. One accent (green), used on actions and the order bubble. */
:root {
  --bg: #F5F8F6;
  --surface: #FFFFFF;
  --ink: #0F1F18;
  --muted: #475C50;
  --line: #D9E4DD;
  --accent: #0B7A4B;
  --accent-ink: #FFFFFF;
  --accent-soft: #DDF3E6;
  --bubble-out: #D6F3CC;
  --bubble-in: #FFFFFF;
  --chat-bg: #E4ECE7;
  --note-bg: #FFF1D6;
  --note-ink: #6B4A00;
  --shadow: rgba(15, 31, 24, 0.28);
  --font-display: "Cairo", "Tajawal", system-ui, sans-serif;
  --font-body: "Tajawal", "Cairo", system-ui, sans-serif;
  --step-small: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: clamp(1.5rem, 3.2vw, 1.9rem);
  --step-3: clamp(1.75rem, 4vw, 2.4rem);
  --step-4: clamp(2.1rem, 5.4vw, 3.5rem);
  --max: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1410; --surface: #121E18; --ink: #E8F1EB; --muted: #9DB2A5; --line: #22322A;
    --accent: #3FD48C; --accent-ink: #05230F; --accent-soft: #12301F;
    --bubble-out: #164A2C; --bubble-in: #1B2A22; --chat-bg: #0F1A14;
    --note-bg: #3A2E0F; --note-ink: #F3D58B; --shadow: rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1410; --surface: #121E18; --ink: #E8F1EB; --muted: #9DB2A5; --line: #22322A;
  --accent: #3FD48C; --accent-ink: #05230F; --accent-soft: #12301F;
  --bubble-out: #164A2C; --bubble-in: #1B2A22; --chat-bg: #0F1A14;
  --note-bg: #3A2E0F; --note-ink: #F3D58B; --shadow: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--step-0); line-height: 1.8;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.3; margin: 0; text-wrap: balance; }
h1 { font-size: var(--step-4); font-weight: 800; }
h2 { font-size: var(--step-3); font-weight: 800; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

.wrap {
  width: 100%; max-width: var(--max); margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* header */
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.2rem; padding-block: 0.9rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem;
}
.brand-name { display: grid; line-height: 1.2; font-family: var(--font-display); font-weight: 800; }
.brand-name small { font-family: var(--font-body); font-weight: 500; color: var(--muted); font-size: 0.8rem; }
.nav { display: flex; gap: 1.2rem; overflow-x: auto; white-space: nowrap; order: 3; flex-basis: 100%; padding-block: 0.3rem; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding-block: 0.25rem; }
.nav a:hover { color: var(--accent); }
.bar .btn-sm { margin-inline-start: auto; }
@media (min-width: 860px) {
  .nav { order: 0; flex: 1; flex-basis: auto; justify-content: center; }
  .bar .btn-sm { margin-inline-start: 0; }
}
@media (max-width: 760px) { .hide-sm { display: none !important; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 48px;
  padding: 0.55rem 1.5rem; border-radius: 999px; border: 2px solid transparent; font: inherit;
  font-family: var(--font-display); font-weight: 700; text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-inv { background: var(--accent-ink); color: var(--accent); }
.btn-inv:hover { filter: brightness(0.96); }
.btn-sm { min-height: 42px; padding: 0.35rem 1.1rem; font-size: 0.95rem; }
.btn-lg { min-height: 56px; padding-inline: 2rem; font-size: 1.1rem; }
.btn[aria-disabled="true"] { opacity: 0.55; }

/* hero */
.hero { padding-block: clamp(1.5rem, 5vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-copy { display: grid; gap: 1.2rem; justify-items: start; }
.eyebrow { color: var(--accent); font-weight: 700; font-family: var(--font-display); letter-spacing: 0.02em; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 36rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.fine { color: var(--muted); font-size: var(--step-small); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

/* chat mockup */
.phone-wrap { margin: 0; display: grid; gap: 0.8rem; justify-items: center; min-width: 0; }
.phone {
  width: min(100%, 330px); background: var(--surface); border: 1px solid var(--line); border-radius: 28px;
  box-shadow: 0 24px 50px -24px var(--shadow); overflow: hidden;
}
.phone-top { display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 1rem; background: var(--accent); color: var(--accent-ink); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-ink); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-family: var(--font-display); }
.phone-top strong { display: block; line-height: 1.2; font-family: var(--font-display); }
.phone-top small { opacity: 0.85; }
.chat { background: var(--chat-bg); padding: 1rem; display: grid; gap: 0.6rem; }
.chip { justify-self: center; font-size: 0.78rem; font-weight: 700; padding: 0.1rem 0.7rem; border-radius: 999px; background: var(--note-bg); color: var(--note-ink); }
.bubble { max-width: 94%; padding: 0.6rem 0.8rem; border-radius: 12px; font-size: 0.92rem; line-height: 1.65; color: var(--ink); }
.bubble.out { background: var(--bubble-out); justify-self: start; border-start-start-radius: 3px; }
.bubble.in { background: var(--bubble-in); justify-self: end; border-start-end-radius: 3px; }
.bubble b { font-family: var(--font-display); }
.rows { display: grid; gap: 0.1rem; margin-block: 0.4rem; }
.row { display: flex; justify-content: space-between; gap: 1rem; }
.row .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.total { font-weight: 700; border-top: 1px dashed var(--muted); margin-top: 0.2rem; padding-top: 0.2rem; }
.caption { font-size: var(--step-small); color: var(--muted); text-align: center; max-width: 22rem; }

/* sections */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.band { background: var(--surface); border-block: 1px solid var(--line); }
.sec-head { max-width: 46rem; display: grid; gap: 0.6rem; margin-bottom: 2rem; }
.sec-head p { color: var(--muted); }
.grid { display: grid; gap: 1rem; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr)); }

.problem { display: grid; gap: 0.8rem; align-content: start; min-width: 0; }
.ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem;
  display: flex; flex-direction: column; gap: 0.8rem; min-width: 0;
}
.band .card { background: var(--bg); }
.card .price { font-weight: 700; color: var(--ink); }
.card .actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: auto; padding-top: 0.4rem; }
.card-main { grid-column: 1 / -1; background: var(--accent-soft); border-color: transparent; }
.band .card-main { background: var(--accent-soft); }
.card p { color: var(--muted); }
.card-main p { color: var(--ink); }
.tag { align-self: flex-start; font-size: 0.8rem; font-weight: 700; padding: 0.1rem 0.7rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-family: var(--font-display); }
.card-main .tag { background: var(--accent); color: var(--accent-ink); }
.tag-note { background: var(--note-bg); color: var(--note-ink); }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.ticks li { position: relative; padding-inline-start: 1.4rem; color: var(--ink); }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.8em; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); }
.small-note { font-size: var(--step-small); color: var(--muted); }

/* steps */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.steps li { counter-increment: s; display: grid; gap: 0.5rem; align-content: start; min-width: 0; }
.steps li::before {
  content: counter(s); width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800;
}
.steps h3 { font-size: 1.1rem; }
.steps p { color: var(--muted); }

/* pricing table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.band .table-wrap { background: var(--bg); }
table { border-collapse: collapse; width: 100%; min-width: 540px; }
th, td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); text-align: center; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th { background: var(--accent-soft); font-family: var(--font-display); font-weight: 700; }
thead th small { display: block; font-family: var(--font-body); font-weight: 500; color: var(--muted); }
tbody th { text-align: start; font-weight: 500; }
td .yes { color: var(--accent); font-weight: 800; }
td .no { color: var(--muted); }
td.price-cell { font-weight: 700; font-variant-numeric: tabular-nums; }
.notes { display: grid; gap: 0.5rem; margin-top: 1.2rem; }

/* about */
.about-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); align-items: start; }
.portrait { width: 200px; height: 200px; border-radius: 24px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 5rem; overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
.chips li { padding: 0.2rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.9rem; direction: ltr; }
.links { display: flex; flex-wrap: wrap; gap: 1rem; }
@media (max-width: 700px) { .about-grid { grid-template-columns: minmax(0, 1fr); } }

/* faq */
.faq { max-width: 46rem; }
.faq details { border-bottom: 1px solid var(--line); padding-block: 1rem; }
.faq summary { display: flex; justify-content: space-between; gap: 1rem; cursor: pointer; list-style: none; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin-top: 0.6rem; color: var(--muted); }

/* contact */
.contact-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: stretch; }
.contact-card { background: var(--accent); color: var(--accent-ink); border-radius: 20px; padding: clamp(1.4rem, 4vw, 2.2rem); display: grid; gap: 1rem; align-content: start; }
.contact-card a:not(.btn) { color: var(--accent-ink); }
.contact-card p { opacity: 0.95; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(1.2rem, 4vw, 2rem); display: grid; gap: 0.9rem; }
label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 0.25rem; }
input, select, textarea {
  width: 100%; font: inherit; padding: 0.6rem 0.8rem; min-height: 46px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); color: var(--ink);
}
textarea { min-height: 96px; resize: vertical; }
.field-hint { color: var(--note-ink); background: var(--note-bg); border-radius: 8px; padding: 0.4rem 0.7rem; font-size: 0.9rem; }

footer { padding-block: 2rem; color: var(--muted); font-size: var(--step-small); border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.8rem; }

/* sticky whatsapp bar and toast */
.sticky-wa {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 20; display: none; background: var(--bg); border-top: 1px solid var(--line);
  padding-top: 0.6rem; padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.sticky-wa .btn { width: 100%; }
@media (max-width: 760px) { .sticky-wa { display: block; } body.has-sticky { padding-bottom: 5.2rem; } }
.toast {
  position: fixed; inset-inline: 0; margin-inline: auto; width: min(34rem, calc(100% - 32px)); z-index: 40;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); background: var(--surface); color: var(--ink);
  border: 2px solid var(--accent); border-radius: 14px; padding: 1rem; display: grid; gap: 0.6rem; box-shadow: 0 16px 40px -16px var(--shadow);
}
.toast[hidden] { display: none; }
.toast pre { margin: 0; white-space: pre-wrap; font-family: var(--font-body); font-size: 0.9rem; background: var(--chat-bg); padding: 0.6rem; border-radius: 8px; max-height: 10rem; overflow: auto; }

/* demo page */
.demo-note { background: var(--note-bg); color: var(--note-ink); border-radius: 14px; padding: 0.9rem 1.1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; }
.demo-note strong { font-family: var(--font-display); }
.demo-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-block: 1.4rem; }
.demo-head .avatar { width: 52px; height: 52px; background: var(--accent); color: var(--accent-ink); font-size: 1.4rem; }
.demo-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; padding-bottom: 3rem; }
@media (max-width: 860px) { .demo-grid { grid-template-columns: minmax(0, 1fr); } }
.menu-cat { margin-bottom: 1.6rem; }
.menu-cat h2 { font-size: var(--step-2); margin-bottom: 0.3rem; }
.dish { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 0.9rem; border-bottom: 1px solid var(--line); }
.dish-info { min-width: 0; }
.dish-info strong { font-family: var(--font-display); }
.dish-info p { color: var(--muted); font-size: 0.92rem; }
.dish-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.dish-side { display: grid; gap: 0.4rem; justify-items: end; flex-shrink: 0; }
.qty { display: flex; align-items: center; gap: 0.4rem; }
.qty button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.qty button:hover { border-color: var(--accent); color: var(--accent); }
.qty output { min-width: 1.6rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty .add-btn { width: auto; height: auto; min-height: 40px; padding: 0.2rem 1.1rem; font-size: 0.95rem; border: 2px solid transparent; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.qty .add-btn:hover { border-color: transparent; color: var(--accent-ink); filter: brightness(1.08); }
.cart { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.2rem; display: grid; gap: 1rem; position: sticky; top: 1rem; }
@media (max-width: 860px) { .cart { position: static; } }
.cart-lines { display: grid; gap: 0.35rem; }
.cart-empty { color: var(--muted); }
.totals { display: grid; gap: 0.2rem; border-top: 1px dashed var(--line); padding-top: 0.7rem; }
.totals .row.total { border-top: 0; margin: 0; padding: 0; font-size: 1.15rem; font-family: var(--font-display); }
.msg { white-space: pre-wrap; background: var(--chat-bg); border-radius: 12px; padding: 0.8rem; font-size: 0.9rem; line-height: 1.7; max-height: 16rem; overflow: auto; margin: 0; font-family: var(--font-body); }
.cart-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 20; display: none; background: var(--accent); color: var(--accent-ink);
  padding-top: 0.7rem; padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  text-decoration: none; font-family: var(--font-display); font-weight: 700;
}
.cart-bar span { display: flex; justify-content: space-between; gap: 1rem; }
@media (max-width: 860px) { .cart-bar { display: block; } body.has-cart-bar { padding-bottom: 4.5rem; } }
