:root {
  --smoke: #0e0c0a;      /* page, matches the logo background */
  --wood: #1d1612;       /* product surfaces */
  --wood-2: #2a201a;
  --ivory: #efe6d8;      /* logo lettering */
  --ash: #9c8f80;
  --resin: #c8924f;      /* oud oil amber: prices, actions */
  --resin-deep: #8a5a26;
  --line: #3a2e25;
  --f-display: "Italiana", "Times New Roman", serif;
  --f-body: "IBM Plex Sans", system-ui, sans-serif;
  color-scheme: dark;
}
:lang(ar), [dir="rtl"] { --f-display: "Reem Kufi", "IBM Plex Sans Arabic", sans-serif; --f-body: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, sans-serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--smoke); color: var(--ivory); font-family: var(--f-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--resin); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: rgba(14, 12, 10, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.top.scrolled { border-bottom-color: var(--line); }
.top-logo img { width: 72px; height: auto; opacity: 0; transition: opacity .3s; }
.top.scrolled .top-logo img { opacity: 1; }
.lang { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; cursor: pointer; }
.lang:hover { border-color: var(--resin); }

/* hero: the logo over a slow ember glow */
.hero { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 16px 36px; overflow: hidden; isolation: isolate; }
.ember { position: absolute; inset: auto -20% -60% -20%; height: 120%; z-index: -1;
  background: radial-gradient(closest-side, rgba(200, 146, 79, .28), rgba(138, 90, 38, .12) 45%, transparent 75%);
  animation: breathe 9s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
.hero-logo { width: min(240px, 62vw); height: auto; }
.intro { max-width: 34ch; margin: 22px auto 0; color: #d9cdbb; font-size: 17px; line-height: 1.65; }
.intro:empty { display: none; }

/* categories */
.cats { display: flex; gap: 6px; overflow-x: auto; padding: 4px max(16px, calc((100% - 1180px) / 2 + 24px)) 14px; scrollbar-width: none; position: sticky; top: 53px; z-index: 15; background: var(--smoke); }
.cats::-webkit-scrollbar { display: none; }
.cats:empty { display: none; }
.cat { flex: none; background: none; border: 1px solid var(--line); color: var(--ash); border-radius: 999px; padding: 7px 16px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.cat[aria-pressed="true"] { background: var(--ivory); color: var(--smoke); border-color: var(--ivory); }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; padding: 6px 16px 120px; max-width: 1180px; margin: 0 auto; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 20px; padding-inline: 24px; } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.status { grid-column: 1 / -1; text-align: center; color: var(--ash); padding: 40px 0; margin: 0; }
.empty { grid-column: 1 / -1; text-align: center; padding: 30px 8px 10px; }
.empty h2 { font-family: var(--f-display); font-weight: 400; font-size: 28px; margin: 0 0 8px; }
.empty p { color: var(--ash); margin: 0 auto 18px; max-width: 36ch; }
.sec { grid-column: 1 / -1; font-family: var(--f-display); font-weight: 400; font-size: 26px; margin: 18px 0 -4px; color: var(--ivory); }
.sec:first-child { margin-top: 0; }
.item { display: flex; flex-direction: column; min-width: 0; }
.ph { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--wood); position: relative; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .mono { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-size: clamp(44px, 12vw, 72px); color: var(--wood-2);
  background: radial-gradient(circle at 50% 70%, #2b2019, var(--wood) 70%); }
.ph .mono span { color: #4a3a2e; }
.sold { position: absolute; inset-inline-start: 8px; top: 8px; background: rgba(14, 12, 10, .82); color: var(--ivory); font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.item.out .ph img, .item.out .ph .mono { opacity: .45; }
.nm { font-size: 15px; font-weight: 500; margin: 10px 0 2px; line-height: 1.35; overflow-wrap: anywhere; }
.ds { color: var(--ash); font-size: 13px; margin: 0; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin-top: auto; padding-top: 8px; }
.row .add, .row .qty { width: 100%; justify-content: space-between; }
@media (min-width: 720px) { .row { flex-direction: row; align-items: center; justify-content: space-between; } .row .add, .row .qty { width: auto; } }
.price { color: var(--resin); font-weight: 600; font-size: 15px; white-space: nowrap; unicode-bidi: isolate; }
.price small { font-weight: 400; color: var(--ash); font-size: 12px; }
.add { background: none; border: 1px solid var(--resin); color: var(--resin); border-radius: 999px; min-width: 40px; height: 36px; padding: 0 12px; cursor: pointer; font-size: 14px; font-weight: 500; }
.add:hover { background: var(--resin); color: var(--smoke); }
.add:disabled { border-color: var(--line); color: var(--ash); cursor: default; background: none; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--resin); border-radius: 999px; height: 36px; }
.qty button { background: none; border: 0; min-width: 40px; height: 100%; cursor: pointer; color: var(--resin); font-size: 18px; line-height: 1; }
.qty output { min-width: 20px; text-align: center; font-weight: 600; font-size: 14px; }

/* basket bar */
.bar { position: fixed; inset: auto 0 0 0; z-index: 30; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(14, 12, 10, .95) 35%); }
.bar-btn { width: 100%; max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--resin); color: #1a120a; border: 0; border-radius: 14px; padding: 15px 20px; font-weight: 600; font-size: 16px; cursor: pointer;
  box-shadow: 0 10px 30px rgba(200, 146, 79, .25); }
.bar-btn.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.03); } }

/* order sheet */
.sheet { border: 0; padding: 0; background: transparent; color: var(--ivory); width: 100%; max-width: 560px; margin: auto auto 0; max-height: 92vh; }
.sheet::backdrop { background: rgba(0, 0, 0, .6); }
@media (min-width: 720px) { .sheet { margin: auto; } .sheet-in { border-radius: 20px; } }
.sheet-in { background: #17120f; border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 18px 18px max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet-hd { display: flex; justify-content: space-between; align-items: center; }
.sheet-hd h2 { font-family: var(--f-display); font-weight: 400; font-size: 28px; margin: 0; }
.x { background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: var(--ash); padding: 4px 8px; }
.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-height: 38vh; overflow-y: auto; }
.lines li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.lines .ln { font-size: 15px; }
.lines .lp { color: var(--ash); font-size: 13px; }
.lines .qty { grid-row: span 2; }
.sum { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; font-size: 17px; }
.sum b { color: var(--resin); }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ash); }
.fld input, .fld textarea { background: var(--wood); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--ivory); font-size: 16px; resize: vertical; }
.fld input:focus, .fld textarea:focus { outline: none; border-color: var(--resin); }
.wa { display: flex; justify-content: center; align-items: center; gap: 10px; background: #25d366; color: #052e16; text-decoration: none; font-weight: 600; border-radius: 14px; padding: 15px; font-size: 16px; }
.wa:hover { background: #2fe072; }
.fine { color: var(--ash); font-size: 13px; margin: -4px 0 0; text-align: center; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 28px 16px 130px; text-align: center; color: var(--ash); font-size: 14px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.foot a { color: var(--ivory); text-underline-offset: 3px; }
.foot .links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

@media (prefers-reduced-motion: reduce) { .ember, .bar-btn.bump { animation: none; } .top, .top-logo img { transition: none; } }
