/* ============================================================
   listing.css — Buy / Rent / Off-Plan Listing Pages
   RAS Real Estate UAE
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --black:  #0d0d0d;
    --white:  #ffffff;
    --ivory:  #f8f5f0;
    --cream:  #f2ede5;
    --green:  #2C6E4E;
    --grey:   #6b6b6b;
    --border: rgba(0,0,0,0.08);
}

/* ── Reset ─────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: "Clash Grotesk", "DM Sans", sans-serif;
    color: var(--black);
    background: var(--white);
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Fonts ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,400&family=Figtree:wght@300;400;500;600&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=clash-grotesk@400,500,600&display=swap');

/* ============================================================
   NAVBAR
   ============================================================ */

.nav__overlay { display: none; }

.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1001;
    padding: 0 5%;
    height: 74px;
    display: flex; align-items: center;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 1px 0 var(--border);
    transition: box-shadow .3s;
}

.nav__inner {
    width: 100%; max-width: 1360px;
    margin: 0 auto;
    display: flex; align-items: center;
    gap: 40px;
}
.nav__logo { display: flex; align-items: center; }
.nav__logo img {
    height: 72px; width: auto; display: block;
    filter: brightness(0);
    transition: filter .35s;
}

.nav__links {
    display: flex; align-items: center;
    gap: 32px; margin-left: auto;
}
.nav__item { position: relative; }
.nav__item > a {
    font-size: 13.5px; font-weight: 400;
    color: #333; letter-spacing: 0.02em;
    transition: color .2s;
}
.nav__item > a:hover { color: var(--green); }

/* Active nav state */
.nav__item--active > a {
    color: var(--green) !important;
    border-bottom: 1.5px solid var(--green);
    padding-bottom: 2px;
}

.nav__arrow {
    font-size: 14px; color: rgba(0,0,0,0.3);
    margin-left: 2px; cursor: default; transition: color .2s;
}
.nav__item--drop { display: flex; align-items: center; gap: 2px; }

/* Invisible hover bridge — prevents dropdown from closing when
   mouse crosses the gap between the nav item and the dropdown. */
@media (min-width: 993px) {
    .nav__item--drop::after {
        content: '';
        position: absolute;
        top: 100%;
        left: -8px;
        right: -8px;
        height: 22px;
    }
}

.nav__drop {
    position: absolute;
    top: calc(100% + 18px); left: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 180px; padding: 8px 0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.10);
    display: none; flex-direction: column;
}
.nav__drop.open { display: flex; }
.nav__drop a {
    padding: 11px 20px; font-size: 13.5px;
    color: var(--black);
    transition: background .15s, color .15s;
}
.nav__drop a:hover { background: var(--cream); color: var(--green); }
@media (min-width: 993px) { .nav__item--drop:hover .nav__drop { display: flex; } }

.nav__cta {
    font-size: 12px; font-weight: 500;
    letter-spacing: 0.08em; text-transform: uppercase;
    padding: 9px 22px;
    border: 1.5px solid var(--black);
    border-radius: 6px; color: var(--black);
    transition: all .25s; white-space: nowrap;
}
.nav__cta:hover { background: var(--black); color: var(--white); }

.nav__burger {
    display: none; flex-direction: column;
    gap: 5px; padding: 10px; margin-left: auto;
}
.nav__burger span {
    display: block; width: 24px; height: 1.5px;
    background: var(--black); transition: all .3s;
}
.nav__burger.open span:nth-child(1) { transform: rotate(45deg) translate(4.5px,4.5px); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: rotate(-45deg) translate(4.5px,-4.5px); }
.nav__close { display: none; }

/* ============================================================
   PAGE HERO HEADER
   ============================================================ */

.lp-hero {
    padding-top: 74px;
    background: var(--black);
    padding-bottom: 0;
}

.lp-hero__inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 52px 5% 0;
}

.lp-hero__breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: rgba(255,255,255,0.4);
    letter-spacing: 0.06em; text-transform: uppercase;
    margin-bottom: 20px;
}
.lp-hero__breadcrumb a { color: rgba(255,255,255,0.4); transition: color .2s; }
.lp-hero__breadcrumb a:hover { color: rgba(255,255,255,0.8); }
.lp-hero__breadcrumb span { color: rgba(255,255,255,0.2); }

.lp-hero__title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: clamp(32px, 4vw, 58px);
    font-weight: 400; color: var(--white);
    line-height: 1.1; margin-bottom: 14px;
}

.lp-hero__sub {
    font-size: 13px; color: rgba(255,255,255,0.4);
    letter-spacing: 0.06em; text-transform: uppercase;
    margin-bottom: 40px;
}

/* ── Filter bar ──────────────────────────────────────────── */
.lp-filters {
    background: rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.07);
}

.lp-filters__form {
    max-width: 1360px; margin: 0 auto;
    padding: 20px 5%;
    display: flex; align-items: center;
    gap: 10px; flex-wrap: wrap;
}

/* ── Desktop: wrapper divs are layout-transparent ── */
.lp-filters__row1    { display: contents; }
.lp-filters__selects { display: contents; }

/* ── Mobile-only elements hidden on desktop ── */
.lp-filters__toggle  { display: none; }
.lp-filters__btn--apply { display: none; }

.lp-filters__form input,
.lp-filters__form select {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 11px 16px;
    font-size: 13px; color: var(--white);
    outline: none;
    transition: border-color .2s, background .2s;
    -webkit-appearance: none;
    appearance: none;
}
.lp-filters__form input::placeholder { color: rgba(255,255,255,0.35); }
.lp-filters__form select option { background: #1a1a1a; color: #fff; }
.lp-filters__form input:focus,
.lp-filters__form select:focus {
    border-color: rgba(44,110,78,0.5);
    background: rgba(255,255,255,0.12);
}

.lp-filters__keyword { flex: 1; min-width: 180px; }
.lp-filters__select  { min-width: 140px; }

.lp-filters__btn {
    background: var(--green); color: var(--white);
    border-radius: 8px;
    padding: 11px 28px;
    font-size: 12px; font-weight: 500;
    letter-spacing: 0.1em; text-transform: uppercase;
    transition: background .25s; flex-shrink: 0;
}
.lp-filters__btn:hover { background: #225940; }

/* ── Sort bar ──────────────────────────────────────────── */
.lp-sortbar {
    background: var(--ivory);
    border-bottom: 1px solid var(--border);
}

.lp-sortbar__inner {
    max-width: 1360px; margin: 0 auto;
    padding: 14px 5%;
    display: flex; align-items: center;
    justify-content: space-between; gap: 16px;
}

.lp-sortbar__count {
    font-size: 13px; color: var(--grey);
    letter-spacing: 0.02em;
}
.lp-sortbar__count strong {
    font-weight: 600; color: var(--black);
}

.lp-sortbar__sort {
    display: flex; align-items: center; gap: 10px;
}
.lp-sortbar__sort label {
    font-size: 12px; color: var(--grey);
    letter-spacing: 0.04em; white-space: nowrap;
}
.lp-sortbar__sort select {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px; color: var(--black);
    outline: none; cursor: pointer;
}

/* ============================================================
   PROPERTY GRID
   ============================================================ */

.lp-main {
    background: var(--ivory);
    padding: 40px 5% 80px;
}

.lp-main__inner {
    max-width: 1360px; margin: 0 auto;
}

.lp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 56px;
}

/* ── Property card ───────────────────────────────────── */
.lp-card {
    display: block;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform .3s, box-shadow .3s;
}
.lp-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.10);
}

.lp-card__img {
    position: relative;
    height: 240px; overflow: hidden;
}
.lp-card__img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .55s ease;
}
.lp-card:hover .lp-card__img img { transform: scale(1.06); }

.lp-card__badge {
    position: absolute; top: 14px; left: 14px;
    background: var(--black); color: var(--white);
    font-size: 9px; font-weight: 500;
    letter-spacing: 0.12em; text-transform: uppercase;
    padding: 5px 12px; border-radius: 4px;
}
.lp-card__badge--rent { background: var(--green); }
.lp-card__badge--offplan { background: #1a3a2a; }

.lp-card__price {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 100%);
    padding: 32px 16px 14px;
    font-family: "Figtree", sans-serif;
    font-size: 17px; font-weight: 500;
    color: var(--white);
}
.lp-card__price sub {
    font-size: 11px; font-weight: 400;
    opacity: 0.75; margin-left: 4px;
    vertical-align: baseline;
}

.lp-card__body { padding: 18px 20px 22px; }

.lp-card__title {
    font-family: "Cormorant Garamond", serif;
    font-size: 19px; font-weight: 400;
    color: var(--black); line-height: 1.3;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lp-card__loc {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; color: var(--grey);
    margin-bottom: 16px;
}
.lp-card__loc svg { width: 12px; height: 12px; flex-shrink: 0; }

.lp-card__meta {
    display: flex; align-items: center; gap: 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.lp-card__meta-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; color: #555;
    flex: 1;
    padding-right: 10px;
}
.lp-card__meta-item:not(:last-child) {
    border-right: 1px solid var(--border);
    margin-right: 10px;
}
.lp-card__meta-item svg { width: 13px; height: 13px; color: var(--grey); }

/* Offplan card extras */
.lp-card__tags {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.lp-card__tag {
    font-size: 10px; letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--green);
    background: rgba(44,110,78,0.08);
    border-radius: 4px; padding: 4px 10px;
}

/* ============================================================
   PAGINATION
   ============================================================ */

.lp-pagination {
    display: flex; align-items: center;
    justify-content: center; gap: 6px;
    padding: 8px 0;
}

.lp-pagination__btn,
.lp-pagination__page {
    display: flex; align-items: center; justify-content: center;
    height: 40px; min-width: 40px;
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--black);
    padding: 0 14px;
    transition: all .2s;
}
.lp-pagination__btn:hover,
.lp-pagination__page:hover {
    border-color: var(--green); color: var(--green);
}
.lp-pagination__page--active {
    background: var(--green); color: var(--white);
    border-color: var(--green);
}
.lp-pagination__dots {
    color: var(--grey); font-size: 14px;
    padding: 0 4px;
}

/* ============================================================
   INSIGHTS
   ============================================================ */

.lp-insights {
    background: var(--white);
    padding: 80px 5%;
    border-top: 1px solid var(--border);
}
.lp-insights__inner { max-width: 1360px; margin: 0 auto; }

.lp-insights__header {
    display: flex; align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 48px;
}
.lp-insights__title {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 400; color: var(--black);
}
.lp-insights__link {
    font-size: 12px; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--black);
    border-bottom: 1px solid var(--black);
    padding-bottom: 2px;
    transition: color .2s, border-color .2s;
}
.lp-insights__link:hover { color: var(--green); border-color: var(--green); }

.lp-insights__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.lp-ins-card {
    border-radius: 12px; overflow: hidden;
    border: 1px solid var(--border);
    background: var(--white);
    transition: transform .3s, box-shadow .3s;
}
.lp-ins-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.08);
}
.lp-ins-card__img { height: 200px; overflow: hidden; }
.lp-ins-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.lp-ins-card:hover .lp-ins-card__img img { transform: scale(1.05); }
.lp-ins-card__body { padding: 22px 22px 26px; }
.lp-ins-card__date {
    font-size: 11px; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--grey);
    margin-bottom: 10px;
}
.lp-ins-card__text {
    font-size: 14.5px; line-height: 1.65;
    color: #2a2a2a; margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lp-ins-card__read {
    font-size: 12px; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--green);
    border-bottom: 1px solid rgba(44,110,78,0.3);
    padding-bottom: 2px; display: inline-block;
    transition: border-color .2s;
}
.lp-ins-card__read:hover { border-color: var(--green); }

/* ============================================================
   FOOTER (matches homepage)
   ============================================================ */

.footer { position: relative; overflow: hidden; color: #fff; }
.footer__bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; z-index: 0;
}
.footer__veil {
    position: relative; z-index: 1;
    background: rgba(6,6,6,.93);
    padding: 90px 5% 48px;
}
.footer__top {
    width: 100%; max-width: 1360px;
    margin: 0 auto 64px;
    display: grid; grid-template-columns: repeat(5,1fr);
    gap: 40px; align-items: start;
}
.footer__col h4 {
    font-size: 10px; font-weight: 500;
    letter-spacing: 0.18em; text-transform: uppercase;
    color: rgba(255,255,255,.32); margin-bottom: 20px;
}
.footer__col a, .footer__col p {
    display: block; font-size: 13.5px;
    color: rgba(255,255,255,.55);
    line-height: 1.6; margin-bottom: 9px;
    text-decoration: none; transition: color .2s;
}
.footer__col a:hover { color: #fff; }
.footer__col--brand {
    display: flex; flex-direction: column;
    align-items: flex-start; gap: 20px;
}
.footer__col--brand img { height: 64px; opacity: .85; }
.footer__socials { display: flex; gap: 16px; }
.footer__socials img { width: 20px; opacity: .45; cursor: pointer; transition: opacity .2s; }
.footer__socials img:hover { opacity: 1; }
.footer__bottom {
    width: 100%; max-width: 1360px; margin: 0 auto;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,.06);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12.5px; color: rgba(255,255,255,.28);
}
.footer__bottom div { display: flex; gap: 24px; }
.footer__bottom a { color: rgba(255,255,255,.28); text-decoration: none; transition: color .2s; }
.footer__bottom a:hover { color: rgba(255,255,255,.7); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1100px) {
    .lp-grid { grid-template-columns: repeat(2, 1fr); }
    .lp-insights__grid { grid-template-columns: repeat(2, 1fr); }
    .footer__top { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    /* Nav mobile drawer */
    .nav__overlay {
        display: block; position: fixed; inset: 0;
        background: rgba(0,0,0,0.65); z-index: 999;
        opacity: 0; pointer-events: none;
        transition: opacity 0.4s ease;
    }
    .nav__overlay.open { opacity: 1; pointer-events: all; }
    .nav__links {
        position: fixed;
        top: 0; right: 0; bottom: 0; left: auto;
        width: min(340px,88vw);
        height: 100vh; height: 100dvh;
        background: #0d0d0d;
        flex-direction: column; align-items: flex-start;
        padding: 0 36px 52px; gap: 0;
        display: flex; z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.42s cubic-bezier(0.4,0,0.2,1);
        overflow-y: auto; overscroll-behavior: contain;
        box-shadow: -16px 0 80px rgba(0,0,0,0.6);
    }
    .nav__links.open { transform: translateX(0); }
    .nav__close {
        display: flex; align-items: center; justify-content: center;
        align-self: flex-end; flex-shrink: 0;
        width: 46px; height: 46px;
        background: rgba(255,255,255,0.07);
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: 50%; color: #fff; cursor: pointer;
        margin: 28px 0 44px auto; transition: background 0.2s;
    }
    .nav__links .nav__item { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.07); }
    .nav__links .nav__item--drop { display: grid; grid-template-columns: 1fr auto; align-items: center; }
    .nav__links .nav__item--drop > a { grid-column:1; grid-row:1; }
    .nav__links .nav__item--drop > .nav__arrow { grid-column:2; grid-row:1; padding: 20px 0 20px 16px; }
    .nav__links .nav__item--drop > .nav__drop { grid-column:1/-1; grid-row:2; }
    .nav__links .nav__item > a { color:#fff!important; font-size:19px; font-weight:300; padding:20px 0; display:block; width:100%; }
    .nav__links .nav__arrow { color:rgba(255,255,255,0.35)!important; }
    .nav__drop { position:static; box-shadow:none; border:none; background:transparent; padding:0 0 16px; }
    .nav__drop a { color:rgba(255,255,255,0.45)!important; font-size:13px; letter-spacing:0.06em; text-transform:uppercase; padding:9px 0; display:block; }
    .nav__cta { display: none; }
    .nav__burger { display: flex; }
    .nav { height: 64px; }
    .nav__inner { gap: 0; }
    .nav__logo img { height: 48px; }

    /* Hero */
    .lp-hero__inner { padding: 36px 5% 0; }
    .lp-hero__title { font-size: clamp(28px, 8vw, 40px); }

    /* ── Filters: collapsible panel on mobile ── */
    .lp-filters__form {
        flex-direction: column;
        gap: 0;
        padding: 16px 5%;
    }

    /* Row 1: keyword + toggle button (full width, side by side) */
    .lp-filters__row1 {
        display: flex;
        gap: 10px;
        width: 100%;
    }
    .lp-filters__keyword {
        flex: 1; min-width: 0;
    }

    /* Toggle button — visible on mobile */
    .lp-filters__toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        padding: 11px 16px;
        background: rgba(255,255,255,0.09);
        border: 1px solid rgba(255,255,255,0.18);
        border-radius: 8px;
        color: rgba(255,255,255,0.85);
        font-size: 12px; font-weight: 500;
        letter-spacing: 0.08em; text-transform: uppercase;
        cursor: pointer; white-space: nowrap; flex-shrink: 0;
        transition: background .2s, border-color .2s;
    }
    .lp-filters__toggle.active {
        background: rgba(44,110,78,0.25);
        border-color: rgba(44,110,78,0.5);
        color: #fff;
    }
    .lp-filters__toggle svg { width: 15px; height: 15px; flex-shrink: 0; }
    .lp-filters__toggle__arrow { transition: transform .3s; }
    .lp-filters__toggle.active .lp-filters__toggle__arrow { transform: rotate(180deg); }

    /* Desktop search button hidden on mobile */
    .lp-filters__btn--search { display: none; }

    /* Collapsible panel */
    .lp-filters__selects {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        pointer-events: none;
        transition: max-height .35s ease, opacity .25s ease, padding .3s ease, margin .3s ease;
        padding-top: 0; margin-top: 0;
    }
    .lp-filters__selects.open {
        max-height: 500px;
        opacity: 1;
        pointer-events: all;
        padding-top: 12px;
        margin-top: 10px;
        border-top: 1px solid rgba(255,255,255,0.08);
    }
    .lp-filters__selects .lp-filters__select {
        min-width: 0; width: 100%;
    }

    /* Apply button spans full width at bottom of panel */
    .lp-filters__btn--apply {
        display: block;
        grid-column: 1 / -1;
        text-align: center;
        padding: 13px;
    }

    /* Sort bar */
    .lp-sortbar__inner { flex-direction: column; align-items: flex-start; gap: 10px; }

    /* Grid */
    .lp-main { padding: 32px 5% 60px; }
    .lp-grid { grid-template-columns: 1fr; gap: 20px; margin-bottom: 40px; }
    .lp-card__img { height: 220px; }

    /* Insights */
    .lp-insights { padding: 56px 5%; }
    .lp-insights__header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .lp-insights__grid { grid-template-columns: 1fr; }

    /* Footer */
    .footer__top { grid-template-columns: repeat(2,1fr); gap: 32px; }
    .footer__bottom { flex-direction: column; gap: 14px; text-align: center; }
}

@media (max-width: 480px) {
    .lp-grid { grid-template-columns: 1fr; }
    .footer__top { grid-template-columns: 1fr; }
}
