/* Palette comes from the approved logo. The page descends from Siq shadow through rock bands into a white gallery. */
:root {
  --shadow: #2F1411;
  --deep: #5B2A25;
  --rose: #B4503F;
  --sand: #D9A679;
  --stone: #F6E9DD;
  --ink: #3A1D19;
  --mute: #75594F;
  --line: #E6D9D0;
  --wa: #17724A;
  --wa-dark: #115A3A;
  --bar-h: 58px;
  --display: "El Messiri", "IBM Plex Sans Arabic", serif;
  --body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}
:lang(en) { --display: "Marcellus", Georgia, serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--ink); font: 16px/1.7 var(--body); }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

.skip { position: absolute; inset-block-start: -60px; inset-inline-start: 12px; z-index: 40; background: #fff; padding: 8px 14px; }
.skip:focus { inset-block-start: 8px; }

.ghost { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 7px 14px; line-height: 1.4; }
.ghost:hover { border-color: var(--deep); }
.solid { background: var(--deep); color: #fff; border: 0; border-radius: 6px; padding: 10px 18px; font-weight: 600; }
.solid:hover { background: var(--shadow); }
.link { background: none; border: 0; padding: 0; text-decoration: underline; color: var(--mute); }

.bar {
  position: sticky; inset-block-start: 0; z-index: 20; height: var(--bar-h);
  display: flex; align-items: center; gap: 8px; background: #fff; border-block-end: 1px solid var(--line);
  padding-inline: max(14px, env(safe-area-inset-left, 0px)) max(14px, env(safe-area-inset-right, 0px));
}
.brand { display: flex; align-items: center; gap: 8px; margin-inline-end: auto; text-decoration: none; font: 600 19px/1 var(--display); color: var(--deep); min-width: 0; }
.brand img { flex: none; }
/* Arabic dots sit below the baseline, so the line box must be tall enough for overflow:hidden not to clip them. */
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.7; }
.cart { display: inline-flex; gap: 6px; align-items: center; }
.cart b, #filterCount { background: var(--rose); color: #fff; border-radius: 10px; font-size: 12px; min-width: 20px; padding: 0 5px; text-align: center; line-height: 20px; }

.hero { background: var(--shadow); color: var(--stone); position: relative; }
.hero-in {
  max-width: 1120px; margin-inline: auto; display: grid; gap: 22px; justify-items: center; text-align: center;
  padding-block: 34px 26px; padding-inline: 18px;
}
.hero-logo { width: min(250px, 66vw); height: auto; }
.hero-text { display: grid; gap: 12px; justify-items: center; }
.hero h1 { font: 600 clamp(29px, 7.4vw, 56px)/1.25 var(--display); text-wrap: balance; max-width: 15em; }
.hero p { color: #E9D3C3; max-width: 34em; font-size: clamp(16px, 2.2vw, 19px); }
.browse { margin-block-start: 6px; background: var(--stone); color: var(--shadow); text-decoration: none; font-weight: 600; padding: 10px 26px; border-radius: 6px; }
.browse:hover { background: #fff; }
.strata { display: block; width: 100%; height: clamp(90px, 15vw, 210px); }

main { max-width: 1180px; margin-inline: auto; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.about { display: grid; gap: 8px; padding-block: 18px 40px; max-width: 42em; }
.about h2, .catalog h2 { font: 600 clamp(25px, 4vw, 32px)/1.3 var(--display); color: var(--deep); }
#aboutBody { display: grid; gap: 8px; }

.catalog { display: grid; gap: 14px; padding-block-end: 56px; }
.catalog > * { min-width: 0; }
.tools { position: sticky; inset-block-start: var(--bar-h); z-index: 10; background: #fff; display: grid; gap: 8px; padding-block: 10px 8px; margin-inline: -16px; padding-inline: 16px; border-block-end: 1px solid var(--line); }
.tools > * { min-width: 0; }
.tools-row { display: flex; gap: 8px; }
#search { flex: 1 1 auto; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; background: #fff; }
#openFilters { flex: none; display: inline-flex; gap: 6px; align-items: center; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-block: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 4px 13px; font-size: 14.5px; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--deep); border-color: var(--deep); color: #fff; }
.status-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; color: var(--mute); font-size: 14.5px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 14px; }
.item { display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 4px; min-width: 0; }
.shot { display: block; aspect-ratio: 1; background: #fff; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.shot:hover img { transform: scale(1.03); }
.item h3 { font: 500 16px/1.4 var(--body); margin-block-start: 6px; }
.item h3 a { text-decoration: none; }
.item h3 a:hover { color: var(--rose); }
.item .desc { color: var(--mute); font-size: 13.5px; line-height: 1.55; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.price { font-weight: 600; color: var(--deep); font-size: 15px; }
.price.ask { font-weight: 500; color: var(--mute); font-size: 14px; }
.acts { display: grid; grid-template-columns: minmax(0, 1fr) 42px; gap: 6px; margin-block-start: 4px; }
.wa { display: flex; align-items: center; justify-content: center; background: var(--wa); color: #fff; text-decoration: none; border-radius: 6px; padding: 8px 6px; font-weight: 500; font-size: 14px; line-height: 1.3; text-align: center; }
.wa:hover { background: var(--wa-dark); }
.add { background: #fff; border: 1px solid var(--line); border-radius: 6px; font-size: 21px; line-height: 1; color: var(--deep); }
.add:hover { border-color: var(--deep); }
.add.in { background: var(--stone); border-color: var(--sand); }
.more { justify-self: center; padding: 10px 26px; margin-block-start: 14px; }
.empty { display: grid; gap: 12px; justify-items: center; text-align: center; padding-block: 44px; color: var(--mute); }
.load-error { padding: 24px 16px; text-align: center; color: var(--rose); }

.foot { background: var(--shadow); color: #E9D3C3; font-size: 14.5px; padding-block-end: 84px; }
.foot-in { max-width: 1180px; margin-inline: auto; padding: 26px 18px; display: grid; gap: 8px; }
.foot-links { display: flex; gap: 18px; }
.foot a { color: #fff; }

.float-wa {
  position: fixed; z-index: 15; width: 54px; height: 54px; border-radius: 50%; background: var(--wa); color: #fff;
  display: grid; place-items: center; box-shadow: 0 3px 12px rgba(47, 20, 17, .35);
  inset-block-end: calc(16px + env(safe-area-inset-bottom, 0px)); inset-inline-end: calc(16px + env(safe-area-inset-right, 0px));
}
.float-wa:hover { background: var(--wa-dark); }

dialog.sheet { border: 0; padding: 0; color: var(--ink); background: #fff; max-width: none; max-height: none; }
dialog.sheet::backdrop { background: rgba(47, 20, 17, .6); }

dialog.detail { width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); margin: auto; border-radius: 8px; overflow: auto; }
.detail-in { display: grid; }
.detail-in > * { min-width: 0; }
.detail-shot { background: #fff; }
.detail-shot img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.detail-info { display: grid; gap: 10px; padding: 18px; align-content: start; }
.detail-info > * { min-width: 0; }
.detail-info h2 { font: 600 25px/1.3 var(--display); color: var(--deep); padding-inline-end: 64px; }
.detail-info .no { color: var(--mute); font-size: 14px; }
.detail-info .price { font-size: 19px; }
.detail-info .price.ask { font-size: 15.5px; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; margin: 0; font-size: 14.5px; }
.facts dt { color: var(--mute); }
.facts dd { margin: 0; }
.detail-acts { display: grid; gap: 8px; }
.detail-acts .wa { padding: 11px; font-size: 16px; }
.detail-note { color: var(--mute); font-size: 13.5px; }
.detail .close { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; z-index: 2; }

dialog.panel {
  width: min(430px, 100vw); height: 100dvh; margin: 0; margin-inline-start: auto;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
dialog.panel[open] { display: grid; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-block-end: 1px solid var(--line); }
.panel-head h2 { font: 600 21px/1.3 var(--display); color: var(--deep); }
.panel-body { overflow-y: auto; padding: 14px 16px; display: grid; gap: 18px; align-content: start; }
.panel-body > * { min-width: 0; }
.panel-foot { display: flex; gap: 8px; justify-content: space-between; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-block-start: 1px solid var(--line); }
.panel-foot.stack { display: grid; }
.panel-foot .solid { flex: 1; }
.group { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.group legend { font-weight: 600; padding: 0; margin-block-end: 6px; color: var(--deep); }
.opt { display: inline-flex; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt span { border: 1px solid var(--line); border-radius: 18px; padding: 3px 12px; font-size: 14.5px; cursor: pointer; }
.opt small { color: var(--mute); }
.opt input:checked + span { background: var(--deep); border-color: var(--deep); color: #fff; }
.opt input:checked + span small { color: inherit; }
.opt input:focus-visible + span { outline: 2px solid var(--rose); outline-offset: 2px; }

.line { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.line img { width: 62px; height: 62px; object-fit: cover; grid-row: span 2; }
.line .nm { font-weight: 500; line-height: 1.35; font-size: 15px; }
.line .pr { color: var(--mute); font-size: 13.5px; grid-column: 2; }
.line .rm { grid-column: 3; grid-row: 1; background: none; border: 0; color: var(--mute); text-decoration: underline; font-size: 13px; padding: 0; }
.qty { display: inline-flex; align-items: center; gap: 2px; grid-column: 3; grid-row: 2; }
.qty button { width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 5px; line-height: 1; }
.qty span { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-empty { text-align: center; color: var(--mute); padding-block: 34px; }
.sum { display: flex; justify-content: space-between; font-weight: 600; color: var(--deep); }
.cart-note { font-size: 13.5px; color: var(--mute); }
#cartFoot .wa { padding: 11px; font-size: 16px; }

.toast { position: fixed; z-index: 50; inset-block-end: calc(82px + env(safe-area-inset-bottom, 0px)); inset-inline-start: 50%; transform: translateX(-50%); background: var(--shadow); color: #fff; padding: 7px 16px; border-radius: 6px; font-size: 14.5px; white-space: nowrap; max-width: calc(100vw - 24px); }
[dir="rtl"] .toast { transform: translateX(50%); }

@media (min-width: 620px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 20px; }
}
@media (min-width: 860px) {
  .hero-in { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); justify-items: start; text-align: start; gap: 54px; align-items: center; padding-block: 52px 30px; padding-inline: 26px; }
  .hero-text { justify-items: start; }
  .hero-logo { width: 300px; }
  .detail-in { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .detail-info { padding: 26px 22px; }
  .about { padding-block-start: 26px; }
}
@media (min-width: 1040px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .shot img { transition: none; }
}
