:root {
  --ivory: #fbf6ef;
  --paper: #fffdf9;
  --ink: #2b1622;
  --muted: #7c6a70;
  --line: #e9dfd3;
  --wine: #7a1f3d;
  --gold: #b08a4e;
  --whatsapp: #128c4f;
  --radius: 16px;
  --display: 'El Messiri', 'IBM Plex Sans Arabic', serif;
  --body: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ivory); color: var(--ink); font: 400 16px/1.6 var(--body); }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.page { max-width: 560px; margin: 0 auto; }

/* Catalog ---------------------------------------------------------------- */
.masthead { padding: 34px 16px 22px; text-align: center; }
.masthead h1 { margin: 0; font: 700 34px/1.25 var(--display); letter-spacing: 0; }
.masthead p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.rule { width: 56px; height: 1px; margin: 14px auto 0; background: var(--gold); }

.install { margin-top: 16px; min-height: 46px; padding: 8px 24px; border: 0; border-radius: 99px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; }
.install-help { width: min(340px, calc(100% - 32px)); padding: 22px; border: 0; border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.install-help::backdrop { background: rgba(43, 22, 34, .55); }
.install-help h2 { margin: 0 0 10px; font: 700 21px/1.4 var(--display); }
.install-help ol { margin: 0; padding-inline-start: 22px; }
.install-help li { margin-bottom: 7px; }
.install-help p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.install-help button { width: 100%; min-height: 46px; margin-top: 16px; border: 0; border-radius: 12px; background: var(--wine); color: #fff; font-weight: 700; cursor: pointer; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; padding: 0 12px 40px; }
.card { display: block; min-width: 0; }
.card-photo { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--radius); background: var(--line); }
.card-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 8px; right: 8px; padding: 1px 10px; border-radius: 99px; background: rgba(43, 22, 34, .72); color: #fff; font-size: 12px; }
.card h2 { margin: 8px 2px 0; font: 500 15px/1.4 var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-prices { margin: 1px 2px 0; color: var(--muted); font-size: 13px; }
.card-prices b { color: var(--wine); font-weight: 700; }

.skeleton { background: linear-gradient(100deg, var(--line) 40%, #f5eee5 50%, var(--line) 60%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.notice { padding: 70px 24px; text-align: center; color: var(--muted); }
.notice button { display: block; margin: 16px auto 0; padding: 10px 26px; border: 1px solid var(--ink); border-radius: 99px; background: none; cursor: pointer; }

/* Dress page ------------------------------------------------------------- */
.dress { padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
.gallery-wrap { position: relative; }
.gallery { display: flex; width: 100%; aspect-ratio: 3 / 4; max-height: 58svh; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--line); }
.gallery::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; }
.slide img, .slide video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--line); }
.back { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 253, 249, .92); cursor: pointer; }
.back svg { width: 20px; height: 20px; }
.dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .55); transition: background .2s, transform .2s; }
.dots i.on { background: #fff; transform: scale(1.25); }

.info { padding: 18px 16px 0; }
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.info h1 { margin: 0; font: 700 25px/1.35 var(--display); }
.code { flex: none; color: var(--muted); font-size: 14px; }
.step { margin: 22px 0 9px; font-size: 15px; font-weight: 700; }

.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; justify-content: center; min-height: 66px; padding: 10px 14px; border: 1.5px solid var(--wine); border-radius: var(--radius); background: var(--paper); color: var(--wine); font-size: 20px; font-weight: 700; text-align: center; cursor: pointer; transition: background .15s, color .15s; }
input:checked + .option { background: var(--wine); color: #fff; }
input:focus-visible + .option, input:focus-visible + .size { outline: 3px solid var(--gold); outline-offset: 2px; }

.sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.size { display: block; padding: 10px 2px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); text-align: center; line-height: 1.35; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.size b { display: block; font-size: 15px; }
.size span { font-size: 14px; color: var(--muted); direction: ltr; unicode-bidi: isolate; }
input:checked + .size { border-color: var(--ink); background: var(--ink); color: #fff; }
input:checked + .size span { color: #e8dcd2; }

.missing .step { color: #b3261e; }
.missing .options, .missing .sizes { animation: nudge .35s; }
@keyframes nudge { 25% { transform: translateX(5px); } 75% { transform: translateX(-5px); } }

.book-bar { position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
.book-inner { max-width: 528px; margin: 0 auto; }
.summary { margin: 0 0 7px; min-height: 24px; text-align: center; font-size: 15px; color: var(--muted); }
.summary.ready { color: var(--ink); font-weight: 500; }
.book { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; border-radius: var(--radius); background: var(--whatsapp); color: #fff; font-size: 19px; font-weight: 700; }
.book svg { width: 24px; height: 24px; fill: currentColor; }

@media (min-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr 1fr; }
}

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