:root {
  --bg: #F7F6F8;
  --wash-1: rgb(242 163 58 / .45);
  --wash-2: rgb(224 80 122 / .36);
  --wash-3: rgb(122 35 110 / .26);
  --dots: rgb(36 19 42 / .14);
  --surface: #FFFFFF;
  --ink: #24132A;
  --muted: #6F5E73;
  --line: #ECE1EA;
  --plum: #4A1342;
  --rose: #E0507A;
  --saffron: #F2A33A;
  --active-bg: #4A1342;
  --active-ink: #FFFFFF;
  --wa: #168A41;
  --wa-ink: #FFFFFF;
  --tint-top: #FFF1D9;
  --tint-heart: #FDE4EC;
  --tint-base: #F3E6DC;
  --dot-top: #E39A12;
  --dot-heart: #E0507A;
  --dot-base: #8A5232;
  --tone-mix: 15%;
  --radius: 22px;
  --shadow: 0 1px 2px rgb(36 19 42 / .06), 0 14px 34px rgb(36 19 42 / .10);
  --display: "Reem Kufi", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --title: "El Messiri", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --sans: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #110A12;
    --wash-1: rgb(242 163 58 / .20);
    --wash-2: rgb(224 80 122 / .20);
    --wash-3: rgb(140 60 140 / .24);
    --dots: rgb(255 255 255 / .08);
    --surface: #1F1522;
    --ink: #F6EDF4;
    --muted: #B7A6BA;
    --line: #362839;
    --active-bg: #F2A33A;
    --active-ink: #24132A;
    --wa: #25D366;
    --wa-ink: #06260F;
    --tint-top: #3A2C14;
    --tint-heart: #3D1E2A;
    --tint-base: #33241B;
    --tone-mix: 24%;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 14px 34px rgb(0 0 0 / .4);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 55% at 100% 0%, var(--wash-1), transparent 72%),
    radial-gradient(65% 55% at 0% 15%, var(--wash-2), transparent 72%),
    radial-gradient(80% 60% at 50% 110%, var(--wash-3), transparent 72%),
    radial-gradient(var(--dots) 1px, transparent 1.4px) 0 0 / 22px 22px;
}

body:has(dialog[open]) { overflow: hidden; }

img { max-width: 100%; display: block; }

[hidden] { display: none !important; }

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 16px;
}

.hero {
  position: relative;
  overflow: hidden;
  margin-top: calc(14px + env(safe-area-inset-top, 0px));
  padding: 40px 20px 32px;
  border-radius: 30px;
  text-align: center;
  color: #FFFFFF;
  background:
    radial-gradient(55% 75% at 92% 4%, rgb(242 163 58 / .95), transparent 62%),
    radial-gradient(60% 85% at 4% 100%, rgb(224 80 122 / .85), transparent 62%),
    linear-gradient(155deg, #350C33 0%, #5A174D 55%, #7A2350 100%);
}

.hero-notes {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgb(255 255 255 / .14);
  border: 1px solid rgb(255 255 255 / .22);
  font-size: 13px;
  font-weight: 500;
}

.hero-note i { width: 7px; height: 7px; border-radius: 50%; display: block; }

.shop-name {
  margin: 14px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(42px, 11vw, 76px);
  line-height: 1.15;
  text-wrap: balance;
}

.shop-latin {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: #F6D3A0;
}

.tagline {
  margin: 14px auto 0;
  max-width: 34ch;
  font-size: 17px;
  color: rgb(255 255 255 / .88);
  text-wrap: balance;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding-inline: 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}

.btn svg { width: 20px; height: 20px; flex: none; }

.btn-wa { background: var(--wa); color: var(--wa-ink); box-shadow: 0 8px 22px rgb(0 0 0 / .18); }

.btn-glass {
  background: rgb(255 255 255 / .14);
  border: 1px solid rgb(255 255 255 / .3);
  color: #FFFFFF;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.controls {
  position: sticky;
  top: 0;
  z-index: 5;
  margin-top: 18px;
  padding-block: calc(10px + env(safe-area-inset-top, 0px)) 10px;
  background: color-mix(in srgb, var(--bg) 45%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.controls-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.search {
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding-inline: 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--line);
}

.search:focus-within { border-color: var(--rose); }

.search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  height: 40px;
  padding-inline: 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.chip[aria-pressed="true"] { background: var(--active-bg); border-color: var(--active-bg); color: var(--active-ink); }

.count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block: 10px 14px;
}

.count { margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); }

.sort {
  height: 40px;
  padding-inline: 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }

.card {
  --tone: #8E2A3B;
  --on-tone: #FFFFFF;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 7px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--tone) var(--tone-mix), var(--surface));
  transition: box-shadow .2s, transform .2s;
}

@media (hover: hover) {
  .card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
  .card:hover .card-media img { transform: scale(1.04); }
}

.card-open {
  all: unset;
  display: flex;
  flex-direction: column;
  flex: 1;
  cursor: pointer;
}

.card-open:focus-visible { outline: 2px solid var(--tone); outline-offset: 2px; border-radius: 16px; }

.card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  background: color-mix(in srgb, var(--tone) 30%, var(--surface));
}

.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }

.card.is-soldout .card-media img { filter: grayscale(.7); opacity: .7; }

.drops { position: absolute; inset: 0; overflow: hidden; pointer-events: none; display: none; }
.card-media.is-dropping .drops { display: block; }

.drop, .drop > span { position: absolute; inset: 0; }
.drop { animation: drop-x 1.1s var(--d) cubic-bezier(.5, 0, .75, .45) both; }
.drop > span { animation: drop-y 1.1s var(--d) cubic-bezier(.5, 0, .75, .45) both; }

.drop b {
  position: absolute;
  top: 0;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgb(255 255 255 / .86);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 16px rgb(36 19 42 / .2);
  color: #24132A;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  animation: drop-pill 1.1s var(--d) ease-in both;
}

.drop b i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

@keyframes drop-x { from { transform: translateX(var(--sx)); } to { transform: translateX(0); } }
@keyframes drop-y { from { transform: translateY(0); } to { transform: translateY(56%); } }
@keyframes drop-pill {
  0% { transform: translate(-50%, -100%) scale(1); opacity: 0; }
  15% { opacity: 1; }
  78% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
}

.petal {
  position: absolute;
  top: -16px;
  left: var(--x);
  width: 12px;
  height: 16px;
  border-radius: 80% 0 80% 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 45%, #FFFFFF), var(--c));
  animation: petal-fall 1s var(--d) cubic-bezier(.3, .1, .6, 1) both;
}

@keyframes petal-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  15% { opacity: .9; }
  100% { transform: translate(calc(var(--r) * 26px), 300px) rotate(calc(var(--r) * 220deg)); opacity: 0; }
}

.glow {
  position: absolute;
  top: 56%;
  left: 50%;
  width: 75%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tone) 45%, #FFFFFF), transparent);
  mix-blend-mode: screen;
  animation: glow .8s 1.1s ease-out both;
}

@keyframes glow {
  0% { transform: translate(-50%, -50%) scale(.4); opacity: 0; }
  40% { opacity: .8; }
  100% { transform: translate(-50%, -50%) scale(1.3); opacity: 0; }
}

.sheen {
  position: absolute;
  top: -20%;
  bottom: -20%;
  right: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .5), transparent);
  animation: sheen .9s .1s ease-in-out both;
}

@keyframes sheen {
  from { transform: translateX(150%) skewX(-18deg); }
  to { transform: translateX(-400%) skewX(-18deg); }
}

.badges {
  position: absolute;
  inset-block-start: 9px;
  inset-inline-start: 9px;
  display: flex;
  gap: 6px;
}

.badge {
  padding: 2px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}

.badge.new { background: var(--saffron); color: #24132A; }

.badge.out { background: #24132A; color: #FFFFFF; }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 6px 2px;
}

.card-type { font-size: 12.5px; font-weight: 500; color: var(--muted); }

.card-name {
  margin: 0;
  font-family: var(--title);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
}

.card-notes {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 4px 4px;
  margin-top: auto;
}

.price-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--tone);
  color: var(--on-tone);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.price-pill small { font-size: 11.5px; font-weight: 500; opacity: .85; }

.wa-icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: var(--wa);
  color: var(--wa-ink);
}

.wa-icon-btn svg { width: 22px; height: 22px; }

.empty { text-align: center; color: var(--muted); padding-block: 48px; font-size: 17px; }

.foot {
  margin-top: 56px;
  padding-block: 28px calc(100px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.foot p { margin: 4px 0; }

.foot a { color: var(--ink); }

.fab {
  position: fixed;
  inset-inline-start: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  padding-inline: 18px 22px;
  border-radius: 999px;
  background: var(--wa);
  color: var(--wa-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 8px 24px rgb(22 138 65 / .4);
}

.fab svg { width: 24px; height: 24px; }

body:has(dialog[open]) .fab { display: none; }

.sheet {
  --tone: #8E2A3B;
  padding: 0;
  border: 0;
  width: 100%;
  max-width: 100%;
  max-height: 94dvh;
  margin: auto 0 0;
  border-radius: 26px 26px 0 0;
  background: var(--surface);
  color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}

.sheet:focus { outline: none; }

.sheet::backdrop { background: rgb(20 8 22 / .6); }

.sheet[open] { animation: rise .28s cubic-bezier(.2, .8, .2, 1); }

@keyframes rise { from { transform: translateY(28px); opacity: .6; } }

.sheet-inner { position: relative; }

.sheet-media {
  aspect-ratio: 4 / 5;
  max-height: 56dvh;
  width: 100%;
  overflow: hidden;
  background: color-mix(in srgb, var(--tone) 30%, var(--surface));
}

.sheet-media img { width: 100%; height: 100%; object-fit: cover; }

.sheet-close {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.sheet-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 22px 20px calc(26px + env(safe-area-inset-bottom, 0px));
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: color-mix(in srgb, var(--tone) 16%, var(--surface));
  color: var(--ink);
}

.tag.out { background: #24132A; color: #FFFFFF; }

.sheet-title {
  margin: 10px 0 0;
  font-family: var(--title);
  font-size: clamp(32px, 7vw, 44px);
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
}

.sheet-brand { margin: 2px 0 0; color: var(--muted); font-size: 15px; }

.sheet-desc { margin: 0; font-size: 16.5px; max-width: 60ch; }

.section-title { margin: 0 0 10px; font-size: 15px; font-weight: 700; }

.pyramid { display: grid; gap: 8px; }

.tier {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  margin-inline: auto;
  width: 100%;
}

.tier-top { background: var(--tint-top); width: 84%; --dot: var(--dot-top); }
.tier-heart { background: var(--tint-heart); width: 92%; --dot: var(--dot-heart); }
.tier-base { background: var(--tint-base); --dot: var(--dot-base); }

.tier-label { display: flex; align-items: baseline; gap: 8px; font-weight: 700; font-size: 14.5px; }

.tier-label i { width: 9px; height: 9px; border-radius: 50%; background: var(--dot); align-self: center; }

.tier-label small { font-weight: 500; color: var(--muted); font-size: 12.5px; }

.tier-notes { display: flex; flex-wrap: wrap; gap: 6px; }

.note {
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
}

.sizes { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }

.sizes legend { padding: 0; margin-bottom: 10px; font-size: 15px; font-weight: 700; }

.size-opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 2px solid var(--line);
  cursor: pointer;
  font-weight: 500;
  font-size: 16px;
}

.size-opt input { position: absolute; opacity: 0; pointer-events: none; }

.size-opt:has(input:checked) {
  border-color: var(--tone);
  background: color-mix(in srgb, var(--tone) 12%, var(--surface));
}

.size-opt:has(input:focus-visible) { outline: 2px solid var(--tone); outline-offset: 2px; }

.size-price { font-weight: 700; white-space: nowrap; }

.cta-row {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  gap: 10px;
  margin: 0 -20px calc(-26px - env(safe-area-inset-bottom, 0px));
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}

.wa-cta {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding-inline: 18px;
  border-radius: 16px;
  background: var(--wa);
  color: var(--wa-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
}

.wa-cta svg { width: 24px; height: 24px; }

.share-btn {
  display: grid;
  place-items: center;
  width: 56px;
  flex: none;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.share-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 100;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 600;
}

@media (min-width: 820px) {
  .hero { padding: 64px 32px 52px; }
  .sheet {
    width: calc(100% - 48px);
    max-width: 1000px;
    max-height: 90vh;
    margin: auto;
    border-radius: 26px;
  }
  .sheet-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sheet-media { max-height: none; height: 100%; aspect-ratio: auto; min-height: 600px; }
  .sheet-body { padding: 34px 32px 0; }
  .cta-row { margin: 0 -32px; padding: 14px 32px 18px; }
}

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