/* تصميم صفحات العملاء — مطابق لموقع ون مليون الأصلي */
:root {
  /* الألوان: بني رملي وذهبي (2026-11-24). الأخضر القديم: brand #15433F، brand-dark #0D2B28، bg #F6F4EE */
  --ink: #2A1F14; --bg: #F8F3EA; --surface: #FFFFFF; --line: #E8DCC8;
  --brand: #5A4126; --brand-dark: #3B2A17; --brand-2: #C8972C;
  --muted: #7A6A55; --danger: #B4452F; --success: #1F6E4F;
  --warn: #9A6B0F; --warn-bg: #FBF0D9; --ok-bg: #E3F0EA;
  --radius: 16px; --shadow: 0 1px 2px rgba(42, 31, 20, .05), 0 8px 24px rgba(42, 31, 20, .07);
  --shadow-hover: 0 2px 4px rgba(42, 31, 20, .06), 0 16px 36px rgba(42, 31, 20, .14);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  line-height: 1.6; padding-inline: 16px;
  padding-block: env(safe-area-inset-top, 0px) calc(env(safe-area-inset-bottom, 0px) + 24px);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

.wrap { max-width: 560px; margin: 0 auto; }
.wrap-wide { max-width: 1080px; margin: 0 auto; }

/* ---------- Header ---------- */
header.site { display: flex; align-items: center; gap: 12px; padding-block: 22px 10px; }
header.site .home { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo { height: 110px; width: auto; flex-shrink: 0; }
.brandtag { font-size: 22px; font-weight: 800; color: var(--brand-dark); line-height: 1.4; }
@media (max-width: 600px) {
  .logo { height: 84px; }
  .brandtag { font-size: 18px; }
}
@media (max-width: 360px) {
  .logo { height: 70px; }
  .brandtag { font-size: 16px; }
}

/* ---------- خلفية الصفحة كاملة: خطوط المباني (نفس اللوقو) ترسم نفسها بالذهبي — تنرسم من goldLinesBg() في common.js ---------- */
.bgfx { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; opacity: .3; }
.bgfx svg { display: block; }
.bgfx path { fill: none; stroke: var(--brand-2); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: bgdraw 10s ease-in-out infinite alternate; animation-delay: calc(var(--d, 0s) * -1); }
.bgfx path:nth-child(2) { animation-delay: calc(var(--d, 0s) * -1 + .7s); }
.bgfx path:nth-child(3) { animation-delay: calc(var(--d, 0s) * -1 + 1.4s); }
@keyframes bgdraw { 0%, 12% { stroke-dashoffset: 1400; } 72%, 100% { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .bgfx path { animation: none; stroke-dashoffset: 0; } }
header.site nav { margin-inline-start: auto; display: flex; gap: 6px; }
.navlink { text-decoration: none; font-size: 13.5px; font-weight: 700; color: var(--muted); padding: 8px 12px; border-radius: 10px; border: 1.5px solid transparent; white-space: nowrap; }
.navlink:hover { border-color: var(--line); }
.navlink.on { color: var(--brand); border-color: var(--line); background: var(--surface); }

/* ---------- Hero ---------- */
.hero { padding-block: 14px 20px; }
.hero h1 { font-size: clamp(22px, 6vw, 30px); font-weight: 800; line-height: 1.3; margin: 0 0 8px; text-wrap: balance; color: var(--brand-dark); }
.hero p { margin: 0; color: var(--muted); font-size: 15px; max-width: 46ch; }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }

/* ---------- Offers banner (home) ---------- */
.offers-banner { display: flex; align-items: center; gap: 14px; text-decoration: none; margin-bottom: 14px; padding: 14px 16px; transition: border-color .15s, transform .1s; }
.offers-banner:hover { border-color: var(--brand); }
.offers-banner:active { transform: scale(.99); }
.offers-banner .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.offers-banner .ic svg { width: 24px; height: 24px; stroke: #fff; }
.offers-banner b { display: block; color: var(--brand-dark); font-size: 16px; }
.offers-banner small { color: var(--muted); font-size: 13px; }
.offers-banner .arrow { margin-inline-start: auto; color: var(--brand-2); font-size: 22px; font-weight: 800; }

/* ---------- Type switch ---------- */
.switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
/* أزرار الأقسام الثلاثة في صفحة العميل الموحّدة */
.switch.tabs3 { grid-template-columns: repeat(3, 1fr); max-width: 720px; margin-inline: auto; scroll-margin-top: 12px; }
.tab-count { font-weight: 500; opacity: .8; }
.form-title { margin: 0 0 16px; font-size: 19px; color: var(--brand-dark); }
.cta-request { margin-top: 22px; max-width: 560px; margin-inline: auto; }
@media (max-width: 420px) { .switch.tabs3 button { font-size: 12.5px; padding: 12px 4px; } }
.switch button {
  appearance: none; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 16px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; color: var(--muted); box-shadow: var(--shadow);
  transition: border-color .15s, background .15s, color .15s, transform .15s, box-shadow .15s;
}
.switch button:not(.active):hover { border-color: var(--brand-2); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.switch button svg { width: 22px; height: 22px; stroke: var(--muted); transition: stroke .15s; }
.switch button.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.switch button.active svg { stroke: #fff; }
.switch button:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--brand-dark); margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--muted); font-size: 12px; }
.field input, .field select, .field textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 15px; color: var(--ink); background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.field textarea { resize: vertical; min-height: 72px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 400px) { .row2 { grid-template-columns: 1fr; } }
.hint { font-size: 12px; color: var(--danger); margin-top: 5px; display: none; }
.field.invalid input, .field.invalid select { border-color: var(--danger); }
.field.invalid .hint { display: block; }
.submit { width: 100%; border: none; border-radius: 12px; background: var(--brand-2); color: var(--brand-dark); font-weight: 800; font-size: 16px; padding: 14px; cursor: pointer; margin-top: 6px; transition: transform .1s, filter .15s; }
.submit:hover { filter: brightness(1.05); }
.submit:active { transform: scale(.98); }
.submit[disabled] { opacity: .65; cursor: default; }
.privacy { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 10px; }
.err-box { font-size: 13px; color: var(--danger); text-align: center; margin-top: 8px; }

/* ---------- Success ---------- */
.success { text-align: center; padding-block: 28px 10px; display: none; }
.success .tick { width: 58px; height: 58px; border-radius: 50%; background: var(--success); color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.success h2 { margin: 0 0 8px; font-size: 19px; color: var(--brand-dark); }
.success p { margin: 0; color: var(--muted); font-size: 14px; }
.success .again { margin-top: 16px; background: none; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 16px; font-weight: 700; color: var(--muted); cursor: pointer; }

footer.site { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 26px; }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; text-align: right; }
.foot-contact { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.foot-item { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--brand-dark); font-size: 13.5px; font-weight: 700; }
.foot-item:hover { color: var(--brand); }
.foot-item .ico { color: var(--brand-2); }
.foot-license { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); text-align: left; }
.foot-license b { color: var(--brand-dark); font-size: 14px; }
.foot-license img { width: 72px; height: 72px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.foot-copy { margin-top: 14px; }

/* ---------- Offers page ---------- */
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.comm { font-size: 12.5px; color: var(--muted); }
.comm b { color: var(--brand-2); }
.comm-box { background: var(--surface); border: 1px solid var(--line); border-inline-start: 4px solid var(--brand-2); border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: 14px; }
.comm-box b { color: var(--brand-dark); }
.comm-box small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.extras { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.extras span { background: var(--ok-bg); color: var(--success); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 700; }
.filters .field { margin: 0; }
.seg { display: inline-grid; grid-auto-flow: column; gap: 6px; }
.seg button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 16px; font-weight: 700; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 16px; }
.bar .count { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; padding: 0; text-align: inherit; font: inherit; color: inherit; transition: border-color .2s, transform .2s, box-shadow .2s; }
.pcard:hover { border-color: var(--brand-2); transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.pcard:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.thumb { position: relative; aspect-ratio: 4 / 3; background: #EEE6D8; overflow: hidden; }
.thumb img.photo { width: 100%; height: 100%; object-fit: cover; }
.thumb::after { content: ''; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(to top, rgba(0,0,0,.28), transparent); pointer-events: none; z-index: 1; }

/* ---------- صور العقار: سحب يمين ويسار ---------- */
.car { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; height: 100%; -webkit-overflow-scrolling: touch; }
.car::-webkit-scrollbar { display: none; }
.car > img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; scroll-snap-stop: always; user-select: none; -webkit-user-drag: none; }
.thumb .car { position: absolute; inset: 0; }
.car-nav { position: absolute; top: 50%; z-index: 3; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--brand-dark); box-shadow: 0 2px 10px rgba(0,0,0,.2); display: grid; place-items: center; cursor: pointer; transition: opacity .2s, transform .15s; }
.car-nav svg { width: 18px; height: 18px; }
.car-nav:hover { transform: scale(1.08); }
.car-nav.prev { inset-inline-start: 10px; }
.car-nav.next { inset-inline-end: 10px; }
.car-nav[disabled] { opacity: 0 !important; pointer-events: none; }
.thumb .car-nav { opacity: 0; }
.pcard:hover .car-nav { opacity: 1; }
@media (hover: none) { .thumb .car-nav { display: none; } }
.car-dots { position: absolute; bottom: 10px; inset-inline: 0; z-index: 3; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.car-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.6); transition: width .2s, background .2s; }
.car-dots i.on { width: 18px; background: #fff; }
.car-count { position: absolute; bottom: 12px; inset-inline-start: 12px; z-index: 3; background: rgba(0,0,0,.55); color: #fff; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; direction: ltr; }
.car-zoom { position: absolute; bottom: 12px; inset-inline-end: 12px; z-index: 3; background: rgba(0,0,0,.55); color: #fff; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; pointer-events: none; }
.gallery-main .car > img { cursor: zoom-in; }

/* عرض الصور بكامل الشاشة */
.lb { position: fixed; inset: 0; z-index: 90; background: rgba(12, 9, 5, .98); display: flex; flex-direction: column; }
.lb[hidden] { display: none; }
.lb .car { flex: 1; height: auto; }
.lb .car > img { object-fit: contain; }
.lb .car-nav { background: rgba(255,255,255,.15); color: #fff; width: 46px; height: 46px; margin-top: -23px; box-shadow: none; }
.lb .car-nav:hover { background: rgba(255,255,255,.28); }
.lb-close { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); inset-inline-end: 12px; z-index: 4; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15); color: #fff; font-size: 26px; cursor: pointer; }
.lb .car-count { top: calc(env(safe-area-inset-top, 0px) + 20px); bottom: auto; inset-inline-start: 50%; transform: translateX(50%); background: rgba(255,255,255,.15); }
@media (hover: none) { .lb .car-nav { display: none; } }
.ph { position: absolute; inset: 0; display: grid; place-items: center; }
.ph img { width: 30%; opacity: .18; }
.tags { position: absolute; top: 12px; inset-inline: 12px; z-index: 3; display: flex; justify-content: space-between; gap: 6px; pointer-events: none; }
.tag { font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.tags .pill { box-shadow: 0 2px 6px rgba(0,0,0,.15); }
/* خانة البحث في الأحياء */
.ss { position: relative; }
.ss-list { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface, #fff); border: 1.5px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; }
.ss-list[hidden] { display: none; }
.ss-list li { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14.5px; }
.ss-list li:hover, .ss-list li.act { background: var(--bg); }
.ss-list li.cur { color: var(--brand); font-weight: 700; }
.ss-list li.all { color: var(--muted); }
.ss-list li.none { color: var(--muted); cursor: default; }
.tag-group { display: flex; flex-wrap: wrap; gap: 6px; }
.tag.offplan { background: var(--brand-2); }
#fBuild { margin-inline-start: 10px; margin-top: 8px; }
#fBuild[hidden] { display: none; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.st-available { background: var(--ok-bg); color: var(--success); }
.st-reserved { background: var(--warn-bg); color: var(--warn); }
.pbody { padding: 16px 18px 0; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.pbody h3 { margin: 0; font-size: 16.5px; font-weight: 800; color: var(--brand-dark); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.loc { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 4px; }
.loc .ico { color: var(--brand-2); }
.price { font-size: 20px; font-weight: 800; color: var(--brand); margin-top: auto; padding-top: 8px; }
.price small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.specs { display: flex; gap: 16px; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); padding: 11px 18px 13px; margin: 10px -18px 0; flex-wrap: wrap; background: #FCFAF6; }
.specs .ico { color: var(--brand-2); }
.pbody:not(:has(.specs)) { padding-bottom: 16px; }
.specs span { display: inline-flex; align-items: center; gap: 5px; }
.ico { width: 16px; height: 16px; flex: none; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); grid-column: 1 / -1; }
.empty a { color: var(--brand); font-weight: 700; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(59, 42, 23, .45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 28px 16px; overflow-y: auto; }
.modal-box { background: var(--bg); border-radius: 18px; width: 100%; max-width: 900px; overflow: hidden; box-shadow: 0 24px 64px rgba(0, 0, 0, .25); position: relative; }
.modal-close { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 22px; line-height: 1; color: var(--brand-dark); }
/* رجوع لكل العروض */
.back-all { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 3; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--brand-dark); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.back-all:hover, .back-bottom button:hover { border-color: var(--brand); }
.back-bottom { padding: 0 18px 20px; }
.back-bottom button { width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 13px; font-family: inherit; font-size: 15px; font-weight: 800; color: var(--brand); cursor: pointer; }
.gallery-main { aspect-ratio: 16 / 9; background: #EEEBE2; position: relative; }
.gallery-main img.photo { width: 100%; height: 100%; object-fit: cover; }
.gallery-main .ph img { width: 14%; }
.gallery-thumbs { display: flex; gap: 8px; padding: 10px 18px 0; overflow-x: auto; }
.gallery-thumbs button { border: 2px solid transparent; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer; flex: none; width: 76px; height: 56px; background: none; }
.gallery-thumbs button.on { border-color: var(--brand-2); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; padding: 18px; }
.detail h2 { margin: 6px 0 2px; font-size: 22px; line-height: 1.35; color: var(--brand-dark); }
.detail .price { font-size: 24px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 14px 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; box-shadow: 0 1px 2px rgba(42, 31, 20, .04); }
.facts small { display: block; color: var(--muted); font-size: 12px; }
.facts b { font-size: 15px; color: var(--brand-dark); }
.desc { white-space: pre-line; color: #33433f; font-size: 15px; }
.map-box { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface, #fff); }
.map-box h3 { display: flex; align-items: center; gap: 6px; margin: 0; padding: 12px 14px; font-size: 15px; color: var(--brand); }
.map-frame { display: block; width: 100%; height: 240px; border: 0; }
.map-go { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 13px; background: var(--brand); color: #fff; font-weight: 700; font-size: 15px; text-decoration: none; }
.map-go:hover { filter: brightness(1.1); }
.map-go .ico { stroke: #fff; }
.maplink { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--brand); font-weight: 700; font-size: 14px; text-decoration: none; }
.share-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); font-weight: 700; }
.share-btn { border: 1.5px solid var(--line); background: var(--surface); color: var(--brand-dark); border-radius: 999px; padding: 6px 14px; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; }
.share-btn:hover { border-color: var(--brand); }
.share-btn.wa { background: #1E9E5A; border-color: #1E9E5A; color: #fff; }
.interest h3 { margin: 0 0 4px; font-size: 17px; color: var(--brand-dark); }
.interest > p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.note-reserved { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
.alt-contact { display: flex; gap: 8px; margin-top: 12px; }
.alt-contact a { flex: 1; text-align: center; text-decoration: none; border: 1.5px solid var(--line); border-radius: 10px; padding: 9px; font-weight: 700; font-size: 13.5px; color: var(--brand-dark); background: var(--bg); }
.alt-contact a:hover { border-color: var(--brand); }

@media (max-width: 820px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .field:first-child { grid-column: 1 / -1; }
  .detail { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .modal { padding: 0; }
  .modal-box { border-radius: 0; min-height: 100%; }
}
