/* ================================================================
   CORE CARE — التنسيقات النهائية المتكاملة
   تجمع بين:
     1. CCX بانر سينمائي (القسم الأول)
     2. Scroll Story (القسم الثاني)
     3. تنسيقات مساعدة (Header, General)

   ضعه في: تخصيص الثيم ← الأكواد المخصّصة ← CSS
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

/* ============================================================
   1. المتغيرات العامة
   ============================================================ */
:root {
  --green: #1b4332;
  --green2: #2d6a4f;
  --gold: #d4af37;
  --gold2: #b8912b;
  --pink: #f8e8ee;
  --cream: #f5f0eb;
  --ink: #17251f;
  --font: var(--font-main, "DINNextLTArabic"), "Tajawal", system-ui, sans-serif;
  --e: cubic-bezier(.22, 1, .36, 1);
  --p: 0;
  --sp: 0;
}

/* ============================================================
   2. CCX BANNER (القسم الأول)
   ============================================================ */

.ccx {
  direction: rtl;
  font-family: var(--font);
  color: var(--ink);
  position: relative;
  isolation: isolate;
}

.ccx__track {
  position: relative;
  height: 360vh;
}

.ccx__stage {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1.25rem, 6vw, 6rem);
  opacity: calc(1 - (max(var(--p), .88) - .88) * 12);
  transition: opacity 0.3s ease;
}

.ccx__stage.is-fixed {
  position: fixed;
  z-index: 20;
}

.ccx__stage.is-bottom {
  position: absolute;
  top: auto;
  bottom: 0;
}

/* خلفيات CCX */
.ccx__bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: 0;
  transition: opacity 1s var(--e);
}

.ccx__bg--1 {
  opacity: 1;
  background:
    radial-gradient(1100px 620px at 80% 14%, rgba(212, 175, 55, .20), transparent 60%),
    radial-gradient(900px 700px at 10% 90%, rgba(45, 106, 79, .14), transparent 62%),
    linear-gradient(135deg, #ffffff 0%, var(--pink) 48%, var(--cream) 100%);
}

.ccx__bg--2 {
  background:
    radial-gradient(1000px 700px at 74% 26%, rgba(212, 175, 55, .22), transparent 58%),
    linear-gradient(140deg, #eef1e6 0%, #e7ddc8 55%, var(--cream) 100%);
}

.ccx__bg--3 {
  background:
    radial-gradient(1000px 720px at 78% 22%, rgba(212, 175, 55, .30), transparent 56%),
    linear-gradient(150deg, #14322a 0%, var(--green) 52%, #0d221b 100%);
}

.ccx__stage[data-scene="0"] .ccx__bg--1,
.ccx__stage[data-scene="1"] .ccx__bg--2,
.ccx__stage[data-scene="2"] .ccx__bg--3 {
  opacity: 1;
}

.ccx__stage[data-scene="1"] .ccx__bg--1,
.ccx__stage[data-scene="2"] .ccx__bg--1 {
  opacity: 0;
}

.ccx__grain {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .4;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

.ccx__stage[data-scene="2"] {
  color: #f3efe9;
}

/* أجرام عائمة CCX */
.ccx__orbs {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transform: translateY(calc(var(--p) * -60px));
}

.ccx__orbs i {
  position: absolute;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, var(--pink) 34%, rgba(212, 175, 55, .55));
  opacity: .32;
  filter: blur(2px);
  animation: ccxFloat var(--t) ease-in-out infinite alternate;
}

@keyframes ccxFloat {
  to {
    transform: translate3d(0, -42px, 0) scale(1.12);
  }
}

/* شبكة CCX */
.ccx__grid {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
}

/* طبقات CCX */
.ccx__layer {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--e), transform .7s var(--e);
  pointer-events: none;
}

.ccx__layer.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.ccx__eyebrows {
  position: relative;
  height: 2.6rem;
}

.ccx__eyebrow {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  width: max-content;
  padding: .5rem 1.05rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
  color: var(--green2);
  background: rgba(255, 255, 255, .7);
  border: 1px solid rgba(27, 67, 50, .14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ccx__stage[data-scene="2"] .ccx__eyebrow {
  color: #f6ecc9;
  background: rgba(255, 255, 255, .08);
  border-color: rgba(212, 175, 55, .3);
}

.ccx__eyebrow b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, .25);
  animation: ccxPulse 2.4s infinite;
}

@keyframes ccxPulse {
  50% {
    box-shadow: 0 0 0 9px rgba(212, 175, 55, 0);
  }
}

.ccx__titles {
  position: relative;
  height: clamp(9rem, 20vw, 15rem);
  margin: 1.1rem 0 .6rem;
}

.ccx__title {
  position: absolute;
  inset: 0;
  margin: 0;
  font-weight: 900;
  line-height: 1.05;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  color: var(--green);
  display: flex;
  flex-wrap: wrap;
  gap: .1em .28em;
  align-content: flex-start;
}

.ccx__stage[data-scene="2"] .ccx__title {
  color: #fff;
}

.ccx__title span {
  display: inline-block;
}

.ccx__title .is-outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--green2);
}

.ccx__stage[data-scene="2"] .ccx__title .is-outline {
  -webkit-text-stroke-color: var(--gold);
}

.ccx__title .is-gold {
  color: var(--gold);
}

.ccx__lede {
  max-width: 34ch;
  font-size: clamp(1rem, 1.5vw, 1.28rem);
  line-height: 1.95;
  color: #41554b;
}

.ccx__stage[data-scene="2"] .ccx__lede {
  color: #cdddce;
}

.ccx__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.6rem;
}

.ccx__btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 54px;
  padding: 0 1.6rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .25s var(--e), box-shadow .25s;
}

.ccx__btn em {
  font-style: normal;
  transition: transform .25s;
}

.ccx__btn:hover em {
  transform: translate(-4px, 4px);
}

.ccx__btn--primary {
  background: linear-gradient(135deg, var(--green), var(--green2));
  color: #fff;
  box-shadow: 0 14px 30px rgba(27, 67, 50, .26);
}

.ccx__btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(27, 67, 50, .32);
}

.ccx__btn--ghost {
  border: 1px solid rgba(27, 67, 50, .24);
  color: var(--green);
  background: rgba(255, 255, 255, .72);
}

.ccx__stage[data-scene="2"] .ccx__btn--ghost {
  color: #f3efe9;
  border-color: rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .08);
}

.ccx__btn--ghost:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
}

.ccx__rip {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, .5);
  transform: translate(-50%, -50%) scale(0);
  animation: ccxRip .6s ease-out forwards;
}

@keyframes ccxRip {
  to {
    transform: translate(-50%, -50%) scale(16);
    opacity: 0;
  }
}

.ccx__visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 470px;
  margin: auto;
  transform: translateY(calc(var(--p) * 40px));
}

.ccx__halo {
  position: absolute;
  width: 92%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, .9), rgba(248, 232, 238, .5) 45%, transparent 70%);
  filter: blur(6px);
  animation: ccxHalo 8s ease-in-out infinite;
}

@keyframes ccxHalo {
  50% {
    transform: scale(1.06);
  }
}

.ccx__stack {
  position: relative;
  width: 74%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: rotate(calc(var(--p) * 6deg));
  animation: ccxSway 9s ease-in-out infinite;
}

@keyframes ccxSway {
  50% {
    transform: translateY(-10px) rotate(calc(var(--p) * 6deg));
  }
}

.ccx__obj {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.ccx__obj svg {
  width: 74%;
  height: auto;
  filter: drop-shadow(0 26px 44px rgba(27, 67, 50, .32));
}

.ccx__cap {
  position: absolute;
  bottom: 1%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 3;
}

.ccx__cap small {
  display: block;
  font-size: .64rem;
  letter-spacing: .42em;
  font-weight: 800;
  color: var(--green2);
}

.ccx__stage[data-scene="2"] .ccx__cap small {
  color: #e9dca8;
}

.ccx__sub2 {
  position: relative;
  display: block;
  height: 1.5rem;
  margin-top: .25rem;
}

.ccx__sub2 em {
  position: absolute;
  inset: 0;
  font-style: normal;
  font-weight: 800;
  font-size: 1rem;
  color: var(--gold);
  white-space: nowrap;
  transform: translateX(-50%);
  left: 50%;
  width: max-content;
}

/* أيقونات CCX المكبرة */
.ccx__mini {
  position: absolute;
  width: 70px !important;
  height: 70px !important;
  display: grid;
  place-items: center;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 12px 24px rgba(27, 67, 50, .18);
  color: var(--gold);
  font-size: 40px !important;
  animation: ccxFloat 7s ease-in-out infinite alternate;
}

.ccx__mini svg {
  width: 40px !important;
  height: 40px !important;
}

.ccx__mini--1 {
  top: 8%;
  right: 0;
}

.ccx__mini--2 {
  bottom: 16%;
  left: -2%;
  animation-delay: -2s;
}

.ccx__mini--3 {
  top: 46%;
  left: -7%;
  animation-delay: -4s;
  font-size: 40px !important;
}

.ccx__note {
  position: absolute;
  padding: 12px 20px !important;
  border-radius: 60px !important;
  font-size: 18px !important;
  font-weight: 800;
  color: var(--green);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 16px 32px rgba(27, 67, 50, .2) !important;
  white-space: nowrap;
}

.ccx__note--a {
  top: 16%;
  right: -4%;
}

.ccx__note--b {
  bottom: 18%;
  left: -6%;
}

.ccx__rail {
  position: absolute;
  bottom: clamp(1rem, 4vh, 2.2rem);
  right: clamp(1.25rem, 6vw, 6rem);
  left: clamp(1.25rem, 6vw, 6rem);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  z-index: 2;
}

.ccx__steps {
  display: flex;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-shrink: 0;
}

.ccx__steps li {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-weight: 800;
  font-size: 18px !important;
  color: #9aa8a0;
  transition: .4s;
}

.ccx__stage[data-scene="2"] .ccx__steps li {
  color: rgba(255, 255, 255, .5);
}

.ccx__steps li b {
  display: grid;
  place-items: center;
  width: 38px !important;
  height: 38px !important;
  border-radius: 12px !important;
  font-size: 16px !important;
  background: rgba(27, 67, 50, .1);
  color: var(--green2);
  transition: .4s;
}

.ccx__steps li.is-active {
  color: var(--green);
}

.ccx__stage[data-scene="2"] .ccx__steps li.is-active {
  color: #fff;
}

.ccx__steps li.is-active b {
  background: var(--gold);
  color: #3a2d05;
  transform: scale(1.08);
}

.ccx__bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(27, 67, 50, .14);
  overflow: hidden;
}

.ccx__stage[data-scene="2"] .ccx__bar {
  background: rgba(255, 255, 255, .2);
}

.ccx__bar span {
  display: block;
  height: 100%;
  width: calc(var(--p) * 100%);
  background: linear-gradient(90deg, var(--gold), var(--green2));
  border-radius: 2px;
}

.ccx__cue {
  position: absolute;
  left: 50%;
  bottom: 5.2rem;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  z-index: 2;
  font-weight: 700;
  font-size: 18px !important;
  color: var(--green2);
  opacity: calc(1 - var(--p) * 6);
}

.ccx__cue i {
  width: 32px !important;
  height: 56px !important;
  border-radius: 18px !important;
  border: 3px solid currentColor;
  position: relative;
  opacity: .6;
}

.ccx__cue i:before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 6px !important;
  height: 14px !important;
  margin-left: -3px;
  border-radius: 2px;
  background: currentColor;
  animation: ccxCue 1.6s ease-in-out infinite;
}

@keyframes ccxCue {
  50% {
    transform: translateY(11px);
    opacity: .3;
  }
}

/* طبقة الانتقال السينمائية CCX */
.ccx__transition {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 100%, rgba(212, 175, 55, 0.15), transparent 60%),
    radial-gradient(circle at 30% 80%, rgba(45, 106, 79, 0.10), transparent 50%),
    linear-gradient(to bottom,
      transparent 0%,
      rgba(27, 67, 50, 0.08) 40%,
      rgba(245, 240, 235, 0.25) 70%,
      rgba(245, 240, 235, 0.60) 85%,
      rgba(245, 240, 235, 0.92) 100%
    );
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity;
}

.ccx__stage[data-progress="end"] .ccx__transition {
  opacity: 1;
}

.ccx__transition-symbol {
  position: absolute;
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(212, 175, 55, 0.20);
  font-size: 80px;
  font-weight: 900;
  letter-spacing: 8px;
  white-space: nowrap;
  user-select: none;
  opacity: 0.6;
  animation: ccxSymbolPulse 4s ease-in-out infinite;
}

@keyframes ccxSymbolPulse {
  0%,
  100% {
    opacity: 0.4;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translateX(-50%) scale(1.04);
  }
}

.ccx__transition-glow {
  position: absolute;
  bottom: -10%;
  left: 50%;
  width: 80%;
  height: 40%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at 50% 100%, rgba(212, 175, 55, 0.15), transparent 70%);
  filter: blur(40px);
  opacity: 0;
  transition: opacity 1.2s ease;
}

.ccx__stage[data-progress="end"] .ccx__transition-glow {
  opacity: 1;
}

/* دخول أولي CCX */
.ccx__copy>*,
.ccx__visual {
  animation: ccxIn .9s var(--e) both;
}

.ccx__eyebrows {
  animation-delay: .05s;
}

.ccx__titles {
  animation-delay: .15s;
}

.ccx__lede {
  animation-delay: .3s;
}

.ccx__actions {
  animation-delay: .42s;
}

.ccx__visual {
  animation-delay: .25s;
}

@keyframes ccxIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   3. SCROLL STORY (القسم الثاني) — مع إصلاحات المشاكل
   ============================================================ */

.cc-scroll-story,
.cc-scroll-story * {
  box-sizing: border-box;
}

.cc-scroll-story {
  --cc-ink: #102f27;
  --cc-ink-dark: #0b2b22;
  --cc-white: #fffdf9;
  --cc-tone: #d8c6b9;
  position: relative;
  height: 440vh;
  margin: 0;
  color: var(--cc-white);
  background: var(--cc-ink);
  isolation: isolate;
  font-family: inherit;
}

.cc-story__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 680px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,.06), transparent 28%),
    linear-gradient(135deg, var(--cc-ink-dark), #173f34 58%, #0d2922);
}

.cc-story__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8,34,27,.08), rgba(8,34,27,.84) 72%);
  pointer-events: none;
}

.cc-story__aurora {
  position: absolute;
  right: 37%;
  top: 50%;
  width: 55vw;
  height: 55vw;
  border-radius: 50%;
  background:
    conic-gradient(
      from 25deg,
      transparent,
      var(--cc-tone, #d8c6b9),
      transparent 36%,
      rgba(255,255,255,.13),
      transparent 70%
    );
  filter: blur(70px);
  opacity: .32;
  transform:
    translate(50%, -50%)
    rotate(calc(var(--cc-progress, 0) * 70deg));
  transition: background .8s ease;
  will-change: transform;
}

.cc-story__watermark {
  position: absolute;
  left: -2vw;
  bottom: -5vw;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,.08);
  font-size: clamp(90px, 15vw, 250px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.06em;
  white-space: nowrap;
  user-select: none;
}

.cc-story__counter {
  position: absolute;
  top: 16%;
  left: 6.5vw;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  color: rgba(255,255,255,.55);
}

.cc-story__counter strong {
  color: var(--cc-tone, #d8c6b9);
  font-size: clamp(52px, 5vw, 76px);
  font-weight: 700;
  line-height: .8;
  transition: color .7s ease;
}

.cc-story__counter span {
  font-size: 12px;
  letter-spacing: .18em;
}

.cc-story__visual {
  position: absolute;
  right: 10%;
  top: 50%;
  width: min(42vw, 600px);
  height: min(66vh, 670px);
  display: grid;
  place-items: center;
  transform: translateY(-50%);
}

.cc-story__visual::after {
  content: "";
  position: absolute;
  bottom: 2%;
  width: 54%;
  height: 8%;
  border-radius: 50%;
  background: #000;
  filter: blur(25px);
  opacity: .32;
}

.cc-story__image {
  position: absolute;
  z-index: 3;
  width: 48%;
  height: 74%;
  border-radius: 170px 170px 24px 24px;
  object-fit: cover;
  box-shadow: 0 45px 90px rgba(0,0,0,.34);
  opacity: 0;
  filter: saturate(.72);
  transform: translateY(50px) scale(.84) rotate(8deg);
  transition:
    opacity .7s ease,
    transform 1.05s cubic-bezier(.16,1,.3,1),
    filter .7s ease;
  will-change: transform, opacity;
}

.cc-story__image.is-active {
  opacity: 1;
  filter: saturate(.92);
  transform: translateY(0) scale(1) rotate(-3deg);
}

.cc-story__ring {
  position: absolute;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  animation: ccStorySpin 22s linear infinite;
}

.cc-story__ring--one {
  inset: 5%;
  border-style: dashed;
}

.cc-story__ring--two {
  inset: 15%;
  animation-direction: reverse;
  animation-duration: 16s;
}

.cc-story__orbit {
  position: absolute;
  z-index: 5;
  left: 5%;
  top: 18%;
  padding: 11px 18px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 11px;
  transition: opacity .25s ease, transform .5s ease;
}

.cc-story__nav {
  position: absolute;
  z-index: 7;
  right: 4vw;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  transform: translateY(-50%);
}

.cc-story__nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px;
  border: 0;
  color: rgba(255,255,255,.38);
  background: transparent;
  font: inherit;
  font-size: 9px;
  white-space: nowrap;
  cursor: pointer;
  transition: color .5s ease, transform .5s ease;
}

.cc-story__nav i {
  width: 18px;
  height: 1px;
  background: currentColor;
  transition: width .5s ease, background .5s ease;
}

.cc-story__nav button:hover,
.cc-story__nav button:focus-visible {
  color: #fff;
}

.cc-story__nav button:focus-visible {
  outline: 1px solid var(--cc-tone, #d8c6b9);
  outline-offset: 6px;
}

.cc-story__nav button.is-active {
  color: #fff;
  transform: translateX(-7px);
}

.cc-story__nav button.is-active i {
  width: 42px;
  background: var(--cc-tone, #d8c6b9);
}

.cc-story__scroll-note {
  position: absolute;
  right: 50%;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: rgba(255,255,255,.55);
  font-size: 9px;
  letter-spacing: .08em;
  transform: translateX(50%);
}

.cc-story__scroll-note i {
  display: block;
  width: 1px;
  height: 28px;
  background: var(--cc-tone, #d8c6b9);
  animation: ccStoryScrollCue 1.8s infinite;
}

.cc-story__chapters {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

/* ===== إصلاح: جعل كل الفصول مرئية وبلون موحد ===== */
.cc-story__chapter {
  width: 44%;
  height: 110vh;
  margin-right: auto;
  padding: 0 8vw 0 4vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0.12;
  transform: translateY(70px);
  transition: opacity .65s ease, transform .8s ease;
}

.cc-story__chapter.is-active {
  opacity: 1;
  transform: none;
}

/* ===== إصلاح: جعل جميع النصوص بيضاء وواضحة ===== */
.cc-story__chapter > span {
  color: var(--cc-tone, #d8c6b9) !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  opacity: 1 !important;
}

.cc-story__chapter h2 {
  max-width: 700px;
  margin: 20px 0 24px;
  color: #ffffff !important;
  font-size: clamp(46px, 5vw, 82px);
  font-weight: 700;
  line-height: 1.05;
  opacity: 1 !important;
}

.cc-story__chapter p {
  max-width: 500px;
  margin: 0;
  color: #cbd6d1 !important;
  font-size: 15px;
  line-height: 2;
  opacity: 1 !important;
}

.cc-story__chapter a {
  width: max-content;
  margin-top: 18px;
  padding-bottom: 9px;
  display: inline-flex;
  align-items: center;
  gap: 38px;
  border-bottom: 1px solid rgba(255,255,255,.7);
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none !important;
  pointer-events: auto;
  transition: gap .3s ease, color .3s ease;
}

.cc-story__chapter a:hover {
  gap: 48px;
  color: var(--cc-tone, #d8c6b9) !important;
}

.cc-story__chapter b {
  font-size: 20px;
}

@keyframes ccStorySpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ccStoryScrollCue {
  0% {
    transform-origin: top;
    transform: scaleY(0);
  }
  50% {
    transform-origin: top;
    transform: scaleY(1);
  }
  51% {
    transform-origin: bottom;
  }
  100% {
    transform-origin: bottom;
    transform: scaleY(0);
  }
}

/* ============================================================
   4. توافق مع الجوال (لكلا القسمين)
   ============================================================ */

@media (max-width: 820px) {

  /* CCX - موبايل */
  .ccx__track {
    height: 300vh;
  }

  .ccx__grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .ccx__copy {
    order: 2;
  }

  .ccx__visual {
    order: 1;
    max-width: min(70vw, 300px);
  }

  .ccx__eyebrows {
    display: flex;
    justify-content: center;
    height: 2.4rem;
  }

  .ccx__eyebrow {
    position: absolute;
  }

  .ccx__titles {
    height: clamp(8rem, 34vw, 11rem);
  }

  .ccx__title {
    justify-content: center;
  }

  .ccx__actions {
    justify-content: center;
  }

  .ccx__lede {
    margin-inline: auto;
  }

  .ccx__note {
    display: none;
  }

  .ccx__cue {
    display: none;
  }

  .ccx__rail {
    flex-direction: column;
    align-items: stretch;
    gap: .6rem;
  }

  .ccx__steps {
    justify-content: center;
  }

  .ccx__mini {
    width: 50px !important;
    height: 50px !important;
  }

  .ccx__mini svg {
    width: 28px !important;
    height: 28px !important;
  }

  .ccx__mini--3 {
    font-size: 28px !important;
  }

  /* Scroll Story - موبايل */
  .cc-scroll-story {
    height: 420vh;
  }

  .cc-story__stage {
    min-height: 620px;
  }

  .cc-story__visual {
    right: 6%;
    top: 35%;
    width: 88vw;
    height: 47vh;
  }

  .cc-story__image {
    width: 42%;
    height: 76%;
  }

  .cc-story__chapter {
    width: 100%;
    height: 105vh;
    padding: 56vh 24px 50px;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
  }

  .cc-story__chapter h2 {
    margin: 12px 0;
    font-size: clamp(34px, 9vw, 44px);
  }

  .cc-story__chapter p {
    font-size: 13px;
    line-height: 1.8;
  }

  .cc-story__counter {
    top: 11%;
    left: 20px;
  }

  .cc-story__counter strong {
    font-size: 48px;
  }

  .cc-story__nav {
    right: 18px;
    top: 46%;
    gap: 13px;
  }

  .cc-story__nav span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .cc-story__nav i {
    width: 11px;
  }

  .cc-story__nav button.is-active i {
    width: 28px;
  }

  .cc-story__orbit {
    left: 9%;
    top: 12%;
  }

  .cc-story__scroll-note {
    display: none;
  }

  .cc-story__watermark {
    bottom: 2%;
    font-size: 27vw;
  }
}

@media (max-width: 480px) {
  .cc-story__visual {
    top: 33%;
    height: 43vh;
  }

  .cc-story__image {
    width: 48%;
    height: 72%;
  }

  .cc-story__chapter {
    padding-top: 54vh;
  }

  .cc-story__chapter h2 {
    font-size: 34px;
  }
}

/* ============================================================
   5. احترام تقليل الحركة (لكلا القسمين)
   ============================================================ */

@media (prefers-reduced-motion: reduce) {

  /* CCX */
  .ccx__track {
    height: auto;
  }

  .ccx__stage {
    position: static;
    height: auto;
    min-height: 92vh;
    opacity: 1 !important;
  }

  .ccx__orbs,
  .ccx__visual,
  .ccx__copy>* {
    transform: none !important;
    animation: none !important;
  }

  .ccx__stage [data-scene="0"] {
    opacity: 1 !important;
    transform: none !important;
  }

  .ccx__stage [data-scene]:not([data-scene="0"]) {
    display: none !important;
  }

  .ccx__bg {
    transition: none;
  }

  .ccx__transition {
    display: none !important;
  }

  /* Scroll Story */
  .cc-scroll-story {
    height: auto;
  }

  .cc-story__stage {
    display: none;
  }

  .cc-story__chapters {
    position: relative;
  }

  .cc-story__chapter {
    width: 100%;
    height: auto;
    min-height: 65vh;
    padding: 80px 8vw;
    opacity: 1 !important;
    transform: none !important;
    background: var(--cc-ink);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
  }

  .cc-story__chapter > span {
    color: #d8c6b9 !important;
  }

  .cc-story__chapter h2 {
    color: #ffffff !important;
  }

  .cc-story__chapter p {
    color: #cbd6d1 !important;
  }
}

/* ================================================================
   CORE CARE — تحسين الأيقونات والطبقة الانتقالية
   ================================================================ */

/* --- 1. تحسين الأيقونات (تتغير مع المشاهد) --- */

/* الحاوية الأساسية للأيقونات */
.ccx__mini-wrapper {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* الأيقونات بشكل عام */
.ccx__mini {
  position: absolute;
  width: 80px !important;
  height: 80px !important;
  display: grid;
  place-items: center;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 40px rgba(27, 67, 50, 0.20);
  color: var(--gold);
  font-size: 32px !important;
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, opacity, background, box-shadow;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ccx__mini svg {
  width: 36px !important;
  height: 36px !important;
  transition: all 0.6s ease;
}

/* ----- أيقونة القطرة (المشهد 0) ----- */
.ccx__mini--1 {
  top: 10%;
  right: 2%;
  transform: translate(0, 0) scale(1) rotate(0deg);
  opacity: 1;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 232, 238, 0.9));
  border-color: rgba(212, 175, 55, 0.2);
  box-shadow: 0 16px 40px rgba(45, 106, 79, 0.15), inset 0 0 30px rgba(212, 175, 55, 0.05);
}

.ccx__mini--1 svg path {
  fill: #2d6a4f;
  stroke: #d4af37;
  stroke-width: 1.5;
}

/* ----- أيقونة الورقة (المشهد 1) ----- */
.ccx__mini--2 {
  bottom: 18%;
  left: -4%;
  transform: translate(0, 0) scale(1) rotate(0deg);
  opacity: 1;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(235, 245, 235, 0.9));
  border-color: rgba(45, 106, 79, 0.2);
  box-shadow: 0 16px 40px rgba(45, 106, 79, 0.15), inset 0 0 30px rgba(45, 106, 79, 0.05);
}

.ccx__mini--2 svg path {
  fill: #1b4332;
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 1.3;
}

/* ----- أيقونة النجمة (المشهد 2) ----- */
.ccx__mini--3 {
  top: 48%;
  left: -8%;
  transform: translate(0, 0) scale(1) rotate(0deg);
  opacity: 1;
  font-size: 36px !important;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(212, 175, 55, 0.08));
  border-color: rgba(212, 175, 55, 0.3);
  box-shadow: 0 16px 40px rgba(212, 175, 55, 0.12), inset 0 0 40px rgba(212, 175, 55, 0.05);
  color: #d4af37;
}

/* ----- تغيرات الأيقونات حسب المشهد ----- */

/* المشهد 0: القطرة نشطة، الأخرى مخفية/مصغرة */
.ccx__stage[data-scene="0"] .ccx__mini--1 {
  transform: translate(0, 0) scale(1) rotate(0deg);
  opacity: 1;
  box-shadow: 0 16px 40px rgba(45, 106, 79, 0.25), 0 0 60px rgba(212, 175, 55, 0.08);
}

.ccx__stage[data-scene="0"] .ccx__mini--2,
.ccx__stage[data-scene="0"] .ccx__mini--3 {
  transform: translate(20px, -10px) scale(0.6) rotate(-10deg);
  opacity: 0.3;
  filter: grayscale(0.8);
}

/* المشهد 1: الورقة نشطة */
.ccx__stage[data-scene="1"] .ccx__mini--2 {
  transform: translate(0, 0) scale(1) rotate(0deg);
  opacity: 1;
  box-shadow: 0 16px 40px rgba(45, 106, 79, 0.25), 0 0 60px rgba(45, 106, 79, 0.08);
}

.ccx__stage[data-scene="1"] .ccx__mini--1,
.ccx__stage[data-scene="1"] .ccx__mini--3 {
  transform: translate(-20px, 10px) scale(0.6) rotate(10deg);
  opacity: 0.3;
  filter: grayscale(0.8);
}

/* المشهد 2: النجمة نشطة مع توهج */
.ccx__stage[data-scene="2"] .ccx__mini--3 {
  transform: translate(0, 0) scale(1) rotate(0deg);
  opacity: 1;
  box-shadow: 0 16px 40px rgba(212, 175, 55, 0.25), 0 0 80px rgba(212, 175, 55, 0.15);
  animation: ccxStarPulse 2s ease-in-out infinite;
}

.ccx__stage[data-scene="2"] .ccx__mini--1,
.ccx__stage[data-scene="2"] .ccx__mini--2 {
  transform: translate(30px, -10px) scale(0.5) rotate(-15deg);
  opacity: 0.2;
  filter: grayscale(0.9);
}

/* حركة النجمة النابضة */
@keyframes ccxStarPulse {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    box-shadow: 0 16px 40px rgba(212, 175, 55, 0.25), 0 0 80px rgba(212, 175, 55, 0.15);
  }
  50% {
    transform: scale(1.08) rotate(8deg);
    box-shadow: 0 16px 60px rgba(212, 175, 55, 0.35), 0 0 120px rgba(212, 175, 55, 0.25);
  }
}

/* --- 2. تحسين الطبقة الانتقالية (بديل اللون الأبيض) --- */

/* تقوية الطبقة الانتقالية */
.ccx__transition {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(212, 175, 55, 0.20), transparent 70%),
    radial-gradient(ellipse at 30% 80%, rgba(45, 106, 79, 0.12), transparent 50%),
    linear-gradient(to bottom,
      transparent 0%,
      rgba(27, 67, 50, 0.04) 30%,
      rgba(245, 240, 235, 0.15) 55%,
      rgba(245, 240, 235, 0.50) 75%,
      rgba(245, 240, 235, 0.88) 90%,
      rgba(245, 240, 235, 0.96) 100%
    );
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity;
}

/* تفعيل الطبقة في نهاية التمرير */
.ccx__stage[data-progress="end"] .ccx__transition {
  opacity: 1;
}

/* عنصر التوهج الذهبي في الطبقة */
.ccx__transition-glow {
  position: absolute;
  bottom: -5%;
  left: 50%;
  width: 90%;
  height: 45%;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at 50% 100%, rgba(212, 175, 55, 0.25), transparent 70%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.10), transparent 60%);
  filter: blur(50px);
  opacity: 0;
  transition: opacity 1.4s ease;
}

.ccx__stage[data-progress="end"] .ccx__transition-glow {
  opacity: 1;
}

/* شعار النهاية */
.ccx__transition-symbol {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(212, 175, 55, 0.15);
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 900;
  letter-spacing: 12px;
  white-space: nowrap;
  user-select: none;
  opacity: 0.4;
  animation: ccxSymbolPulse 4s ease-in-out infinite;
  text-shadow: 0 0 60px rgba(212, 175, 55, 0.05);
}

@keyframes ccxSymbolPulse {
  0%, 100% {
    opacity: 0.3;
    transform: translateX(-50%) scale(1);
    letter-spacing: 12px;
  }
  50% {
    opacity: 0.7;
    transform: translateX(-50%) scale(1.03);
    letter-spacing: 18px;
    color: rgba(212, 175, 55, 0.25);
  }
}

/* إضافة طبقة سفلية سوداء/خضراء تحت الطبقة الانتقالية لمنع اللون الأبيض */
.ccx__stage[data-progress="end"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 14;
  background: linear-gradient(to bottom, transparent 0%, var(--cc-ink, #102f27) 100%);
  opacity: 0.3;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

/* إضافة مؤشر نهاية القسم (خط ذهبي) */
.ccx__stage[data-progress="end"] .ccx__end-line {
  opacity: 1;
  transform: translateX(-50%) scaleX(1);
}

.ccx__end-line {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  max-width: 600px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.6), rgba(212, 175, 55, 0.3), transparent);
  z-index: 16;
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

/* ================================================================
   منع ظهور اللون الأبيض بين CCX ومكونات سلة
   ================================================================ */

/* 1. تأكد من أن خلفية الصفحة متناسقة */
body {
  background: #f5f0eb;
}

/* 2. جعل القسم المخصص يندمج مع مكونات سلة */
.ccx__stage[data-progress="end"] {
  opacity: 1 !important;
  z-index: 20;
}

/* 3. استهداف مكونات سلة التي تأتي بعد CCX مباشرة */
.ccx + *,
.ccx ~ * {
  position: relative;
  z-index: 10;
  margin-top: -2px;
  background: transparent !important;
}

/* 4. استهداف مكون التصنيفات أو home component تحديداً */
#ccx ~ .ccm-store-sections,
#ccx ~ div > .ccm-store-sections,
#ccx ~ [class*="container"]:has(.ccm-store-sections) {
  position: relative;
  z-index: 10;
  margin-top: -2px;
  background: transparent !important;
  padding-top: 1px;
}

/* 5. إذا كان المكون داخل div بخلاف ذلك */
.ccx + div:not(.cc-scroll-story) {
  position: relative;
  z-index: 10;
  margin-top: -2px;
  background: transparent !important;
}

/* 6. إزالة أي خلفيات بيضاء من مكونات سلة */
.ccm-store-sections,
.salla-container,
.container {
  background: transparent !important;
}

/* 7. جعل خلفية القسم التالي متناسقة مع نهاية الطبقة الانتقالية */
.ccx__stage[data-progress="end"] ~ .ccm-store-sections,
.ccx__stage[data-progress="end"] ~ div .ccm-store-sections {
  background: linear-gradient(to bottom, rgba(245, 240, 235, 0.96), #f5f0eb) !important;
  padding-top: 20px;
}
/* ================================================================
   إصلاح تناسق الانتقالات بين الأقسام في Scroll Story
   ================================================================ */

/* 1. جعل جميع الصور لها نفس سرعة الانتقال */
.cc-story__image {
  transition: opacity 0.7s ease, transform 1.05s cubic-bezier(.16, 1, .3, 1), filter 0.7s ease !important;
}

/* 2. جعل جميع الفصول لها نفس سرعة الانتقال */
.cc-story__chapter {
  transition: opacity 0.65s ease, transform 0.8s ease !important;
}

/* 3. التأكد من أن جميع الأقسام تظهر بنفس الطريقة */
.cc-story__chapter.is-active {
  opacity: 1 !important;
  transform: none !important;
}

/* 4. التأكد من أن الصور النشطة تظهر بنفس الطريقة */
.cc-story__image.is-active {
  opacity: 1 !important;
  filter: saturate(.92) !important;
  transform: translateY(0) scale(1) rotate(-3deg) !important;
}

/* 5. جعل جميع الصور غير النشطة لها نفس التموضع */
.cc-story__image:not(.is-active) {
  opacity: 0 !important;
  transform: translateY(50px) scale(.84) rotate(8deg) !important;
  filter: saturate(.72) !important;
}

/* 6. إزالة أي اختلافات بين الأقسام */
.cc-story__chapter > span,
.cc-story__chapter h2,
.cc-story__chapter p {
  transition: opacity 0.5s ease, transform 0.6s ease !important;
}

/* 7. جعل الأقسام غير النشطة لها نفس التموضع */
.cc-story__chapter:not(.is-active) {
  opacity: 0.12 !important;
  transform: translateY(70px) !important;
}

/* 8. ضمان أن الأورورا تتغير بسلاسة */
.cc-story__aurora {
  transition: background 0.8s ease, transform 0.8s ease !important;
}