/* Smart Idea demo — Rokn Properties. Deep navy and warm gold: calm and
   trustworthy, the way property buyers expect. List and map side by side on
   wide screens, a List / Map switch on phones. Logical properties throughout
   so Arabic (rtl) and English (ltr) both work. */
:root {
  --bg: #F3F5F8;
  --paper: #fff;
  --ink: #14243A;
  --ink-2: #4A5A70;
  --mut: #7A889B;
  --line: #DFE5EC;
  --navy: #14324A;
  --navy-2: #1E4A6B;
  --gold: #F2B544;
  --ok: #1F7A4D;
  --bad: #B42318;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.6 "Plus Jakarta Sans", Inter, system-ui, sans-serif; }
:lang(ar) body { font-family: Cairo, system-ui, sans-serif; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--mut); }
.small { font-size: 12.5px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; }
.pad { padding: 20px; }
.none { color: var(--mut); text-align: center; padding: 30px 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 20px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 700; cursor: pointer;
}
.btn:hover { border-color: var(--navy); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--mut); }
.btn.ghost-light { background: transparent; border-color: rgba(255, 255, 255, .3); color: #fff; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.wa { background: #E7F7EE; border-color: #BFE6CF; color: #11643A; margin-top: 8px; }
.linkish { border: 0; background: none; padding: 0; color: inherit; font-weight: inherit; text-align: start; cursor: pointer; }
.linkish:hover { color: var(--navy-2); text-decoration: underline; }
.chip { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.chip.on { background: #FFF4DC; border-color: var(--gold); color: #7A5200; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--navy); }

/* ── Header ── */
.re-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px clamp(16px, 3vw, 32px); background: var(--paper); border-bottom: 1px solid var(--line); }
.re-brand { display: flex; align-items: center; gap: 10px; }
.re-brand b { display: block; font-size: 17px; font-weight: 800; }
.re-brand small { display: block; font-size: 12px; color: var(--mut); }
.re-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); margin-inline-start: auto; }
.re-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-weight: 700; cursor: pointer; }
.re-tabs button[aria-selected="true"] { background: var(--navy); color: #fff; }
.favs-btn { height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; color: #B7791F; }

/* ── Search ── */
.filters { position: relative; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px clamp(16px, 3vw, 32px); background: var(--paper); border-bottom: 1px solid var(--line); }
.filters select, .res-head select, .fld select, .fld input {
  height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-weight: 600; font-size: 14px;
}
.deal { display: flex; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.deal button { height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.deal button[aria-pressed="true"] { background: var(--navy); color: #fff; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 0; }
.results { padding: 14px clamp(16px, 2vw, 24px) 90px; min-width: 0; }
.res-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.count { font-weight: 800; font-size: 17px; margin-inline-end: auto; }
.list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lcard { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; transition: box-shadow .2s, border-color .2s; }
.lcard:hover, .lcard.is-sel { border-color: var(--navy); box-shadow: 0 10px 28px -14px rgba(20, 50, 74, .45); }
.lc-img { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; border: 0; padding: 0; cursor: pointer; background: none; overflow: hidden; }
.facade { display: block; width: 100%; height: 100%; }
.lc-deal, .lc-year { position: absolute; top: 10px; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.lc-deal { inset-inline-start: 10px; background: var(--navy); color: #fff; }
.lc-year { inset-inline-end: 10px; background: rgba(255, 255, 255, .9); color: var(--ink); }
.lc-body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.lc-price { font-weight: 800; font-size: 17px; color: var(--navy); }
.lc-body h3 { font-size: 14.5px; font-weight: 700; }
.lc-specs { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--mut); font-size: 13px; }
.lc-specs span + span::before { content: "·"; margin-inline-end: 12px; }
.lc-acts { display: flex; gap: 6px; margin-top: 6px; }

.mapbox { position: sticky; top: 0; height: calc(100dvh - 0px); max-height: 900px; padding: 14px clamp(16px, 2vw, 24px) 14px 0; display: grid; grid-template-rows: auto 1fr; gap: 8px; }
[dir="rtl"] .mapbox { padding: 14px 0 14px clamp(16px, 2vw, 24px); }
#map { border-radius: 16px; border: 1px solid var(--line); min-height: 420px; z-index: 0; }
.pin-wrap { background: none; border: 0; }
.pin {
  display: inline-block; transform: translate(-50%, -100%); padding: 4px 9px; border-radius: 99px; white-space: nowrap;
  background: #fff; color: var(--ink); border: 1.5px solid var(--navy); font: 700 12.5px/1.2 "Plus Jakarta Sans", Cairo, sans-serif;
  box-shadow: 0 4px 10px rgba(20, 36, 58, .25); transition: transform .15s, background .15s;
}
.pin.hot, .pin.on { background: var(--navy); color: #fff; transform: translate(-50%, -100%) scale(1.12); z-index: 1000; }
.pin.on { background: var(--gold); color: var(--ink); border-color: var(--ink); }
.pop { display: grid; gap: 4px; min-width: 190px; font-family: "Plus Jakarta Sans", Cairo, sans-serif; }
.pop .facade { height: 90px; border-radius: 8px; }
.pop b { font-size: 15px; color: var(--navy); }
.pop span { font-size: 12.5px; color: var(--ink-2); }
.pop .btn { margin-top: 4px; color: #fff; }
.m-toggle { display: none; }

.cmp-bar {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 700;
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .5);
}
[dir="rtl"] .cmp-bar { padding: 8px 18px 8px 8px; }

/* ── Listing page ── */
.detail { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 60px; }
.link-back { border: 0; background: none; color: var(--ink-2); font-weight: 700; cursor: pointer; margin: 18px 0 12px; }
.dt { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.dt-pic { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 9; background: #fff; border: 1px solid var(--line); }
.dt-pictabs { position: absolute; bottom: 12px; inset-inline-start: 12px; display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: rgba(255, 255, 255, .92); }
.dt-pictabs button { height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; font-weight: 700; font-size: 13px; cursor: pointer; }
.dt-pictabs button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.dt-main > .muted { margin-top: 6px; }
.dt-price { font-size: 28px; font-weight: 800; color: var(--navy); margin-top: 16px; }
.dt h1 { font-size: clamp(22px, 3vw, 30px); }
.dt-acts { display: flex; gap: 8px; margin: 12px 0 8px; }
.dt-main h2 { font-size: 17px; margin: 22px 0 10px; }
.dt-specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.dt-specs div { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.dt-specs dt { color: var(--mut); font-size: 12.5px; }
.dt-specs dd { font-weight: 700; }
.feats { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.feats li { padding: 6px 12px; border-radius: 99px; background: #E8F0F7; color: var(--navy); font-size: 13.5px; font-weight: 600; }
.dt-side { display: grid; gap: 16px; position: sticky; top: 16px; }
.dt-side h2 { font-size: 17px; margin-bottom: 8px; }
.calc .muted { font-size: 13px; margin-bottom: 10px; }
.rng { display: grid; gap: 4px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.rng span { display: flex; justify-content: space-between; gap: 8px; }
.rng b { color: var(--navy); }
.rng input { accent-color: var(--navy); width: 100%; }
.calc-out { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); font-weight: 600; }
.calc-out b { font-size: 22px; color: var(--navy); }
#req { display: grid; gap: 12px; }
.fld { display: grid; gap: 5px; }
.fld > span { font-weight: 600; font-size: 13.5px; }
.fld input, .fld select { width: 100%; font-size: 16px; font-weight: 500; }
.fld [aria-invalid="true"] { border-color: var(--bad); }
:lang(ar) #r-phone { text-align: right; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.err { color: var(--bad); font-size: 12.5px; font-style: normal; font-weight: 600; }
.err:empty { display: none; }
.how { border: 0; display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.how legend { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.how label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.how input { accent-color: var(--navy); }
.req-ok { display: grid; gap: 12px; padding: 14px; border-radius: 12px; background: #E7F5EE; color: #11502F; font-weight: 600; }

/* ── Compare ── */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(20, 36, 58, .5); }
.modal-panel { width: min(960px, 100%); max-height: 90dvh; overflow: auto; background: var(--paper); border-radius: 18px; padding: 20px; }
.modal-panel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-panel h2:focus { outline: none; }
.x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 22px; cursor: pointer; }
.cmp-scroll { overflow-x: auto; }
.cmp-scroll table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 14px; }
.cmp-scroll th, .cmp-scroll td { padding: 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.cmp-scroll tbody th { color: var(--mut); font-weight: 600; width: 140px; }
.cmp-scroll thead th .facade { height: 90px; border-radius: 10px; margin-bottom: 6px; }
.cmp-scroll thead th { font-size: 13.5px; }

/* ── Company board ── */
.board { max-width: 1240px; margin: 0 auto; padding: 20px clamp(16px, 3vw, 32px) 60px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.kpi span { display: block; color: var(--mut); font-size: 13px; font-weight: 600; }
.kpi b { font-size: 24px; font-variant-numeric: tabular-nums; }
.b-tabs { display: flex; gap: 4px; padding: 4px; width: fit-content; border-radius: 12px; background: #E3E8EF; margin-bottom: 16px; }
.b-tabs button { height: 38px; padding: 0 18px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.b-tabs button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.pipe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { background: #E8EDF3; border-radius: 16px; padding: 10px; min-height: 200px; }
.col h2 { display: flex; justify-content: space-between; align-items: center; font-size: 14.5px; padding: 4px 6px 10px; }
.col h2 span { min-width: 24px; height: 24px; border-radius: 99px; display: grid; place-items: center; background: var(--paper); font-size: 12.5px; }
.lead { background: var(--paper); border-radius: 12px; padding: 12px; margin-bottom: 8px; display: grid; gap: 3px; border: 1px solid var(--line); }
.lead.is-mine { border-color: var(--gold); box-shadow: 0 0 0 2px #FBE3A8; }
.lead small { color: var(--mut); font-size: 12.5px; }
:lang(ar) .lead small[dir="ltr"] { text-align: right; }
.lead-l { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.lead-acts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tag { justify-self: start; padding: 0 8px; border-radius: 99px; background: #FFF4DC; color: #7A5200; font-size: 11.5px; font-style: normal; font-weight: 700; }
.top-viewed { margin-top: 16px; }
.top-viewed h2 { font-size: 15.5px; margin-bottom: 10px; }
.top-viewed ol { padding-inline-start: 22px; display: grid; gap: 6px; font-size: 14px; }
.top-viewed li { padding-inline-start: 4px; }
.top-viewed li b { margin-inline-start: 10px; color: var(--navy); }
.top-viewed small { color: var(--mut); font-weight: 400; }
.b-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.b-list { list-style: none; padding: 6px; }
.b-list li { display: flex; align-items: center; gap: 12px; padding: 10px; border-bottom: 1px solid var(--line); }
.b-list li:last-child { border-bottom: 0; }
.b-list li.is-off { opacity: .55; }
.bl-pic { width: 76px; height: 48px; border-radius: 8px; overflow: hidden; flex: none; }
.bl-txt { flex: 1; min-width: 0; }
.bl-txt b { display: block; font-size: 14px; }
.bl-txt small { color: var(--mut); font-size: 12.5px; }
.pill { padding: 2px 10px; border-radius: 99px; background: #EEF1F5; color: var(--mut); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.on { background: #E3F4EA; color: var(--ok); }
.b-add { display: grid; gap: 12px; position: sticky; top: 16px; }
.b-add h2 { font-size: 16px; }
.ok-msg { color: var(--ok); font-weight: 600; font-size: 13.5px; }
.ok-msg:empty { display: none; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .list { grid-template-columns: 1fr; }
  .dt { grid-template-columns: 1fr; }
  .dt-side { position: static; }
  .dt-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-split { grid-template-columns: 1fr; }
  .b-add { position: static; }
}
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  .mapbox { display: none; position: static; height: calc(100dvh - 150px); padding: 10px 16px; }
  body.show-map .mapbox { display: grid; }
  body.show-map .results { display: none; }
  .m-toggle {
    display: block; position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 15;
    height: 46px; padding: 0 22px; border: 0; border-radius: 99px; background: var(--ink); color: #fff; font-weight: 700; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .5);
  }
  .cmp-bar { bottom: 74px; }
  .filters { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .filters > * { flex: none; }
  .re-tabs { order: 3; width: 100%; margin: 0; }
  .re-tabs button { flex: 1; justify-content: center; }
  .favs-btn { margin-inline-start: auto; }
  .re-brand small { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe { grid-template-columns: 1fr; }
  .b-list li { flex-wrap: wrap; }
}
