/*
  File: css/styles.css
  Purpose: Global design system + component styles for Raju Real Estate.
  Engine: Plain CSS (no preprocessor, no build step).
  Platform: Static site on Cloudflare Pages. Modern evergreen browsers.
  Design: Bold & vibrant. Royal indigo primary, amber micro-accent.
  Why CSS variables: single source of truth so brand colors change in one place.
*/

:root {
  /* Brand palette — navy + copper, matched to the Raju Real Estate logo.
     Scale names kept (indigo and amber) so every component that references
     them re-skins from these values alone. */
  --indigo-900: #0f2036;
  --indigo-800: #17293f;
  --indigo-700: #1e3453;
  --indigo-600: #23395d;   /* brand navy */
  --indigo-500: #2c476f;
  --indigo-100: #dbe4ef;
  --indigo-50:  #eef3f8;

  --amber-500: #c17a3f;    /* brand copper */
  --amber-400: #d59259;
  --amber-100: #f3e3d3;

  --ink:      #0f1222;   /* near-black text */
  --ink-soft: #4b5168;   /* secondary text */
  --line:     #e6e8f0;   /* borders */
  --bg:       #ffffff;
  --bg-soft:  #f6f7fb;   /* section alt background */
  --bg-tint:  var(--indigo-50);

  --ok:   #16a34a;
  --sold: #dc2626;
  --rent: #7c3aed;

  --brand: var(--indigo-600);
  --brand-dark: var(--indigo-800);
  --accent: var(--amber-500);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15,18,34,.06), 0 2px 8px rgba(15,18,34,.05);
  --shadow-md: 0 8px 24px rgba(15,18,34,.10);
  --shadow-lg: 0 20px 48px rgba(30,27,75,.18);

  --maxw: 1200px;
  --font-head: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; color: var(--ink); letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.section--soft { background: var(--bg-soft); }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.eyebrow { display: inline-block; font-family: var(--font-head); font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); background: var(--indigo-50); padding: 6px 12px; border-radius: 999px; margin-bottom: 14px; }
.section-head { max-width: 640px; margin: 0 auto 40px; }
.section-head.left { margin-left: 0; text-align: left; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 600; font-size: .95rem; padding: 13px 22px; border-radius: 999px; border: 2px solid transparent; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(35,57,93,.30); }
.btn--primary:hover { background: var(--indigo-700); box-shadow: 0 10px 26px rgba(35,57,93,.40); }
.btn--accent { background: var(--accent); color: #2a1a08; box-shadow: 0 8px 20px rgba(193,122,63,.34); }
.btn--accent:hover { background: var(--amber-400); }
.btn--ghost { background: #fff; color: var(--brand); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--brand); background: var(--indigo-50); }
.btn--light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); }
.btn--light:hover { background: rgba(255,255,255,.24); }
.btn--wa { background: #25d366; color: #06331b; }
.btn--wa:hover { background: #1fbd5a; }
.btn--block { width: 100%; justify-content: center; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { height: 40px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-family: var(--font-head); font-weight: 600; font-size: .95rem; color: var(--ink); padding: 9px 14px; border-radius: 10px; }
.nav-links a:hover, .nav-links a.active { color: var(--brand); background: var(--indigo-50); }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: .2s; }

@media (max-width: 900px) {
  .nav-links { position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 12px 20px; transform: translateY(-140%); transition: transform .25s ease; box-shadow: var(--shadow-md); }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px; border-radius: 8px; }
  .nav-toggle { display: block; }
  .nav-cta .btn--ghost { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; background:
    radial-gradient(1200px 500px at 85% -10%, rgba(193,122,63,.38), transparent 60%),
    linear-gradient(135deg, var(--indigo-900), var(--indigo-700) 55%, var(--indigo-600)); overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; opacity: .5; pointer-events: none; }
.hero-inner { position: relative; z-index: 2; padding: 84px 0 96px; max-width: 760px; }
.hero h1 { color: #fff; }
.hero h1 .hl { color: var(--amber-400); }
.hero p.lead { font-size: 1.15rem; color: rgba(255,255,255,.9); max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats { display: flex; gap: 32px; margin-top: 44px; flex-wrap: wrap; }
.hero-stat b { font-family: var(--font-head); font-size: 1.9rem; display: block; color: #fff; }
.hero-stat span { color: rgba(255,255,255,.8); font-size: .9rem; }

/* Quick search bar on hero */
.quick-search { position: relative; z-index: 3; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 16px; margin: -44px auto 0; max-width: 980px; display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 12px; }
.quick-search .field { display: flex; flex-direction: column; gap: 4px; }
.quick-search label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.quick-search select, .quick-search input { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; font-family: var(--font-body); font-size: .95rem; background: #fff; color: var(--ink); }
.quick-search .btn { align-self: end; height: 44px; }
@media (max-width: 820px) { .quick-search { grid-template-columns: 1fr 1fr; margin-top: 24px; } .quick-search .btn { grid-column: 1 / -1; } }

/* ---------- Listing cards ---------- */
.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 980px) { .grid-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-cards { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .16s ease, box-shadow .16s ease; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--indigo-100), var(--indigo-50)); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-family: var(--font-head); font-weight: 700; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; color: #fff; }
.badge--sale { background: var(--ok); }
.badge--sold { background: var(--sold); }
.badge--rent { background: var(--rent); }
.badge--type { background: rgba(15,18,34,.72); }
.badge--featured { position: absolute; top: 12px; right: 12px; background: var(--accent); color: #241a00; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card-price { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; color: var(--brand-dark); }
.card-price small { font-weight: 600; font-size: .8rem; color: var(--ink-soft); }
.card-title { font-family: var(--font-head); font-weight: 600; font-size: 1.02rem; margin: 6px 0 2px; }
.card-loc { color: var(--ink-soft); font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.card-specs { display: flex; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: .86rem; flex-wrap: wrap; }
.card-specs .spec { display: flex; align-items: center; gap: 6px; }
.card-specs .spec b { color: var(--ink); font-weight: 600; }
.card-foot { margin-top: auto; padding-top: 14px; display: flex; gap: 8px; }
.card-foot .btn { flex: 1; padding: 10px 12px; font-size: .85rem; }

.icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex: none; }

/* ---------- Listings page: filter rail ---------- */
.listings-layout { display: grid; grid-template-columns: 296px 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .listings-layout { grid-template-columns: 1fr; } }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); position: sticky; top: 88px; }
.filters h3 { display: flex; align-items: center; justify-content: space-between; font-size: 1.05rem; }
.filter-group { padding: 14px 0; border-top: 1px solid var(--line); }
.filter-group:first-of-type { border-top: 0; }
.filter-group > label { display: block; font-family: var(--font-head); font-weight: 600; font-size: .85rem; margin-bottom: 8px; }
.filter-group select, .filter-group input { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 11px; font-family: var(--font-body); font-size: .92rem; background: #fff; }
.range-row { display: flex; gap: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .82rem; font-weight: 600; font-family: var(--font-head); padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink-soft); transition: .12s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.listings-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.listings-bar .count { font-family: var(--font-head); font-weight: 600; }
.listings-bar .count b { color: var(--brand); }
.sort-select { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; font-family: var(--font-body); background: #fff; }
.filter-toggle { display: none; }
@media (max-width: 900px) {
  .filters { position: static; display: none; margin-bottom: 20px; }
  .filters.open { display: block; }
  .filter-toggle { display: inline-flex; }
}
.no-results { text-align: center; padding: 60px 20px; color: var(--ink-soft); }

/* ---------- Property detail ---------- */
.pd-head { padding: 28px 0 8px; }
.pd-crumb { font-size: .88rem; color: var(--ink-soft); margin-bottom: 12px; }
.pd-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.pd-price { font-family: var(--font-head); font-weight: 700; font-size: 2rem; color: var(--brand-dark); }
.pd-gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 1fr; gap: 10px; border-radius: var(--radius); overflow: hidden; margin: 18px 0 28px; }
.pd-gallery .g-main { grid-row: span 2; }
.pd-gallery figure { margin: 0; position: relative; aspect-ratio: 4/3; background: var(--indigo-50); }
.pd-gallery .g-main { aspect-ratio: auto; }
.pd-gallery img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
@media (max-width: 720px) { .pd-gallery { grid-template-columns: 1fr 1fr; } .pd-gallery .g-main { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 16/10; } }

.pd-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .pd-layout { grid-template-columns: 1fr; } }
.pd-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 6px 0 26px; }
@media (max-width: 620px) { .pd-facts { grid-template-columns: repeat(2, 1fr); } }
.fact { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.fact b { display: block; font-family: var(--font-head); font-size: 1.15rem; color: var(--ink); }
.fact span { font-size: .78rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.pd-block { margin-bottom: 30px; }
.pd-block h2 { font-size: 1.4rem; }
.amenities { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.amenities li { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); }
.amenities li svg { color: var(--ok); }
#map { height: 340px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 1; }

.pd-aside { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 16px; }
.agent-card, .enquire-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.agent-card .who { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.agent-card .avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--indigo-600), var(--amber-500)); color: #fff; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; overflow: hidden; flex: none; }
.agent-card .avatar img, img.avatar { width: 100%; height: 100%; object-fit: cover; }
img.avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex: none; }
.enquire-card h3 { margin-bottom: 12px; }

/* ---------- Forms ---------- */
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-family: var(--font-head); font-weight: 600; font-size: .86rem; margin-bottom: 6px; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 13px; font-family: var(--font-body); font-size: .95rem; background: #fff; color: var(--ink); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--indigo-100); }
.form-field textarea { min-height: 120px; resize: vertical; }
.form-note { font-size: .82rem; color: var(--ink-soft); }
.form-status { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; display: none; }
.form-status.ok { display: block; background: #e7f6ec; color: #14532d; border: 1px solid #bbe3c6; }
.form-status.err { display: block; background: #fdeaea; color: #7f1d1d; border: 1px solid #f3c4c4; }

/* ---------- EMI mini (detail aside) ---------- */
.emi-line { display: flex; justify-content: space-between; font-size: .9rem; padding: 6px 0; }
.emi-line b { font-family: var(--font-head); }

/* ---------- Contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info .info-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-info .info-item .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--indigo-50); color: var(--brand); display: grid; place-items: center; flex: none; }
.contact-info .info-item b { font-family: var(--font-head); display: block; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(135deg, var(--indigo-800), var(--indigo-600)); color: #fff; border-radius: 22px; padding: 48px; text-align: center; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.9); max-width: 520px; margin: 0 auto 22px; }

/* ---------- City strip ---------- */
.city-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 720px) { .city-strip { grid-template-columns: 1fr 1fr; } }
.city-tile { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3/4; color: #fff; display: flex; align-items: flex-end; padding: 18px; background: linear-gradient(180deg, transparent 40%, rgba(15,18,34,.8)), linear-gradient(135deg, var(--indigo-700), var(--amber-500)); transition: transform .16s ease; }
.city-tile:hover { transform: translateY(-4px); }
.city-tile b { font-family: var(--font-head); font-size: 1.2rem; position: relative; z-index: 2; }
.city-tile span { position: absolute; left: 18px; bottom: 44px; font-size: .82rem; color: rgba(255,255,255,.85); z-index: 2; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c7cbdb; padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; }
.site-footer a { color: #c7cbdb; display: block; padding: 4px 0; }
.site-footer a:hover { color: #fff; }
.footer-brand svg { height: 40px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 36px; padding-top: 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .85rem; color: #8b90a8; }

/* ---------- Floating WhatsApp ---------- */
.wa-float { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 56px; height: 56px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: 0 10px 26px rgba(37,211,102,.45); transition: transform .15s ease; }
.wa-float:hover { transform: scale(1.06); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(9,10,20,.92); z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 10px; object-fit: contain; }
.lightbox button { position: absolute; background: rgba(255,255,255,.14); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* ---------- Language toggle (Phase 3 hook, present in header) ---------- */
.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-toggle button { border: 0; background: #fff; padding: 7px 12px; font-family: var(--font-head); font-weight: 600; font-size: .82rem; cursor: pointer; color: var(--ink-soft); }
.lang-toggle button.active { background: var(--brand); color: #fff; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
