/* Everything below the hero: product card, before/after, steps, sticky button. Loaded without blocking the first paint. */
/* ---------- 8. product card (#serum): full-bleed photos + the card ---------- */
/* anchored sections stop one header-height from the top, so their first line is not under the pinned header.
   The full-bleed story starts at the very top instead: the header is transparent over it. */
section[id] { scroll-margin-top: var(--header-h); }
#commander { scroll-margin-top: calc(var(--header-h) + 24px); }
section.story,
section.pdp { scroll-margin-top: 0; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* #serum: the five photos are the background of the whole section; the white card floats over them on wide
   screens (end side: right, left in Arabic) and follows them as a plain white block on phones */
.pdp { position: relative; background: var(--bg); }
.pdp__media {
  position: relative;
  height: 60vh;
  height: 60svh;
  min-height: 340px;
  overflow: hidden;
  background: #1b1b1b;
}
.gallery__frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.gallery__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  /* once faded out, the next visit starts from the zoomed state again */
  transition: opacity .5s ease, transform 0s .5s;
}
.gallery__slide.is-active {
  opacity: 1;
  transform: scale(1);
  transition: opacity .5s ease, transform 1.4s ease-out;
}
.gallery__slide.is-active,
.gallery__slide.is-next { will-change: opacity; }
.gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
/* dots, same as the how-to story, on a dark pill so they read over light and dark photos */
.gallery__dots {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 14px;
  z-index: 3;
  display: flex;
  width: max-content;
  margin-inline: auto;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .32);
}
.gallery__dot { position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.gallery__dot::before {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  transition: background-color .2s, transform .2s;
}
.gallery__dot.is-active::before { background: #fff; transform: scale(1.25); }
.gallery__dot:focus-visible { outline-color: #fff; outline-offset: -6px; }

/* only the card catches the pointer: hover-pause and swipe work on the photo all around it */
.pdp__inner { position: relative; z-index: 2; pointer-events: none; }
.pdp__inner > * { pointer-events: auto; }

/* the info card: a plain white block under the photos on phones */
.card {
  min-width: 0;
  padding: 28px 24px 40px;
  background: var(--bg);
}
@media (min-width: 1024px) {
  .pdp {
    display: flex;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--header-h) + 40px) var(--gutter) 104px;
    background: #1b1b1b;
  }
  .pdp__media { position: absolute; inset: 0; height: auto; min-height: 0; }
  /* the photos run 20% past the start edge, so the products sit in the free space beside the card, not behind it */
  .gallery__frame { inset-inline-start: -20%; }
  .gallery__dots { inset-block-end: 28px; }
  .pdp__inner {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
  }
  /* floating over the photo as a glass card: same radius and padding as before */
  .card {
    width: min(500px, 42vw);
    padding: 32px;
    border-radius: 20px;
  }
}

/* ---------- glass card (wide screens only) ----------
   main.js measures the photo behind the card for each of the five images (once they have loaded) and sets
   data-mode="dark" (white text) or "light" (black text) on #serum, plus --glass, a tint just strong enough to keep
   the text at 5:1 or better over that photo. The colours are registered properties, so they cross-fade in .5s
   together with the photo; with reduced motion the global rule makes that a cut. */
@property --glass      { syntax: "<color>"; inherits: false; initial-value: rgba(255, 255, 255, .72); }
@property --card-ink   { syntax: "<color>"; inherits: true;  initial-value: #000; }
@property --card-ink-2 { syntax: "<color>"; inherits: true;  initial-value: #2B2B2B; }
@property --card-line  { syntax: "<color>"; inherits: true;  initial-value: rgba(0, 0, 0, .1); }
@property --card-chip  { syntax: "<color>"; inherits: true;  initial-value: rgba(0, 0, 0, .2); }
@property --card-edge  { syntax: "<color>"; inherits: true;  initial-value: rgba(0, 0, 0, .1); }
@media (min-width: 1024px) {
  .pdp .card {
    --card-ink: #000;
    --card-ink-2: #2B2B2B;
    --card-line: rgba(0, 0, 0, .1);
    --card-chip: rgba(0, 0, 0, .2);
    --card-edge: rgba(0, 0, 0, .1);
    --ink: var(--card-ink);
    --ink-2: var(--card-ink-2);
    color: var(--ink);
    background: var(--glass);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
            backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--card-edge);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .18), 0 2px 10px rgba(0, 0, 0, .08);
  }
  .pdp[data-mode="dark"] .card {
    --card-ink: #fff;
    --card-ink-2: rgba(255, 255, 255, .88);
    --card-line: rgba(255, 255, 255, .15);
    --card-chip: rgba(255, 255, 255, .3);
    --card-edge: rgba(255, 255, 255, .15);
  }
  /* the fade-up on scroll keeps its own transition; the colours ride along with the photo crossfade */
  html .pdp .card,
  html.motion .pdp .card.is-in {
    transition:
      opacity .6s ease-out, transform .6s ease-out,
      --glass .5s ease, --card-ink .5s ease, --card-ink-2 .5s ease, --card-line .5s ease, --card-chip .5s ease, --card-edge .5s ease;
  }
  .pdp .card .chips li,
  .pdp .card .size__opt span,
  .pdp .card .qty { border-color: var(--card-chip); }
  .pdp .card .size__opt input:checked + span { border-color: var(--card-ink); }
  .pdp .card .acc,
  .pdp .card .acc__item { border-color: var(--card-line); }
  .pdp .card .stars g:first-of-type { fill: var(--card-chip); }
  .pdp .card .stars g:last-of-type { fill: var(--card-ink); }
  /* the order button stays red with white text in both modes */
  .pdp .card .pill { color: var(--on-crimson); }
}
/* fades up once when it scrolls into view */
html.motion .card { opacity: 0; transform: translateY(24px); }
html.motion .card.is-in { opacity: 1; transform: none; transition: opacity .6s ease-out, transform .6s ease-out; }

.rating { display: flex; align-items: center; gap: 10px; }
.stars { display: block; width: 96px; height: auto; }
[dir="rtl"] .stars { transform: scaleX(-1); }
.rating__n { font-size: 1rem; font-weight: 600; }

.card__eyebrow {
  margin: 16px 0 0;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
}
html[lang="ar"] .card__eyebrow { letter-spacing: 0; font-size: 13px; }
.card__title {
  margin: 10px 0 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
html[lang="ar"] .card__title { font-family: var(--font-ar-head); font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.card__sub { margin: 6px 0 0; color: var(--ink-2); font-size: 1.0625rem; font-weight: 500; }
.card__price { margin: 18px 0 0; font-size: 1.6rem; font-weight: 700; line-height: 1.2; text-align: start; }
html[dir="rtl"] .card__price { text-align: right; }
.card__desc {
  max-width: 46ch;
  margin: 18px 0 0;
  color: var(--ink-2);
  line-height: 1.6;
}
html[lang="ar"] .card__desc { line-height: 1.8; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 5px 12px;
  border: 1px solid rgba(0, 0, 0, .25);
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.4;
}

.size { margin: 22px 0 0; padding: 0; border: 0; }
.size__opt { display: inline-block; cursor: pointer; }
.size__opt input { position: absolute; opacity: 0; pointer-events: none; }
.size__opt span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid rgba(0, 0, 0, .25);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
}
.size__opt input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.size__opt input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

.buy { display: flex; align-items: center; gap: 12px; margin-block-start: 22px; }
.qty {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, .25);
  border-radius: 999px;
}
.qty__btn {
  width: 44px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 1.4rem/1 var(--font-sans);
  cursor: pointer;
}
.qty__btn:disabled { opacity: .3; cursor: default; }
.qty__n { min-width: 28px; text-align: center; font-size: 1.0625rem; font-weight: 600; }
.buy__cta { flex: 1 1 auto; min-width: 0; }
.card__ship { margin: 12px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }

/* accordions: closed by default, a + that turns into a − */
.acc { margin-block-start: 26px; border-top: 1px solid rgba(0, 0, 0, .08); }
.acc__item { border-bottom: 1px solid rgba(0, 0, 0, .08); }
.acc__item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.acc__item summary::-webkit-details-marker { display: none; }
.acc__item summary::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
}
.acc__item[open] summary::after { content: "−"; }
.acc__item p { margin: 0 0 18px; color: var(--ink-2); line-height: 1.6; font-size: 1rem; }
html[lang="ar"] .acc__item p { line-height: 1.8; }
html[dir="rtl"] .acc__inci { text-align: right; }

@media (max-width: 480px) {
  .buy { flex-wrap: wrap; }
  .buy__cta { flex-basis: 100%; }
  .qty { width: 100%; justify-content: space-between; }
  .qty__btn { flex: 1 1 0; }
}

/* ---------- 9. before / after (#resultats) ---------- */
.results {
  padding: clamp(64px, 8vw, 120px) 24px;
  background: var(--bg);
}
.results__inner {
  display: grid;
  gap: 32px;
  max-width: 1200px;
  margin-inline: auto;
}
@media (min-width: 1024px) {
  .results__inner {
    grid-template-columns: 45fr 55fr;
    gap: 56px;
    align-items: center;
  }
}
.results__text { min-width: 0; }
.results__eyebrow {
  margin: 0;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
}
html[lang="ar"] .results__eyebrow { letter-spacing: 0; font-size: 13px; }
.results__title {
  margin: 14px 0 0;
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
html[lang="ar"] .results__title { font-family: var(--font-ar-head); font-weight: 700; letter-spacing: 0; line-height: 1.3; }

/* the comparison stays physical (before on the left, after on the right) in both languages */
.compare { min-width: 0; }
.compare__frame {
  --pos: 50%;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 20px;
  background: #F3F3F3;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
}
.compare__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.compare__after {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 var(--pos));
}
.compare__tag {
  position: absolute;
  inset-block-start: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
}
.compare__tag--before { left: 14px; }
.compare__tag--after { right: 14px; }
.compare__line {
  position: absolute;
  inset-block: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: #fff;
  pointer-events: none;
}
.compare__handle {
  position: absolute;
  inset-block-start: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9);
}
/* invisible, but it carries the keyboard and screen-reader behaviour; the drag is handled on the frame */
.compare__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.compare__range:focus-visible ~ .compare__line .compare__handle { outline: 3px solid var(--ink); outline-offset: 5px; box-shadow: 0 0 0 3px #fff; }
.compare__range:focus-visible ~ .compare__line { background: #fff; }

/* ---------- 10. how to use (#utilisation): a full-bleed photo per step, the text changes with it ---------- */
.story { background: var(--bg); }
.story__stage {
  --pad: clamp(24px, 6vw, 96px);
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #1b1b1b;
  color: #fff;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.story__slide { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.story__slide.is-active { z-index: 2; }

/* the photo: the new one fades in over the old one, which only disappears once it is covered (no dip) */
.story__bg {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0s .7s;
}
.story__slide.is-active .story__bg { opacity: 1; transition: opacity .7s ease; }
.story__bg picture { display: contents; }
.story__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.story__slide:nth-child(1) .story__img { object-position: 64% 30%; }
.story__slide:nth-child(2) .story__img { object-position: 72% 30%; }
.story__slide:nth-child(3) .story__img { object-position: 70% 30%; }
/* a soft scrim on the side where the text sits (the bottom on phones), so the photo is not flattened */
.story__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .5) 0, rgba(0, 0, 0, 0) 130px),
    linear-gradient(to right, rgba(0, 0, 0, .66) 0%, rgba(0, 0, 0, .5) 36%, rgba(0, 0, 0, 0) 72%),
    linear-gradient(to top, rgba(0, 0, 0, .4) 0%, rgba(0, 0, 0, 0) 45%);
}
[dir="rtl"] .story__bg::after {
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, .5) 0, rgba(0, 0, 0, 0) 130px),
    linear-gradient(to left, rgba(0, 0, 0, .66) 0%, rgba(0, 0, 0, .5) 36%, rgba(0, 0, 0, 0) 72%),
    linear-gradient(to top, rgba(0, 0, 0, .4) 0%, rgba(0, 0, 0, 0) 45%);
}

/* the text fades and rises 15px at the same moment the photo changes */
.story__text {
  position: absolute;
  inset-inline-start: var(--pad);
  inset-block-end: calc(var(--pad) + 40px);
  max-width: min(560px, calc(100% - 2 * var(--pad)));
  opacity: 0;
  transform: translateY(15px);
  transition: opacity .7s ease, transform .7s ease;
}
.story__slide.is-active .story__text { opacity: 1; transform: none; pointer-events: auto; }
.story__eyebrow {
  margin: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
}
html[lang="ar"] .story__eyebrow { letter-spacing: 0; font-size: 13px; }
.story__num {
  margin: 14px 0 0;
  font-size: clamp(3rem, 7vw, 6rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
}
.story__num span { font-size: .4em; letter-spacing: 0; opacity: .75; }
.story__title {
  margin: 12px 0 0;
  font-size: clamp(2.2rem, 4.4vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
html[lang="ar"] .story__title { font-family: var(--font-ar-head); font-weight: 700; letter-spacing: 0; line-height: 1.25; }
.story__desc {
  max-width: 38ch;
  margin: 14px 0 0;
  color: #fff;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.6;
}
html[lang="ar"] .story__desc { line-height: 1.8; }
.story__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.story__tags li {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.4;
}

/* step controls: arrows (desktop with a mouse), dots (always) */
.story__nav {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 18px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story__dots { display: flex; }
.story__dot { position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.story__dot::before {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  transition: background-color .2s, transform .2s;
}
.story__dot.is-active::before { background: #fff; transform: scale(1.25); }
.story__dot:focus-visible,
.story__arrow:focus-visible { outline-color: #fff; outline-offset: -4px; }
.story__arrow {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  background: rgba(0, 0, 0, .18);
  color: #fff;
  cursor: pointer;
}
.story__arrow:hover { background: rgba(255, 255, 255, .22); }
[dir="rtl"] .story__arrow svg { transform: scaleX(-1); }
@media (hover: hover) and (min-width: 1024px) {
  .story__arrow { display: grid; }
  .story__nav { gap: 14px; }
}

/* phones: the scrim comes up from the bottom, the text sits above the dots */
@media (max-width: 1023px) {
  .story__bg::after,
  [dir="rtl"] .story__bg::after {
    background:
      linear-gradient(to bottom, rgba(0, 0, 0, .5) 0, rgba(0, 0, 0, 0) 130px),
      linear-gradient(to top, rgba(0, 0, 0, .74) 0%, rgba(0, 0, 0, .58) 48%, rgba(0, 0, 0, 0) 86%);
  }
  .story__text { inset-block-end: 76px; }
}

/* reduced motion (and no script): no cycling, no pinning, three full-bleed blocks that scroll normally */
html:not(.motion) .story__stage { height: auto; min-height: 0; touch-action: auto; user-select: auto; }
html:not(.motion) .story__slide { position: relative; height: 100vh; height: 100svh; min-height: 560px; pointer-events: auto; }
html:not(.motion) .story__bg { opacity: 1; transition: none; }
html:not(.motion) .story__text { opacity: 1; transform: none; transition: none; }
html:not(.motion) .story__nav { display: none; }


/* ---------- 11. phones and tablets ---------- */
/* product card: title, price and the order button come first, the long text after */
@media (max-width: 1023px) {
  .card { display: flex; flex-direction: column; }
  .rating   { order: 0; }
  .card__eyebrow { order: 1; }
  .card__title   { order: 2; }
  .card__sub     { order: 3; }
  .card__price   { order: 4; }
  .size     { order: 5; }
  .buy      { order: 6; }
  .card__ship    { order: 7; }
  .card__desc    { order: 8; }
  .chips    { order: 9; }
  .acc      { order: 10; }
}

/* sticky WhatsApp bar: slides in when no order button is on screen */
.sticky-cta {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding: 0 24px env(safe-area-inset-bottom, 0px);
  background: var(--crimson);
  color: var(--on-crimson);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform .25s ease, visibility 0s .25s;
}
.sticky-cta.is-on { transform: none; visibility: visible; transition: transform .25s ease; }
.sticky-cta:hover { background: var(--crimson-hover); }
.sticky-cta:focus-visible { outline-color: #fff; outline-offset: -6px; }
@media (min-width: 1024px) { .sticky-cta { display: none; } }
