/* ==========================================================================
   الضحيان العقارية — نظام التصميم
   --------------------------------------------------------------------------
   الأساس: أسود الشعار #22211F + أكسنت ذهبي #A9812F يُستعمل بحساب.
   يدعم الاتجاهين: العربية RTL افتراضيًا، والإنجليزية LTR عبر [dir="ltr"].
   يعتمد على fonts.css (خطوط مستضافة ذاتيًا) — يُربط قبل هذا الملف.
   ========================================================================== */

/* ===== 1) الرموز (Design Tokens) ===== */

:root {
  /* الأساسي — من الشعار */
  --brand:      #22211f;
  --brand-900:  #000000;
  --brand-700:  #14130f;
  --brand-600:  #2e2d2a;
  --brand-100:  #d7d6d2;
  --brand-50:   #f2f1ee;

  /* الأكسنت — لمسة الفخامة، لا يُستعمل للأزرار الرئيسية */
  --gold:       #a9812f;
  --gold-600:   #8d6a24;
  --gold-100:   #ecdfc2;
  --gold-50:    #f8f3e8;

  /* الحبر والأسطح */
  --ink:        #1c1b1a;
  --ink-2:      #45443f;
  --muted:      #6e6d68;
  --line:       #e5e4e0;
  --line-2:     #f0efec;
  --bg:         #ffffff;
  --surface:    #f7f6f4;
  --white:      #ffffff;

  /* الحالات */
  --ok:         #1d6b45;
  --ok-bg:      #edf7f1;
  --danger:     #a52a2a;
  --danger-bg:  #fdf0f0;
  --warn:       #8a5a10;
  --warn-bg:    #fff4e0;
  --wa:         #1faa53;
  --wa-600:     #178c44;

  /* المسافات */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* الاستدارة */
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-pill: 999px;

  /* الظلال */
  --sh-sm: 0 1px 2px rgba(20, 19, 17, .06), 0 1px 3px rgba(20, 19, 17, .04);
  --sh:    0 4px 16px rgba(20, 19, 17, .08);
  --sh-lg: 0 12px 40px rgba(20, 19, 17, .12);

  /* التخطيط */
  --wrap: 1180px;
  --header-h: 76px;

  /* الطباعة */
  --font-ar: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, system-ui, sans-serif;
  --font-en: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font: var(--font-ar);

  --t-xs: .75rem;  --t-sm: .875rem; --t-base: 1rem;  --t-md: 1.125rem;
  --t-lg: 1.25rem; --t-xl: 1.5rem;  --t-2xl: 2rem;   --t-3xl: 2.5rem; --t-4xl: 3.5rem;

  --ease: cubic-bezier(.2, .7, .3, 1);
  --dur: 180ms;
}

/* النسخة الإنجليزية: خط لاتيني وارتفاع سطر أقل */
[dir='ltr'] { --font: var(--font-en); line-height: 1.65; }

/* ===== 2) إعادة الضبط ===== */

*, *::before, *::after { box-sizing: border-box; }

/* أي عنصر يحمل hidden يختفي فعلًا — الكلاسات هنا تعرّف display فتتغلّب
   على قاعدة المتصفح الافتراضية لولا !important. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--s-4)); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--gold-600); }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, var(--t-4xl)); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, var(--t-2xl)); }
h3 { font-size: var(--t-md); }
p  { margin: 0 0 1em; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* أرقام الهوية والتواصل: عزل ثنائي الاتجاه ومنع الكسر في منتصف الرقم */
bdi[dir='ltr'] { unicode-bidi: isolate; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ===== 3) التخطيط ===== */

.wrap { width: min(100% - var(--s-5) * 2, var(--wrap)); margin-inline: auto; }
.section { padding: clamp(var(--s-7), 6vw, var(--s-9)) 0; }
.section--tight { padding: clamp(var(--s-6), 4vw, var(--s-7)) 0; }
.section--surface { background: var(--surface); }
.section--dark { background: var(--brand); color: #fff; }
.section--dark h2 { color: #fff; }
.section--dark p { color: rgba(255, 255, 255, .74); }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-6);
}
.section-eyebrow {
  display: block; margin-bottom: var(--s-2);
  color: var(--gold-600); font-weight: 700; font-size: var(--t-sm); letter-spacing: .04em;
}
.section--dark .section-eyebrow { color: var(--gold-100); }

.muted { color: var(--muted); }
.center { text-align: center; }
.stack > * + * { margin-top: var(--s-4); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ===== 4) الأزرار ===== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: .72rem 1.4rem; border-radius: var(--r-pill); border: 1.5px solid transparent;
  font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn--primary { background: var(--brand); color: var(--white); }
.btn--primary:hover { background: var(--brand-900); color: var(--white); transform: translateY(-1px); }
.btn--gold { background: var(--gold); color: #fff; }
.btn--gold:hover { background: var(--gold-600); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--brand); border-color: var(--brand-100); }
.btn--ghost:hover { background: var(--brand-50); color: var(--brand); }
.btn--light { background: var(--white); color: var(--brand); }
.btn--light:hover { background: var(--brand-50); color: var(--brand); }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.btn--outline-light:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: var(--wa-600); color: #fff; }
.btn--block { width: 100%; }
.btn--sm { padding: .45rem .9rem; font-size: var(--t-sm); }
.btn--lg { padding: .9rem 2rem; font-size: var(--t-md); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; }

/* ===== 5) الترويسة ===== */

.site-header {
  position: sticky; inset-block-start: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  position: relative; display: flex; align-items: center; gap: var(--s-5);
  min-height: var(--header-h);
}
.site-header__logo img { height: 42px; width: auto; }
.site-nav { display: flex; gap: 2px; margin-inline: auto; }
.site-nav a {
  padding: .5rem .8rem; border-radius: var(--r-pill);
  color: var(--ink-2); font-weight: 600; font-size: .95rem;
}
.site-nav a:hover { background: var(--brand-50); color: var(--brand); }
.site-nav a[aria-current='page'] { color: var(--brand); background: var(--brand-50); }
.site-header__cta { display: flex; gap: var(--s-2); align-items: center; }

.lang-switch {
  background: none; border: 1.5px solid var(--line); border-radius: var(--r-pill);
  padding: .4rem .8rem; font: inherit; font-weight: 700; font-size: var(--t-sm);
  color: var(--ink-2); cursor: pointer; transition: var(--dur) var(--ease);
}
.lang-switch:hover { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand); }

.nav-toggle {
  display: none; margin-inline-start: auto;
  background: none; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: .45rem .6rem; font-size: 1.2rem; line-height: 1; color: var(--brand); cursor: pointer;
}


/* زر أيقونة في الترويسة (المفضلة) */
.icon-btn {
  position: relative; width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink-2); background: var(--white);
  transition: var(--dur) var(--ease);
}
.icon-btn:hover { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn__count {
  position: absolute; inset-block-start: -7px; inset-inline-start: -7px;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  background: var(--gold); color: #fff; font-size: .7rem; font-weight: 700;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.site-header__add svg { width: 15px; height: 15px; }

/* أزرار البطاقة: قارن + التفاصيل */
.prop__actions { display: flex; gap: .5rem; margin-top: .9rem; }
.prop__actions .btn { flex: 1; }
.prop__cmp[aria-pressed='true'] {
  background: var(--gold-50); border-color: var(--gold); color: var(--gold-600);
}

/* ===== 6) فتات الخبز ===== */

.breadcrumb { font-size: var(--t-sm); color: var(--muted); margin-bottom: var(--s-4); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span[aria-current] { color: var(--ink-2); }

/* ===== 7) الواجهة الرئيسية ===== */

.hero {
  position: relative;
  isolation: isolate;
  color: #fff;
  padding: clamp(var(--s-8), 9vw, 150px) 0 clamp(var(--s-7), 6vw, var(--s-9));
  overflow: hidden;
  /* تدرّج أسود فاخر — بلا صور ولا ملفات: وهجان ذهبيان على أسود عميق */
  background:
    radial-gradient(700px 420px at 20% 92%, rgba(169, 129, 47, .30), transparent 66%),
    radial-gradient(820px 460px at 92% -8%, rgba(169, 129, 47, .22), transparent 62%),
    linear-gradient(180deg, #14130f 0%, #0e0d0b 72%);
}

/* نقاط ضوء خافتة تكسر صمت الأسود دون أن تُلاحَظ */
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 18% 28%, rgba(236, 223, 194, .40), transparent),
    radial-gradient(1.5px 1.5px at 72% 62%, rgba(236, 223, 194, .28), transparent),
    radial-gradient(1.5px 1.5px at 46% 84%, rgba(236, 223, 194, .22), transparent);
}

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(236, 223, 194, .34);
  color: var(--gold-100); backdrop-filter: blur(6px);
  border-radius: var(--r-pill); padding: .38rem 1.05rem;
  font-size: var(--t-sm); font-weight: 700; margin-bottom: var(--s-5);
}
.hero h1 { color: #fff; margin-bottom: .35em; }
.hero__lead {
  font-size: clamp(1rem, .95rem + .4vw, var(--t-md));
  color: rgba(255, 255, 255, .78); max-width: 46ch;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.hero__actions .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .34); }
.hero__actions .btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ===== 8) محرك البحث ===== */

.hero-search {
  position: relative; z-index: 1;
  background: var(--white); border: 1px solid rgba(255, 255, 255, .5); border-radius: var(--r);
  box-shadow: 0 26px 64px rgba(0, 0, 0, .40); padding: var(--s-4) var(--s-5) var(--s-5); margin-top: var(--s-6);
}
.hero-search__tabs { display: flex; gap: var(--s-1); margin-bottom: var(--s-4); }
.hero-search__tabs button {
  background: none; border: 1.5px solid transparent; border-radius: var(--r-pill);
  padding: .4rem 1.15rem; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer;
  transition: var(--dur) var(--ease);
}
.hero-search__tabs button[aria-selected='true'] { background: var(--brand); color: #fff; }
.hero-search__tabs button:not([aria-selected='true']):hover { background: var(--brand-50); color: var(--brand); }
.hero-search__row {
  display: grid; gap: var(--s-3); align-items: end;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
}
.hero-search .field label { font-size: var(--t-xs); color: var(--muted); font-weight: 700; }
.hero-search .input { font-weight: 600; }
.hero-search__go { height: 46px; padding-inline: 2rem; }
.hero-search__more {
  background: none; border: none; color: var(--gold-600); font: inherit; font-weight: 700;
  font-size: var(--t-sm); cursor: pointer; margin-top: var(--s-3); padding: 0;
}
.hero-search__extra { display: none; }
.hero-search__extra.is-open { display: contents; }

/* ===== 9) شريط الأرقام ===== */

.stats-band { background: var(--brand); color: #fff; }
.stats-band__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stats-band__item {
  padding: var(--s-6) var(--s-4); text-align: center;
  border-inline-start: 1px solid rgba(255, 255, 255, .12);
}
.stats-band__item:first-child { border-inline-start: none; }
.stats-band__item b {
  display: block; font-size: var(--t-2xl); font-weight: 800; line-height: 1.2;
  font-variant-numeric: tabular-nums; color: var(--gold-100);
}
.stats-band__item span { color: rgba(255, 255, 255, .72); font-size: .92rem; }

/* ===== 10) البطاقات العامة ===== */

.cards { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s-5); box-shadow: var(--sh-sm);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover { box-shadow: var(--sh); transform: translateY(-2px); }
.card__icon {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: var(--s-4);
  background: var(--gold-50); color: var(--gold-600); display: grid; place-items: center;
}
.card__icon svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: .35em; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ===== 11) بطاقة عقار ===== */

.prop-grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.prop {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.prop:hover { box-shadow: var(--sh); transform: translateY(-3px); }

.prop__media { position: relative; aspect-ratio: 4 / 3; background: var(--brand-50); }
.prop__media img { width: 100%; height: 100%; object-fit: cover; }
.prop__media--empty { display: grid; place-items: center; color: var(--brand-100); }
.prop__media--empty svg { width: 64px; height: 64px; }
.prop__media::after {
  content: ''; position: absolute; inset-block-end: 0; inset-inline: 0; height: 50%;
  background: linear-gradient(to top, rgba(12, 12, 11, .85), transparent); pointer-events: none;
}
.prop__media--empty::after { display: none; }

/* صف علوي واحد: الشارات في جهة والقلب في الجهة المقابلة */
.prop__top {
  position: absolute; inset-block-start: .7rem; inset-inline: .7rem; z-index: 2;
  display: flex; align-items: flex-start; gap: .5rem;
}
.prop__badges { display: flex; flex-wrap: wrap; gap: .35rem; flex: 1; }

.prop__fav {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .94); color: var(--muted);
  display: grid; place-items: center; transition: var(--dur) var(--ease);
  box-shadow: var(--sh-sm);
}
.prop__fav:hover { background: #fff; transform: scale(1.08); }
.prop__fav[aria-pressed='true'] { color: #c0392b; }
.prop__fav svg { width: 17px; height: 17px; }

.prop__price {
  position: absolute; inset-block-end: .85rem; inset-inline-end: 1rem; z-index: 2;
  color: #fff; font-weight: 800; font-size: 1.3rem; font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.prop__price small { font-weight: 600; font-size: .78rem; opacity: .9; }

.prop__body { display: flex; flex-direction: column; flex: 1; padding: var(--s-4) var(--s-5); }
.prop__title { font-size: 1.05rem; line-height: 1.5; margin-bottom: .35rem; }
.prop__title a { color: var(--ink); }
.prop__title a:hover { color: var(--gold-600); }
.prop__loc {
  display: flex; align-items: center; gap: .35rem;
  color: var(--muted); font-size: .9rem; margin-bottom: var(--s-3);
}
.prop__loc svg { width: 15px; height: 15px; flex: none; opacity: .7; }

.prop__meta {
  display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-top: auto;
  padding-top: var(--s-3); border-top: 1px solid var(--line-2);
  color: var(--ink-2); font-size: .88rem;
}
.prop__meta span { display: inline-flex; align-items: center; gap: .35rem; }
.prop__meta svg { width: 16px; height: 16px; opacity: .6; }

/* الشريط السفلي: الإفصاح النظامي + زر المقارنة */
.prop__bar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: .7rem var(--s-5); background: var(--surface); border-top: 1px solid var(--line);
}
.prop__licence { font-size: var(--t-xs); color: var(--muted); }
.prop__cmp { flex: none; }
.prop__cmp svg { width: 15px; height: 15px; }

.prop__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.prop__ref { font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }

.price { color: var(--brand); font-weight: 700; font-size: 1.1rem; }
.price small { color: var(--muted); font-weight: 500; font-size: var(--t-xs); }

.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  background: var(--brand); color: #fff; border-radius: var(--r-pill);
  padding: .22rem .7rem; font-size: .76rem; font-weight: 700; white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge--type  { background: var(--brand); }
.badge--soft  { background: rgba(255, 255, 255, .94); color: var(--ink); }
.badge--muted { background: rgba(69, 68, 63, .85); }
.badge--gold  { background: var(--gold); }
.badge--new   { background: var(--ok); }

/* ===== 12) بطاقة مشروع ===== */

.project {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 380px; padding: var(--s-5); overflow: hidden;
  border-radius: var(--r); color: #fff; box-shadow: var(--sh);
  background: linear-gradient(160deg, var(--brand-600), var(--brand) 55%, var(--brand-900));
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.project:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); color: #fff; }
.project__media { position: absolute; inset: 0; z-index: 0; }
.project__media img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.project__media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12, 12, 11, .92), rgba(12, 12, 11, .25));
}
.project__body { position: relative; z-index: 1; }
.project h3 { color: #fff; margin-bottom: .3em; font-size: var(--t-lg); }
.project p { color: rgba(255, 255, 255, .76); font-size: .93rem; margin-bottom: var(--s-3); }
.project__meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .86rem; color: rgba(255, 255, 255, .85); }
.project__status {
  position: absolute; inset-block-start: var(--s-5); inset-inline-start: var(--s-5); z-index: 1;
}

/* ===== 13) بطاقة خدمة ===== */

.service {
  display: block; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r); padding: var(--s-5); box-shadow: var(--sh-sm); color: inherit;
  transition: var(--dur) var(--ease);
}
.service:hover { box-shadow: var(--sh); transform: translateY(-2px); border-color: var(--gold-100); color: inherit; }
.service h3 { margin-bottom: .3em; }
.service p { color: var(--muted); font-size: .93rem; margin-bottom: var(--s-3); }
.service__go { color: var(--gold-600); font-weight: 700; font-size: var(--t-sm); }

/* ===== 14) بطاقة منطقة ===== */

.area {
  position: relative; display: flex; align-items: flex-end; min-height: 170px;
  padding: var(--s-4); border-radius: var(--r); overflow: hidden; color: #fff;
  background: linear-gradient(160deg, var(--brand-600), var(--brand-900));
  transition: var(--dur) var(--ease);
}
.area:hover { transform: translateY(-2px); color: #fff; }
.area strong { position: relative; z-index: 1; font-size: var(--t-md); }
.area span { position: relative; z-index: 1; color: rgba(255, 255, 255, .7); font-size: var(--t-sm); }

/* ===== 15) آراء العملاء ===== */

.testimonial {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s-5); box-shadow: var(--sh-sm);
}
.testimonial__quote { color: var(--ink-2); font-size: 1.02rem; margin-bottom: var(--s-4); }
.testimonial__quote::before { content: '”'; color: var(--gold); font-size: 2.4rem; line-height: 0; vertical-align: -.35em; margin-inline-end: .2rem; }
.testimonial__who { display: flex; align-items: center; gap: var(--s-3); }
.testimonial__avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--gold-50);
  color: var(--gold-600); display: grid; place-items: center; font-weight: 700; flex: none;
}
.testimonial__name { font-weight: 700; font-size: .95rem; }
.testimonial__role { color: var(--muted); font-size: var(--t-sm); }

/* ===== 16) النماذج ===== */

.field { display: flex; flex-direction: column; gap: var(--s-1); }
.field label { font-weight: 600; font-size: .92rem; color: var(--ink-2); }
.field .req { color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; padding: .7rem .9rem; font: inherit; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-50); }
.input[aria-invalid='true'] { border-color: var(--danger); background: var(--danger-bg); }
textarea.input { min-height: 130px; resize: vertical; line-height: 1.7; }
.field__error { color: var(--danger); font-size: var(--t-sm); min-height: 1.2em; }
.form-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: clamp(var(--s-5), 3vw, var(--s-6)); box-shadow: var(--sh);
}

.input-suffix { position: relative; display: flex; align-items: center; }
.input-suffix .input { padding-inline-end: 3rem; }
.input-suffix span {
  position: absolute; inset-inline-end: .9rem; color: var(--muted);
  font-size: var(--t-sm); pointer-events: none;
}

.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-block; padding: .4rem .9rem; background: var(--white);
  border: 1.5px solid var(--line); border-radius: var(--r-pill);
  font-size: .9rem; color: var(--ink-2); transition: var(--dur) var(--ease);
}
.chip:hover span { border-color: var(--brand-100); background: var(--brand-50); }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* مصيدة البريد الآلي */
.hp {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; opacity: 0; pointer-events: none;
}

.form-step { margin-bottom: var(--s-7); }
.form-step__head {
  display: flex; align-items: center; gap: var(--s-2); font-size: 1.05rem;
  padding-bottom: var(--s-2); border-bottom: 1px solid var(--line); margin-bottom: var(--s-5);
}
.form-step__num {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .88rem;
}

.req-tabs { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: var(--s-6); }
.req-tab {
  display: grid; gap: .25rem; text-align: start; cursor: pointer; font: inherit;
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r);
  padding: var(--s-4); transition: var(--dur) var(--ease);
}
.req-tab:hover { border-color: var(--gold-100); background: var(--gold-50); }
.req-tab[aria-selected='true'] { background: var(--brand); border-color: var(--brand); color: #fff; }
.req-tab__t { font-weight: 700; font-size: 1.02rem; }
.req-tab__d { font-size: .86rem; color: var(--muted); }
.req-tab[aria-selected='true'] .req-tab__d { color: rgba(255, 255, 255, .78); }

/* ===== 17) التنبيهات والحالات ===== */

.alert { padding: var(--s-4); border-radius: var(--r-sm); margin-bottom: var(--s-5); font-size: .95rem; }
.alert--error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f0d3d3; }
.alert--ok { background: var(--ok-bg); color: var(--ok); border: 1px solid #cfe7da; }

.success-box { text-align: center; padding: var(--s-6) var(--s-4); }
.success-box__ref {
  display: inline-block; margin: var(--s-3) 0 var(--s-5); padding: .6rem 1.4rem;
  background: var(--gold-50); border: 1px dashed var(--gold); color: var(--gold-600);
  border-radius: var(--r-sm); font-weight: 700; font-size: 1.35rem; letter-spacing: .08em;
  font-variant-numeric: tabular-nums; direction: ltr;
}

.empty {
  text-align: center; padding: var(--s-8) var(--s-5); color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r);
}
.empty h3 { color: var(--ink-2); }

.skeleton {
  height: 340px; border-radius: var(--r);
  background: linear-gradient(90deg, #eeecea 25%, #f8f7f5 50%, #eeecea 75%);
  background-size: 200% 100%; animation: sk 1.2s infinite;
}
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* صورة نائبة موسومة — تُستبدل بصور حقيقية لاحقًا */
.ph {
  display: grid; place-items: center; aspect-ratio: 16 / 10;
  background: repeating-linear-gradient(45deg, var(--brand-50), var(--brand-50) 12px, #eceae6 12px, #eceae6 24px);
  color: var(--brand-100);
}
.ph svg { width: 56px; height: 56px; }

/* ===== 18) الثقة والدعوة ===== */

.trust { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.trust__item {
  display: flex; gap: var(--s-3); align-items: flex-start;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s-5);
}
.trust__item strong { display: block; }
.trust__item span { color: var(--muted); font-size: .9rem; }

.cta {
  position: relative; overflow: hidden; text-align: center;
  background: linear-gradient(135deg, var(--brand-900), var(--brand) 60%, var(--brand-600));
  color: #fff; border-radius: var(--r-lg); padding: clamp(var(--s-6), 5vw, var(--s-8));
}
.cta::after {
  content: ''; position: absolute; inset-block-start: -40%; inset-inline-end: -10%;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(169, 129, 47, .28), transparent 65%);
}
.cta > * { position: relative; z-index: 1; }
.cta h2 { color: #fff; }
.cta p { color: rgba(255, 255, 255, .82); max-width: 56ch; margin-inline: auto; }
.cta__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

/* ===== 19) خدمات الطلبات ===== */

.req-grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.req-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 340px; padding: var(--s-5); overflow: hidden;
  border-radius: var(--r); color: #fff; box-shadow: var(--sh);
  background: linear-gradient(160deg, var(--brand-600) 0%, var(--brand) 55%, var(--brand-900) 100%);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.req-card:hover { transform: translateY(-3px); box-shadow: var(--sh-lg); color: #fff; }
.req-card__icon {
  position: absolute; inset-block-start: var(--s-4); inset-inline-end: var(--s-4);
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(169, 129, 47, .2); color: var(--gold-100);
}
.req-card__icon svg { width: 26px; height: 26px; }
.req-card h3 { color: #fff; margin-bottom: .4rem; font-size: var(--t-lg); }
.req-card p { color: rgba(255, 255, 255, .75); font-size: .93rem; margin-bottom: var(--s-4); }
.req-card__go { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; color: var(--gold-100); }

/* ===== 20) الفلاتر ===== */

.filters {
  display: grid; gap: var(--s-3); align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s-5); box-shadow: var(--sh-sm); margin-bottom: var(--s-6);
}
.filters__row { grid-column: 1 / -1; display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }

/* ===== 21) صفحة تفاصيل العقار ===== */

.detail { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr); align-items: start; }
.gallery__main {
  aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden;
  background: #14130f; display: grid; place-items: center;
}
/* contain لا cover: صور الجوال العمودية تُعرض كاملة بلا قصّ للمبنى */
.gallery__main img { width: 100%; height: 100%; object-fit: contain; }
.gallery__thumbs { display: flex; gap: .6rem; margin-top: .6rem; flex-wrap: wrap; }
.gallery__thumbs img {
  width: 84px; height: 62px; object-fit: cover; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; opacity: .75; transition: var(--dur) var(--ease);
}
.gallery__thumbs img[aria-current='true'] { border-color: var(--gold); opacity: 1; }

.specs { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: var(--s-6) 0; }
.spec { background: var(--surface); border-radius: var(--r-sm); padding: var(--s-3) var(--s-4); }
.spec span { display: block; color: var(--muted); font-size: .82rem; }
.spec strong { font-size: 1.05rem; }

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.features li { position: relative; padding-inline-start: 1.5rem; color: var(--ink-2); }
.features li::before { content: '✓'; position: absolute; inset-inline-start: 0; color: var(--gold-600); font-weight: 700; }

.side-card {
  position: sticky; inset-block-start: calc(var(--header-h) + var(--s-4));
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s-5); box-shadow: var(--sh);
}
.side-card .price { display: block; font-size: 1.6rem; margin-bottom: .25rem; }
.license-note {
  margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--line);
  font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums;
}

.map-embed { aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.map-embed iframe { width: 100%; height: 100%; border: 0; }
.map-embed__placeholder { display: grid; place-items: center; height: 100%; gap: var(--s-3); color: var(--muted); text-align: center; padding: var(--s-4); }

/* شريط المقارنة العائم */
.compare-bar {
  position: fixed; inset-block-end: 0; inset-inline: 0; z-index: 55;
  background: var(--brand); color: #fff; padding: var(--s-3) 0;
  box-shadow: 0 -6px 24px rgba(20, 19, 17, .18);
  transform: translateY(100%); transition: transform var(--dur) var(--ease);
}
.compare-bar.is-open { transform: translateY(0); }
.compare-bar__inner { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.compare-bar__count { font-weight: 700; }

/* ===== 22) الصفحات النصية ===== */

.prose { max-width: 70ch; }
.prose h2 { margin-top: var(--s-7); }
.prose ul { padding-inline-start: 1.4rem; }
.prose li { margin-bottom: .5rem; }

/* ===== 23) التذييل ===== */

.site-footer { background: #171614; color: #cac8c3; margin-top: var(--s-8); padding: var(--s-8) 0 var(--s-5); }
.site-footer a { color: #cac8c3; }
.site-footer a:hover { color: #fff; }
.site-footer__grid { display: grid; gap: var(--s-6); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h4 { color: #fff; font-size: var(--t-base); margin-bottom: var(--s-3); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .93rem; }
.site-footer__logo img { height: 52px; margin-bottom: var(--s-4); }
.site-footer__legal {
  display: flex; flex-wrap: wrap; gap: .5rem var(--s-5); justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, .13); margin-top: var(--s-7); padding-top: var(--s-5);
  font-size: var(--t-sm); color: #97958f;
}
.site-footer__legal span { font-variant-numeric: tabular-nums; }

/* ===== 24) زر واتساب العائم ===== */

.wa-float {
  position: fixed; inset-block-end: var(--s-5); inset-inline-end: var(--s-5); z-index: 60;
  width: 56px; height: 56px; border-radius: 50%; background: var(--wa); color: #fff;
  display: grid; place-items: center; box-shadow: var(--sh-lg); transition: var(--dur) var(--ease);
}
.wa-float:hover { background: var(--wa-600); color: #fff; transform: scale(1.06); }
.wa-float svg { width: 30px; height: 30px; }

/* ===== 25) لوحة الإدارة ===== */

.admin-bar { background: var(--brand-900); color: #fff; padding: var(--s-3) 0; }
.admin-bar__inner { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.admin-bar strong { font-size: 1.05rem; }
.admin-bar .who { margin-inline-start: auto; font-size: .88rem; color: #bdbbb5; }

.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--line); margin: var(--s-6) 0; flex-wrap: wrap; }
.tabs button {
  background: none; border: none; border-bottom: 3px solid transparent;
  padding: .7rem 1.1rem; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
}
.tabs button[aria-selected='true'] { color: var(--brand); border-bottom-color: var(--gold); }

.stats { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s-4); }
.stat b { display: block; font-size: 1.9rem; line-height: 1.2; color: var(--brand); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .88rem; }

.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
table.data { width: 100%; min-width: 900px; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: .8rem .9rem; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
table.data th { background: var(--surface); font-weight: 600; color: var(--ink-2); white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data td.num { font-variant-numeric: tabular-nums; direction: ltr; text-align: start; }

.pill { display: inline-block; padding: .15rem .7rem; border-radius: var(--r-pill); font-size: .8rem; font-weight: 600; }
.pill--new { background: #e7f0ff; color: #1e4d91; }
.pill--in_progress { background: var(--warn-bg); color: var(--warn); }
.pill--done { background: var(--ok-bg); color: var(--ok); }
.pill--cancelled { background: #f0f0f0; color: #666; }
.pill--published { background: var(--ok-bg); color: var(--ok); }
.pill--draft { background: #f0f0f0; color: #666; }
.pill--reserved, .pill--sold, .pill--rented { background: var(--gold-50); color: var(--gold-600); }
.row-actions { display: flex; gap: var(--s-1); flex-wrap: wrap; }

.payload { margin-top: .4rem; }
.payload summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: var(--t-sm); }
.payload dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; margin: .6rem 0 0; font-size: var(--t-sm); }
.payload dt { color: var(--muted); white-space: nowrap; }
.payload dd { margin: 0; }

/* ===== 26) الحركة ===== */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ===== 27) الاستجابة ===== */

@media (max-width: 1024px) {
  .hero-search__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-search__go { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
  .side-card { position: static; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; inset-block-start: 100%; inset-inline: 0;
    flex-direction: column; gap: 2px; padding: var(--s-3) var(--s-5) var(--s-5);
    background: var(--white); border-bottom: 1px solid var(--line); box-shadow: var(--sh);
  }
  .site-nav { margin-inline: 0; }
  .site-nav.is-open { display: flex; }
  .site-header__cta .lang-switch { display: none; }
  .stats-band__item { border-inline-start: none; border-block-start: 1px solid rgba(255, 255, 255, .12); }
  .stats-band__item:first-child { border-block-start: none; }
}

@media (max-width: 480px) {
  .hero-search__row { grid-template-columns: 1fr; }
  .prop-grid { grid-template-columns: 1fr; }
  .btn { padding: .65rem 1.1rem; }
}

@media print {
  .site-header, .site-footer, .wa-float, .compare-bar, .btn { display: none !important; }
}

/* جدول المقارنة */
table.cmp th[scope='row'] { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
table.cmp thead th { vertical-align: top; min-width: 200px; }
table.cmp thead th a { color: var(--ink); font-weight: 700; }
table.cmp thead th a:hover { color: var(--gold-600); }

/* شريط النتائج: العدد + الترتيب */
.results-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-4);
}
.results-bar p { margin: 0; }
.results-bar__sort { flex-direction: row; align-items: center; gap: var(--s-2); }
.results-bar__sort label { white-space: nowrap; font-size: var(--t-sm); color: var(--muted); }
.results-bar__sort .input { width: auto; padding-block: .45rem; }

/* ===== رافع الصور في لوحة الإدارة ===== */
.uploader {
  border: 2px dashed var(--line); border-radius: var(--r);
  padding: var(--s-5); text-align: center; background: var(--surface);
  transition: var(--dur) var(--ease);
}
.uploader.is-over { border-color: var(--gold); background: var(--gold-50); }
.uploader__status { margin-top: var(--s-3); font-size: var(--t-sm); }

.uploader__grid {
  display: grid; gap: var(--s-3); margin-top: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}
.up-item {
  position: relative; margin: 0; border-radius: var(--r-sm); overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--brand-50); cursor: grab;
  border: 1px solid var(--line);
}
.up-item:active { cursor: grabbing; }
.up-item img { width: 100%; height: 100%; object-fit: cover; }
.up-item__cover {
  position: absolute; inset-block-start: .35rem; inset-inline-start: .35rem;
  background: var(--gold); color: #fff; border-radius: var(--r-pill);
  padding: .1rem .55rem; font-size: .7rem; font-weight: 700;
}
.up-item__del {
  position: absolute; inset-block-start: .35rem; inset-inline-end: .35rem;
  width: 24px; height: 24px; border: none; border-radius: 50%; cursor: pointer;
  background: rgba(20, 19, 17, .78); color: #fff; font-size: .8rem; line-height: 1;
}
.up-item__del:hover { background: var(--danger); }

/* ===== شاشة دخول الإدارة ===== */
.auth-page { background: var(--brand-900); }
.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: var(--s-5);
  background:
    radial-gradient(700px 420px at 20% 92%, rgba(169, 129, 47, .26), transparent 66%),
    radial-gradient(820px 460px at 88% -8%, rgba(169, 129, 47, .18), transparent 62%),
    linear-gradient(180deg, #14130f 0%, #0e0d0b 72%);
}
.auth__card {
  width: min(100%, 420px); background: var(--white);
  border-radius: var(--r-lg); padding: clamp(var(--s-5), 5vw, var(--s-7));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.auth__logo { display: block; margin-bottom: var(--s-6); }
.auth__logo img { height: 40px; width: auto; }
.auth h1 { font-size: var(--t-xl); margin-bottom: .25em; }
.auth__note {
  margin: var(--s-5) 0 0; padding-top: var(--s-4);
  border-top: 1px solid var(--line); font-size: var(--t-xs);
}

.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap .input { padding-inline-end: 4.2rem; }
.pw-toggle {
  position: absolute; inset-inline-end: .6rem;
  background: none; border: none; cursor: pointer; padding: .3rem .5rem;
  font: inherit; font-size: var(--t-sm); font-weight: 600; color: var(--gold-600);
}

/* زر الإدارة في الترويسة */
.admin-link { color: var(--muted); }
.admin-link:hover { color: var(--brand); }
