/* Layout: a clean white storefront. Announcement strip, centred logo header, split hero
   with the live name preview on a grey photo panel, category tiles, then a square-image product grid. */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --ink: #141414;
  --muted: #6B6B6B;
  --line: #E6E6E6;
  --field: #D4D4D4;       /* input borders */
  --well: #F3F3F3;        /* grey panel behind product drawings, like a photo backdrop */
  --accent: #CF2039;      /* Layer Lab red: logo, badges, cart count */
  --btn: #141414;
  --btn-ink: #FFFFFF;
  --ok: #0B7A44;
  --warn-bg: #FFF5E6;
  --warn-ink: #7A4A00;
  --wa: #25D366;

  --sans: "Inter", "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --brand: "Lexend", "Inter", sans-serif;

  --s-1: 0.8125rem;  /* 13 */
  --s0: 1rem;        /* 16 */
  --s1: 1.25rem;     /* 20 */
  --s2: 1.5rem;      /* 24 */
  --s3: 2rem;        /* 32 */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --surface: #1A1A1A; --ink: #F1F1F1; --muted: #A3A3A3; --line: #2A2A2A; --field: #3A3A3A;
    --well: #1F1F1F; --accent: #E2394F; --btn: #F1F1F1; --btn-ink: #141414; --ok: #3FB57A;
    --warn-bg: #2E2414; --warn-ink: #F2C77B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --surface: #1A1A1A; --ink: #F1F1F1; --muted: #A3A3A3; --line: #2A2A2A; --field: #3A3A3A;
  --well: #1F1F1F; --accent: #E2394F; --btn: #F1F1F1; --btn-ink: #141414; --ok: #3FB57A;
  --warn-bg: #2E2414; --warn-ink: #F2C77B;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: var(--s0); line-height: 1.6;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: var(--bg);
}
img, svg { max-width: 100%; }
#site-head, #site-foot { display: contents; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }
html:has(dialog[open]) { overflow: hidden; }

.wrap {
  max-width: 1240px; margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 900px) {
  .wrap { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); }
}
h1, h2, h3 { font-family: var(--sans); font-weight: 700; line-height: 1.2; margin: 0; text-wrap: balance; }
h2 { font-size: var(--s2); }
h3 { font-size: var(--s1); }
:lang(en) h1, :lang(en) h2 { letter-spacing: -0.02em; }
p { margin: 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding-inline: 28px; border-radius: 999px; border: 1px solid var(--btn);
  background: var(--btn); color: var(--btn-ink); font-weight: 600;
  text-decoration: none; cursor: pointer; transition: opacity .15s;
}
.btn:hover { opacity: .86; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { opacity: 1; background: var(--well); }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- announcement + header ---------- */
.announce {
  border-bottom: 1px solid var(--line); text-align: center; font-size: var(--s-1);
  padding-block: 8px; color: var(--ink);
}
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; min-height: 64px; }
.site-nav { display: flex; gap: 24px; font-size: 0.9375rem; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { width: 34px; height: 26px; flex: none; }
.brand b { font-family: var(--brand); font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.head-tools { justify-self: end; display: flex; align-items: center; gap: 4px; }
.icon-btn {
  min-height: 44px; min-width: 44px; padding-inline: 10px; border-radius: 999px;
  border: 0; background: transparent; cursor: pointer; text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: 0.9375rem;
}
.icon-btn:hover { background: var(--well); }
.icon-btn svg { width: 22px; height: 22px; }
.count {
  min-width: 20px; height: 20px; padding-inline: 5px; border-radius: 999px;
  background: var(--accent); color: #FFFFFF; font-size: 11px; line-height: 20px; text-align: center;
}
@media (max-width: 820px) {
  .site-nav { display: none; }
  .site-head .wrap { grid-template-columns: 1fr auto; }
  .brand b { font-size: 1.2rem; }
}

/* ---------- hero ---------- */
.hero { padding-block: 0 clamp(40px, 6vw, 72px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-copy { display: grid; gap: 22px; min-width: 0; padding-block: 24px; }
.hero h1 { font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1.15; }
.hero-copy .lead { font-size: var(--s1); color: var(--muted); max-width: 32ch; line-height: 1.55; }
.try { display: grid; gap: 10px; max-width: 460px; }
.try label { font-weight: 600; font-size: 0.9375rem; }
.try-row { display: flex; gap: 10px; flex-wrap: wrap; }
.try-row input { flex: 1 1 170px; min-width: 0; }
.hero-links { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; font-size: 0.9375rem; }
.hero-links a { font-weight: 600; text-underline-offset: 5px; }

.plate {
  position: relative; aspect-ratio: 1 / 1; max-width: 100%; background: var(--well);
  display: grid; place-items: center; overflow: hidden;
}
.plate .piece { width: min(74%, 480px); position: relative; }
.plate .piece svg { display: block; width: 100%; height: auto; }
.plate .nozzle {
  position: absolute; inset-inline: -4%; height: 2px; top: 100%;
  background: var(--accent); opacity: 0; pointer-events: none;
}
.plate .readout {
  position: absolute; inset-inline: 20px; bottom: 16px; display: flex; justify-content: space-between; gap: 12px;
  color: var(--muted); font-size: var(--s-1);
}
.plate .readout span { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; padding-left: 0; padding-right: 0; }
  .hero-copy { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 4px 0; }
  .plate { order: -1; aspect-ratio: 4 / 3; }
}

/* ---------- inputs ---------- */
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 4px;
  border: 1px solid var(--field); background: var(--surface);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.input[aria-invalid="true"] { border-color: var(--accent); }
.field { display: grid; gap: 6px; }
.field-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.field-top label { font-weight: 600; font-size: 0.9375rem; }
.hint { font-size: var(--s-1); color: var(--muted); }
.err { font-size: var(--s-1); color: var(--accent); }

/* ---------- sections ---------- */
.section { padding-block: clamp(36px, 6vw, 72px); }
.sec-head { display: grid; gap: 6px; margin-bottom: 24px; max-width: 60ch; }
.sec-head p { color: var(--muted); }
.sec-row { display: flex; align-items: end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 20px; }

/* category tiles */
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cat { display: grid; gap: 10px; text-decoration: none; text-align: center; font-weight: 500; font-size: 0.9375rem; cursor: pointer; background: none; border: 0; padding: 0; }
.cat .well { aspect-ratio: 1 / 1; }
.cat .well svg { width: 74%; transition: transform .25s; }
.cat:hover .well svg { transform: scale(1.04); }

/* filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 36px; padding-inline: 14px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; cursor: pointer; font-size: 0.875rem;
}
.chip[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }

/* product grid */
.grid { display: grid; gap: 32px 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 10px; } }
.card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.well {
  background: var(--well); aspect-ratio: 1 / 1; display: grid; place-items: center;
  overflow: hidden; position: relative;
}
.well svg { width: 80%; height: auto; display: block; transition: transform .25s; }
.well img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.card:hover .well svg, .card:hover .well img { transform: scale(1.04); }
.card-body { display: grid; gap: 2px; }
.card-name { font-size: 0.9375rem; font-weight: 500; line-height: 1.45; }
.card:hover .card-name { text-decoration: underline; text-underline-offset: 4px; }
.price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card .price { font-size: 0.9375rem; }
.tag {
  position: absolute; inset-block-start: 10px; inset-inline-end: 10px;
  background: var(--surface); color: var(--ink); border-radius: 3px;
  padding: 2px 8px; font-size: 0.75rem; font-weight: 500;
}
.card-custom .well { background: var(--ink); }
.card-custom .well svg { width: 46%; color: var(--bg); }
.swatches { display: inline-flex; gap: 4px; align-items: center; }
.swatches i {
  width: 14px; height: 14px; border-radius: 50%; display: inline-block;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 35%, transparent);
}

/* custom design (a real sequence, so it is numbered) */
.custom .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); }
@media (max-width: 860px) { .custom .wrap { grid-template-columns: 1fr; } }
.steps { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 18px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; counter-increment: s; }
.steps li::before {
  content: counter(s); width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 0.875rem;
  background: var(--btn); color: var(--btn-ink);
}
.steps b { display: block; }
.form { display: grid; gap: 16px; background: var(--well); padding: clamp(18px, 3vw, 32px); }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .form .row2 { grid-template-columns: 1fr; } }

/* delivery facts */
.band { background: var(--well); }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.facts div { display: grid; gap: 4px; }
.facts b { font-size: var(--s2); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* FAQ */
.faq { max-width: 820px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding-block: 18px; font-weight: 600;
  display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4em; line-height: 1; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 18px; color: var(--muted); max-width: 65ch; }

/* footer */
.site-foot { border-top: 1px solid var(--line); padding-block: 48px calc(28px + env(safe-area-inset-bottom, 0px)); font-size: 0.9375rem; }
.site-foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.site-foot h3 { font-size: var(--s0); margin-bottom: 12px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--ink); text-decoration: underline; }
.site-foot .brand { color: var(--ink); }
.site-foot .legal { grid-column: 1 / -1; color: var(--muted); font-size: var(--s-1); padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 20px; }
@media (max-width: 760px) { .site-foot .wrap { grid-template-columns: 1fr; } }

/* WhatsApp button */
.wa-float {
  position: fixed; z-index: 30; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 56px; height: 56px; border-radius: 50%; background: var(--wa); color: #FFFFFF;
  display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); text-decoration: none;
}
.wa-float svg { width: 30px; height: 30px; }

/* ---------- dialogs ---------- */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--surface); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.sheet { width: min(1040px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); border-radius: 8px; overflow: auto; margin: auto; }
.sheet-x { position: sticky; top: 0; height: 0; z-index: 3; display: flex; justify-content: flex-end; }
.sheet-x .icon-btn { margin: 10px; font-size: 1.4rem; line-height: 1; background: var(--surface); }
.sheet-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sheet .well { aspect-ratio: auto; min-height: 100%; }
.sheet .well svg { width: 84%; }
.sheet-body { padding: clamp(18px, 3.5vw, 36px); display: grid; gap: 18px; align-content: start; min-width: 0; }
.sheet-body h2 { font-size: var(--s3); }
@media (max-width: 760px) {
  .sheet { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .sheet-in { grid-template-columns: 1fr; }
  .sheet .well { min-height: 0; aspect-ratio: 1 / 1; }
  .sheet-body h2 { font-size: var(--s2); }
}
.opt-group { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.opt-group legend { font-weight: 600; font-size: 0.9375rem; padding: 0; margin-bottom: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt > span {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding-inline: 16px;
  border-radius: 999px; border: 1px solid var(--field); cursor: pointer; font-size: 0.9375rem;
}
.opt input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.opt .dot { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 35%, transparent); }
.buy-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.qty { display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid var(--field); }
.qty button { width: 44px; height: 46px; border: 0; background: none; cursor: pointer; font-size: 1.2rem; }
.qty output { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.buy-row .btn { flex: 1 1 200px; }
.specs { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 0.9375rem; padding-top: 16px; border-top: 1px solid var(--line); }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-variant-numeric: tabular-nums; }
.note { background: var(--warn-bg); color: var(--warn-ink); padding: 12px 14px; font-size: 0.9375rem; }

/* cart drawer */
.drawer {
  width: min(440px, 100vw); height: 100dvh; max-height: 100dvh; margin: 0; margin-inline-start: auto;
  display: none; flex-direction: column; padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer[open] { display: flex; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: var(--s1); }
.drawer-list { flex: 1; overflow: auto; padding: 4px 18px; display: grid; align-content: start; }
.line { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.line .well svg { width: 92%; }
.line-top { display: flex; justify-content: space-between; gap: 10px; }
.line-name { font-weight: 500; line-height: 1.4; }
.line-meta { color: var(--muted); font-size: var(--s-1); }
.line-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.line .qty button { width: 36px; height: 36px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 18px; display: grid; gap: 12px; }
.total-row { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.0625rem; }
.pay-note { font-size: var(--s-1); color: var(--muted); text-align: center; }
.empty { text-align: center; padding: 48px 12px; display: grid; gap: 14px; justify-items: center; }
.error-box { background: var(--warn-bg); color: var(--warn-ink); padding: 10px 14px; font-size: 0.9375rem; }

.small-dialog { width: min(460px, calc(100vw - 32px)); border-radius: 8px; padding: 24px; margin: auto; }
.small-dialog .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* toast (sits above the WhatsApp button) */
.toast {
  position: fixed; z-index: 50; inset-inline: 0; bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  margin-inline: auto; width: max-content; max-width: calc(100vw - 32px);
  background: var(--btn); color: var(--btn-ink); border-radius: 999px; padding: 8px 8px 8px 20px;
  display: flex; align-items: center; gap: 14px; font-weight: 600; font-size: 0.9375rem;
}
[dir="rtl"] .toast { padding: 8px 20px 8px 8px; }
.toast .btn { min-height: 36px; padding-inline: 16px; background: var(--btn-ink); color: var(--btn); border-color: var(--btn-ink); }

/* policies + success pages */
.doc { max-width: 780px; padding-block: 40px 64px; }
.doc h1 { font-size: var(--s3); margin-bottom: 8px; }
.doc h2 { font-size: var(--s1); margin-top: 40px; margin-bottom: 10px; scroll-margin-top: 90px; }
.doc p, .doc li { max-width: 68ch; }
.doc p + p { margin-top: 10px; }
.doc ul { padding-inline-start: 22px; display: grid; gap: 6px; }
.doc .toc { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
