/* ==========================================================
   كولكشن الشتا - Parallax
   الفهرس:
   1) المتغيرات (ألوان / أحجام)
   2) الأساسيات
   3) الـ Parallax (هيكل السيكشنز)
   4) المحتوى (منتج / نصوص / أزرار)
   5) التفاعل والحركة
   6) ثيم كل سيكشن (خلفية + لون التوهج)
   7) تقليل الحركة (Accessibility)
   ========================================================== */


/* ---------- 1) المتغيرات ---------- */
:root {
  --font-main: "Cairo", system-ui, sans-serif;
  --color-text: #fff;

  /* حجم المنتج */
  --product-width: min(72vw, 360px, 40vh);

  /* قوة الحركة (بالبكسل) - زوّد الرقم لحركة أكبر */
  --move-product: 16px;
  --move-background: 14px;
  --move-text: 6px;

  /* قوة تغبيش وتغميق الخلفية */
  --bg-blur: 30px;
  --bg-brightness: .90;
}


/* ---------- 2) الأساسيات ---------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #111;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
}


/* ---------- 3) الـ Parallax (متلمسهوش إلا لو عارف) ----------
   كل سيكشن absolute ومزاح بـ (--i × ارتفاع الشاشة).
   المحتوى fixed ومقصوص بـ clip، فالسيكشن اللي بعده بيغطي اللي قبله. */
.section {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100vh;
  top: calc(var(--i) * 100vh);
  z-index: calc(var(--i) + 1);
  overflow: hidden;
  clip: rect(0, auto, auto, 0);
  background-color: var(--bg, #1b1512);
  color: var(--fg, var(--color-text));
  box-shadow: inset 0 1px 80px rgba(0, 0, 0, .18);
}

/* طبقة الخلفية (الصورة) */
.section::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--photo, none) center / cover;
  filter: blur(var(--bg-blur)) brightness(var(--bg-brightness)) saturate(1.1);
  transform:
    translate3d(
      calc(var(--nx, 0) * var(--move-background) * -1),
      calc(var(--ny, 0) * -10px),
      0)
    scale(1.06);
  transition: transform .2s ease-out;
  will-change: transform;
}

/* طبقة التوهج الملوّن ورا المنتج */
/* .section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(ellipse 60% 42% at 50% 42%, var(--accent, transparent), transparent 70%);
} */

/* المحتوى الثابت في نص الشاشة */
.section__content {
  position: fixed;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}


/* ---------- 4) المحتوى ---------- */
/* المنتج */
.product {
  position: relative;
  width: var(--product-width);
  --pop: 0;
  cursor: pointer;
  filter: drop-shadow(0 28px 24px rgba(0, 0, 0, .35));
  will-change: transform;
}

.product img {
  display: block;
  width: 100%;
  height: auto;
}

/* ظل تحت المنتج */
.product::after {
  content: "";
  display: block;
  width: 70%;
  height: 16px;
  margin: 8px auto 0;
  background: radial-gradient(ellipse, rgba(0, 0, 0, .5), transparent 70%);
}

/* النصوص */
.section__title {
  margin: 0;
  font-size: clamp(28px, 6.5vw, 44px);
  font-weight: 900;
  line-height: 1.15;
}

.section__title--xl { font-size: clamp(34px, 8vw, 60px); }

.section__text {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(15px, 3.8vw, 18px);
  line-height: 1.7;
  opacity: .92;
}

.section__hint { font-size: 14px; opacity: .7; }

.section__price {
  padding: 6px 20px;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 700;
}

/* زرار الطلب */
.section__cta {
  display: inline-block;
  margin-top: 4px;
  padding: 12px 30px;
  border-radius: 999px;
  background: var(--fg, #fff);
  color: var(--bg);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.section__cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }


/* ---------- 5) التفاعل والحركة ----------
   المتغيرات دي بيحدّثها js/main.js:
   --nx / --ny : مكان الماوس أو ميل التليفون (من -1 لـ 1)
   --sp        : تقدّم السكرول في السيكشن (من -1 لـ 1)
   --sa        : القيمة المطلقة لـ --sp */
.product {
  transform:
    translate3d(
      calc(var(--nx, 0) * var(--move-product)),
      calc(var(--ny, 0) * 12px + var(--sp, 0) * -30px),
      0)
    rotate(calc(var(--sp, 0) * 6deg + var(--nx, 0) * 2deg))
    scale(calc(1 - var(--sa, 0) * .12 + var(--pop) * .05));
  transition: transform .18s ease-out;
}

.product:hover { --pop: 1; }

.section__content > :not(.product) {
  transform: translate3d(calc(var(--nx, 0) * var(--move-text)), calc(var(--sp, 0) * -14px), 0);
}


/* ---------- 6) ثيم كل سيكشن ----------
   --bg     : لون احتياطي لو الصورة مش موجودة
   --photo  : صورة الخلفية
   --accent : لون التوهج ورا المنتج (خليه قريب من ألوان الخلفية)
   --fg     : لون الكلام (اختياري) */
.section--intro { --bg: #1b1512; }

.section--shoe {
  --bg: #2f4a3d;
  --photo: url("../images/backgrounds/shoe-bg.jpg");
  --accent: rgba(70, 170, 120, .4);
}

.section--bag-daisy {
  --bg: #3a2438;
  --photo: url("../images/backgrounds/bag-daisy-bg.jpg");
  --accent: rgba(200, 80, 150, .4);
}

.section--bag-croc {
  --bg: #12283a;
  --photo: url("../images/backgrounds/bag-croc-bg.jpg");
  --accent: rgba(90, 160, 210, .4);
}

.section--cta { --bg: #0f0d0c; }


/* ---------- 7) تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  .product,
  .section::before,
  .section__content > * {
    transform: none !important;
    transition: none !important;
  }
}
