/* =====================================================================
   PropertyHub Kenya — Design system
   Palette translated from SimplyOrganic's organic/natural branding:
   deep forest green primary, warm cream background, amber/gold accent.
   ===================================================================== */

:root, [data-theme="forest"] {
  --forest-900: #14301e;
  --forest-800: #1c3f27;
  --forest-700: #20492f;   /* primary */
  --forest-600: #2c5c3c;
  --forest-500: #3a7350;
  --forest-100: #e6efe8;

  --cream-50:  #fefcf6;
  --cream-100: #faf6ec;    /* page background */
  --cream-200: #f2ead8;

  --amber-600: #c98a2c;    /* accent */
  --amber-500: #dba24a;
  --amber-100: #f8e9cf;

  --ink-900: #24211b;
  --ink-700: #4c473d;
  --ink-500: #7a7466;
  --ink-300: #b6afa0;

  --red-600: #b3432e;
  --green-ok: #2c5c3c;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(36, 33, 27, 0.08);
  --shadow-md: 0 8px 24px rgba(20, 48, 30, 0.10);
  --shadow-lg: 0 18px 48px rgba(20, 48, 30, 0.16);
  --maxw: 1200px;

  /* Semantic roles — themes (assets/css/themes.css) override these. Defaults
     reproduce the original forest palette exactly. */
  --surface: #fff;                   /* cards, panels, tables */
  --heading: var(--forest-900);      /* heading text on the page */
  --text-strong: var(--forest-800);  /* prices, stats, emphasised text */
  --link: var(--forest-700);         /* links, outline buttons */
  --on-primary: #fff;                /* text on forest-700 fills */
  --on-accent: #fff;                 /* text on amber-600 fills */
  --accent-text: var(--amber-600);   /* eyebrows, card types (accent as text) */
  --accent-soft-text: #7a5416;       /* text on amber-100 */
  --input-border: #ddd6c4;
  --chrome: var(--forest-900);       /* topbar, footer, admin sidebar */
  --on-chrome: #fff;
  --on-chrome-muted: #cfe0d4;
  --on-chrome-soft: #b9d0bf;
  --on-chrome-faint: #7fa088;
  --on-chrome-hover: rgba(255,255,255,.08);
  --chrome-line: rgba(255,255,255,.1);
  --topbar-bg: var(--forest-900);
  --topbar-text: #f2ead8;
  --sidebar-text: #eef4ee;
  --hero-bg: linear-gradient(160deg, var(--forest-800), var(--forest-700) 60%, var(--forest-600));
  --cta-bg: linear-gradient(145deg, var(--forest-700), var(--forest-800));
  --cta-border: rgba(219,162,74,.35);
  --cta-tag-bg: var(--amber-500);
  --cta-tag-text: var(--forest-900);
  --cta-link: var(--amber-500);
  --badge-accent: var(--amber-600);  /* accent on a fixed white badge */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink-900);
  background: var(--cream-100);
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: Georgia, 'Times New Roman', serif; color: var(--heading); line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
  white-space: nowrap;
}
.btn--primary { background: var(--amber-600); color: var(--on-accent); }
.btn--primary:hover { background: var(--amber-500); }
.btn--secondary { background: var(--forest-700); color: var(--on-primary); }
.btn--secondary:hover { background: var(--forest-600); }
.btn--outline { background: transparent; border-color: var(--link); color: var(--link); }
.btn--outline:hover { background: var(--forest-100); }
.btn--ghost { background: var(--forest-100); color: var(--text-strong); }
.btn--ghost:hover { background: var(--forest-100); filter: brightness(0.97); }
.btn--danger { background: var(--red-600); color: #fff; }
.btn--sm { padding: 6px 14px; font-size: 0.82rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Topbar / header ---------- */
.topbar { background: var(--topbar-bg); color: var(--topbar-text); font-size: 0.82rem; }
.topbar__inner { display: flex; align-items: center; padding: 7px 0; }

.announce-marquee { overflow: hidden; flex: 1; min-width: 0; }
.announce-marquee__track { display: flex; width: max-content; gap: 56px; animation: announce-marquee-scroll 22s linear infinite; }
.announce-marquee:hover .announce-marquee__track { animation-play-state: paused; }
.announce-marquee__item { white-space: nowrap; }
@keyframes announce-marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .announce-marquee__track { animation: none; } }

.site-header { background: var(--cream-50); box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 50; }
.site-header__inner { display: flex; align-items: center; gap: 28px; padding: 14px 20px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.35rem; color: var(--text-strong); }
.brand__mark { font-size: 1.6rem; }
.brand__logo { height: 36px; width: auto; max-width: 160px; object-fit: contain; }
.main-nav { display: flex; gap: 22px; flex: 1; }
.main-nav a { font-weight: 600; color: var(--ink-700); font-size: 0.95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--link); border-color: var(--amber-600); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text-strong); }

.nav-dropdown { position: relative; }
.nav-dropdown__toggle { display: inline-block; }
.nav-dropdown__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--cream-50);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 8px 0;
  z-index: 60;
}
.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu,
.nav-dropdown.open .nav-dropdown__menu { display: block; }
.nav-dropdown__menu a { display: block; padding: 8px 18px; border-bottom: none; font-weight: 500; }
.nav-dropdown__menu a:hover { background: var(--forest-100); color: var(--link); }

@media (max-width: 900px) {
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--cream-50); flex-direction: column; padding: 10px 20px; box-shadow: var(--shadow-md); display: none; max-height: calc(100vh - 60px); overflow-y: auto; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .header-actions .btn { display: none; }
  .nav-dropdown__menu { display: none; position: static; box-shadow: none; padding: 0 0 8px 14px; min-width: 0; }
  .nav-dropdown.open .nav-dropdown__menu { display: block; }
  .nav-dropdown__toggle { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--cream-200); width: 100%; padding: 10px 0; }
  .nav-dropdown__caret { display: none; }
  .nav-dropdown__toggle::after { content: '+'; font-weight: 700; }
  .nav-dropdown.open .nav-dropdown__toggle::after { content: '\2212'; }
}

/* ---------- Alerts / flash ---------- */
.alert { margin: 14px 0; padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 500; }
.alert--success { background: #e4f3e8; color: var(--green-ok); border: 1px solid #bfe3c9; }
.alert--error   { background: #fbe8e4; color: var(--red-600); border: 1px solid #f1c3ba; }
.alert--info    { background: var(--amber-100); color: var(--accent-soft-text); border: 1px solid var(--amber-500); }

/* ---------- Hero ---------- */
.hero {
  background: var(--hero-bg);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  color: #fff; padding: 56px 0;
}
/* Homepage banner: taller, with the text centred vertically (grows with the
   screen height, within limits, so it never swallows a short laptop screen) */
.hero--home { display: flex; align-items: center; min-height: clamp(380px, 55vh, 540px); }
.hero--home > .container { width: 100%; }
.hero__flex { display: flex; align-items: center; justify-content: center; gap: 44px; }
.hero__inner { text-align: center; max-width: 720px; }
.hero__eyebrow { display: inline-block; background: rgba(255,255,255,.14); padding: 6px 16px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 18px; text-shadow: none; }
.hero h1 { color: #fff; font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 12px; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.hero p { color: #eef4ee; font-size: 1.1rem; opacity: .92; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
@media (max-width: 900px) {
  .hero__flex { flex-direction: column; }
  .hero__inner { text-align: center; max-width: none; }
}

/* Hero slideshow: admin-uploaded images scroll slowly right-to-left behind the
   hero content. Each slide is exactly one hero wide and object-fit:cover scales
   and crops it to fill the banner at any size, so no image is ever stretched. */
.hero--slideshow { position: relative; overflow: hidden; }
.hero--slideshow > .container { position: relative; z-index: 2; }
.hero__slides { position: absolute; inset: 0; z-index: 0; }
.hero__slides::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,.45), rgba(0,0,0,.18) 75%); }
/* Phones: a phone-shaped banner would crop a wide photo to a thin slice, so
   the image instead runs full width at its own shape (--hero-ratio, set from
   the uploaded images) with the text below it on the plain banner colour. */
@media (max-width: 600px) {
  .hero--home.hero--slideshow { display: block; min-height: 0; padding: 0 0 26px; }
  .hero--home.hero--slideshow .hero__slides { position: relative; inset: auto; width: 100%; aspect-ratio: var(--hero-ratio, 16 / 9); overflow: hidden; }
  .hero--home.hero--slideshow .hero__slides::after { display: none; }
  .hero--home.hero--slideshow .hero__track--single { animation: none; }
  .hero--home.hero--slideshow .hero__track--single .hero__slide { transform: none; }
  .hero--home.hero--slideshow > .container { padding-top: 20px; }
  .hero--slideshow h1 { font-size: 1.7rem; margin-bottom: 6px; }
  .hero--slideshow p { font-size: 0.92rem; }
  .hero--slideshow .hero__eyebrow { font-size: 0.68rem; padding: 4px 12px; margin-bottom: 10px; }
}
.hero__track {
  display: flex; height: 100%;
  width: calc(var(--hero-count) * 200%);
  animation: hero-scroll calc(var(--hero-count) * 14s) linear infinite;
  will-change: transform;
}
.hero__slide { flex: 1 1 0; min-width: 0; height: 100%; object-fit: cover; object-position: center; display: block; }
/* A single image drifts gently instead of looping into a copy of itself */
.hero__track--single { width: 100%; animation: hero-drift 24s ease-in-out infinite alternate; }
.hero__track--single .hero__slide:nth-child(n+2) { display: none; }
.hero__track--single .hero__slide { transform: scale(1.12); }
@keyframes hero-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes hero-drift { from { transform: translateX(4%); } to { transform: translateX(-4%); } }
@media (prefers-reduced-motion: reduce) {
  .hero__track, .hero__track--single { animation: none; }
}

/* ---------- Search bar (slim rectangle below the hero) ---------- */
.search-bar-section { padding: 18px 0 4px; }
.search-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: 8px 8px 8px 12px;
}
.search-bar .search-tabs { margin: 0; flex-shrink: 0; flex-wrap: nowrap; }
.search-bar .search-form { flex: 1; flex-direction: row; align-items: center; gap: 8px; }
.search-bar .field { flex: 1 1 0; min-width: 0; }
.search-bar input, .search-bar select { padding: 8px 10px; font-size: 0.88rem; height: 38px; }
.search-bar .btn { flex-shrink: 0; height: 38px; padding: 0 28px; font-size: 0.88rem; }
@media (max-width: 800px) {
  .search-bar { flex-direction: column; align-items: stretch; padding: 10px; }
  .search-bar .search-form { flex-wrap: wrap; }
  .search-bar .field { flex: 1 1 100%; }
  .search-bar .btn { width: 100%; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.search-tabs { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.search-tabs button {
  padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 0.82rem; color: var(--ink-700);
  background: none; border: none; font-family: inherit; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.search-tabs button:hover { background: var(--cream-100); }
.search-tabs button.active { background: var(--forest-700); color: var(--on-primary); }
.search-tabs button.active:hover { background: var(--forest-700); }
.search-form { display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.field--hidden { display: none; }
.field label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-500); }


input, select, textarea {
  font: inherit; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--input-border);
  background: var(--cream-50); color: var(--ink-900); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--forest-500); box-shadow: 0 0 0 3px var(--forest-100); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
[hidden] { display: none !important; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.form-hint { font-size: 0.8rem; color: var(--ink-500); margin-top: 4px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 8px 16px; }
.checkbox-item { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.checkbox-item input { width: auto; }

/* ---------- Search results layout ---------- */
.search-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .search-layout { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section--tight { padding: 32px 0; }
.section__head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.eyebrow { color: var(--accent-text); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: 0.78rem; }
.section__head h2 { margin: 4px 0 0; }
/* Page-level <h1> on list pages, sized like the section headings it replaced */
.section__head h1, .page-heading { font-size: 1.5em; margin: 4px 0 0; }
.page-heading { margin-bottom: 12px; }
.muted { color: var(--ink-500); }

/* ---------- Area chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 12px; }
.chip { background: var(--surface); border: 1px solid var(--cream-200); border-radius: var(--radius-md); padding: 16px 20px; font-weight: 700; color: var(--text-strong); box-shadow: var(--shadow-sm); transition: transform .15s; flex: 1 1 200px; }
.chip:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.chip small { display: block; font-weight: 500; color: var(--ink-500); margin-top: 4px; }

/* ---------- Category tiles ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.cat-tile { background: var(--cream-50); border: 1px solid var(--cream-200); border-radius: var(--radius-md); padding: 22px 14px; text-align: center; font-weight: 700; color: var(--text-strong); }
.cat-tile:hover { background: var(--forest-100); }
.cat-tile .cat-icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }

/* ---------- Listing cards ---------- */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.card {
  background: var(--surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-200); transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card__img { position: relative; aspect-ratio: 4/3; background: var(--forest-100); overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.badge { padding: 4px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.badge--new { background: var(--forest-700); color: var(--on-primary); }
.badge--verified { background: var(--amber-600); color: var(--on-accent); }
.badge--boost { background: #fff; color: var(--badge-accent); border: 1px solid var(--badge-accent); }
.badge--sale { background: rgba(255,255,255,.92); color: var(--forest-800); }
.badge--rent { background: rgba(255,255,255,.92); color: var(--red-600); }
.card__save { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.9); border-radius: 50%; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; }
.card__body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card__type { font-size: 0.72rem; font-weight: 800; color: var(--accent-text); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.card__title { font-family: Georgia, serif; font-size: 1.05rem; margin: 0 0 4px; color: var(--heading); }
.card__title a { color: inherit; }
.card__location { color: var(--ink-500); font-size: 0.86rem; margin-bottom: 8px; }
.card__price { font-weight: 800; color: var(--text-strong); font-size: 1.15rem; margin-bottom: 8px; }
.card__facts { display: flex; gap: 12px; font-size: 0.82rem; color: var(--ink-700); margin-bottom: 10px; flex-wrap: wrap; }
.card__amenities { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag { background: var(--cream-200); color: var(--ink-700); font-size: 0.72rem; padding: 3px 9px; border-radius: 999px; }

/* ---------- Category marquee (auto-scrolling, e.g. Home Solutions) ---------- */
.cat-marquee {
  overflow: hidden; margin-bottom: 24px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.cat-marquee__track { display: flex; width: max-content; gap: 18px; animation: cat-marquee-scroll 32s linear infinite; }
.cat-marquee:hover .cat-marquee__track { animation-play-state: paused; }
.cat-marquee__item {
  display: block; width: 180px; height: 180px; flex-shrink: 0;
  border-radius: var(--radius-md); overflow: hidden; background: var(--surface);
  border: 2px solid transparent; box-shadow: var(--shadow-sm); transition: border-color .15s ease, transform .15s ease;
}
.cat-marquee__item:hover { transform: translateY(-3px); }
.cat-marquee__item:hover, .cat-marquee__item.active { border-color: var(--forest-500); }
.cat-marquee__icon {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; background: var(--forest-100); font-size: 3rem;
}
.cat-marquee__photo { display: block; width: 100%; height: 100%; object-fit: cover; }
@keyframes cat-marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .cat-marquee__track { animation: none; } }

/* ---------- Guide cards ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,340px)); gap: 22px; }
.guide-card { background: var(--surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--cream-200); }
.guide-card__body { padding: 18px; }
.guide-card__cat { color: var(--accent-text); font-weight: 800; font-size: 0.72rem; text-transform: uppercase; }

/* ---------- Trust strip ---------- */

/* ---------- Listing detail ---------- */
.breadcrumb { font-size: 0.82rem; color: var(--ink-500); margin: 18px 0; }
.breadcrumb a { color: var(--link); }
/* Listing/development photo gallery (includes/gallery.php): main photo with
   ‹ › arrows + counter, and a thumbnail strip holding every photo. */
.gallery { margin-bottom: 24px; outline: none; }
.gallery__main { position: relative; aspect-ratio: 16 / 9; max-height: 560px; width: 100%; border-radius: var(--radius-lg); overflow: hidden; background: #161a17; }
/* contain: the whole photo is always visible (a dark frame fills any spare space) */
.gallery__main img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery__nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.5); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding-bottom: 3px; transition: background .15s;
}
.gallery__nav:hover, .gallery__nav:focus-visible { background: rgba(0,0,0,.75); }
.gallery__nav--prev { left: 12px; }
.gallery__nav--next { right: 12px; }
.gallery__count { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: 0.78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.gallery__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; }
.gallery__thumb { flex: 0 0 96px; height: 68px; padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: var(--forest-100); opacity: .7; scroll-snap-align: start; transition: opacity .15s, border-color .15s; }
.gallery__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { opacity: 1; }
.gallery__thumb.is-active { border-color: var(--amber-600); opacity: 1; }
@media (max-width: 600px) {
  .gallery__main { aspect-ratio: 4 / 3; border-radius: var(--radius-md); }
  .gallery__nav { width: 36px; height: 36px; font-size: 1.4rem; }
  .gallery__thumb { flex-basis: 72px; height: 54px; }
}

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 34px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.detail-price { font-size: 1.9rem; font-weight: 800; color: var(--text-strong); }
.detail-sub { color: var(--ink-500); font-size: 0.88rem; margin-bottom: 20px; }

.facts-table { width: 100%; border-collapse: collapse; margin: 14px 0 26px; }
.facts-table td { padding: 10px 4px; border-bottom: 1px solid var(--cream-200); font-size: 0.92rem; }
.facts-table td:first-child { color: var(--ink-500); width: 40%; }
.facts-table td:last-child { font-weight: 700; color: var(--ink-900); }

.amenity-block { margin-bottom: 20px; }
.amenity-block h4 { margin-bottom: 8px; font-size: 0.95rem; }
.amenity-list { display: flex; flex-wrap: wrap; gap: 8px; }

.contact-card { background: var(--surface); border: 1px solid var(--cream-200); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-sm); position: sticky; top: 90px; }
.agent-mini { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.agent-mini img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--forest-100); }
.agent-mini strong { display: block; }
.agent-mini span { font-size: 0.8rem; color: var(--ink-500); }
/* Site logo in the contact card: show the whole logo, not a cropped circle */
.agent-mini--site img { border-radius: var(--radius-sm); object-fit: contain; background: none; }
.agent-mini--site .brand__mark { font-size: 2rem; line-height: 1; width: 52px; text-align: center; }
.contact-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

/* ---------- Agency / agent profile ---------- */
.profile-head { display: flex; gap: 20px; align-items: center; background: var(--surface); padding: 26px; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin: 24px 0; flex-wrap: wrap; }
.profile-head img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; background: var(--forest-100); }
.profile-stats { display: flex; gap: 26px; margin-top: 10px; flex-wrap: wrap; }
.profile-stats b { font-size: 1.3rem; color: var(--text-strong); display: block; }
.profile-stats span { font-size: 0.8rem; color: var(--ink-500); }

/* ---------- Auth / forms pages ---------- */
.auth-wrap { max-width: 460px; margin: 50px auto; background: var(--surface); padding: 34px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.auth-wrap h1 { text-align: center; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 0.9rem; }
.role-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.role-picker label { border: 2px solid var(--cream-200); border-radius: var(--radius-sm); padding: 12px; text-align: center; cursor: pointer; font-weight: 700; font-size: 0.85rem; }
.role-picker input { display: none; }
.role-picker input:checked + span { color: var(--link); }
.role-picker label:has(input:checked) { border-color: var(--forest-600); background: var(--forest-100); }

/* ---------- Pricing ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 22px; }
.plan-card { background: var(--surface); border-radius: var(--radius-lg); padding: 26px; border: 1px solid var(--cream-200); box-shadow: var(--shadow-sm); text-align: center; position: relative; }
.plan-card--featured { border-color: var(--amber-500); box-shadow: var(--shadow-lg); transform: scale(1.02); }
.plan-card__badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--amber-600); color: var(--on-accent); font-size: 0.72rem; font-weight: 800; padding: 4px 14px; border-radius: 999px; }
.plan-card__price { font-size: 2.1rem; font-weight: 800; color: var(--text-strong); margin: 10px 0; }
.plan-card__price span { font-size: 0.9rem; font-weight: 500; color: var(--ink-500); }
.plan-features { list-style: none; padding: 0; margin: 18px 0; text-align: left; }
.plan-features li { padding: 7px 0; border-bottom: 1px dashed var(--cream-200); font-size: 0.9rem; }
.plan-features li::before { content: '✓ '; color: var(--forest-600); font-weight: 800; }

/* ---------- Dashboards (agent / account) ---------- */
.dash-shell { display: grid; grid-template-columns: 230px 1fr; gap: 30px; padding: 30px 0 60px; }
@media (max-width: 850px) { .dash-shell { grid-template-columns: 1fr; } }
.dash-side { background: var(--surface); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-sm); height: fit-content; }
.dash-side a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 600; color: var(--ink-700); margin-bottom: 4px; font-size: 0.92rem; }
.dash-side a:hover, .dash-side a.active { background: var(--forest-100); color: var(--text-strong); }
.dash-side .plan-pill { display: inline-block; background: var(--amber-100); color: var(--accent-soft-text); font-size: 0.72rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; margin-top: 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--surface); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--forest-600); }
.stat-card b { font-size: 1.6rem; display: block; color: var(--text-strong); }
.stat-card span { font-size: 0.8rem; color: var(--ink-500); }

.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--cream-200); font-size: 0.9rem; }
.data-table th { background: var(--forest-100); color: var(--text-strong); font-size: 0.76rem; text-transform: uppercase; letter-spacing: .03em; }
.data-table tr:last-child td { border-bottom: none; }
.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; }
.status-pill--approved, .status-pill--active, .status-pill--published, .status-pill--completed, .status-pill--won, .status-pill--replied { background: #e4f3e8; color: var(--green-ok); }
.status-pill--pending, .status-pill--draft, .status-pill--new  { background: var(--amber-100); color: var(--accent-soft-text); }
.status-pill--rejected, .status-pill--suspended, .status-pill--failed, .status-pill--lost { background: #fbe8e4; color: var(--red-600); }
.status-pill--expired, .status-pill--read { background: var(--cream-200); color: var(--ink-500); }

.card-panel { background: var(--surface); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 22px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }

.pagination { display: flex; gap: 6px; justify-content: center; margin: 30px 0; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--cream-200); font-weight: 600; font-size: 0.85rem; }
.pagination .current { background: var(--forest-700); color: var(--on-primary); border-color: var(--forest-700); }

.image-upload-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); gap: 10px; margin-top: 10px; }
.image-upload-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--cream-200); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-500); }
.empty-state .icon { font-size: 2.4rem; margin-bottom: 10px; }

/* ---------- Admin shell ---------- */
.admin-body { background: var(--cream-100); }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--chrome); color: var(--sidebar-text); padding: 20px 14px; }
.admin-sidebar .brand { color: var(--on-chrome); margin-bottom: 22px; padding: 0 8px; }
.admin-sidebar a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--on-chrome-muted); font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--on-chrome-hover); color: var(--on-chrome); }
.admin-sidebar .nav-group { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--on-chrome-faint); padding: 16px 12px 6px; }
.admin-main { padding: 26px 30px 60px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.admin-topbar h1 { margin: 0; font-size: 1.5rem; }

@media (max-width: 850px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

/* ---------- Misc ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.small { font-size: 0.85rem; }
.divider { height: 1px; background: var(--cream-200); margin: 22px 0; }
.whatsapp-fab { position: fixed; bottom: 22px; right: 22px; width: 56px; height: 56px; border-radius: 50%; background: #25D366; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; box-shadow: var(--shadow-md); z-index: 60; }

.site-footer { background: var(--chrome); color: var(--on-chrome-muted); padding: 50px 0 0; margin-top: 40px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 30px; padding-bottom: 30px; }
@media (max-width: 800px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__cta { grid-column: 1 / -1; } }
.footer__cta { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius-md); background: var(--cta-bg); border: 1px solid var(--cta-border); color: var(--on-chrome-muted); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.footer__cta:hover { transform: translateY(-3px); border-color: var(--amber-500); box-shadow: 0 12px 28px rgba(0,0,0,.25); color: var(--on-chrome-muted); }
.footer__cta-tag { align-self: flex-start; background: var(--cta-tag-bg); color: var(--cta-tag-text); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 10px; border-radius: 999px; }
.footer__cta strong { color: var(--on-chrome); font-size: 1.05rem; line-height: 1.3; }
.footer__cta-text { font-size: 0.85rem; color: var(--on-chrome-soft); line-height: 1.5; }
.footer__cta-btn { margin-top: 4px; font-weight: 600; color: var(--cta-link); font-size: 0.9rem; }
.footer__cta-btn span { display: inline-block; transition: transform .2s ease; }
.footer__cta:hover .footer__cta-btn span { transform: translateX(4px); }
.footer__col h4 { color: var(--on-chrome); font-size: 0.85rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.footer__col a { display: block; margin-bottom: 8px; color: var(--on-chrome-soft); font-size: 0.9rem; }
.footer__col a:hover { color: var(--on-chrome); }
.footer__brand p { color: var(--on-chrome-soft); font-size: 0.85rem; }
.footer__bottom { border-top: 1px solid var(--chrome-line); padding: 16px 20px; display: flex; justify-content: space-between; font-size: 0.8rem; flex-wrap: wrap; gap: 8px; }
.footer__credit { color: var(--on-chrome-soft); text-decoration: underline; text-underline-offset: 2px; }
.footer__credit:hover { color: var(--on-chrome); }
.footer__social { display: flex; flex-wrap: wrap; gap: 6px 14px; }

/* ---- Rich text toolbar (admin CMS content fields) ------------------- */
.rte { border: 1px solid var(--input-border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px; background: var(--cream-100); border-bottom: 1px solid var(--input-border); }
.rte-toolbar__group { display: flex; gap: 2px; border-right: 1px solid var(--cream-200); padding-right: 8px; }
.rte-toolbar__group:last-child { border-right: none; padding-right: 0; }
.rte-btn { border: 1px solid transparent; background: transparent; color: var(--ink-700); font: inherit; font-size: 0.82rem; padding: 6px 9px; border-radius: var(--radius-sm); cursor: pointer; line-height: 1; }
.rte-btn:hover { background: var(--forest-100); border-color: var(--forest-100); }
.rte-btn.is-active { background: var(--forest-700); color: var(--on-primary); }
.rte-editor { min-height: 260px; max-height: 520px; overflow-y: auto; padding: 14px 16px; line-height: 1.6; }
.rte-editor:focus { outline: none; }
.rte-editor img { max-width: 100%; border-radius: var(--radius-sm); }
.rte-editor blockquote { border-left: 3px solid var(--amber-500); margin: 10px 0; padding: 4px 0 4px 14px; color: var(--ink-500); }
.rte textarea { border: none; border-radius: 0; border-top: 1px solid var(--input-border); width: 100%; }
.rte textarea:focus { box-shadow: none; }

.rich-text { line-height: 1.7; }
.rich-text ul, .rich-text ol { margin: 0 0 14px; padding-left: 22px; }
.rich-text blockquote { border-left: 3px solid var(--amber-500); margin: 10px 0; padding: 4px 0 4px 14px; color: var(--ink-500); }
.rich-text p { margin: 0 0 14px; }

/* ---- Theme picker (Admin -> Appearance) -------------------------------
   Each .theme-mock carries its own data-theme, so it renders with that
   theme's real tokens regardless of the theme the admin panel is using. */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.theme-option { display: flex; flex-direction: column; background: var(--surface); border: 2px solid var(--cream-200); border-radius: var(--radius-md); overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.theme-option:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option:has(input:checked) { border-color: var(--link); box-shadow: 0 0 0 3px var(--forest-100), var(--shadow-md); }
.theme-option:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
.theme-option__meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.theme-option__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.theme-option__preview { color: var(--link); font-weight: 600; margin-top: 4px; align-self: flex-start; }
.theme-option__preview:hover { text-decoration: underline; }

.theme-mock { background: var(--cream-100); color: var(--ink-900); font-size: 10px; line-height: 1.2; border-bottom: 1px solid var(--cream-200); user-select: none; }
.tm-topbar { background: var(--topbar-bg); color: var(--topbar-text); padding: 3px 8px; font-size: 8px; }
.tm-header { background: var(--cream-50); display: flex; align-items: center; gap: 6px; padding: 6px 8px; box-shadow: var(--shadow-sm); }
.tm-brand { font-weight: 800; color: var(--text-strong); margin-right: auto; }
.tm-nav { width: 22px; height: 4px; border-radius: 2px; background: var(--ink-300); }
.tm-hero { background: var(--hero-bg); padding: 14px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tm-hero__title { color: #fff; font-family: Georgia, serif; font-size: 13px; font-weight: 700; }
.tm-btn { display: inline-block; padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: 9px; }
.tm-btn--accent { background: var(--amber-600); color: var(--on-accent); }
.tm-btn--primary { background: var(--forest-700); color: var(--on-primary); }
.tm-body { display: flex; gap: 8px; padding: 10px 8px; align-items: flex-start; }
.tm-card { flex: 1; background: var(--surface); border: 1px solid var(--cream-200); border-radius: 6px; padding: 7px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); }
.tm-card__type { color: var(--accent-text); font-weight: 800; font-size: 8px; text-transform: uppercase; }
.tm-card__title { color: var(--heading); font-family: Georgia, serif; font-weight: 700; }
.tm-card__price { color: var(--text-strong); font-weight: 800; }
.tm-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tm-tag { background: var(--cream-200); color: var(--ink-700); padding: 2px 7px; border-radius: 999px; font-size: 8px; }
.tm-footer { background: var(--chrome); padding: 8px; display: flex; align-items: center; gap: 6px; }
.tm-footer__line { width: 30px; height: 4px; border-radius: 2px; background: var(--on-chrome-soft); opacity: .7; }
.tm-footer__tag { margin-left: auto; background: var(--cta-tag-bg); color: var(--cta-tag-text); font-weight: 800; font-size: 8px; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.video-embed { position: relative; aspect-ratio: 16 / 9; width: 100%; margin: 16px 0; border-radius: var(--radius-md); overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Photo picker previews (input[data-multi-upload], see main.js) */
.upload-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.upload-preview:empty { display: none; }
.upload-preview__item { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--forest-100); }
.upload-preview__item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.upload-preview__item span { display: block; padding: 4px 6px; font-size: 0.7rem; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-preview__remove {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.65); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer;
}
.upload-preview__remove:hover { background: var(--red-600); }
.upload-preview__note:empty { display: none; }

/* Saved-photo manager on listing forms: choose cover, tick to delete */
.photo-manager { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 8px; }
.photo-manager__item { border: 2px solid var(--cream-200); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); transition: border-color .15s, opacity .15s; }
.photo-manager__item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--forest-100); }
.photo-manager__item label { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 0.8rem; font-weight: 600; cursor: pointer; margin: 0; }
.photo-manager__item input { width: auto; margin: 0; }
.photo-manager__delete { color: var(--red-600); border-top: 1px solid var(--cream-200); }
.photo-manager__item:has(.photo-manager__cover input:checked) { border-color: var(--amber-600); }
.photo-manager__item:has(.photo-manager__delete input:checked) { border-color: var(--red-600); opacity: .55; }
