/* OBJECT: corners sharpened by rebrand.py */
/* =====================================================================
   OBJECT — base tokens + shared components
   Used by: index.html (store), brand.html (identity guide), logo.html
   Fonts (load in each page <head>):
   https://fonts.googleapis.com/css2?family=Anybody&family=Noto+Kufi+Arabic:wght@800;900&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Montserrat:wght@500;600;700&display=swap
   ===================================================================== */

:root {
  color-scheme: dark;

  /* brand */
  --orange: #E2621F;
  --orange-hover: #EC7434;
  --orange-press: #C4501A;
  --orange-soft: rgba(226, 98, 31, .12);
  --orange-line: rgba(226, 98, 31, .5);

  /* warm-tinted neutrals (biased toward the orange, never pure grey) */
  --bg: #0A0A0A;
  --bg-2: #0C0C0C;
  --surface: #100F0E;
  --surface-2: #171513;
  --surface-3: #201D1A;
  --line: #2A2724;
  --line-2: #3B3835;
  --text: #E6DACC;
  --text-2: #CFC4B6;
  --muted: #8C857C;

  /* collection colours */
  --blessin: #1E3B33;
  --blessin-violet: #6C3BC4;
  --almd: #121212;
  --dreamer: #6F6E5B;

  /* state */
  --success: #35C27A;
  --danger: #FF5A4E;

  /* type */
  --f-ar: Alexandria, "Segoe UI", Tahoma, Arial, sans-serif;
  --f-en: "Anybody", Montserrat, Impact, sans-serif;
  --f-logo: Montserrat, "Segoe UI", Arial, sans-serif;

  /* shape + motion */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .5);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --container: 1240px;
  --gutter: 16px;

  /* surfaces that change with the theme */
  --ink: var(--orange);                 /* orange used as text (prices, links, headings) */
  --hdr-solid: rgba(9, 8, 7, .72);
  --field-bg: rgba(0, 0, 0, .35);
  --field-line: rgba(255, 255, 255, .14);
  --card-bg: linear-gradient(180deg, #121110 0%, #0C0C0C 60%);

  /* reading direction helpers: gradients/masks that run toward the end or start side */
  --to-end: to left;
  --to-start: to right;
  --x: -1;                              /* +1 in LTR: "forward" nudges */
}
[dir="ltr"] { --to-end: to right; --to-start: to left; --x: 1; }
[dir="ltr"] .flip { transform: scaleX(-1); }

/* light palette — optional; the store opens dark and switches only when the customer taps the button */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F6F2EC;
  --bg-2: #EFE9E1;
  --surface: #FFFFFF;
  --surface-2: #F8F4EF;
  --surface-3: #EEE7DE;
  --line: #E4DCD2;
  --line-2: #D2C8BC;
  --text: #17130F;
  --text-2: #5A5149;
  --muted: #8B8178;
  --ink: #A3410E;
  --orange-soft: rgba(226, 98, 31, .1);
  --hdr-solid: rgba(255, 255, 255, .72);
  --field-bg: #FFFFFF;
  --field-line: #DCD3C8;
  --card-bg: #FFFFFF;
  --shadow: 0 18px 40px rgba(70, 45, 20, .12);
}
/* photo areas stay dark in both themes */
.is-dark {
  color-scheme: dark;
  --bg: #0A0A0A;
  --bg-2: #0C0C0C;
  --surface: #100F0E;
  --surface-2: #171513;
  --surface-3: #201D1A;
  --line: #2A2724;
  --line-2: #3B3835;
  --text: #E6DACC;
  --text-2: #CFC4B6;
  --muted: #8C857C;
  --ink: var(--orange);
  --hdr-solid: rgba(9, 8, 7, .72);
  --field-bg: rgba(0, 0, 0, .35);
  --field-line: rgba(255, 255, 255, .14);
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-ar);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; line-height: 1.25; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--orange); color: #000; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- type helpers ---------- */
.en { font-family: var(--f-en); letter-spacing: .01em; }
.eyebrow {
  font-family: var(--f-logo);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--ink);
}
.latin { font-family: var(--f-logo); direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }

.section-title {
  display: inline-grid;
  justify-items: center;
  gap: 10px;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
}
.section-title::after {
  content: "";
  width: 72px;
  height: 3px;
  border-radius: 3px;
  background: var(--orange);
}

/* ---------- icons ---------- */
.i {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.i--fill { fill: currentColor; stroke: none; }

/* ---------- buttons ---------- */
.btn {
  --h: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--h);
  padding: 0 22px;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn .i { width: 20px; height: 20px; }
.btn--primary { background: var(--orange); color: #0C0C0C; }
.btn--primary:hover { background: var(--orange-hover); box-shadow: 0 8px 24px rgba(226, 98, 31, .28); }
.btn--primary:active { background: var(--orange-press); }
.btn--outline { border: 1.5px solid color-mix(in srgb, var(--text) 70%, transparent); color: var(--text); }
.btn--outline:hover { border-color: var(--orange); color: var(--orange); }
.btn--ghost { color: var(--text-2); }
.btn--ghost:hover { color: var(--orange); }
.btn--dark { background: var(--surface-3); color: var(--text); border: 1px solid var(--line-2); }
.btn--dark:hover { border-color: var(--orange-line); }
.btn--pill { border-radius: var(--r-pill); }
.btn--lg { --h: 54px; padding: 0 32px; font-size: 17px; }
.btn--sm { --h: 38px; padding: 0 16px; font-size: 14px; }
.btn--block { width: 100%; }
.btn--icon { width: var(--h); padding: 0; border-radius: var(--r-pill); }
.btn[disabled], .btn.is-disabled { background: var(--surface-3); color: var(--muted); box-shadow: none; cursor: not-allowed; border-color: transparent; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--orange);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.link-arrow .i { width: 18px; height: 18px; transition: translate .2s var(--ease); }
.link-arrow:hover .i { translate: calc(4px * var(--x)) 0; }

/* ---------- chips (filter tabs) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  font-family: var(--f-logo);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--text-2);
  transition: all .2s var(--ease);
}
.chip:lang(ar), .chip.is-ar { font-family: var(--f-ar); font-size: 13px; letter-spacing: 0; }
.chip:hover { color: var(--text); border-color: var(--text-2); }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #0C0C0C; }

/* ---------- size picker ---------- */
.sizes { display: flex; gap: 8px; justify-content: center; direction: ltr; }
.size {
  min-width: 38px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  font-family: var(--f-logo);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  transition: all .15s var(--ease);
}
.size:hover { border-color: var(--text-2); }
.size[aria-checked="true"] { border-color: var(--orange); color: var(--ink); background: var(--orange-soft); }
.size:disabled { color: var(--muted); border-style: dashed; text-decoration: line-through; cursor: not-allowed; opacity: .6; }
.sizes.is-shake { animation: shake .4s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.badge--new { background: var(--orange); color: #0C0C0C; }
.badge--sale { background: #E6DACC; color: #120d09; }
.badge--hot { background: #1A120C; color: var(--orange); border: 1px solid var(--orange-line); }
.badge--out { background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2); }
.badge--count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  justify-content: center;
  background: var(--orange);
  color: #0C0C0C;
  font-size: 11px;
  font-family: var(--f-logo);
  font-weight: 700;
}

/* ---------- price + rating ---------- */
.price { display: flex; align-items: baseline; justify-content: center; gap: 10px; font-weight: 600; }
.price .now { color: var(--ink); font-size: 16px; }
/* official Saudi Riyal sign — sized to the cap height of the text around it */
.sar { display: inline-block; width: auto; height: .84em; aspect-ratio: 1124.14 / 1256.39; fill: currentColor; vertical-align: -.06em; flex: none; }
.money { display: inline-flex; align-items: baseline; gap: 0; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.money .sar { align-self: center; height: .78em; }
.price .was { color: var(--muted); font-size: 13px; text-decoration: line-through; font-weight: 400; }
.stars { display: inline-flex; gap: 3px; color: var(--orange); }
.stars .i { width: 16px; height: 16px; }

/* ---------- product card ---------- */
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.pcard:hover { border-color: rgba(226, 98, 31, .35); transform: translateY(-3px); box-shadow: var(--shadow); }
.pcard__media {
  position: relative;
  display: block;
  aspect-ratio: 6 / 5;
  max-width: 100%;
  overflow: hidden;
  background: #0C0C0C;
}
.pcard__link { display: block; width: 100%; height: 100%; }
.pcard__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.pcard:hover .pcard__media img { transform: scale(1.04); }
.pcard__quick {
  position: absolute;
  inset-inline: 14px;
  bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  height: 36px;
  border-radius: var(--r-pill);
  background: rgba(16, 15, 14, .78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .16);
  font-size: 13px;
  font-weight: 500;
  color: #E6DACC;
  opacity: 0;
  transform: translateY(8px);
  transition: all .25s var(--ease);
}
.pcard__quick .i { width: 16px; height: 16px; }
.pcard:hover .pcard__quick, .pcard__quick:focus-visible, .pcard__link:focus-visible + .pcard__quick { opacity: 1; transform: none; }
.pcard__quick:hover { border-color: var(--orange); color: var(--orange); }
.pcard__wish {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #E6DACC;
  transition: color .2s, background .2s, transform .2s var(--ease);
}
.pcard__wish:hover { background: rgba(255, 255, 255, .06); }
.pcard__wish .i { width: 22px; height: 22px; }
.pcard__wish[aria-pressed="true"] { color: var(--orange); }
.pcard__wish[aria-pressed="true"] .i { fill: currentColor; }
.pcard__wish.is-pop { animation: pop .35s var(--ease); }
@keyframes pop { 50% { transform: scale(1.25); } }
.pcard__badge { position: absolute; top: 16px; inset-inline-end: 14px; z-index: 2; }
.pcard__body { display: grid; gap: 12px; padding: 14px 14px 16px; text-align: center; }
.pcard__name a:hover { color: var(--ink); }
.pcard__name {
  font-family: var(--f-ar);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  direction: ltr;
  unicode-bidi: isolate;
}
.pcard__meta { font-size: 12px; color: var(--muted); margin-top: -8px; }
.pcard__add { --h: 42px; border-radius: var(--r-xs); }
.pcard.is-soldout .pcard__media img { filter: grayscale(.85) brightness(.6); }
.pcard__soldout {
  position: absolute;
  inset-inline: 0;
  top: 44%;
  width: max-content;
  margin-inline: auto;
  padding: 6px 16px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, .7);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #E6DACC;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

/* ---------- payment badges ---------- */
.pays { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 302px; } /* always one straight line of five; the marks shrink instead of wrapping */ /* always one straight line: the marks shrink instead of wrapping */
.pay {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  height: auto;
  aspect-ratio: 54 / 34;
  border-radius: 2px;
  background: #fff;
  overflow: hidden;
}
.pay img { width: 78%; height: 62%; object-fit: contain; }
.pay--mastercard img { height: 70%; }
.pay--applepay img { height: 56%; }

/* ---------- toast ---------- */
.toasts {
  position: fixed;
  z-index: 90;
  inset-inline: 0;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
  padding-inline: 16px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: toast-in .35s var(--ease);
}
.toast .i { color: var(--orange); }
.toast.is-out { animation: toast-out .3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* a button waiting for the server */
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn--dark.is-busy::after { border-color: var(--line-2); border-top-color: var(--orange); }
@keyframes spin { to { transform: rotate(360deg); } }
