/* ============================================================================
 * style.css — نظام التصميم + أقسام الصفحة + Responsive
 * ----------------------------------------------------------------------------
 * موبايل أولاً · RTL بالكامل (خصائص منطقية margin-inline/padding-inline)
 * بلا خطوط خارجية (لا طلب شبكة) · بلا إطار عمل.
 * ========================================================================== */

/* ---------------- [TOKENS] --------------------------------------------- */
:root {
  /* ألوان */
  --c-bg:          #FFF9F7;
  --c-surface:     #FFFFFF;
  --c-ink:         #241A1E;
  --c-muted:       #6B5A61;
  --c-brand:       #C6375F;
  --c-brand-dark:  #9E2449;
  --c-brand-soft:  #FDECF0;
  --c-line:        #F0E1E4;
  --c-ok:          #1F7A54;

  /* مسافات */
  --sp-1: .35rem;  --sp-2: .6rem;  --sp-3: 1rem;
  --sp-4: 1.5rem;  --sp-5: 2.2rem; --sp-6: 3.4rem;

  /* أشكال وظلال */
  --r-sm: 8px; --r-md: 14px; --r-lg: 22px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(36,26,30,.06);
  --sh-2: 0 8px 28px rgba(36,26,30,.10);
  --sh-3: 0 18px 50px rgba(198,55,95,.22);

  /* حاوية */
  --wrap: 1120px;
  --wrap-narrow: 720px;

  /* خطوط: نظام مدمج فقط — لا طلب خارجي */
  --font: "Segoe UI", "Noto Sans Arabic", "Dubai", Tahoma, system-ui, -apple-system, sans-serif;
}

/* ---------------- [RESET] ---------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-ink);
  background: var(--c-bg);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 var(--sp-2); font-weight: 800; letter-spacing: -.01em; }
p { margin: 0 0 var(--sp-2); }
a { color: var(--c-brand-dark); }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--c-brand); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 0;
  background: var(--c-brand); color: #fff; padding: var(--sp-2) var(--sp-3);
  z-index: 50; border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { inset-inline-start: 0; }

/* ---------------- [LAYOUT] --------------------------------------------- */
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2rem, var(--wrap-narrow)); }
.section { padding-block: var(--sp-6); }
.section--tint { background: var(--c-brand-soft); }
.section__title { font-size: clamp(1.5rem, 4vw, 2.1rem); text-align: center; }
.section__sub { color: var(--c-muted); text-align: center; max-width: 56ch; margin-inline: auto; margin-bottom: var(--sp-5); }

/* ---------------- [BUTTONS] -------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .7rem 1.6rem;
  font: inherit; font-weight: 800; font-size: 1.05rem;
  text-decoration: none; border: 1px solid transparent; border-radius: var(--r-pill);
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--c-brand); color: #fff; box-shadow: var(--sh-3); }
.btn-primary:hover { background: var(--c-brand-dark); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: rgba(255,255,255,.75); color: var(--c-brand-dark); border-color: var(--c-line); min-height: 42px; padding: .45rem 1.1rem; font-size: .95rem; }
.btn-ghost:hover { background: #fff; }
.btn--block { width: 100%; }
.btn--lg { min-height: 58px; font-size: 1.15rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.btn:disabled:hover { background: var(--c-brand); }

/* ---------------- [HERO] ----------------------------------------------- */
.hero {
  background:
    radial-gradient(1000px 420px at 90% -10%, #FFE3EA 0%, transparent 60%),
    linear-gradient(180deg, #FFF6F3 0%, var(--c-bg) 100%);
  padding-bottom: var(--sp-6);
}
.topbar {
  width: min(100% - 2rem, var(--wrap)); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); padding-block: var(--sp-3);
}
.brand { display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; color: var(--c-brand); }
.brand span { color: var(--c-ink); }

.hero__grid {
  width: min(100% - 2rem, var(--wrap)); margin-inline: auto;
  display: grid; gap: var(--sp-5); align-items: center; padding-top: var(--sp-3);
}
.eyebrow {
  display: inline-block; margin-bottom: var(--sp-2);
  background: #fff; border: 1px solid var(--c-line); color: var(--c-brand-dark);
  font-size: .85rem; font-weight: 700; padding: .28rem .8rem; border-radius: var(--r-pill);
}
.hero h1 { font-size: clamp(2.1rem, 7vw, 3.4rem); }
.lead { font-size: clamp(1rem, 2.6vw, 1.15rem); color: var(--c-muted); max-width: 52ch; }
.lead strong { color: var(--c-ink); }

.hero__cta { margin-top: var(--sp-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.hero__price { font-weight: 800; font-size: 1.02rem; color: var(--c-ink); margin: 0; }
.hero__price .sep { color: var(--c-line); margin-inline: .25rem; }

.ticks { list-style: none; display: grid; gap: .35rem; margin-top: var(--sp-4); color: var(--c-muted); font-size: .95rem; }
.ticks li { padding-inline-start: 1.5rem; position: relative; }
.ticks li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .62em;
  width: 14px; height: 8px; border-inline-start: 2.5px solid var(--c-ok);
  border-bottom: 2.5px solid var(--c-ok); transform: rotate(-45deg);
}
.hero__media { margin: 0; }
.hero__media img {
  width: 100%; border-radius: var(--r-lg); box-shadow: var(--sh-2);
  background: #fff;
}

/* ---------------- [STEPS] ---------------------------------------------- */
.steps { list-style: none; display: grid; gap: var(--sp-3); counter-reset: s; margin-bottom: var(--sp-5); }
.step {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-md); padding: var(--sp-4); box-shadow: var(--sh-1);
}
.step h3 { font-size: 1.12rem; }
.step p { color: var(--c-muted); margin: 0; font-size: .97rem; }
.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin-bottom: var(--sp-2);
  background: var(--c-brand); color: #fff; font-weight: 800;
  border-radius: var(--r-pill);
}
.banner { margin: 0; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-2); }
.banner img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* ---------------- [CARDS] ---------------------------------------------- */
.cards { display: grid; gap: var(--sp-3); }
.card {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-md); padding: var(--sp-4); box-shadow: var(--sh-1);
}
.card h3 { font-size: 1.05rem; }
.card p { color: var(--c-muted); margin: 0; font-size: .95rem; }
.card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; margin-bottom: var(--sp-2);
  background: var(--c-brand-soft); color: var(--c-brand); border-radius: var(--r-sm);
}

/* ---------------- [GALLERY] -------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
.gallery__item { margin: 0; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-1); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 5; transition: transform .4s ease; }
.gallery__item:hover img { transform: scale(1.04); }
.gallery__item--wide { grid-column: span 2; }
.gallery__item--wide img { aspect-ratio: 16 / 10; }

/* ---------------- [OFFER] ---------------------------------------------- */
.offer {
  background: var(--c-surface); border: 2px solid var(--c-brand);
  border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-4);
  text-align: center; box-shadow: var(--sh-2);
}
.offer__price { font-size: clamp(2.4rem, 9vw, 3.6rem); font-weight: 900; color: var(--c-brand); margin-block: var(--sp-2) var(--sp-3); }
.offer__price span:last-child { font-size: .4em; font-weight: 800; vertical-align: middle; color: var(--c-ink); margin-inline-start: .18em; }
.offer__list { list-style: none; display: grid; gap: .5rem; text-align: start; margin-bottom: var(--sp-4); color: var(--c-muted); }
.offer__list li { padding-inline-start: 1.6rem; position: relative; }
.offer__list li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--c-ok); font-weight: 900; }
.offer__list strong { color: var(--c-ink); }
.micro { font-size: .85rem; color: var(--c-muted); margin: var(--sp-3) 0 0; }

/* ---------------- [FORM] ----------------------------------------------- */
.form {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-lg); padding: var(--sp-4); box-shadow: var(--sh-2);
  display: grid; gap: var(--sp-3);
}
.field { display: grid; gap: .3rem; }
.field-row { display: grid; gap: var(--sp-3); }
label { font-weight: 700; font-size: .93rem; }
input, select {
  font: inherit; font-size: 1rem; color: var(--c-ink);
  background: #fff; border: 1.5px solid var(--c-line);
  border-radius: var(--r-sm); padding: .7rem .8rem; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--c-muted) 50%), linear-gradient(135deg, var(--c-muted) 50%, transparent 50%); background-position: left 1.1rem top 55%, left .75rem top 55%; background-size: .35rem .35rem, .35rem .35rem; background-repeat: no-repeat; padding-inline-start: 2rem; }
input::placeholder { color: #A99BA0; }
input:focus, select:focus { border-color: var(--c-brand); box-shadow: 0 0 0 3px rgba(198,55,95,.15); outline: none; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: #D93A3A; background: #FFF6F6; }
.field__err { min-height: 1.1em; margin: 0; font-size: .82rem; color: #C42B2B; font-weight: 600; }
.form__err { margin: 0; min-height: 1.2em; font-size: .9rem; color: #C42B2B; font-weight: 700; text-align: center; }
.form__err--start { text-align: start; }

.summary {
  background: var(--c-brand-soft); border-radius: var(--r-md);
  padding: var(--sp-3); display: grid; gap: .35rem;
}
.summary__row { display: flex; justify-content: space-between; font-size: .97rem; color: var(--c-muted); }
.summary__row--total { border-top: 1px dashed #E7C4CD; padding-top: .5rem; margin-top: .2rem; font-weight: 900; font-size: 1.12rem; color: var(--c-ink); }

/* ---------------- [FAQ] ------------------------------------------------ */
.faq { display: grid; gap: var(--sp-2); }
details {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-md); padding: var(--sp-3); box-shadow: var(--sh-1);
}
summary { font-weight: 800; cursor: pointer; list-style: none; position: relative; padding-inline-end: 1.6rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; inset-inline-end: .1rem; color: var(--c-brand); font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: "–"; }
details p { margin: var(--sp-2) 0 0; color: var(--c-muted); font-size: .95rem; }

/* ---------------- [FOOTER] --------------------------------------------- */
.footer { background: var(--c-ink); color: #D9CFD3; padding-block: var(--sp-5); text-align: center; font-size: .9rem; }
.footer__disclaimer {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-md); padding: var(--sp-3); max-width: 62ch;
  margin-inline: auto; margin-bottom: var(--sp-3); color: #F3E7EA;
}
.footer__copy { margin: 0; opacity: .75; }

/* ---------------- [RESPONSIVE] ----------------------------------------- */
@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .field-row { grid-template-columns: 1fr 1fr; }
  .gallery { gap: var(--sp-3); }
}
@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.05fr .95fr; gap: var(--sp-6); padding-top: var(--sp-5); }
  .cards { grid-template-columns: repeat(4, 1fr); }
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .gallery__item { grid-column: span 1; }
  .gallery__item--wide { grid-column: span 2; }
  .gallery__item img { aspect-ratio: 3 / 4; }
  .form { padding: var(--sp-5); }
}

/* ---------------- [FX] تأثيرات حديثة — vanilla (P1..P7) ------------------ */
/* P7: أجسام عائمة زخرفية في Hero — لا تُقرأ من قارئ الشاشة (pseudo) */
.hero { position: relative; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  border-radius: 50%; filter: blur(70px); opacity: .5;
}
.hero::before {
  width: 46vmax; height: 46vmax; inset-inline-start: -14vmax; top: -18vmax;
  background: #FFD3DF; animation: fx-float-a 16s ease-in-out infinite alternate;
}
.hero::after {
  width: 38vmax; height: 38vmax; inset-inline-end: -12vmax; bottom: -16vmax;
  background: #FFE7D9; animation: fx-float-b 21s ease-in-out infinite alternate;
}
.topbar, .hero__grid { position: relative; z-index: 1; }
@keyframes fx-float-a { to { transform: translate3d(4vmax, 3vmax, 0) scale(1.08); } }
@keyframes fx-float-b { to { transform: translate3d(-4vmax, -3vmax, 0) scale(1.1); } }

/* P2: ظهور تدريجي — الإخفاء مشروط بوجود fx-on (fail-open: بلا JS = بلا إخفاء) */
html.fx-on [data-fx="r"] { opacity: 0; transform: translate3d(0, 26px, 0); }
html.fx-on [data-fx="r"].is-in {
  opacity: 1; transform: none;
  transition: opacity .75s cubic-bezier(.22,.61,.36,1), transform .75s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--fx-d, 0ms);
}

/* P1: تيلت 3D + وهج — يسبق قاعدة الظهور ليظل التيلت مسيطراً على transform */
html.fx-on .fx-tilt {
  position: relative; z-index: 1;
  transform: perspective(900px) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg));
  transition: transform .16s ease-out, box-shadow .2s ease;
  will-change: transform;
}
.fx-tilt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(340px circle at var(--fx-mx, 50%) var(--fx-my, 50%),
              rgba(255,255,255,.6), transparent 62%);
  opacity: 0; transition: opacity .25s ease;
}
.fx-tilt:hover::after, .fx-tilt:focus-within::after { opacity: 1; }
.fx-tilt:hover { box-shadow: var(--sh-2); }

/* P5: شريط تقدّم التمرير */
.fx-progress {
  position: fixed; inset-inline: 0; top: 0; height: 3px; z-index: 60;
  background: rgba(198,55,95,.12);
}
.fx-progress i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--c-brand), var(--c-brand-dark));
  transform: scaleX(0); transform-origin: right center;
}

/* P3/P4: عمق Hero ومغناطيسية الأزرار — will-change مُقتصد */
.hero__media { will-change: transform; }

/* ---------------- [REDUCED MOTION] ------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  /* الحركة اللانهائية بـ .01ms تُومض — نُلغيها تماماً */
  .hero::before, .hero::after { animation: none !important; }
  .fx-progress i { transition: none !important; }
}
