/* =========================================================
   Compounds map — shared styles for compounds.html and solana-living.html.
   Uses logical properties so the layout mirrors in RTL (Arabic).
   ========================================================= */
:root {
    --sage: #5e6b63;
    --sage-dark: #3f4a44;
    --gold: #b8963f;
    --gold-light: #e3c97f;
    --cream: #f7f3ea;
    --ink: #1f2622;
    --muted: #7a8580;
    --line: rgba(94, 107, 99, 0.18);
    --card: #ffffff;
    --header-h: 84px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: 'Jost', 'Tajawal', 'Segoe UI', sans-serif;
    background: var(--cream);
    color: var(--ink);
    overflow: hidden;
}
button { font-family: inherit; cursor: pointer; }

/* ===== Header ===== */
.sl-header {
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
    z-index: 1000;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 0 28px;
    background: rgba(247, 243, 234, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.sl-header[hidden] { display: none; }
.sl-logos { display: flex; align-items: center; gap: 16px; height: 100%; }
.sl-divider { width: 1px; height: 44px; background: var(--line); }
.sl-title { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; }
.sl-title h1 {
    font-family: 'Cormorant Garamond', 'Tajawal', serif;
    font-weight: 600; letter-spacing: 0.22em; font-size: 26px;
    color: var(--sage); text-transform: uppercase;
}
.sl-logo-solana { height: 70px; width: auto; mix-blend-mode: multiply; }
.sl-logo-zad { height: 46px; width: auto; }

/* ===== Map ===== */
#map {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    z-index: 1; background: #e9e5da;
}
.leaflet-control-attribution { font-size: 10px; }
.leaflet-container { font-family: inherit; }

.compound-pin {
    display: flex; flex-direction: column; align-items: center;
    position: absolute; left: 0; top: 0;
    transform: translate(-50%, -100%);
    width: max-content;
}
.compound-pin .bubble {
    display: flex; align-items: center; gap: 10px;
    background: var(--sage); color: #fff;
    border: 2px solid var(--gold-light);
    border-radius: 40px; padding-block: 8px; padding-inline: 8px 16px;
    box-shadow: 0 10px 26px rgba(31, 38, 34, 0.35);
    transition: transform 0.2s, background 0.2s;
}
.compound-pin .sun {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(145deg, var(--gold-light), var(--gold));
    display: grid; place-items: center; color: #fff; font-size: 15px;
}
.compound-pin .name { font-weight: 800; font-size: 15px; white-space: nowrap; }
.compound-pin .count { font-size: 12px; opacity: 0.85; white-space: nowrap; }
.compound-pin .tail {
    width: 0; height: 0;
    border-left: 9px solid transparent; border-right: 9px solid transparent;
    border-top: 11px solid var(--sage);
}
.compound-pin:hover .bubble, .compound-pin.active .bubble { transform: scale(1.06); background: var(--sage-dark); }
.compound-pin.active .tail { border-top-color: var(--sage-dark); }
.leaflet-marker-icon.compound-marker { background: none; border: none; overflow: visible; }

/* ===== Intro hint ===== */
.hint {
    position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
    z-index: 500; background: var(--card); border: 1px solid var(--line);
    border-radius: 40px; padding: 12px 22px; font-size: 14px; font-weight: 600;
    color: var(--sage-dark); box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    display: flex; align-items: center; gap: 10px; transition: opacity 0.3s;
}
.hint i { color: var(--gold); }
.hint.hidden { opacity: 0; pointer-events: none; }

/* ===== Compound panel (inline-end side) ===== */
.panel {
    position: fixed; top: calc(var(--header-h) + 16px); inset-inline-end: 16px; bottom: 16px;
    width: 420px; max-width: calc(100vw - 32px);
    z-index: 900; background: var(--cream);
    border: 1px solid var(--line); border-radius: 22px;
    box-shadow: 0 24px 60px rgba(31, 38, 34, 0.25);
    display: flex; flex-direction: column; overflow: hidden;
    transform: translateX(calc(100% + 40px)); transition: transform 0.35s ease;
}
[dir="rtl"] .panel { transform: translateX(calc(-100% - 40px)); }
.panel.open, [dir="rtl"] .panel.open { transform: translateX(0); }
.panel-head { padding: 22px 22px 16px; background: var(--sage); color: #fff; position: relative; }
.panel-head .eyebrow { font-size: 12px; color: var(--gold-light); font-weight: 700; letter-spacing: 0.08em; }
.panel-head h2 {
    font-family: 'Cormorant Garamond', serif; font-size: 30px; font-weight: 600;
    letter-spacing: 0.04em; margin-top: 2px; padding-inline-end: 44px;
}
.panel-head .desc { font-size: 14px; opacity: 0.88; margin-top: 6px; line-height: 1.7; }
.panel-head .meta { display: flex; gap: 10px 16px; margin-top: 12px; font-size: 13px; flex-wrap: wrap; align-items: center; }
.panel-head .meta i { color: var(--gold-light); margin-inline-end: 5px; }
.close-btn {
    position: absolute; top: 16px; inset-inline-end: 16px; width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255,255,255,0.16); border: none; color: #fff; font-size: 16px;
}
.close-btn:hover { background: rgba(255,255,255,0.3); }

.panel-body { flex: 1; min-height: 0; overflow-y: auto; }
.overview { padding: 4px 18px 0; }
.ov-title { font-size: 15px; font-weight: 800; color: var(--sage-dark); margin: 18px 0 10px; }
.ov-list { list-style: none; display: grid; gap: 7px; font-size: 14px; color: var(--ink); }
.ov-list li { display: flex; gap: 8px; align-items: baseline; line-height: 1.6; }
.ov-list i { color: var(--gold); font-size: 12px; flex-shrink: 0; }
.amenity-strip {
    display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px;
    scroll-snap-type: x mandatory; margin: 0 -18px; padding-inline: 18px;
}
.amenity-card {
    flex: 0 0 150px; scroll-snap-align: start; border: none; padding: 0; background: none;
    border-radius: 12px; overflow: hidden; position: relative; aspect-ratio: 4 / 3;
}
.amenity-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.amenity-card:hover img { transform: scale(1.06); }
.amenity-card span {
    position: absolute; inset: auto 0 0 0; padding: 18px 8px 7px; color: #fff; font-size: 12px; font-weight: 700;
    background: linear-gradient(transparent, rgba(0,0,0,0.65)); text-align: start;
}
.filters {
    display: flex; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line);
    overflow-x: auto; position: sticky; top: 0; z-index: 2; background: var(--cream);
}
.chip {
    border: 1px solid var(--line); background: var(--card); color: var(--sage-dark);
    border-radius: 30px; padding: 7px 14px; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.chip.active { background: var(--gold); border-color: var(--gold); color: #fff; }

.units { padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.unit-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
    text-align: start; width: 100%; padding: 0; color: inherit; flex-shrink: 0; display: block;
    transition: transform 0.2s, box-shadow 0.2s;
}
.unit-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(31, 38, 34, 0.12); }
.unit-card .thumb { position: relative; aspect-ratio: 16 / 9; background: #ddd; }
.unit-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.unit-card .badge {
    position: absolute; top: 10px; inset-inline-start: 10px; background: #e7f4ec; color: #22663f;
    font-size: 12px; font-weight: 800; border-radius: 20px; padding: 4px 10px;
}
.unit-card .photos {
    position: absolute; bottom: 10px; inset-inline-end: 10px; background: rgba(0,0,0,0.55); color: #fff;
    font-size: 12px; border-radius: 20px; padding: 3px 9px;
}
.unit-card .body { padding: 14px 16px 16px; }
.unit-card .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; }
.unit-card h3 { font-size: 17px; font-weight: 800; color: var(--ink); }
.unit-card .price { color: var(--gold); font-weight: 800; font-size: 16px; white-space: nowrap; }
.unit-card .price small { font-size: 12px; color: var(--muted); font-weight: 500; }
.specs { display: flex; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.specs i { color: var(--sage); margin-inline-end: 5px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 15px; }
.empty i { font-size: 34px; color: var(--gold); display: block; margin-bottom: 10px; }

/* ===== Modal ===== */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 2000; background: rgba(20, 26, 23, 0.6);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--cream); border-radius: 22px; width: 860px; max-width: 100%;
    max-height: calc(100vh - 40px); overflow-y: auto; position: relative;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.gallery { position: relative; background: #111; aspect-ratio: 16 / 9; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px;
    border-radius: 50%; border: none; background: rgba(255,255,255,0.88); color: var(--ink); font-size: 16px;
}
.gal-prev { inset-inline-start: 14px; }
.gal-next { inset-inline-end: 14px; }
[dir="rtl"] .gal-nav i { transform: scaleX(-1); }
.gal-label {
    position: absolute; top: 14px; inset-inline-start: 14px; background: rgba(0,0,0,0.55); color: #fff;
    font-size: 14px; font-weight: 700; padding: 5px 14px; border-radius: 20px;
}
.gal-count {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.55); color: #fff; font-size: 13px; padding: 4px 12px; border-radius: 20px;
}
.modal .close-btn { background: rgba(0,0,0,0.5); z-index: 2; }
.thumbs { display: flex; gap: 8px; padding: 12px 22px 0; overflow-x: auto; }
.thumbs img {
    width: 84px; height: 56px; object-fit: cover; border-radius: 8px; cursor: pointer;
    opacity: 0.55; border: 2px solid transparent; flex-shrink: 0;
}
.thumbs img.active { opacity: 1; border-color: var(--gold); }
.modal-body { padding: 18px 22px 24px; }
.modal-body .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.modal-body h3 { font-size: 24px; font-weight: 800; }
.modal-body .ov-list { margin-top: 4px; }
.modal-body .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.modal-body .price { color: var(--gold); font-size: 24px; font-weight: 800; }
.modal-body .price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.spec { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.spec i { color: var(--gold); font-size: 16px; }
.spec .lbl { font-size: 12px; color: var(--muted); margin-top: 6px; }
.spec .val { font-size: 16px; font-weight: 800; margin-top: 2px; }
.section-title { font-size: 15px; font-weight: 800; margin: 20px 0 10px; color: var(--sage-dark); }
.features { display: flex; flex-wrap: wrap; gap: 8px; }
.features span {
    background: #ece6d6; color: var(--sage-dark); font-size: 13px; font-weight: 600;
    border-radius: 20px; padding: 6px 12px;
}
.features i { color: var(--gold); margin-inline-end: 5px; }
.actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.btn {
    flex: 1; min-width: 160px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px; border-radius: 12px; font-weight: 800; font-size: 15px; text-decoration: none; border: none;
}
.btn-wa { background: #25d366; color: #fff; }
.btn-call { background: var(--sage); color: #fff; }
.btn-mail { background: var(--gold); color: #fff; }
.btn-map { background: var(--card); color: var(--sage-dark); border: 1px solid var(--line); }
.map-link {
    display: inline-flex; align-items: center; gap: 6px; color: var(--sage-dark); background: var(--gold-light);
    border-radius: 20px; padding: 3px 12px; font-weight: 700; text-decoration: none;
}
.panel-head .meta .map-link i { color: var(--sage-dark); margin: 0; }

/* ===== Mobile ===== */
@media (max-width: 760px) {
    :root { --header-h: 68px; }
    .sl-header { padding: 0 14px; }
    .sl-logo-solana { height: 56px; }
    .sl-logo-zad { height: 34px; }
    .sl-title h1 { font-size: 17px; letter-spacing: 0.14em; }
    .sl-logos { gap: 10px; }
    .sl-divider { height: 32px; }
    .sl-title { position: static; transform: none; }
    .panel, [dir="rtl"] .panel {
        top: auto; inset-inline: 0; bottom: 0; width: 100%; max-width: 100%;
        height: 72vh; border-radius: 22px 22px 0 0;
        transform: translateY(100%);
    }
    .panel.open, [dir="rtl"] .panel.open { transform: translateY(0); }
    .panel-head { padding: 16px 18px 12px; }
    .panel-head h2 { font-size: 24px; }
    .hint { font-size: 13px; width: calc(100% - 32px); justify-content: center; }
    .modal-backdrop { padding: 0; align-items: flex-end; }
    .modal { border-radius: 22px 22px 0 0; max-height: 92vh; }
    .spec-grid { grid-template-columns: repeat(2, 1fr); }
    .compound-pin .count { display: none; }
    .compound-pin .bubble { padding-block: 4px; padding-inline: 4px 10px; gap: 6px; border-width: 1.5px; }
    .compound-pin .sun { width: 24px; height: 24px; font-size: 11px; }
    .compound-pin .name { font-size: 12px; }
    .compound-pin .tail { border-left-width: 6px; border-right-width: 6px; border-top-width: 8px; }
}
