:root {
  --navy: #0f2a44;
  --navy-2: #1b3d61;
  --gold: #c8a24a;
  --gold-2: #e3c77d;
  --wa: #1fae5b;
  --wa-dark: #178a48;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #6b7684;
  --line: #e3e7ec;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(15, 42, 68, .07);
  --shadow-lg: 0 10px 30px rgba(15, 42, 68, .14);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; display: block; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { color: var(--gold); }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5em; }
.ic { flex-shrink: 0; vertical-align: middle; }
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.section { padding-block: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-title { font-size: 1.45rem; position: relative; padding-inline-start: 14px; }
.section-title::before { content: ""; position: absolute; inset-inline-start: 0; top: .25em; bottom: .25em; width: 5px; border-radius: 4px; background: var(--gold); }
.link-more { font-weight: 700; }

/* ===== الأزرار ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; line-height: 1.2;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 14px; font-size: .92rem; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); color: #fff; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); color: #fff; }
.btn-dark { background: #111; color: #fff; }
.btn-dark:hover { background: #333; color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-2); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; color: #fff; }

/* ===== الهيدر ===== */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.brand:hover { color: #fff; }
.brand span { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 1.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { font-size: .75rem; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a:not(.btn) { color: #dfe7f0; padding: 8px 12px; border-radius: 8px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.main-nav a:not(.btn):hover, .main-nav a.active { color: #fff; background: rgba(255,255,255,.1); }
.main-nav a.active { box-shadow: inset 0 -2px 0 var(--gold); }
.main-nav .btn { margin-inline-start: 8px; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; padding: 8px; cursor: pointer; border-radius: 8px; }

@media (max-width: 960px) {
  .brand small { display: none; }
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none; position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--navy); padding: 8px 16px 16px; box-shadow: 0 10px 20px rgba(0,0,0,.2);
  }
  .main-nav.open { display: flex; }
  .main-nav a:not(.btn) { padding: 12px; }
  .main-nav .btn { margin: 8px 0 0; }
}

/* ===== الهيرو والبحث ===== */
.hero {
  background:
    linear-gradient(135deg, rgba(15,42,68,.95), rgba(27,61,97,.88)),
    radial-gradient(circle at 20% 20%, rgba(200,162,74,.35), transparent 50%);
  color: #fff; padding: 48px 0 56px; text-align: center;
}
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; }
.hero p { opacity: .85; max-width: 680px; margin: 0 auto 26px; font-size: 1.05rem; }
.search-form {
  display: grid; grid-template-columns: 2fr repeat(4, 1fr) auto; gap: 10px; align-items: end;
  background: #fff; padding: 14px; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  text-align: start; color: var(--text);
}
.search-full { grid-template-columns: repeat(4, 1fr); box-shadow: none; padding: 0; background: none; }
.search-full .field-q { grid-column: span 2; }
.search-full .field-actions { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 700; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text); min-height: 44px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.field-actions { flex-direction: row; gap: 8px; }
.field-actions .btn { min-height: 44px; flex: 1; }
@media (max-width: 960px) {
  .search-form { grid-template-columns: 1fr 1fr; }
  .search-form .field-q, .search-form .field-actions { grid-column: 1 / -1; }
  .search-full { grid-template-columns: 1fr 1fr; }
}

.page-head { background: var(--navy); color: #fff; padding: 26px 0; }
.page-head h1 { margin: 0; font-size: 1.6rem; }
.page-head p { margin: 4px 0 0; opacity: .8; }
.filters { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 22px; }
.filters summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters[open] summary { margin-bottom: 14px; }

/* ===== الشبكة والكروت ===== */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 600; color: var(--text); box-shadow: var(--shadow); }
.chip b { background: var(--bg); border-radius: 999px; padding: 0 8px; margin-inline-start: 6px; font-size: .85rem; color: var(--muted); }
.chip:hover { border-color: var(--gold); color: var(--navy); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 20px; }
.grid-ad { grid-column: 1 / -1; }
.grid-ad:empty { display: none; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card.is-closed .card-img img { filter: grayscale(.6); }
.card-img { position: relative; display: block; aspect-ratio: 4 / 3; background: #dde3ea; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-badges { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.card-code { position: absolute; bottom: 10px; inset-inline-start: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; padding: 2px 10px; border-radius: 999px; }
.card-video { position: absolute; bottom: 10px; inset-inline-end: 10px; background: rgba(0,0,0,.6); color: #fff; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-price { color: var(--navy); font-weight: 800; font-size: 1.15rem; }
.card-title { font-size: 1.02rem; margin: 0; font-weight: 700; }
.card-title a { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a:hover { color: var(--gold); }
.card-loc { margin: 0; color: var(--muted); font-size: .9rem; display: flex; align-items: center; gap: 4px; }
.card-specs { display: flex; gap: 14px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.card-specs span { display: inline-flex; align-items: center; gap: 5px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: #eef1f5; color: var(--navy); }
.badge-sale { background: var(--navy); color: #fff; }
.badge-rent { background: var(--gold); color: var(--navy); }
.badge-featured { background: #fff4d6; color: #a07a12; }
.badge-sold, .badge-rented { background: var(--danger); color: #fff; }
.badge-reserved { background: #e67e22; color: #fff; }
.badge-code { background: #eef1f5; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; background: #fff; border-radius: var(--radius); }
.empty .btn { margin-top: 10px; }

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 28px; }
.pagination a, .pagination span { min-width: 42px; padding: 8px 12px; border-radius: 10px; background: #fff; text-align: center; box-shadow: var(--shadow); font-weight: 700; }
.pagination .current { background: var(--navy); color: #fff; }

.cta { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; border-radius: var(--radius); padding: 28px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta h2 { margin-bottom: 4px; }
.cta p { margin: 0; opacity: .85; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== صفحة العقار ===== */
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.property-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.property-head h1 { font-size: clamp(1.35rem, 3.5vw, 1.9rem); margin: 8px 0 4px; }
.property-head .loc { margin: 0; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.property-price strong { font-size: 1.6rem; color: var(--navy); font-weight: 800; display: block; }
.property-price small { color: var(--wa-dark); font-weight: 700; }
.property-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.property-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.property-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 86px; }
@media (max-width: 960px) {
  .property-layout { grid-template-columns: 1fr; }
  .property-side { position: static; }
}
.box { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.box h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }

.gallery-main { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; background: #111; aspect-ratio: 16 / 10; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-count { position: absolute; bottom: 12px; inset-inline-start: 12px; background: rgba(0,0,0,.65); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--navy); display: grid; place-items: center; padding-bottom: 4px; }
.gallery-nav.prev { inset-inline-start: 12px; }
.gallery-nav.next { inset-inline-end: 12px; }
[dir="rtl"] .gallery-nav { transform: translateY(-50%) scaleX(-1); }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: thin; }
.gallery-thumbs button { flex: 0 0 88px; height: 66px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: #ddd; opacity: .7; }
.gallery-thumbs button.active { border-color: var(--gold); opacity: 1; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.video-embed.video-tiktok { aspect-ratio: 9 / 16; max-width: 340px; margin-inline: auto; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-file { width: 100%; max-height: 600px; border-radius: 10px; background: #000; margin-top: 12px; }

.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.specs div { background: var(--bg); border-radius: 10px; padding: 10px 14px; }
.specs dt { color: var(--muted); font-size: .85rem; }
.specs dd { margin: 0; font-weight: 700; }
.description { white-space: normal; overflow-wrap: anywhere; }

.contact-box { display: flex; flex-direction: column; gap: 10px; }
.contact-name { font-size: 1.1rem; text-align: center; }
.meta-line { margin: 4px 0 0; font-size: .85rem; color: var(--muted); text-align: center; display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.share-box strong { display: block; margin-bottom: 10px; }
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btns a, .share-btns button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); font: inherit; font-weight: 600; cursor: pointer; }
.share-btns a:hover, .share-btns button:hover { border-color: var(--gold); }

.mobile-contact-bar { display: none; }
@media (max-width: 960px) {
  .mobile-contact-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: fixed; inset-inline: 0; bottom: 0; z-index: 60; background: #fff; padding: 10px 12px; box-shadow: 0 -4px 14px rgba(0,0,0,.1); }
  body:has(.mobile-contact-bar) .wa-float { display: none; }
  body:has(.mobile-contact-bar) .site-footer { padding-bottom: 76px; }
}

/* ===== الإعلانات ===== */
.ad-box { margin: 20px 0; text-align: center; min-height: 100px; }
.ad-label { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 4px; }

/* ===== الصفحات الثابتة ===== */
.prose { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); max-width: 860px; margin-inline: auto; }
.prose h2 { font-size: 1.2rem; margin-top: 1.4em; }
.prose p, .prose li { color: #37414d; }
.contact-cards { display: grid; gap: 10px; max-width: 420px; margin: 16px 0; }
.social-light a { background: var(--bg); color: var(--navy); }

/* ===== الفوتر ===== */
.site-footer { background: #0b1f33; color: #c3cfdb; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 28px; padding-block: 36px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h3 { color: #fff; font-size: 1.05rem; }
.site-footer p { margin: 0 0 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: #c3cfdb; display: inline-flex; align-items: center; gap: 6px; }
.site-footer a:hover { color: var(--gold); }
.contact-list li { display: flex; align-items: center; gap: 6px; }
.social { display: flex; gap: 10px; }
.social a { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; }
.social a:hover { background: var(--gold); color: var(--navy); }
.copyright { text-align: center; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: .88rem; }

.wa-float { position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 55; width: 58px; height: 58px; border-radius: 50%; background: var(--wa); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(31,174,91,.45); }
.wa-float:hover { color: #fff; background: var(--wa-dark); }

.cookie-bar { position: fixed; bottom: 12px; inset-inline: 12px; z-index: 70; max-width: 640px; margin-inline: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 14px 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cookie-bar[hidden] { display: none; }
.cookie-bar p { margin: 0; font-size: .9rem; flex: 1 1 260px; }

/* ===== رسائل ===== */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.alert-success { background: #e7f7ee; color: #146c3a; }
.alert-error { background: #fdecea; color: #a12b1f; }
.alert-info { background: #eaf2fb; color: #1b4f86; }

/* ===== مسار الصفحة داخل الهيدر الكحلي + عمليات البحث الشائعة ===== */
.breadcrumb-light { color: rgba(255,255,255,.7); margin-bottom: 6px; }
.breadcrumb-light a { color: rgba(255,255,255,.85); }
.breadcrumb-light a:hover { color: var(--gold); }
.page-head p { max-width: 820px; }
.popular .chip { font-weight: 600; font-size: .92rem; }
