/* Abaya reels — "black crepe and thread"
   Ink base so the fabric reads true, chalk type, and one signature element:
   a woven sadu band borrowed from Gulf weaving, used as the only ornament. */

:root {
  --ink:      #0C0D11;
  --ink-soft: #16171D;
  --chalk:    #F5F2EC;
  --muted:    #A8A49B;
  --sadu:     #A8231F;   /* the red of a sadu band */
  --wa:       #1FA855;
  --radius:   14px;
  --pad:      clamp(16px, 4vw, 28px);
  --display:  'Reem Kufi', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --body:     'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink); color: var(--chalk);
  font-family: var(--body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--chalk); outline-offset: 3px; border-radius: 4px; }

/* ---- the signature: a woven band ---- */
.sadu {
  height: 4px; width: 100%;
  background:
    repeating-linear-gradient(135deg, transparent 0 5px, rgba(245,242,236,.85) 5px 7px),
    var(--sadu);
}

/* ---- top bar ---- */
.topbar {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 20;
  padding-block-start: env(safe-area-inset-top);
  background: linear-gradient(to bottom, rgba(12,13,17,.92), rgba(12,13,17,0));
}
.topbar--solid { position: static; background: var(--ink-soft); }
.brand {
  display: block; font-family: var(--display); font-weight: 600;
  font-size: 20px; letter-spacing: .01em; padding: 12px var(--pad) 4px;
}
.rail {
  display: flex; gap: 18px; overflow-x: auto; padding: 0 var(--pad) 10px;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail__item {
  flex: none; font-size: 14px; color: var(--muted); padding-block: 4px;
  border-block-end: 2px solid transparent;
}
.rail__item.is-on { color: var(--chalk); border-block-end-color: var(--sadu); }

/* ---- the reels feed ---- */
.feed {
  height: 100dvh; overflow-y: scroll; scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain; scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }

.reel {
  position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always;
  display: flex; align-items: flex-end; overflow: hidden;
}
.reel__media { position: absolute; inset: 0; background: var(--ink-soft); }

/* Vertical scroll moves between designs; this strip moves between photos
   of one design. Snap on both axes, no JavaScript needed for the gesture. */
.gal {
  display: flex; height: 100%; width: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.gal::-webkit-scrollbar { display: none; }
.gal__img {
  flex: 0 0 100%; width: 100%; height: 100%;
  object-fit: cover; display: block; scroll-snap-align: center;
  user-select: none; -webkit-user-drag: none;
}

/* Stills need a little life where a clip would have had movement. */
@media (prefers-reduced-motion: no-preference) {
  .gal__img { transition: transform 900ms cubic-bezier(.22,.61,.36,1); }
  .reel.is-active .gal__img:first-child { transform: scale(1.04); }
}

.gal__dots {
  position: absolute; inset-block-start: calc(12px + env(safe-area-inset-top));
  inset-inline: 0; display: flex; justify-content: center; gap: 5px;
  pointer-events: none;
}
.gal__dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(245,242,236,.38); transition: background 180ms, width 180ms;
}
.gal__dot.is-on { background: var(--chalk); width: 14px; border-radius: 3px; }
.reel__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(12,13,17,.92) 0%, rgba(12,13,17,.55) 32%, transparent 62%);
}
.reel__body {
  position: relative; width: 100%; padding: var(--pad);
  padding-block-end: calc(var(--pad) + env(safe-area-inset-bottom));
  display: grid; gap: 10px;
}

.chip { display: inline-flex; align-items: center; gap: 8px; width: fit-content; }
.chip__logo {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  background: var(--ink-soft); border: 1px solid rgba(245,242,236,.25);
}
.chip__name { font-family: var(--display); font-size: 15px; }
.chip__city { font-size: 12px; color: var(--muted); }
.chip--dark { margin-block-end: 12px; }

.reel__title {
  margin: 0; font-family: var(--display); font-weight: 500;
  font-size: clamp(22px, 6vw, 30px); line-height: 1.25;
}
.reel__price {
  margin: 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.reel__desc { margin: 0; font-size: 14px; color: var(--muted); }
.reel__meta {
  margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 13px; color: var(--muted);
}
.badge {
  font-size: 11px; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--sadu); color: var(--chalk); font-weight: 400;
}
.badge--block { display: inline-block; margin: 0 0 12px; }

.reel__actions { display: flex; gap: 10px; align-items: stretch; margin-block-start: 4px; }
.cta {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--wa); color: #fff; font-weight: 600; font-size: 16px;
  padding: 14px 18px; border-radius: var(--radius); min-height: 52px;
  transition: transform .12s ease;
}
.cta:active { transform: scale(.985); }
.cta--wide { width: 100%; margin-block: 20px 12px; }
.icon-btn {
  flex: none; width: 52px; border-radius: var(--radius); cursor: pointer;
  background: rgba(245,242,236,.12); border: 1px solid rgba(245,242,236,.2);
  color: var(--chalk); display: grid; place-items: center;
}
.ghost { display: inline-block; color: var(--muted); font-size: 14px; border-block-end: 1px solid var(--sadu); }

.soundhint {
  position: absolute; inset-block-start: 50%; inset-inline-start: 50%;
  transform: translate(-50%, -50%); pointer-events: none;
  background: rgba(12,13,17,.7); border-radius: 999px; padding: 8px 16px; font-size: 13px;
  opacity: 0; transition: opacity .3s;
}
.soundhint.is-on { opacity: 1; }

.empty, .feed__end { text-align: center; color: var(--muted); padding: 40px var(--pad); font-size: 14px; }
.feed__loading { text-align: center; padding: 24px; color: var(--muted); font-size: 13px; }

/* ---- product page ---- */
.page { background: var(--ink); }
.detail { max-width: 1000px; margin: 0 auto; padding: 0 0 60px; }
.detail__media { display: grid; gap: 2px; background: var(--ink-soft); }
.detail__media img, .detail__video { width: 100%; display: block; }
.detail__info { padding: 24px var(--pad); }
.detail h1 { font-family: var(--display); font-weight: 500; font-size: clamp(24px, 6vw, 34px); margin: 0 0 6px; }
.detail__price { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 0 0 14px; }
.detail__desc { color: var(--muted); font-size: 15px; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 20px 0 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }

@media (min-width: 900px) {
  .detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; padding-block-start: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---- dashboard ---- */
.panel { max-width: 900px; margin: 0 auto; padding: 24px var(--pad) 80px; }
.panel h1 { font-family: var(--display); font-weight: 500; font-size: 26px; margin: 0 0 4px; }
.panel h2 { font-family: var(--display); font-weight: 500; font-size: 19px; margin: 32px 0 10px; }
.panel a.back { color: var(--muted); font-size: 14px; }
.card { background: var(--ink-soft); border-radius: var(--radius); padding: 18px; margin-block-end: 12px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
label { display: block; font-size: 13px; color: var(--muted); margin-block-end: 4px; }
input, textarea, select {
  width: 100%; background: var(--ink); color: var(--chalk); font-family: var(--body); font-size: 15px;
  border: 1px solid rgba(245,242,236,.18); border-radius: 10px; padding: 11px 12px;
}
textarea { min-height: 110px; resize: vertical; }
.field { margin-block-end: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--chalk); color: var(--ink); font-family: var(--body); font-weight: 600; font-size: 15px;
  border: 0; border-radius: 10px; padding: 12px 20px; min-height: 46px;
}
.btn--quiet { background: transparent; color: var(--chalk); border: 1px solid rgba(245,242,236,.28); }
.btn--danger { background: var(--sadu); color: #fff; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.note { font-size: 13px; color: var(--muted); }
.alert { border-inline-start: 3px solid var(--sadu); padding: 10px 14px; border-radius: 0 10px 10px 0; background: var(--ink-soft); margin-block-end: 16px; font-size: 14px; }
.alert--ok { border-inline-start-color: var(--wa); }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(245,242,236,.12); }
.stat { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 10px 8px; border-block-end: 1px solid rgba(245,242,236,.12); }
th { color: var(--muted); font-weight: 400; }
.thumb { width: 48px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--ink); }
progress { width: 100%; height: 8px; }

/* The reels page: the feed is the only thing that scrolls. */
.feedpage { overflow: hidden; height: 100dvh; }
.filternote { margin: 0; padding: 0 var(--pad) 10px; color: var(--muted); font-size: 13px; }
