/* ============================================================
   Tenant real-estate design system — Airbnb-inspired.
   Brand tokens (--brand-*) are injected per-tenant at SSR time
   (see render/theme.js); everything below references them so each
   agency rebrands by swapping its primary color in the admin.
   Neutral/scale tokens are fixed constants.
   ============================================================ */

:root {
  /* Brand (overridden per-tenant via inline :root injection) */
  --brand-primary: #FF385C;
  --brand-primary-hover: #E00B41;
  --brand-on-primary: #FFFFFF;
  --brand-secondary: #460479;
  --brand-text: #222222;
  --brand-text-muted: #6A6A6A;
  --brand-bg: #FFFFFF;
  --brand-surface: #F7F7F7;
  --brand-border: #DDDDDD;
  --brand-font: 'Inter', -apple-system, system-ui, "Helvetica Neue", sans-serif;

  /* Derived neutrals (fixed) */
  --ink: var(--brand-text);
  --body: #3F3F3F;
  --muted: var(--brand-text-muted);
  --muted-soft: #929292;
  --hairline: var(--brand-border);
  --hairline-soft: #EBEBEB;
  --border-strong: #C1C1C1;
  --canvas: var(--brand-bg);
  --surface-soft: var(--brand-surface);
  --surface-strong: #F2F2F2;

  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-full: 9999px;

  --shadow-card: 0 0 0 1px rgba(0,0,0,0.02), 0 2px 6px rgba(0,0,0,0.04), 0 4px 8px rgba(0,0,0,0.1);
  --shadow-pop: 0 8px 28px rgba(0,0,0,0.16);

  --max-content: 1280px;
  --max-detail: 1080px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--brand-font);
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
ul { list-style: none; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }

.container { max-width: var(--max-content); margin: 0 auto; padding: 0 24px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-sm); font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer; transition: .15s ease; white-space: nowrap;
}
.btn-primary { background: var(--brand-primary); color: var(--brand-on-primary); }
.btn-primary:hover { background: var(--brand-primary-hover); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--ink); }
.btn-outline:hover { background: var(--surface-soft); }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #1da851; }
.btn-block { width: 100%; }

/* ============================================================
   TOP NAV
   ============================================================ */
.topnav { position: sticky; top: 0; z-index: 100; background: var(--canvas); border-bottom: 1px solid var(--hairline); }
.topnav__inner { height: 80px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -0.4px; color: var(--ink); }
.brand img { height: 36px; width: auto; }
.brand__mark { width: 32px; height: 32px; display: grid; place-items: center; background: var(--brand-primary); color: #fff; border-radius: var(--r-sm); }
.brand__name { display: inline-flex; align-items: center; gap: 10px; }
.brand__name--fallback { display: none; } /* revealed by site.js if the logo image fails to load */

.nav-tabs { display: flex; align-items: center; justify-content: center; gap: 4px; }
.nav-tab { position: relative; padding: 28px 16px; font-size: 16px; font-weight: 600; color: var(--muted); transition: color .15s ease; }
.nav-tab:hover { color: var(--ink); }
.nav-tab--active { color: var(--ink); }
.nav-tab--active::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 2px; background: var(--ink); }

.nav-utils { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-full); display: grid; place-items: center; color: var(--ink); transition: background .15s ease; }
.icon-btn:hover { background: var(--surface-strong); }
.host-cta { padding: 12px 16px; border-radius: var(--r-full); font-size: 14px; font-weight: 600; color: var(--ink); }
.host-cta:hover { background: var(--surface-strong); }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: var(--r-full); border: 1px solid var(--hairline); place-items: center; color: var(--ink); }
.align-right-icon { display: block; }
/* Animated lucide "align-right": on click the lines spring out and settle back
   to the initial state. site.js adds .is-animating for one animation cycle. */
.nav-toggle.is-animating .align-right-icon__line--2 { animation: align-right-line2 520ms cubic-bezier(0.34, 1.56, 0.64, 1); }
.nav-toggle.is-animating .align-right-icon__line--3 { animation: align-right-line3 520ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes align-right-line2 {
  0% { transform: translateX(0); }
  50% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}
@keyframes align-right-line3 {
  0% { transform: translateX(0); }
  50% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

/* ============================================================
   HERO + SEARCH
   ============================================================ */
.hero { padding: 56px 0 24px; text-align: center; }
.hero__headline { font-size: clamp(26px, 4vw, 34px); font-weight: 700; line-height: 1.25; margin-bottom: 10px; }
.hero__subhead { font-size: clamp(15px, 2vw, 17px); color: var(--muted); margin-bottom: 16px; }
.hero__proof {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 0;
  color: var(--muted); font-size: 14px; margin-bottom: 32px;
}
.hero__proof span { padding: 0 14px; position: relative; }
.hero__proof span + span::before {
  content: '·'; position: absolute; left: -2px; color: var(--hairline);
}

/* Hero with background image (toggled via branding.heroImageEnabled) */
.hero--has-image {
  position: relative;
  color: #fff;
  padding: 96px 0 56px;
}
.hero--has-image::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--hero-img);
  background-size: cover;
  background-position: center;
  z-index: -2;
}
.hero--has-image::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.65));
  z-index: -1;
}
.hero--has-image .hero__headline { color: #fff; }
.hero--has-image .hero__subhead { color: rgba(255,255,255,.88); }
.hero--has-image .hero__proof,
.hero--has-image .hero__proof span { color: rgba(255,255,255,.92); }
.hero--has-image .hero__proof span + span::before { color: rgba(255,255,255,.5); }

/* Desktop-only hero enlargement — mobile baseline above is intentionally untouched.
   Without a min-height the hero box is too short for background-size:cover, which
   over-crops the focal subject of the image. Mobile (≤ 860px) is fine as-is. */
@media (min-width: 861px) {
  .hero { padding: 80px 0 40px; }

  .hero--has-image {
    padding: 128px 0 96px;
    min-height: clamp(510px, 62vh, 720px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .hero--has-image .container { width: 100%; }
}

.searchbar {
  display: grid; grid-template-columns: 1.1fr 1.4fr 1.1fr 1.1fr 1.2fr auto auto;
  align-items: stretch; max-width: 1100px; margin: 0 auto; background: var(--canvas);
  border-radius: var(--r-full); box-shadow: var(--shadow-card); padding: 6px 6px 6px 0;
  position: relative; z-index: 20;
}
/* When the advanced panel is open the bar is taller, so the pill radius
   over-curves the corners — drop to a gentle radius while expanded. */
.searchbar:has(.searchbar__advanced:not(.searchbar__advanced--collapsed)) {
  border-radius: var(--r-lg); padding-bottom: 0;
}
.searchbar__segment { padding: 10px 20px; text-align: left; border-right: 1px solid var(--hairline); border-radius: var(--r-full); display: flex; flex-direction: column; justify-content: center; min-width: 0; transition: background .15s ease; }
.searchbar__segment:hover { background: var(--surface-soft); }
.searchbar__segment:last-of-type { border-right: 0; }
.searchbar__label { display: block; font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.searchbar__control { width: 100%; border: 0; background: transparent; font-family: inherit; font-size: 14px; color: var(--ink); outline: none; padding: 0; }
.searchbar__control::placeholder { color: var(--muted); }
select.searchbar__control { cursor: pointer; appearance: none; }
.searchbar__orb {
  align-self: center; justify-self: end; width: 50px; height: 50px; background: var(--brand-primary);
  border-radius: var(--r-full); display: grid; place-items: center; color: #fff; transition: background .15s ease; margin-right: 4px;
}
.searchbar__orb:hover { background: var(--brand-primary-hover); }

/* "Plus de filtres" toggle */
.searchbar__more {
  align-self: center; justify-self: end; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; margin-right: 8px; border-radius: var(--r-full); border: 1px solid var(--hairline);
  background: transparent; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.searchbar__more:hover { background: transparent; border-color: var(--hairline); color: var(--brand-primary); }
.searchbar__more[aria-expanded="true"] { background: var(--surface-strong); border-color: var(--border-strong); }

/* Advanced filters panel (full-width row under the bar) */
.searchbar__advanced {
  grid-column: 1 / -1; margin-top: 8px; padding: 18px; border-top: 1px solid var(--hairline);
}
.searchbar__advanced--collapsed { display: none; }
.searchbar__advanced-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.adv-field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.adv-field__label { font-size: 12px; font-weight: 700; color: var(--ink); }
.adv-field__control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  font-family: inherit; font-size: 14px; color: var(--ink); background: var(--canvas); outline: none;
}

/* Custom rounded dropdown (JS enhancement of search-bar selects) */
.rselect { position: relative; width: 100%; }
.rselect__btn {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%;
  border: 0; background: transparent; font-family: inherit; font-size: 14px; color: var(--ink);
  cursor: pointer; padding: 0; text-align: left;
}
.rselect__btn svg { flex: none; color: var(--muted); transition: transform .15s ease; }
.rselect[data-open="true"] .rselect__btn svg { transform: rotate(180deg); }
.rselect__panel {
  position: absolute; top: calc(100% + 12px); left: -8px; min-width: calc(100% + 16px); z-index: 60;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop); padding: 6px; list-style: none; margin: 0; max-height: 280px; overflow-y: auto;
}
.rselect[data-open="false"] .rselect__panel { display: none; }
.rselect__opt {
  padding: 9px 12px; border-radius: var(--r-sm); font-size: 14px; color: var(--ink); cursor: pointer;
  white-space: nowrap;
}
.rselect__opt:hover { background: var(--surface-soft); }
.rselect__opt--active { background: var(--surface-strong); font-weight: 600; }

/* ============================================================
   CATEGORY STRIP
   ============================================================ */
.categories { border-bottom: 1px solid var(--hairline); padding: 20px 0; }
.categories__inner { display: flex; gap: 32px; overflow-x: auto; scrollbar-width: none; width: max-content; max-width: 100%; margin-inline: auto; }
.categories__inner::-webkit-scrollbar { display: none; }
.category { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 4px; min-width: 64px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; font-weight: 600; transition: color .15s ease; white-space: nowrap; }
.category:hover { color: var(--ink); border-bottom-color: var(--hairline); }
.category--active { color: var(--ink); border-bottom-color: var(--ink); }
.category__icon { display: grid; place-items: center; height: 24px; }
.category--active .category__icon { color: var(--brand-primary); }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 40px 0; }
.section--surface { background: var(--surface-soft); }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.section__title { font-size: clamp(20px, 3vw, 26px); font-weight: 700; letter-spacing: -0.5px; }
.section__sub { color: var(--muted); margin-top: 4px; font-size: 15px; }
.section__link { font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: underline; white-space: nowrap; }
.eyebrow { color: var(--brand-primary); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }

/* ============================================================
   PROPERTY CARD GRID
   ============================================================ */
.property-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 24px; }
.property-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card { display: block; color: inherit; }
.card__media { position: relative; aspect-ratio: 20 / 19; border-radius: var(--r-md); overflow: hidden; background: var(--surface-strong); }
.card__img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card__img { transform: scale(1.03); }
.card__placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: var(--surface-strong); color: var(--muted-soft); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.card__badge { position: absolute; top: 12px; left: 12px; background: var(--canvas); color: var(--ink); font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: var(--r-full); box-shadow: var(--shadow-card); }
.card__badge--status { left: auto; right: 48px; }
.card__heart { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: var(--r-full); background: rgba(0,0,0,0.25); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: grid; place-items: center; color: #fff; cursor: pointer; transition: transform .12s ease; }
.card__heart:hover { transform: scale(1.08); }
.card__heart.is-saved svg { fill: var(--brand-primary); stroke: var(--brand-primary); }
.card__count { position: absolute; bottom: 12px; left: 12px; background: rgba(0,0,0,0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: var(--r-full); display: inline-flex; align-items: center; gap: 6px; }
.card__body { padding-top: 12px; }
.card__row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card__title { font-size: 16px; font-weight: 600; color: var(--ink); }
.card__metric { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.card__meta { font-size: 14px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card__price { margin-top: 6px; font-size: 16px; color: var(--ink); }
.card__price strong { font-weight: 700; }
.card__fees { font-size: 12px; color: var(--muted-soft); margin-top: 2px; }

/* ============================================================
   MOROCCO MAP SECTION — faint flag watermark
   Revert: delete this block, the section--map class on the
   <section> in Home.jsx, and apps/website-server/public/morocco-flag.png
   ============================================================ */
.section--map { position: relative; overflow: hidden; }
.section--map::before {
  content: '';
  position: absolute; inset: 0;
  background: url('/morocco-flag.png') no-repeat center/cover;
  opacity: 0.10 ;
  pointer-events: none;
}
.section--map > .container { position: relative; z-index: 1; }

/* ============================================================
   INTERACTIVE MOROCCO MAP
   ============================================================ */
.mmap__svg {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  margin: 8px auto 0;
  overflow: visible;
}

/* Base geography: soft fill + faint internal region lines. */
.mmap__regions path {
  fill: var(--surface-strong);
  stroke: var(--hairline-soft);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: fill .25s ease;
}

/* Markers */
.mmap__marker { cursor: default; }
.mmap__marker--active { cursor: pointer; }

.mmap__hit { fill: transparent; }

.mmap__dot {
  fill: var(--muted-soft);
  transition: fill .2s ease, r .2s ease;
}
.mmap__marker--active .mmap__dot {
  fill: var(--ink);
  animation: mmap-blink 2s ease-in-out infinite;
}

.mmap__label {
  fill: var(--ink);
  font-size: 19px;
  font-weight: 600;
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--canvas);
  stroke-width: 4px;
  pointer-events: none;
  transition: fill .2s ease;
}

/* Pulse ring (blinks continuously on active cities, intensifies on hover/focus) */
.mmap__pulse {
  fill: none;
  stroke: var(--brand-primary);
  stroke-width: 2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.mmap__marker--active .mmap__pulse {
  animation: mmap-pulse 2s ease-out infinite;
}

/* Tooltip */
.mmap__tip {
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}
.mmap__tip-text {
  fill: var(--brand-primary);
  font-size: 15px;
  font-weight: 600;
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--canvas);
  stroke-width: 4px;
}

/* Hover + keyboard focus states */
.mmap__marker--active:hover .mmap__dot,
.mmap__marker--active:focus-visible .mmap__dot {
  fill: var(--brand-primary);
  r: 7;
}
.mmap__marker--active:hover .mmap__label,
.mmap__marker--active:focus-visible .mmap__label {
  fill: var(--brand-primary);
}
.mmap__marker--active:hover .mmap__tip,
.mmap__marker--active:focus-visible .mmap__tip {
  opacity: 1;
}
.mmap__marker--active:hover .mmap__pulse,
.mmap__marker--active:focus-visible .mmap__pulse {
  animation: mmap-pulse 1.4s ease-out infinite;
}
.mmap__marker--active:focus-visible {
  outline: none;
}
.mmap__marker--active:focus-visible .mmap__dot {
  stroke: var(--brand-primary);
  stroke-width: 3;
}

@keyframes mmap-pulse {
  0%   { opacity: .55; transform: scale(1); }
  100% { opacity: 0;   transform: scale(3); }
}

@keyframes mmap-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
  .mmap__marker--active .mmap__dot,
  .mmap__marker--active .mmap__pulse,
  .mmap__marker--active:hover .mmap__pulse,
  .mmap__marker--active:focus-visible .mmap__pulse {
    animation: none;
    opacity: .4;
  }
  .mmap__marker--active .mmap__dot {
    opacity: 1;
  }
}

/* Mobile: smaller labels; keep tap targets large via .mmap__hit */
@media (max-width: 540px) {
  .mmap__label { font-size: 26px; }
  .mmap__tip-text { font-size: 22px; }
}

/* ============================================================
   TRUST BLOCK
   ============================================================ */
.trust { background: var(--surface-soft); padding: 56px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.trust__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.trust__item h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.4px; }
.trust__item p { font-size: 15px; color: var(--muted); }
.trust__icon { width: 48px; height: 48px; border-radius: var(--r-md); background: var(--canvas); display: grid; place-items: center; margin-bottom: 16px; color: var(--brand-primary); box-shadow: var(--shadow-card); }

/* ============================================================
   CTA STRIP
   ============================================================ */
.cta-strip { text-align: center; max-width: 680px; margin: 0 auto; }
.cta-strip h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 10px; }
.cta-strip p { color: var(--muted); margin-bottom: 24px; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); padding: 18px 0; flex-wrap: wrap; }
.breadcrumb a:hover { text-decoration: underline; }

/* ============================================================
   LISTINGS
   ============================================================ */
.listings { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; }
.filters { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 22px; position: sticky; top: 100px; box-shadow: var(--shadow-card); }
.filters h3 { font-size: 16px; margin-bottom: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; color: var(--muted); }
.field input, .field select { width: 100%; padding: 11px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); font-size: 14px; font-family: inherit; background: var(--canvas); color: var(--ink); }
.field-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.listings-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }
.result-count { color: var(--muted); font-size: 15px; }
.sort-form { display: flex; gap: 8px; align-items: center; }
.sort-form select { padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); font-family: inherit; font-size: 14px; background: var(--canvas); }

/* Mobile filters sheet — hidden on desktop, shown via @media 900px */
.listings__toolbar { display: none; }
.filters-toggle { display: none; }
.filters-toggle__badge { display: none; }
.filters__close { display: none; }
.listings__backdrop { display: none; }
.filters__actions {
  display: flex; flex-direction: column; gap: 8px; margin-top: 8px;
}
.filters__apply { width: 100%; }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 44px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 9px 15px; border: 1px solid var(--hairline); border-radius: var(--r-sm); font-weight: 600; font-size: 14px; }
.pagination a:hover { border-color: var(--ink); }
.pagination .active { background: var(--ink); color: #fff; border-color: var(--ink); }

.empty { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty p { margin-bottom: 16px; }

/* ============================================================
   PROPERTY DETAIL
   ============================================================ */
.detail { padding: 8px 0 64px; }
.detail__inner { max-width: var(--max-detail); margin: 0 auto; padding: 0 24px; }
.detail__title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.detail__title { font-size: clamp(24px, 4vw, 30px); font-weight: 700; letter-spacing: -0.5px; }
.detail__subtitle { font-size: 15px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail__actions { display: flex; gap: 8px; }
.detail__action-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; text-decoration: underline; }
.detail__action-btn:hover { background: var(--surface-soft); }
.detail__action-btn.is-saved svg { fill: var(--brand-primary); stroke: var(--brand-primary); }

.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; margin: 22px 0 40px; border-radius: var(--r-md); overflow: hidden; height: 440px; }
.gallery__main { grid-row: 1 / 3; position: relative; overflow: hidden; }
.gallery--single .gallery__main { grid-row: 1 / 3; grid-column: 1 / -1; }
.gallery__main img, .gallery__cell img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: transform .4s ease; }
.gallery__main img:hover, .gallery__cell img:hover { transform: scale(1.04); }
.gallery__cell { position: relative; overflow: hidden; }
.gallery__placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: var(--surface-strong); color: var(--muted-soft); font-weight: 600; font-size: 15px; text-transform: uppercase; letter-spacing: .1em; }
.gallery__expand { position: absolute; bottom: 16px; right: 16px; background: var(--canvas); border: 1px solid var(--ink); padding: 8px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; box-shadow: var(--shadow-card); }

.detail__layout { display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: start; }
.detail__main h2 { font-size: 20px; font-weight: 600; margin: 32px 0 16px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 24px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.fact { display: flex; flex-direction: column; gap: 4px; }
.fact__label { font-size: 16px; font-weight: 700; }
.fact__value { font-size: 14px; color: var(--muted); }
.detail__desc { font-size: 16px; line-height: 1.65; color: var(--body); white-space: pre-line; }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 32px; list-style: none; padding: 0; }
.features li { display: flex; align-items: center; gap: 12px; font-size: 16px; color: var(--ink); }
.features li svg { color: var(--brand-primary); flex-shrink: 0; }

/* Reservation-style inquiry card */
.inquiry-card { position: sticky; top: 100px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md); box-shadow: var(--shadow-pop); padding: 24px; }
.inquiry-card__price { font-size: 24px; font-weight: 700; margin-bottom: 2px; }
.inquiry-card__price-sub { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.inquiry-card__form { display: grid; gap: 12px; }
.inquiry-card__field { border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 10px 12px; }
.inquiry-card__field label { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.inquiry-card__field input, .inquiry-card__field textarea { width: 100%; border: 0; font-size: 14px; color: var(--ink); font-family: inherit; outline: none; background: transparent; resize: vertical; }
.inquiry-card__cta { background: var(--brand-primary); color: var(--brand-on-primary); font-size: 16px; font-weight: 600; padding: 14px 24px; border-radius: var(--r-sm); width: 100%; transition: background .15s ease; }
.inquiry-card__cta:hover { background: var(--brand-primary-hover); }
.inquiry-card__cta:disabled { opacity: .6; cursor: default; }
.inquiry-card__whatsapp { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); font-size: 14px; font-weight: 600; color: var(--ink); background: var(--canvas); }
.inquiry-card__whatsapp:hover { background: var(--surface-soft); }
.inquiry-card__fineprint { text-align: center; font-size: 12px; color: var(--muted); }
.agent-row { display: flex; align-items: center; gap: 12px; padding: 16px 0 0; margin-top: 16px; border-top: 1px solid var(--hairline-soft); }
.agent-row__avatar { width: 40px; height: 40px; border-radius: var(--r-full); background: var(--surface-strong); display: grid; place-items: center; font-weight: 700; color: var(--ink); font-size: 14px; }
.agent-row__name { font-size: 14px; font-weight: 600; }
.agent-row__meta { font-size: 12px; color: var(--muted); }

/* ============================================================
   FORMS (shared status + honeypot)
   ============================================================ */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-row input, .form-row textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); font-size: 15px; font-family: inherit; color: var(--ink); background: var(--canvas); }
.form-row textarea { min-height: 120px; resize: vertical; }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.form-note { font-size: 13px; color: var(--muted); }
.form-status { padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; margin-bottom: 16px; display: none; }
.form-status.ok { display: block; background: #e7f6ec; color: #166534; }
.form-status.err { display: block; background: #fdecec; color: #b91c1c; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }
.info-card { background: var(--surface-soft); border-radius: var(--r-md); padding: 28px; }
.info-card h3 { margin-bottom: 18px; font-size: 18px; }
.info-row { display: flex; gap: 14px; margin-bottom: 18px; }
.info-row .ico { color: var(--brand-primary); flex-shrink: 0; }
.info-row strong { display: block; font-size: 14px; }
.info-row a, .info-row div { font-size: 14px; color: var(--muted); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--canvas); border-top: 1px solid var(--hairline); padding: 48px 0 0; margin-top: 64px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--hairline); }
.footer__brand { font-size: 20px; font-weight: 800; margin-bottom: 10px; color: var(--ink); }
.footer__tagline { font-size: 14px; color: var(--muted); max-width: 280px; }
.footer__col h4 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.footer__col li { margin-bottom: 12px; }
.footer__col a { font-size: 14px; color: var(--ink); }
.footer__col a:hover { text-decoration: underline; }
.footer__social { display: flex; gap: 10px; margin-top: 14px; }
.footer__social a { width: 38px; height: 38px; border-radius: var(--r-full); background: var(--surface-strong); display: grid; place-items: center; color: var(--ink); }
.footer__social a:hover { background: var(--brand-primary); color: #fff; }
.footer__legal { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; padding: 24px 0; font-size: 14px; color: var(--muted); }

/* ============================================================
   WHATSAPP FLOAT + LIGHTBOX
   ============================================================ */
.wa-float { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; border-radius: var(--r-full); background: #25D366; display: grid; place-items: center; color: #fff; box-shadow: 0 8px 24px rgba(37,211,102,.4); z-index: 90; transition: transform .15s ease; }
.wa-float:hover { transform: scale(1.06); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 120; display: none; align-items: center; justify-content: center; padding: 24px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.lightbox .close { position: absolute; top: 20px; right: 26px; color: #fff; font-size: 40px; cursor: pointer; line-height: 1; }

/* Transient toast (share/save feedback) */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--r-full); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-pop); z-index: 130; opacity: 0; transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.toast--show { opacity: 1; transform: translate(-50%, 0); }

/* Hidden by default on desktop; shown on mobile when the orb is hidden.
   Must appear BEFORE the @media block so the mobile rule can override it. */
.searchbar__submit-mobile { display: none; margin-top: 4px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1128px) {
  .property-grid { grid-template-columns: repeat(3, 1fr); }
  .property-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .trust__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .listings { grid-template-columns: 1fr; gap: 16px; }

  /* Sticky toolbar above results — holds the Filtres toggle button */
  .listings__toolbar {
    display: flex; gap: 8px; align-items: center;
    position: sticky; top: 70px; z-index: 40;
    background: var(--canvas); padding: 10px 0; margin-bottom: 4px;
    border-bottom: 1px solid var(--hairline);
  }
  .filters-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px; border: 1px solid var(--border-strong); border-radius: var(--r-full);
    background: var(--canvas); font-family: inherit; font-size: 14px; font-weight: 600;
    color: var(--ink); cursor: pointer;
  }
  .filters-toggle__badge {
    display: inline-grid; place-items: center;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--brand-primary); color: #fff; font-size: 11px; font-weight: 700;
  }

  /* Filters sidebar becomes a right-side drawer */
  .filters {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(380px, 90vw);
    background: var(--canvas); padding: 24px 20px 20px;
    box-shadow: var(--shadow-pop);
    z-index: 115;
    transform: translateX(100%);
    transition: transform .25s ease;
    overflow-y: auto; border: 0; border-radius: 0;
  }
  .filters--open { transform: translateX(0); }
  .filters__close {
    display: grid; place-items: center;
    position: absolute; top: 12px; right: 12px;
    width: 36px; height: 36px; border-radius: var(--r-full);
    border: 0; background: var(--surface-soft); color: var(--ink);
    font-size: 22px; line-height: 1; cursor: pointer;
  }

  /* Backdrop dims the page behind the sheet */
  .listings__backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 110;
    opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
  }
  .listings__backdrop--open { opacity: 1; pointer-events: auto; }

  .detail__layout { grid-template-columns: 1fr; }
}
body.filters-open { overflow: hidden; }
@media (max-width: 860px) {
  .topnav__inner { grid-template-columns: 1fr auto; }
  .nav-tabs { display: none; position: absolute; top: 80px; left: 0; right: 0; background: var(--canvas); flex-direction: column; align-items: stretch; padding: 12px 24px; border-bottom: 1px solid var(--hairline); gap: 0; box-shadow: var(--shadow-card); }
  .nav-tabs.open { display: flex; }
  .nav-tab { padding: 14px 0; }
  .nav-tab--active::after { display: none; }
  .nav-toggle { display: grid; }
  .host-cta { display: none; }
  .searchbar { grid-template-columns: 1fr; border-radius: var(--r-md); padding: 12px; gap: 4px; }
  .searchbar__segment { border-right: 0; border-bottom: 1px solid var(--hairline); border-radius: var(--r-sm); width: 100%; padding: 12px; }
  .searchbar__segment:last-of-type { border-bottom: 0; }
  .searchbar__orb { display: none; }
  .searchbar__more { justify-self: stretch; justify-content: center; margin-right: 0; border-radius: var(--r-sm); }
  .searchbar__advanced { padding: 12px 0 4px; }
  .searchbar__advanced-grid { grid-template-columns: 1fr 1fr; }
  .searchbar__submit-mobile { display: block; }
  .property-grid, .property-grid--3 { grid-template-columns: repeat(2, 1fr); }
  .trust__grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; grid-template-rows: 240px 130px; height: auto; }
  .gallery__main { grid-row: auto; }
  .gallery--single { grid-template-rows: 240px; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 540px) {
  .property-grid, .property-grid--3 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .detail__title-row { flex-direction: column; gap: 12px; }
  .section { padding: 32px 0; }
}
