/* =====================================================================
   hi-tech coating — Hero Section (نسخة ثابتة)
   منقولة من مصدر React إلى CSS عادي — بلا Tailwind وبلا اعتماد خارجي.
   تُحمَّل فوق style.css ولا تُعدِّل أيًّا من أنماط الموقع المعتمدة.
   ===================================================================== */

:root, .hero-page {
  /* الارتفاع الفعلي للترويسة المعتمدة عند كل نقطة توقّف — يُضبط في CSS كي تكون
     أول رسمة صحيحة، ثم يُدقّقه hero.js بـResizeObserver. يمنع أي إزاحة (CLS). */
  --hero-h: 82px;
  --hero-midnight: #1A1A2E;
  --hero-coral: #C9314B;
  --hero-steel: #B9C0CA;
  --hero-ease: cubic-bezier(.23, 1, .32, 1);
}

/* التقاط التمرير — proximity كي لا يحتجز التذييل */
@media (max-width: 700px) { :root, .hero-page { --hero-h: 68px; } }

html.hero-snap { scroll-snap-type: y proximity; scroll-behavior: smooth; scroll-padding-top: var(--hero-h); }

.hero-scenes {
  position: relative;
  background: var(--hero-midnight);
  /* حجز الارتفاع الكامل قبل بناء المشاهد — يمنع أي إزاحة تخطيط (CLS) */
  min-height: calc(6 * (100svh - var(--hero-h)));
}
.hero-scenes:has(.hero-scene) { min-height: 0; }

/* عنوان الصفحة للقارئات الشاشية وترتيب العناوين */
.hero-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.hero-scene {
  position: relative;
  height: calc(100svh - var(--hero-h));
  min-height: 460px;
  overflow: hidden;
  isolation: isolate;
  scroll-snap-align: start;
}
/* الترويسة لاصقة، فالمحاذاة تُضبط عبر scroll-padding-top على حاوية التمرير (html) وحدها.
   نُلغي قاعدة [id]{scroll-margin-top:110px} العامة هنا كي لا تتضاعف الإزاحة. */
.hero-scenes .hero-scene[id] { scroll-margin-top: 0; }

.hero-scene .scene-media,
.hero-scene .scene-media img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-scene .scene-media { z-index: 0; overflow: hidden; }
.hero-scene .scene-media img { object-fit: cover; object-position: center; transform: scale(1.06); will-change: transform; }

.hero-scene .scene-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, var(--scene-overlay, rgba(14,17,29,.44)), rgba(15,18,30,.10) 58%, rgba(15,18,30,.62));
}
.hero-scene .scene-grain {
  position: absolute; inset: 0; z-index: 2; opacity: .16; pointer-events: none; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}

.hero-scene .scene-content {
  position: relative; z-index: 3;
  width: min(660px, 52vw);
  margin-inline-start: clamp(80px, 13vw, 250px);
  padding-top: clamp(120px, 20vh, 230px);
  color: #fff;
}
.hero-scene .scene-number {
  display: inline-flex; align-items: center; gap: 9px;
  color: rgba(255,255,255,.72); direction: ltr; font-size: 13px; letter-spacing: .09em;
}
.hero-scene .scene-number i { width: 28px; height: 1px; background: rgba(255,255,255,.48); }
.hero-scene .scene-category {
  display: flex; align-items: center; gap: 12px; margin-top: 18px;
  color: rgba(255,255,255,.80); font-size: 14px;
}
.hero-scene .scene-category b { width: 2px; height: 24px; background: var(--hero-coral); box-shadow: 0 0 12px rgba(201,49,75,.6); }
.hero-scene .scene-badge {
  display: inline-block; margin-top: 14px; padding: 5px 13px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.42); background: rgba(10,15,28,.42);
  color: #fff; font-size: 12px; letter-spacing: .06em;
}
.hero-scene h2.scene-title {
  max-width: 650px; margin: 22px 0 0; color: #fff;
  font-size: clamp(34px, 4.2vw, 60px); line-height: 1.18; font-weight: 700; letter-spacing: -.02em; text-wrap: balance;
}
.hero-scene .scene-text {
  max-width: 570px; margin: 20px 0 30px;
  color: rgba(255,255,255,.86); font-size: clamp(16px, 1.35vw, 22px); line-height: 1.6;
}
.hero-scene .scene-cta {
  display: inline-flex; align-items: center; gap: 14px; min-height: 52px; padding: 14px 24px;
  border-radius: 7px; background: var(--hero-coral); color: #fff; font-size: 16px; font-weight: 700;
  text-decoration: none; box-shadow: 0 12px 32px rgba(201,49,75,.28);
  transition: transform .2s var(--hero-ease), background .2s ease;
}
.hero-scene .scene-cta:hover { background: #df4059; transform: translateY(-3px); color: #fff; }
.hero-scene .scene-cta:active { transform: scale(.97); }
.hero-scene .cta-arrow { display: inline-block; }
html[dir="ltr"] .hero-scene .cta-arrow { transform: scaleX(-1); }

/* منطقة المنتجات — Placeholder */
.hero-scene .scene-products {
  position: absolute; z-index: 4;
  inset-inline-end: clamp(24px, 6vw, 112px);
  bottom: clamp(72px, 10vh, 112px);
  width: min(420px, 32vw); padding: 18px;
  border: 1px solid rgba(255,255,255,.24); border-radius: 12px;
  background: rgba(10,15,28,.34); backdrop-filter: blur(10px);
}
.hero-scene .scene-product-placeholder { display: flex; align-items: center; gap: 15px; }
.hero-scene .placeholder-mark {
  flex: 0 0 66px; width: 66px; height: 86px; border: 1px dashed rgba(255,255,255,.56);
  border-radius: 6px; background: linear-gradient(160deg, transparent 45%, rgba(255,255,255,.10));
}
.hero-scene .placeholder-label { display: block; color: var(--hero-coral); font-size: 10px; }
.hero-scene .scene-product-placeholder strong { display: block; margin-top: 5px; color: #fff; font-size: 14px; }
.hero-scene .scene-product-placeholder small { display: block; margin-top: 6px; color: rgba(255,255,255,.58); font-size: 10px; }

/* مؤشر التمرير */
.hero-scene .scroll-indicator {
  position: absolute; z-index: 5; inset-inline-start: clamp(24px, 6vw, 112px); bottom: 30px;
  display: inline-flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.58); font-size: 11px; transition: opacity .3s ease;
}
.hero-page.is-scrolled .scroll-indicator { opacity: 0; }
.hero-scene .mouse { position: relative; width: 17px; height: 26px; border: 1px solid rgba(255,255,255,.6); border-radius: 10px; }
.hero-scene .wheel { position: absolute; top: 5px; inset-inline-start: 7px; width: 2px; height: 5px; border-radius: 4px; background: var(--hero-coral); animation: heroWheel 1.8s infinite var(--hero-ease); }
@keyframes heroWheel { 0%, 100% { opacity: .3; transform: translateY(0); } 45% { opacity: 1; transform: translateY(6px); } }

/* مؤشرات المشاهد الجانبية */
.hero-progress {
  position: fixed; z-index: 900; top: 50%; inset-inline-end: clamp(20px, 3vw, 56px);
  transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.hero-progress button {
  width: 46px; height: 34px; display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 0; border: 0; color: rgba(255,255,255,.42); background: transparent; cursor: pointer;
}
.hero-progress button span { font-size: 10px; opacity: 0; transition: opacity .25s ease, color .25s ease; }
.hero-progress button::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; transition: width .25s ease, height .25s ease, border-radius .25s ease; }
.hero-progress button:hover span, .hero-progress button.is-active span { opacity: 1; }
.hero-progress button.is-active { color: var(--hero-coral); }
.hero-progress button.is-active::after { width: 22px; height: 2px; border-radius: 0; }
.hero-progress button:focus-visible { outline: 2px solid var(--hero-coral); outline-offset: 4px; }

@media (max-width: 1100px) {
  .hero-scene .scene-content { margin-inline-start: 64px; width: min(600px, 62vw); }
  .hero-scene .scene-products { width: 340px; }
}
@media (max-width: 767px) {
  .hero-scene { height: calc(100svh - var(--hero-h)); }
  .hero-scene .scene-media img { transform: scale(1.03); }
  .hero-scene .scene-overlay { background: linear-gradient(180deg, rgba(12,15,27,.25), rgba(12,15,27,.16) 36%, rgba(12,15,27,.82) 82%); }
  .hero-scene .scene-content {
    position: absolute; inset-inline: 20px; bottom: 152px; width: auto; margin-inline-start: 0; padding-top: 0;
  }
  .hero-scene .scene-number { font-size: 11px; }
  .hero-scene .scene-category { margin-top: 12px; font-size: 12px; }
  .hero-scene .scene-category b { height: 20px; }
  .hero-scene h2.scene-title { max-width: 100%; margin-top: 14px; font-size: clamp(28px, 8.4vw, 40px); line-height: 1.2; }
  .hero-scene .scene-text { max-width: 100%; margin: 14px 0 20px; font-size: 15px; line-height: 1.55; }
  .hero-scene .scene-cta { min-height: 48px; padding: 12px 18px; font-size: 15px; }
  .hero-scene .scene-products { position: static; width: auto; margin: 16px 0 0; padding: 11px 12px; backdrop-filter: none; }
  .hero-scene .placeholder-mark { flex-basis: 44px; width: 44px; height: 56px; }
  .hero-scene .scene-product-placeholder strong { font-size: 11px; }
  /* المنطقة السفلية على الموبايل مشغولة بشريط عرض السعر (0–62px)
     وزر واتساب (88–142px) وزر العودة للأعلى — نرفع محتوى المشهد فوقها كلها. */
  .hero-scene .scroll-indicator { display: none; }
  .hero-progress {
    top: auto; bottom: 72px; inset-inline: 0;
    justify-content: center; transform: none; flex-direction: row; gap: 6px;
  }
  /* هدف لمس ≥ 24×24 مع تباعد كافٍ (WCAG 2.2 — Target Size) */
  .hero-progress button { width: 30px; height: 44px; justify-content: center; }
  .hero-progress button span { display: none; }
  .hero-progress button.is-active::after { width: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html.hero-snap { scroll-behavior: auto; }
  .hero-scene .scene-media img { transform: none !important; }
  .hero-scene .wheel { animation: none; }
}
