:root {
    --bg: #0b1120;
    --bg-alt: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.72);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.16);
    --primary: #38bdf8;
    --primary-grad: linear-gradient(135deg, #38bdf8, #8b5cf6);
    --gold: #d4af37;
    --whatsapp: #25d366;
    --radius: 18px;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

[data-theme="light"] {
    --bg: #f8fafc;
    --bg-alt: #eef2f6;
    --bg-card: rgba(255, 255, 255, 0.92);
    --text: #0f172a;
    --text-muted: #64748b;
    --border: rgba(15, 23, 42, 0.1);
    --shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Cairo', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
}

.container { width: 100%; max-width: 1260px; margin: 0 auto; padding: 0 1.25rem; }
.narrow-container { max-width: 820px; }
.hidden { display: none !important; }
.text-gradient { background: var(--primary-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.text-whatsapp { color: var(--whatsapp); }

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Navbar */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(11, 17, 32, 0.84);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
[data-theme="light"] .site-header { background: rgba(255, 255, 255, 0.88); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; }
.nav-logo { height: 42px; width: auto; display: block; }
.main-nav { display: flex; align-items: center; gap: 1.25rem; }
.main-nav a { color: var(--text); text-decoration: none; font-weight: 700; font-size: .95rem; transition: color .2s; }
.main-nav a:hover { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: .6rem; }
.icon-pill {
    position: relative; width: 38px; height: 38px; border-radius: 12px;
    border: 1px solid var(--border); background: transparent; color: var(--text);
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer;
}
.pill-count {
    position: absolute; top: -6px; left: -6px;
    background: var(--primary); color: #0b1120; font-size: .7rem; font-weight: 800;
    min-width: 18px; height: 18px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
}
.mobile-menu-btn { display: none; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    padding: .62rem 1.2rem; border-radius: 12px; font-family: inherit;
    font-weight: 700; font-size: .92rem; text-decoration: none; cursor: pointer; border: none;
    transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--primary-grad); color: #fff; }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: .42rem .9rem; font-size: .84rem; }
.btn-xs { padding: .28rem .65rem; font-size: .78rem; }
.btn-lg { padding: .85rem 1.65rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* Hero */
.hero-section { position: relative; padding: 5rem 0 4rem; overflow: hidden; text-align: center; }
.hero-bg {
    position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.22), transparent 45%),
                radial-gradient(circle at 80% 30%, rgba(139, 92, 246, 0.22), transparent 45%),
                linear-gradient(180deg, rgba(15,23,42,0.4), var(--bg));
}
.hero-pill {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .35rem .95rem; border-radius: 999px;
    background: rgba(56, 189, 248, 0.14); color: var(--primary); font-weight: 700; font-size: .85rem;
}
.hero-title { font-size: clamp(1.85rem, 4vw, 3rem); font-weight: 900; margin: 1rem 0 .75rem; line-height: 1.28; }
.hero-subtitle { max-width: 700px; margin: 0 auto 2rem; color: var(--text-muted); font-size: 1.05rem; }

.quick-search {
    display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: .75rem;
    padding: 1rem; max-width: 1020px; margin: 0 auto 2.5rem;
}
.qs-input, .f-input {
    width: 100%; padding: .72rem .9rem; border-radius: 12px;
    border: 1px solid var(--border); background: rgba(15, 23, 42, 0.65);
    color: var(--text); font-family: inherit; font-size: .92rem;
}
[data-theme="light"] .qs-input, [data-theme="light"] .f-input { background: #fff; }
.hero-counters { display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap; }
.counter-box strong { display: block; font-size: 2rem; font-weight: 900; color: var(--primary); }
.counter-box span { color: var(--text-muted); font-size: .9rem; }

/* Sections */
.section-pad { padding: 3.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 1.75rem; gap: 1rem; }
.section-head h2 { margin: 0 0 .25rem; font-size: 1.6rem; font-weight: 800; }
.section-head p { margin: 0; color: var(--text-muted); }

/* Property Cards */
.props-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.35rem; }
.props-grid.list-view { grid-template-columns: 1fr; }
.props-grid.list-view .prop-card { display: grid; grid-template-columns: 300px 1fr; }
.prop-card { overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.prop-card:hover { transform: translateY(-5px); }
.prop-media { position: relative; height: 215px; overflow: hidden; background: #1e293b; }
.prop-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.prop-card:hover .prop-media img { transform: scale(1.07); }
.prop-badges { position: absolute; top: 12px; right: 12px; display: flex; gap: .4rem; }
.badge { padding: .22rem .65rem; border-radius: 8px; font-size: .76rem; font-weight: 700; }
.badge-purpose { background: rgba(15, 23, 42, 0.82); color: #fff; }
.badge-featured { background: rgba(212, 175, 55, 0.92); color: #0f172a; }
.badge-type { background: rgba(56, 189, 248, 0.16); color: var(--primary); }
.prop-overlay-actions { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: .4rem; }
.circle-btn {
    width: 34px; height: 34px; border-radius: 50%; border: none;
    background: rgba(15, 23, 42, 0.78); color: #fff; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
}
.circle-btn.active { background: var(--primary); color: #0b1120; }
.prop-code {
    position: absolute; bottom: 10px; right: 12px;
    background: rgba(15, 23, 42, 0.78); color: var(--primary);
    padding: .15rem .55rem; border-radius: 6px; font-size: .75rem; font-weight: 700;
}
.prop-body { padding: 1.15rem; display: flex; flex-direction: column; gap: .5rem; }
.prop-price { font-size: 1.25rem; font-weight: 900; color: var(--primary); }
.prop-title { margin: 0; font-size: 1.02rem; line-height: 1.45; }
.prop-title a { color: var(--text); text-decoration: none; }
.prop-loc { margin: 0; font-size: .85rem; color: var(--text-muted); }
.prop-specs { display: flex; gap: .9rem; font-size: .84rem; color: var(--text-muted); padding: .5rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.prop-actions { display: flex; gap: .5rem; margin-top: .25rem; }
.prop-actions .btn { flex: 1; }

/* Cities, Types, Steps, CTA, FAQ */
.cities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.city-card { padding: 1.15rem; display: flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--text); }
.city-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.city-card h4 { margin: 0; font-size: .98rem; }
.city-card span { font-size: .82rem; color: var(--text-muted); }

.types-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.type-card { padding: 1.25rem 1rem; text-align: center; text-decoration: none; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: .45rem; }
.type-card i { font-size: 1.65rem; color: var(--primary); }

.cta-banner { padding: 2.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.cta-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.steps-grid, .testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; }
.step-card, .testimonial-card { padding: 1.5rem; }
.step-num { width: 38px; height: 38px; border-radius: 10px; background: var(--primary-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: .75rem; }
.stars { color: var(--gold); font-size: 1.1rem; margin-bottom: .5rem; }
.faq-list { display: flex; flex-direction: column; gap: .85rem; }
.faq-item { padding: 1.1rem 1.35rem; }
.faq-item summary { font-weight: 700; cursor: pointer; }

/* Search Page */
.search-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; align-items: start; }
.filters-sidebar { padding: 1.25rem; position: sticky; top: 82px; }
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.filters-head h3 { margin: 0; font-size: 1.05rem; }
.filters-form { display: flex; flex-direction: column; gap: .75rem; }
.f-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.f-amenities { display: flex; flex-direction: column; gap: .35rem; max-height: 180px; overflow-y: auto; font-size: .86rem; }
.f-check { display: flex; align-items: center; gap: .45rem; cursor: pointer; }
.results-bar { padding: .85rem 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.results-controls { display: flex; align-items: center; gap: .75rem; }
.view-switcher { display: flex; gap: .35rem; }
.view-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.view-btn.active { background: var(--primary); color: #0b1120; }
.map-box { height: 480px; margin-bottom: 1.25rem; z-index: 1; }

/* Detail Page */
.prop-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.detail-title { margin: .5rem 0; font-size: 1.75rem; }
.detail-price { font-size: 1.85rem; color: var(--primary); display: block; }
.detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 1.25rem; }
.detail-block, .gallery-card, .agent-card { padding: 1.35rem; }
.main-gallery-img { height: 420px; border-radius: 14px; overflow: hidden; background: #1e293b; }
.main-gallery-img img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery-thumbs { display: flex; gap: .6rem; margin-top: .75rem; overflow-x: auto; }
.thumb-item { width: 88px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .7; border: 2px solid transparent; }
.thumb-item.active, .thumb-item:hover { opacity: 1; border-color: var(--primary); }
.gallery-actions-bar { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.specs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .85rem; }
.spec-item { padding: .75rem; border-radius: 12px; border: 1px solid var(--border); }
.spec-item span { display: block; font-size: .8rem; color: var(--text-muted); }
.amenities-tags { display: flex; flex-wrap: wrap; gap: .6rem; }
.amenity-tag { padding: .45rem .85rem; border-radius: 10px; border: 1px solid var(--border); font-size: .88rem; }
.single-map { height: 320px; border-radius: 14px; z-index: 1; }
.mini-calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .85rem; margin-bottom: 1rem; }
.mini-calc-result { padding: .85rem 1rem; border-radius: 12px; background: rgba(56, 189, 248, 0.12); font-weight: 700; }
.sticky-card { position: sticky; top: 86px; }
.agent-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1.15rem; }
.agent-avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--primary-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.25rem; }
.agent-cta-stack { display: flex; flex-direction: column; gap: .65rem; }
.similar-section { margin-top: 3rem; }

/* Forms & Modals */
.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.col-span-2 { grid-column: span 2; }
.form-group label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: .35rem; }
.alert { padding: .9rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 600; }
.alert-success { background: rgba(16, 185, 129, 0.16); color: #34d399; }
.alert-danger { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem; }
.modal-box { width: 100%; max-width: 440px; padding: 1.5rem; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.empty-state { padding: 2rem; text-align: center; color: var(--text-muted); }

/* Footer & Floating WA */
.site-footer { background: #070b14; color: #cbd5e1; padding-top: 3rem; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; padding-bottom: 2.5rem; }
.footer-logo { height: 42px; margin-bottom: .75rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { color: #94a3b8; text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 1rem 0; font-size: .85rem; color: #64748b; text-align: center; }
.floating-wa {
    position: fixed; bottom: 22px; left: 22px; z-index: 60;
    width: 58px; height: 58px; border-radius: 50%;
    background: var(--whatsapp); color: #fff; font-size: 1.75rem;
    display: flex; align-items: center; justify-content: center; text-decoration: none;
    box-shadow: 0 10px 26px rgba(37, 211, 102, 0.45);
    animation: waPulse 2s infinite;
}
@keyframes waPulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
    70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.pagination { display: flex; justify-content: center; gap: .45rem; margin-top: 1.5rem; }
.page-link { padding: .45rem .85rem; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; font-weight: 700; }
.page-link.active { background: var(--primary-grad); color: #fff; border-color: transparent; }

@media (prefers-reduced-motion: reduce) {
    .floating-wa { animation: none; }
    * { transition: none !important; }
}

@media (max-width: 960px) {
    .main-nav { display: none; position: absolute; top: 100%; right: 0; left: 0; background: var(--bg-alt); flex-direction: column; padding: 1rem; border-bottom: 1px solid var(--border); }
    .main-nav.open { display: flex; }
    .mobile-menu-btn { display: inline-flex; }
    .quick-search, .search-layout, .detail-layout, .form-grid-2, .mini-calc-grid { grid-template-columns: 1fr; }
    .col-span-2 { grid-column: span 1; }
    .props-grid.list-view .prop-card { grid-template-columns: 1fr; }
}
