/* =========================================================
   ديار العقارية — ملف التنسيقات الرئيسي
   الأقسام:
   1) المتغيرات والأساسيات
   2) عناصر عامة (أزرار، بطاقات، عناوين)
   3) الهيدر والتنقل
   4) الفوتر
   5) الصفحة الرئيسية
   6) بطاقة العقار
   7) صفحة العقارات (الفلاتر والنتائج)
   8) صفحة تفاصيل العقار
   9) من نحن / اتصل بنا
   10) عناصر عائمة ومساعدة
   11) الاستجابة للشاشات الصغيرة
   ========================================================= */

/* ============ 1) المتغيرات والأساسيات ============ */
:root {
  /* ===== هوية إنماء المدن للتطوير العقاري ===== */
  --brand: #0a2940;         /* الكحلي الأساسي */
  --brand-2: #16496e;       /* درجة أفتح للتفاصيل */
  --brand-soft: #e8eef3;    /* خلفية فاتحة كحلية */
  --mint: #92d3c4;          /* النعناعي — للخلفيات والتمييز */
  --mint-ink: #1f7a66;      /* نعناعي داكن للنصوص (تباين كافٍ) */
  --mint-soft: #eaf7f3;
  --gold: #e68524;          /* البرتقالي — للخلفيات والأزرار */
  --gold-ink: #a4560c;      /* برتقالي داكن للنصوص والأيقونات */
  --gold-soft: #fdf0e2;

  --ink: #17211f;
  --ink-2: #46514f;
  --ink-3: #656e6c;         /* مغمّق ليحقق تباين 4.5:1 على الأبيض */

  --bg: #f6f7f5;
  --surface: #ffffff;
  --line: #e5e8e5;

  --ok: #1f8a5b;
  --ok-soft: #e6f4ed;
  --warn: #8a5a12;
  --warn-soft: #fdf3e2;
  --danger: #b03a3a;
  --danger-soft: #fbeaea;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(16, 33, 31, .06), 0 2px 8px rgba(16, 33, 31, .04);
  --shadow: 0 4px 14px rgba(16, 33, 31, .08), 0 12px 32px rgba(16, 33, 31, .06);
  --shadow-lg: 0 18px 50px rgba(10, 41, 64, .18);

  --container: 1200px;
  --header-h: 76px;

  --font: "Tajawal", "Segoe UI", "Noto Kufi Arabic", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5rem; font-weight: 800; letter-spacing: -.2px; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.18rem; }
p { margin: 0 0 1rem; color: var(--ink-2); }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.section { padding: 72px 0; }
.section--tight { padding: 48px 0; }
.section--alt { background: var(--surface); }

/* حلقة تركيز واضحة للتنقل بلوحة المفاتيح */
:where(a, button, select, input, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--brand-2);
  outline-offset: 2px;
  border-radius: 6px;
}

.muted { color: var(--ink-3); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
/* خاصية hidden يجب أن تتغلب على أي display في القواعد أدناه */
[hidden] { display: none !important; }

/* أرقام لاتينية داخل النص العربي لسهولة القراءة */
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ============ 2) عناصر عامة ============ */
.section-head { margin-bottom: 2.2rem; }
.section-head.center { margin-inline: auto; max-width: 620px; }
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 700; letter-spacing: .5px;
  color: var(--brand-2); background: var(--brand-soft);
  padding: .3rem .8rem; border-radius: 100px; margin-bottom: .7rem;
}
.section-head p { margin-bottom: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .78rem 1.5rem; border-radius: 100px; border: 1px solid transparent;
  font-weight: 700; font-size: .98rem; transition: .18s ease; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(10, 41, 64, .22); }
.btn--primary:hover { background: #061d2e; }
.btn--gold { background: var(--gold); color: #241d0a; box-shadow: 0 6px 18px rgba(230, 133, 36, .3); }
.btn--gold:hover { background: #cf7418; }
.btn--ghost { background: transparent; color: var(--brand); border-color: #cfd8d6; }
.btn--ghost:hover { border-color: var(--brand); background: var(--brand-soft); }
.btn--light { background: #fff; color: var(--brand); }
.btn--light:hover { background: #f2f5f4; }
.btn--wa { background: #15803d; color: #fff; }
.btn--wa:hover { background: #116632; }
.btn--block { width: 100%; }
.btn--sm { padding: .55rem 1.05rem; font-size: .88rem; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .78rem; font-weight: 700; padding: .28rem .7rem; border-radius: 100px;
}
.badge--sale { background: var(--brand); color: #fff; }
.badge--rent { background: var(--gold); color: #241d0a; }
.badge--featured { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }

/* ============ 3) الهيدر ============ */
.header {
  position: sticky; top: 0; z-index: 60; background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.header__inner { display: flex; align-items: center; gap: 1.4rem; height: var(--header-h); }
.logo { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.18rem; color: var(--brand); }
.logo img { width: 46px; height: 46px; object-fit: contain; }
.logo span small { display: block; font-size: .68rem; font-weight: 600; color: var(--ink-3); letter-spacing: 1.5px; }

.nav { display: flex; gap: .3rem; margin-inline-start: auto; }
.nav a {
  padding: .5rem .9rem; border-radius: 100px; font-weight: 600; font-size: .96rem;
  color: var(--ink-2); transition: .15s;
}
.nav a:hover { background: var(--brand-soft); color: var(--brand); }
.nav a.is-active { color: var(--brand); background: var(--brand-soft); }

.header__cta { display: flex; align-items: center; gap: .6rem; }
.header__phone { display: flex; align-items: center; gap: .45rem; font-weight: 700; color: var(--brand); }

.burger {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; padding: 0; place-items: center;
}
.burger span { display: block; width: 19px; height: 2px; background: var(--ink); border-radius: 2px; margin: 3.5px auto; transition: .2s; }
.burger.is-open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ============ 4) الفوتر ============ */
.footer { background: var(--brand); color: #cbd8e2; padding: 60px 0 0; margin-top: 60px; }
.footer a { color: #cbd8e2; }
.footer a:hover { color: #fff; }
.footer h4 { color: #fff; font-size: 1.02rem; margin-bottom: 1rem; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 2.5rem; }
.footer__brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.2rem; color: #fff; margin-bottom: .9rem; }
.footer__brand img { width: 48px; height: 48px; object-fit: contain; }
.footer p { color: #9fb3c4; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .2rem; }
.footer ul a { display: inline-block; padding: .3rem 0; }
.footer__contact li { display: flex; gap: .6rem; align-items: flex-start; color: #9fb3c4; }
.footer__contact svg { flex: none; margin-top: 5px; opacity: .75; }
.social { display: flex; gap: .55rem; margin-top: 1rem; }
.social a {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .1); transition: .2s;
}
.social a:hover { background: var(--gold); color: #241d0a; }
.footer__bottom {
  margin-top: 42px; padding: 20px 0; border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .88rem; color: #90a6b8;
}

/* ============ 5) الصفحة الرئيسية ============ */
.hero { position: relative; background: var(--brand); color: #fff; overflow: hidden; }
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .34; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to left, rgba(10, 41, 64, .95), rgba(10, 41, 64, .74) 55%, rgba(10, 41, 64, .5));
}
.hero__inner { position: relative; z-index: 2; padding: 92px 0 100px; max-width: 720px; }
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero p { color: #cfdce8; font-size: 1.1rem; max-width: 560px; }
.hero__actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* شريط البحث */
.searchbar {
  position: relative; z-index: 3; background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 1.1rem; margin-top: -46px;
}
.searchbar__tabs { display: flex; gap: .4rem; margin-bottom: .9rem; }
.searchbar__tabs button {
  padding: .5rem 1.2rem; border-radius: 100px; border: 1px solid var(--line);
  background: #fff; font-weight: 700; font-size: .92rem; color: var(--ink-2); transition: .15s;
}
.searchbar__tabs button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.searchbar__row { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: .7rem; }
.field { display: grid; gap: .3rem; }
.field label { font-size: .8rem; font-weight: 700; color: var(--ink-3); }
.field select, .field input, .field textarea {
  width: 100%; padding: .72rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); transition: .15s; appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237b8583' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left .9rem center; padding-left: 2.1rem;
}
.field select:focus, .field input:focus, .field textarea:focus {
  outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field--error input, .field--error select, .field--error textarea { border-color: var(--danger); }
.field .error-msg { font-size: .78rem; color: var(--danger); min-height: 1rem; }

/* شريط الإحصائيات */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.stat { text-align: center; padding: 1.4rem 1rem; }
.stat b { display: block; font-size: 2.1rem; color: var(--brand); line-height: 1.2; }
.stat span { color: var(--ink-3); font-size: .94rem; font-weight: 600; }

/* بطاقات التصنيفات */
.types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.type-card {
  display: block; padding: 1.6rem 1.3rem; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); transition: .2s; text-align: center;
}
.type-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.type-card__icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); margin: 0 auto .8rem;
}
.type-card h3 { margin-bottom: .15rem; font-size: 1.05rem; }
.type-card span { font-size: .88rem; color: var(--ink-3); }

/* لماذا نحن */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.feature { padding: 1.7rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.feature__icon {
  width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold-ink); margin-bottom: 1rem;
}
.feature h3 { font-size: 1.08rem; }
.feature p { margin: 0; font-size: .95rem; }

/* شريط الدعوة لاتخاذ إجراء */
.cta {
  background: linear-gradient(135deg, var(--brand), #14496e); color: #fff;
  border-radius: var(--radius-lg); padding: 3rem; display: flex;
  align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.cta h2 { color: #fff; margin-bottom: .35rem; }
.cta p { color: #cfdce8; margin: 0; }
.cta__actions { display: flex; gap: .7rem; flex-wrap: wrap; }

/* ============ 6) بطاقة العقار ============ */
.grid-props { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

.prop {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: .2s; display: flex; flex-direction: column;
}
.prop:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.prop__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--brand-soft); }
.prop__media img { width: 100%; height: 100%; object-fit: cover; transition: .35s; }
.prop:hover .prop__media img { transform: scale(1.05); }
.prop__tags { position: absolute; top: .8rem; inset-inline-start: .8rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.prop__fav {
  position: absolute; top: .7rem; inset-inline-end: .7rem; width: 36px; height: 36px;
  border-radius: 50%; border: none; background: rgba(255, 255, 255, .92); color: var(--ink-3);
  display: grid; place-items: center; transition: .18s; box-shadow: var(--shadow-sm);
}
.prop__fav:hover { background: #fff; color: var(--danger); transform: scale(1.08); }
.prop__fav.is-on { color: var(--danger); }
.prop__fav.is-on svg { fill: currentColor; }
.prop__status {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(23, 33, 31, .55); color: #fff; font-weight: 800; font-size: 1.1rem;
}
.prop__body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.prop__price { color: var(--brand); font-weight: 800; font-size: 1.28rem; margin-bottom: .1rem; }
.prop__price small { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.prop__title { font-size: 1.02rem; font-weight: 700; margin: .2rem 0 .3rem; color: var(--ink); }
.prop__loc { display: flex; align-items: center; gap: .35rem; color: var(--ink-3); font-size: .9rem; margin-bottom: .9rem; }
.prop__meta {
  display: flex; gap: 1rem; flex-wrap: wrap; padding-top: .85rem; margin-top: auto;
  border-top: 1px dashed var(--line); color: var(--ink-2); font-size: .88rem;
}
.prop__meta span { display: flex; align-items: center; gap: .35rem; }
.prop__meta svg { opacity: .55; }

/* ============ 7) صفحة العقارات ============ */
.page-head { background: var(--brand); color: #fff; padding: 46px 0; }
.page-head h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: .25rem; }
.page-head p { color: #b6c8d8; margin: 0; }
.breadcrumb { display: flex; gap: .45rem; font-size: .88rem; color: #90a6b8; margin-bottom: .6rem; flex-wrap: wrap; }
.breadcrumb a:hover { color: #fff; }

.layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.8rem; align-items: start; }
/* min-width:0 يمنع أي محتوى عريض من تمديد أعمدة الشبكة وكسر الصفحة */
.layout > *, .grid-props > *, .detail > *, .map-page > * { min-width: 0; }
.filters { position: sticky; top: calc(var(--header-h) + 16px); padding: 1.3rem; }
.filters__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.filters__head h3 { margin: 0; font-size: 1.05rem; }
.filters__reset { background: none; border: none; color: var(--brand-2); font-weight: 700; font-size: .85rem; padding: .3rem .2rem; margin: -.3rem -.2rem; }
.filters__reset:hover { text-decoration: underline; }
.filters .field { margin-bottom: .9rem; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip {
  padding: .42rem .9rem; border-radius: 100px; border: 1px solid var(--line);
  background: #fff; font-size: .87rem; font-weight: 600; color: var(--ink-2); transition: .15s;
}
.chip:hover { border-color: var(--brand-2); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.range-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

.results__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  flex-wrap: wrap; margin-bottom: 1.2rem;
}
.results__count { font-weight: 700; }
.results__count b { color: var(--brand); }
/* wrap ضروري: بدونه يتمدد الشريط ويكسر عرض الصفحة على الجوال */
.results__sort { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.results__sort select { padding: .55rem .85rem; min-width: 0; }
.filters-toggle { display: none; }

.empty { text-align: center; padding: 4rem 1.5rem; }
.empty svg { color: var(--ink-3); opacity: .4; margin-bottom: 1rem; }
.empty h3 { margin-bottom: .3rem; }

.load-more { display: grid; place-items: center; margin-top: 2.2rem; }

/* ============ 8) صفحة تفاصيل العقار ============ */
.detail { display: grid; grid-template-columns: 1fr 360px; gap: 1.8rem; align-items: start; }

.gallery { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.gallery__main { position: relative; aspect-ratio: 16 / 10; background: var(--brand-soft); }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__tags { position: absolute; top: 1rem; inset-inline-start: 1rem; display: flex; gap: .4rem; }
.gallery__nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px;
  border-radius: 50%; border: none; background: rgba(255, 255, 255, .9); color: var(--ink);
  display: grid; place-items: center; box-shadow: var(--shadow-sm); transition: .15s;
}
.gallery__nav:hover { background: #fff; }
.gallery__nav--prev { inset-inline-end: 1rem; }
.gallery__nav--next { inset-inline-start: 1rem; }
.gallery__thumbs { display: flex; gap: .6rem; padding: .7rem; overflow-x: auto; }
.gallery__thumbs img {
  width: 96px; height: 70px; object-fit: cover; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; opacity: .65; transition: .15s; flex: none;
}
.gallery__thumbs img.is-active, .gallery__thumbs img:hover { opacity: 1; border-color: var(--brand); }

.detail__block { padding: 1.6rem; margin-top: 1.5rem; }
.detail__block h2 { font-size: 1.25rem; margin-bottom: 1rem; }

.detail__title-row { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.detail__price { font-size: 1.9rem; font-weight: 800; color: var(--brand); white-space: nowrap; }
.detail__price small { font-size: .9rem; color: var(--ink-3); font-weight: 600; }

.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.spec { background: var(--surface); padding: 1rem; display: flex; gap: .7rem; align-items: center; }
.spec__icon { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.spec small { display: block; color: var(--ink-3); font-size: .8rem; line-height: 1.4; }
.spec b { font-size: .98rem; }

.feature-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.feature-list li { display: flex; align-items: center; gap: .5rem; color: var(--ink-2); font-size: .95rem; }
.feature-list svg { color: var(--ok); flex: none; }

.map-box { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); position: relative; }
.map-box img { width: 100%; height: 260px; object-fit: cover; }
.map-box__overlay {
  position: absolute; inset: 0; display: grid; place-items: center; gap: .7rem;
  align-content: center; background: rgba(10, 41, 64, .38);
}

.agent { padding: 1.5rem; text-align: center; position: sticky; top: calc(var(--header-h) + 16px); }
.agent__avatar {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto .8rem; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 1.6rem; font-weight: 800;
}
.agent h3 { margin-bottom: .1rem; }
.agent .muted { font-size: .9rem; }
.agent__actions { display: grid; gap: .6rem; margin-top: 1.2rem; }
.agent__note { font-size: .82rem; color: var(--ink-3); margin: 1rem 0 0; }
.agent__ref { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); font-size: .85rem; color: var(--ink-3); }

/* ============ 9) من نحن / اتصل بنا ============ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.split img { border-radius: var(--radius-lg); box-shadow: var(--shadow); }

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.value { padding: 1.6rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.value__num { font-size: .85rem; font-weight: 800; color: var(--gold-ink); letter-spacing: 1px; }

.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 2rem; align-items: start; }
.info-card { padding: 1.3rem; display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.info-card__icon { width: 46px; height: 46px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.info-card h3 { font-size: 1rem; margin-bottom: .15rem; }
.info-card p { margin: 0; font-size: .94rem; }

.form { padding: 1.8rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form textarea { min-height: 130px; resize: vertical; }
.form__note {
  background: var(--gold-soft); border: 1px solid #ecdfc2; border-radius: var(--radius-sm);
  padding: .8rem 1rem; font-size: .87rem; color: #6b5720; margin-bottom: 1.2rem;
}
.form__success {
  background: var(--ok-soft); border: 1px solid #c6e6d6; color: #17663f;
  border-radius: var(--radius-sm); padding: .9rem 1rem; font-size: .93rem; margin-top: 1rem;
}

.faq { display: grid; gap: .8rem; max-width: 820px; margin-inline: auto; }
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1rem 1.2rem;
}
.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand-2); font-size: 1.35rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq p { margin: .8rem 0 0; font-size: .95rem; }

/* ============ 9.2) صفحة المشاريع ومراحل التنفيذ ============ */
.stage-nav {
  position: sticky; top: var(--header-h); z-index: 50;
  background: rgba(255, 255, 255, .95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.stage-nav__inner { display: flex; gap: .4rem; overflow-x: auto; padding: .7rem 0; }
.stage-nav a {
  display: flex; align-items: center; gap: .45rem; flex: none;
  padding: .5rem 1rem; border-radius: 100px; font-weight: 700; font-size: .93rem;
  color: var(--ink-2); border: 1px solid var(--line); background: #fff; transition: .15s;
}
.stage-nav a b {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: .78rem;
}
.stage-nav a:hover { border-color: var(--brand-2); }
.stage-nav a.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.stage-nav a.is-active b { background: rgba(255, 255, 255, .22); color: #fff; }

.stage { scroll-margin-top: calc(var(--header-h) + 70px); }
.stage__head { display: flex; align-items: flex-start; gap: 1.2rem; margin-bottom: 1.8rem; }
.stage__no {
  width: 58px; height: 58px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 1.5rem; font-weight: 800;
  border: 3px solid var(--mint);
}
.stage__head h2 { margin-bottom: .3rem; }
.stage__head p { margin: 0; max-width: 62ch; }
.stage__count {
  margin-inline-start: auto; flex: none; font-size: .85rem; font-weight: 700;
  color: var(--mint-ink); background: var(--mint-soft); padding: .35rem .85rem; border-radius: 100px;
}

.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.shot {
  position: relative; padding: 0; border: 1px solid var(--line); background: var(--brand-soft);
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; cursor: zoom-in; transition: .2s;
}
.shot img { width: 100%; height: 100%; object-fit: cover; transition: .35s; }
.shot:hover { border-color: transparent; box-shadow: var(--shadow); transform: translateY(-3px); }
.shot:hover img { transform: scale(1.06); }
.shot__zoom {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  background: rgba(10, 41, 64, .42); opacity: 0; transition: .2s;
}
.shot:hover .shot__zoom, .shot:focus-visible .shot__zoom { opacity: 1; }

/* عارض الصور */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(6, 22, 36, .93); padding: 4vh 6vw;
}
.lightbox img { max-width: 100%; max-height: 84vh; border-radius: var(--radius); object-fit: contain; }
.lightbox__close {
  position: absolute; top: 18px; inset-inline-end: 22px; width: 46px; height: 46px;
  border-radius: 50%; border: none; background: rgba(255, 255, 255, .14); color: #fff;
  font-size: 1.8rem; line-height: 1; transition: .15s;
}
.lightbox__close:hover { background: rgba(255, 255, 255, .28); }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px;
  border-radius: 50%; border: none; background: rgba(255, 255, 255, .14); color: #fff; transition: .15s;
}
.lightbox__nav::before { content: ""; display: block; width: 12px; height: 12px; margin: 0 auto;
  border-top: 2.5px solid #fff; border-inline-start: 2.5px solid #fff; }
.lightbox__nav--prev { inset-inline-end: 20px; }
.lightbox__nav--prev::before { transform: rotate(135deg); margin-inline-end: 4px; }
.lightbox__nav--next { inset-inline-start: 20px; }
.lightbox__nav--next::before { transform: rotate(-45deg); margin-inline-start: 4px; }
.lightbox__nav:hover { background: rgba(255, 255, 255, .28); }
.lightbox__caption {
  position: absolute; bottom: 20px; inset-inline: 0; text-align: center;
  color: #dbe6ef; font-size: .92rem; font-weight: 600;
}

/* ============ 9.3) شركاء النجاح ============ */
.partners { display: grid; grid-template-columns: repeat(8, 1fr); gap: 1rem; }
.partner {
  aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #fff;
  border: 1px solid var(--line); display: grid; place-items: center; transition: .2s;
}
.partner:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.partner img { width: 100%; height: 100%; object-fit: contain; }

/* ============ 9.5) الخرائط ============ */
.map-shell { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--brand-soft); }
.map-canvas { width: 100%; height: 100%; min-height: 240px; z-index: 1; }
.map-canvas.is-loading::after {
  content: "جاري تحميل الخريطة..."; position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--ink-3); font-weight: 700; z-index: 500;
}
.map-note { font-size: .84rem; color: var(--ink-3); margin: .8rem 0 0; }
.map-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }
.map-box .map-canvas { min-height: 260px; }

/* تصحيح اتجاه Leaflet داخل صفحة RTL */
.leaflet-container { font-family: var(--font); background: #eceee9; }
.leaflet-control-container .leaflet-top.leaflet-left { direction: ltr; }
.leaflet-control-zoom a { color: var(--brand) !important; font-weight: 700; }
.leaflet-control-attribution { font-size: .68rem; direction: ltr; }

/* علامة السعر */
.map-pin-wrap { background: none; border: none; }
.map-pin {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  transform: translate(-50%, -100%); padding: .3rem .7rem; border-radius: 100px;
  background: var(--brand); color: #fff; font-size: .82rem; font-weight: 800; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(16, 33, 31, .3); border: 2px solid #fff; transition: .15s;
  cursor: pointer;
}
.map-pin::after {
  content: ""; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #fff;
}
.map-pin--rent { background: var(--gold); color: #241d0a; }
.map-pin:hover, .map-pin.is-active { transform: translate(-50%, -100%) scale(1.12); z-index: 900; }
.map-pin.is-active { background: var(--ink); color: #fff; box-shadow: 0 6px 18px rgba(16, 33, 31, .45); }
.map-pin.is-off { opacity: .58; }

/* دائرة تجميع العقارات المتقاربة */
.map-cluster-wrap { background: none; border: none; }
.map-cluster {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 1rem;
  border: 3px solid #fff; box-shadow: 0 4px 14px rgba(10, 41, 64, .4); transition: .15s;
}
.map-cluster::before {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  background: var(--brand); opacity: .22;
}
.map-cluster b { position: relative; z-index: 1; }
.map-cluster-wrap:hover .map-cluster { transform: scale(1.08); }

/* النافذة المنبثقة */
.leaflet-popup-content-wrapper { border-radius: var(--radius); padding: 0; overflow: hidden; box-shadow: var(--shadow); }
.leaflet-popup-content { margin: 0; width: 252px !important; }
.leaflet-popup-tip { background: #fff; }
.leaflet-popup-close-button { inset-inline-end: 6px; inset-inline-start: auto !important; color: #fff !important; z-index: 2; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.map-popup__img { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--brand-soft); }
.map-popup__img img { width: 100%; height: 100%; object-fit: cover; }
.map-popup__tags { position: absolute; top: .5rem; inset-inline-start: .5rem; display: flex; gap: .3rem; }
.map-popup__body { padding: .75rem .85rem .85rem; }
.map-popup__price { color: var(--brand); font-weight: 800; font-size: 1.05rem; }
.map-popup__price small { font-size: .74rem; color: var(--ink-3); }
.map-popup h4 { font-size: .92rem; margin: .15rem 0 .25rem; line-height: 1.5; }
.map-popup__loc { display: flex; align-items: center; gap: .3rem; color: var(--ink-3); font-size: .8rem; }
.map-popup__meta { display: flex; gap: .7rem; margin: .55rem 0 .7rem; color: var(--ink-2); font-size: .8rem; }
.map-popup__meta span { display: flex; align-items: center; gap: .25rem; }
.map-popup__meta svg { opacity: .55; width: 14px; height: 14px; }

/* ===== صفحة الخريطة ===== */
.map-page { display: grid; grid-template-columns: 380px 1fr; gap: 0; height: calc(100vh - var(--header-h)); }
.map-page__side { display: flex; flex-direction: column; background: var(--surface); border-inline-end: 1px solid var(--line); min-height: 0; }
.map-page__filters { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); display: grid; gap: .7rem; }
.map-tabs { display: flex; gap: .35rem; }
.map-tabs button {
  flex: 1; padding: .5rem .5rem; border-radius: 100px; border: 1px solid var(--line);
  background: #fff; font-weight: 700; font-size: .88rem; color: var(--ink-2); transition: .15s;
  display: flex; align-items: center; justify-content: center; gap: .35rem;
}
.map-tabs button i { font-style: normal; font-size: .75rem; opacity: .75; }
.map-tabs button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.map-page__filters .field select { padding: .55rem .8rem; font-size: .92rem; }
.map-page__row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

.map-page__count { padding: .7rem 1.1rem; font-size: .88rem; color: var(--ink-2); border-bottom: 1px solid var(--line); background: var(--bg); }
.map-page__list { overflow-y: auto; flex: 1; padding: .6rem; display: grid; gap: .6rem; align-content: start; }

.map-item {
  display: grid; grid-template-columns: 104px 1fr; gap: .7rem; padding: .5rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  cursor: pointer; transition: .15s; text-align: right;
}
.map-item:hover, .map-item.is-active { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.map-item.is-active { background: var(--brand-soft); }
.map-item__img { position: relative; aspect-ratio: 4/3; border-radius: 7px; overflow: hidden; background: var(--brand-soft); }
.map-item__img img { width: 100%; height: 100%; object-fit: cover; }
.map-item__body { min-width: 0; }
.map-item__price { color: var(--brand); font-weight: 800; font-size: .98rem; line-height: 1.4; }
.map-item__price small { font-size: .72rem; color: var(--ink-3); font-weight: 600; }
.map-item h3 { font-size: .86rem; margin: .1rem 0 .2rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.map-item__loc { display: flex; align-items: center; gap: .25rem; color: var(--ink-3); font-size: .78rem; }
.map-item__meta { display: flex; gap: .6rem; margin-top: .3rem; color: var(--ink-2); font-size: .76rem; }
.map-item__meta span { display: flex; align-items: center; gap: .2rem; }
.map-item__meta svg { width: 13px; height: 13px; opacity: .5; }

.map-page__map { position: relative; min-height: 0; }
.map-page__map .map-canvas { height: 100%; }
.map-legend {
  position: absolute; bottom: 22px; inset-inline-end: 14px; z-index: 600;
  background: rgba(255, 255, 255, .95); border: 1px solid var(--line); border-radius: 100px;
  padding: .45rem .9rem; display: flex; gap: 1rem; font-size: .8rem; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.map-legend span { display: flex; align-items: center; gap: .35rem; }
.map-legend i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.map-legend i.sale { background: var(--brand); }
.map-legend i.rent { background: var(--gold); }

.map-switch { display: none; }

/* بانر الخريطة في الصفحة الرئيسية */
.map-banner {
  position: relative; display: block; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--line); min-height: 260px; background: var(--brand-soft); transition: .2s;
}
.map-banner:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.map-banner > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.map-banner__body {
  position: relative; z-index: 2; padding: 2.6rem 2.4rem; max-width: 560px;
  background: linear-gradient(to left, rgba(255, 255, 255, .97) 55%, rgba(255, 255, 255, 0));
  min-height: 260px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
}
.map-banner__body h2 { margin-bottom: .4rem; }
.map-banner__body p { margin-bottom: 1.2rem; }

/* ============ 10) عناصر عائمة ============ */
.fab {
  position: fixed; inset-inline-start: 20px; bottom: 20px; z-index: 55;
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: #15803d; color: #fff; box-shadow: 0 8px 24px rgba(21, 128, 61, .38); transition: .2s;
}
.fab:hover { transform: scale(1.07); }

.to-top {
  position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 55;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--brand); display: grid; place-items: center;
  box-shadow: var(--shadow-sm); opacity: 0; pointer-events: none; transition: .25s;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }

.skeleton {
  background: linear-gradient(90deg, #eef1ef 25%, #f7f9f7 50%, #eef1ef 75%);
  background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius);
  height: 340px;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }

/* ============ 11) الاستجابة ============ */
@media (max-width: 1080px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .detail { grid-template-columns: 1fr; }
  .agent { position: static; }
  .grid-props { grid-template-columns: repeat(2, 1fr); }
  .types { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .nav, .header__phone { display: none; }
  .burger { display: grid; margin-inline-start: auto; }
  .header.is-open .nav {
    display: flex; flex-direction: column; position: absolute; top: var(--header-h);
    inset-inline: 0; background: #fff; padding: 1rem; gap: .2rem;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .header.is-open .nav a { padding: .8rem 1rem; }
  .header__cta .btn { display: none; }

  .layout { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.is-open { display: block; }
  .filters-toggle { display: inline-flex; }
  .split, .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  .features, .values { grid-template-columns: 1fr; }
  .searchbar__row { grid-template-columns: 1fr 1fr; }
  .searchbar__row .field:last-of-type, .searchbar__row > .btn { grid-column: 1 / -1; }
  .feature-list { grid-template-columns: repeat(2, 1fr); }

  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .partners { grid-template-columns: repeat(4, 1fr); }
  .stage__head { flex-wrap: wrap; }
  .stage__count { margin-inline-start: 0; }

  /* الخريطة على الجوال: تبديل بين القائمة والخريطة */
  .map-page { grid-template-columns: 1fr; height: auto; }
  .map-page__side { border-inline-end: none; }
  .map-page__map { height: 65vh; order: -1; }
  .map-page__list { max-height: none; overflow: visible; }
  .map-switch {
    display: flex; position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
    z-index: 56; background: var(--ink); color: #fff; border: none; border-radius: 100px;
    padding: .7rem 1.5rem; font-weight: 700; gap: .5rem; box-shadow: var(--shadow-lg);
  }
  body.map-mode-list .map-page__map { display: none; }
  body.map-mode-map .map-page__side .map-page__list,
  body.map-mode-map .map-page__count { display: none; }
  body.map-mode-map .map-page__map { height: calc(100vh - var(--header-h) - 190px); }
  .map-legend { bottom: 78px; }
}

@media (max-width: 620px) {
  .section { padding: 52px 0; }
  .grid-props, .types { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr; }
  .searchbar { margin-top: -24px; padding: 1rem; }
  .searchbar__row { grid-template-columns: 1fr; }
  .partners { grid-template-columns: repeat(3, 1fr); }
  .stage__no { width: 48px; height: 48px; font-size: 1.25rem; }
  .lightbox { padding: 2vh 3vw; }
  .lightbox__nav { width: 42px; height: 42px; }
  .cta { padding: 2rem 1.4rem; text-align: center; justify-content: center; }
  .cta__actions { justify-content: center; }
  .form__row { grid-template-columns: 1fr; }
  .feature-list { grid-template-columns: 1fr; }
  .hero__inner { padding: 62px 0 74px; }
  .detail__price { font-size: 1.5rem; }
}

@media print {
  .header, .footer, .fab, .to-top, .agent__actions, .breadcrumb { display: none !important; }
}
