@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  /* Brand palette: Monte (dark forest green) over Hueso (warm bone) — see PROPUESTO · MONTE
     SOBRE HUESO. */
  --color-ink: #2f3b34;
  /* Secondary text tones, darkened to pass WCAG AA (≥ 4.5:1) on every light surface, including
     the darker cream-dim of the CRM columns: ink-soft 5.9:1, text-muted 5.6:1 there. */
  --color-ink-soft: #454c47;
  --color-gold: #c9a227;
  --color-gold-soft: #e4c765;
  --color-cream: #e4ded2;
  --color-cream-dim: #d7d3c7;
  --color-white: #ffffff;
  --color-text: #29342e;
  /* #5c6159 passes WCAG AA (4.5:1) on both Hueso and white; the old #747970 did not. */
  --color-text-muted: #4a4f48;
  --color-border: #c9c6ba;
  --color-success: #1f7a4d;
  --color-error: #b3261e;

  --font-display: 'Cinzel', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;

  --shadow-card: 0 8px 24px rgba(47, 59, 52, 0.08);
  --shadow-lifted: 0 16px 40px rgba(47, 59, 52, 0.16);

  --max-width: 1240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-cream);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* No page-level fade in or out: the page is always fully visible. A body faded out on the way to
   the next page was kept that way by the browser, and swiping back or forward to it showed an
   empty screen; a fade-in that a restored page never replays could leave it invisible too. */

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 var(--space-3);
  color: var(--color-ink);
}

p {
  margin: 0 0 var(--space-3);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-gold);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.btn[hidden] {
  display: none;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
  min-height: 44px;
}
/* An icon inside a button stays text-sized. Without this an SVG with no width of its own stretches
   to fill the button (e.g. the arrow on "Ver más en …" on a listing became huge). Buttons that size
   their icons themselves keep their own, more specific rule. */
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn:active {
  transform: translateY(1px);
}
.btn-primary {
  background: var(--color-gold);
  color: var(--color-ink);
}
.btn-primary:hover {
  background: var(--color-gold-soft);
}
.btn-outline {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.5);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
}
.btn-dark {
  background: var(--color-ink);
  color: var(--color-white);
}
.btn-dark:hover {
  background: var(--color-ink-soft);
}
.btn-ghost {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-border);
}
.btn-ghost:hover {
  background: var(--color-cream-dim);
}
.btn-danger {
  background: var(--color-error);
  color: var(--color-white);
}
.btn-danger:hover {
  filter: brightness(1.08);
}
.btn-success {
  background: var(--color-success);
  color: var(--color-white);
}
.btn-success:hover {
  filter: brightness(1.08);
}
.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  min-height: 36px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(47, 59, 52, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 14px var(--space-4);
  /* A bit wider than the page content: the full menu needs ~1,260px on one line. */
  max-width: 1400px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-white);
}
.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
/* The logo's colours (icons.js `logo`): forest outline + gold core on light pages (the defaults in
   the SVG); a cream outline + gold core on the dark site header and footer, and gold + cream on the
   admin bar, as in the brand board. */
.site-header,
.site-footer {
  --logo-house: #F6F1E7;
  --logo-core: #C9A24A;
}
.admin-topbar {
  --logo-house: #C9A24A;
  --logo-core: #F6F1E7;
}
/* The wordmark: "Propty" + "Center" in a geometric sans. On the public site it is written as the
   name is ("ProptyCenter", the second half in gold); the admin bar spells it in spaced capitals
   with the suffix ("ADMIN") in gold (i18n.js renderBrandMarks). */
.brand-name {
  --font-brand: 'Plus Jakarta Sans', var(--font-body);
  font-family: var(--font-brand);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-name-strong {
  font-weight: 700;
}
.brand-name-light {
  font-weight: 700;
  color: var(--color-gold);
}
.site-header .brand-name-light,
.site-footer .brand-name-light {
  color: #D9B862;
}
.admin-topbar .brand-name-light {
  font-weight: 500;
  color: inherit;
}
.brand-name-suffix {
  font-weight: 500;
  color: var(--color-gold);
}
.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 3px;
  color: var(--color-gold-soft);
  margin-top: 3px;
}
.nav-links {
  display: flex;
  gap: clamp(18px, 2vw, var(--space-5));
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap; /* one line per item; below the breakpoint the ☰ menu takes over */
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-white);
  border-color: var(--color-gold);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
}
.nav-toggle svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  overflow: hidden;
}
.lang-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px 12px;
  min-height: 36px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.lang-btn[aria-pressed="true"] {
  background: var(--color-gold);
  color: var(--color-ink);
}

.admin-topbar .lang-switch {
  border-color: rgba(255, 255, 255, 0.25);
}

/* Below this width the full menu (logo · 5 links · country · language · account) doesn't fit on
   one line, so the links fold into the ☰ menu instead of wrapping into two-line items. */
@media (max-width: 1300px) {
  .nav-links {
    /* .site-header uses backdrop-filter, which (like `filter`) makes it the
       containing block for this fixed child — so top is relative to the
       header's own box, not the viewport. Use viewport units for height so
       coverage is correct regardless of which box ends up containing it. */
    position: fixed;
    top: 100%;
    right: 0;
    left: 0;
    height: 100vh; height: 100svh;
    background: var(--color-ink);
    flex-direction: column;
    padding: var(--space-4);
    gap: var(--space-3);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
  }
  .nav-links.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ---------- Hero ---------- */
/* The still (72 KB, the clip's first frame) shows immediately and stays for slow connections; the
   self-hosted video fades in over it once the page has loaded (see public/js/hero-video.js). */
.hero {
  position: relative;
  background: #2f3b34 url('/images/hero-coast-poster.webp') center / cover no-repeat;
  color: var(--color-white);
  overflow: hidden;
  padding: var(--space-8) 0 var(--space-7);
}
.hero-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
/* Covers the hero whatever its shape; hidden until it is actually playing (hero-video.js). */
.hero-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}
.hero-video video.is-visible {
  opacity: 1;
}
.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 26, 23, 0.78) 0%, rgba(43, 39, 31, 0.85) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}
@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none;
  }
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--color-gold-soft);
  margin-bottom: var(--space-3);
}
.hero h1 {
  color: var(--color-white);
  font-size: clamp(2.1rem, 4.5vw, 3.4rem);
  margin-bottom: var(--space-3);
}
.hero p.lead {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.1rem;
  max-width: 560px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* ---------- Sections ---------- */
.section {
  padding: var(--space-7) 0;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.section-head p {
  color: var(--color-text-muted);
  margin: 0;
  max-width: 520px;
}
.section-alt {
  background: var(--color-white);
}

/* ---------- Province grid (home) ---------- */
.province-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}
.province-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  text-decoration: none;
  color: var(--color-white);
  box-shadow: var(--shadow-card);
  border-top: 5px solid var(--province-color, var(--color-gold));
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.province-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
}
.province-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 18, 14, 0) 38%, rgba(20, 18, 14, 0.82) 100%);
}
.province-card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--space-3) var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.province-card-body strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.15;
}
.province-card .count {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
}
.province-highlights {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.76rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 260ms ease, opacity 220ms ease, margin-top 260ms ease;
}
.province-highlights.is-visible {
  max-height: 70px;
  opacity: 1;
  margin-top: 6px;
}
.province-highlights svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-gold);
}

/* ---------- Property cards ---------- */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}
.property-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-ink);
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lifted);
}
.property-card.is-highlighted {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 2px var(--color-gold);
}
.property-card[data-live-id] {
  cursor: pointer;
}
.result-global-id {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.3px;
  margin: 0;
}
.property-card .thumb {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background: var(--color-cream-dim);
}
.property-card .body {
  padding: var(--space-3) var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  width: fit-content;
}
.badge-sale {
  background: #eef4ea;
  color: var(--color-success);
}
.badge-rent {
  background: #f1e9d3;
  color: #8a6a12;
}
.badge-lease {
  background: #e6ecf5;
  color: #2e4e8a;
}
.badge-permutas {
  background: #f5e6f0;
  color: #8a2e6e;
}
.badge-sold {
  background: #e8e6e2;
  color: var(--color-text-muted);
}
/* "Precio rebajado −8%" — the price was cut recently (server/price-reduction.js). */
.badge-reduced {
  background: #fbeae8;
  color: var(--color-error);
}
.badge-reduced-pct {
  font-weight: 800;
  letter-spacing: 0;
}
.badge-attraction {
  background: #e6f2e6;
  color: #2e7d32;
}
.badge-beach {
  background: #e2f1f6;
  color: #1565c0;
}
.badge-restaurant {
  background: #fbece3;
  color: #c9622e;
}
.badge-park {
  background: #eaf5e2;
  color: #4a8a2e;
}
.badge-mall {
  background: #f1e6f6;
  color: #7b3fa0;
}
.badge-health {
  background: #fbe5e5;
  color: #c62828;
}
.badge-services {
  background: #e8eef1;
  color: #546e7a;
}

.attraction-card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: #8a6a12;
  text-decoration: none;
}
.attraction-card-link:hover {
  text-decoration: underline;
}

.attraction-card-social {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.attraction-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-cream-dim);
  color: var(--color-text-muted);
  transition: color 150ms ease, background 150ms ease;
}
.attraction-social-link svg {
  width: 15px;
  height: 15px;
}
.attraction-social-link:hover {
  color: var(--color-gold);
  background: #f1e9d3;
}

.attraction-card-source {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.attraction-card-description {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}

.ad-banner {
  background: var(--color-white);
  border: 1px solid var(--color-gold);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-4);
}
.ad-banner-badge {
  display: inline-block;
  background: var(--color-gold);
  color: var(--color-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.ad-banner h3 {
  font-size: 1.05rem;
  margin: 0 0 4px;
}
.ad-banner p {
  color: var(--color-text-muted);
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.property-price {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-ink);
  margin: 2px 0 0;
}
.property-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}
.property-address {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.property-address svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--color-gold);
}
.property-owner-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.property-specs {
  display: flex;
  gap: var(--space-4);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 6px;
  flex-wrap: wrap;
}
.property-specs span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.property-specs svg {
  width: 16px;
  height: 16px;
  color: var(--color-gold);
}

.list-with-us-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  background: var(--color-ink);
  color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}
.list-with-us-banner h2 {
  color: var(--color-white);
  margin-bottom: 6px;
}
.list-with-us-banner p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  max-width: 480px;
}

.renewal-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--color-cream-dim);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: var(--space-4);
  font-size: 0.85rem;
  line-height: 1.5;
}
.renewal-notice svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-gold);
  margin-top: 1px;
}
.renewal-notice strong {
  display: block;
  color: var(--color-ink);
  font-weight: 600;
}
.renewal-notice p {
  margin: 4px 0 0;
  color: var(--color-text-muted);
}

.empty-state {
  text-align: center;
  padding: var(--space-7) var(--space-4);
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-ink);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-6) 0 var(--space-4);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-5);
}
.footer-grid h4 {
  color: var(--color-white);
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 700;
}
.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.footer-grid a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}
.footer-grid a:hover {
  color: var(--color-gold-soft);
}
.footer-bottom {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.footer-bottom a {
  color: inherit;
  text-decoration: underline;
}
@media (max-width: 720px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* ---------- Utility ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -60px;
  background: var(--color-gold);
  color: var(--color-ink);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top 150ms ease;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus {
  top: var(--space-3);
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  background: #f6e6c8;
  color: #6b4a0e;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid #e2c179;
}
.impersonation-banner-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.impersonation-banner-text svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.impersonation-banner button {
  background: #6b4a0e;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  flex-shrink: 0;
}
.impersonation-banner button:hover {
  filter: brightness(1.1);
}

/* A gentle fade-in for content that gets swapped in by JS after the page has already
   loaded (e.g. the property detail page replacing its "Loading…" placeholder). Pages themselves
   have no cross-page transition: those left a blank screen on back navigation in WebKit. */
.content-fade-in {
  animation: contentFadeIn 220ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .content-fade-in {
    animation: none;
  }
}
@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Demo Mode's site-wide warning strip (public/js/app.js's initDemoModeBanner) — deliberately
   loud (not a subtle badge) and in normal document flow at the very top of <body>, ahead of any
   page's own sticky header, so it can never be mistaken for a real "everything is fine" state. */
/* Every map keeps its layers and buttons (Leaflet uses z-index 400–1000) inside its own box, so
   they scroll under the sticky Demo Mode notice and page bars instead of drawing over them. */
.leaflet-container { isolation: isolate; }

.demo-mode-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  background: repeating-linear-gradient(45deg, #b3261e, #b3261e 12px, #8f1e17 12px, #8f1e17 24px);
  color: #ffffff;
  font-size: 0.85rem;
  padding: 8px 16px;
  text-align: center;
}
.demo-mode-banner strong {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.demo-mode-banner-btn {
  background: #ffffff;
  color: #8f1e17;
  border: 0;
  border-radius: 999px;
  padding: 4px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.demo-mode-banner-btn:hover { background: #fde8e6; }
.demo-mode-banner-btn:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.demo-mode-banner-btn:disabled { opacity: 0.6; cursor: wait; }

/* Page links under a results list (?page=2…) and the related links under a listing — both are
   real links so search engines can follow them (server/seo-render.js). */
.results-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 18px 0 6px; }
.results-pager a, .results-pager span { min-width: 38px; height: 38px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.results-pager a { color: var(--color-ink); border: 1px solid var(--color-border); background: var(--color-white); }
.results-pager a:hover { border-color: var(--color-ink); }
.results-pager span[aria-current] { background: var(--color-ink); color: var(--color-white); }
.related-listings h2 { margin: 0 0 16px; }
.related-listings .property-grid + h2 { margin-top: 36px; }
.related-links { display: flex; flex-wrap: wrap; gap: 8px; }
.related-links a { padding: 8px 14px; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-white); color: var(--color-ink); font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.related-links a:hover { border-color: var(--color-gold); }

/* Market price pages (/costa-rica/precios/…, server/market-render.js). */
.market-page { padding: var(--space-7, 48px) 0; max-width: 1040px; }
.market-page h1 { margin: 0 0 12px; }
.market-page h2 { margin: 40px 0 14px; }
.market-lead { font-size: 1.05rem; color: var(--color-text); max-width: 760px; }
.market-note { font-size: 0.86rem; color: var(--color-text-muted); }
.market-empty { padding: 18px 20px; border: 1px dashed var(--color-border); border-radius: 14px; }
.market-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 24px; }
.market-card { padding: 18px 20px; border: 1px solid var(--color-border); border-radius: 16px; background: var(--color-white); }
.market-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.market-figure { display: flex; flex-direction: column; margin: 0 0 10px; }
.market-figure span { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); }
.market-figure strong { font-size: 1.7rem; color: var(--color-ink); font-variant-numeric: tabular-nums; }
.market-card dl { margin: 0; display: grid; gap: 4px; font-size: 0.88rem; }
.market-card dl div { display: flex; justify-content: space-between; gap: 12px; }
.market-card dt { color: var(--color-text-muted); }
.market-card dt { min-width: 0; }
.market-card dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; flex: none; }
.market-count { margin: 12px 0 0; font-size: 0.84rem; }
.market-table-wrap { overflow-x: auto; }
.market-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.market-table th, .market-table td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); text-align: right; white-space: nowrap; }
.market-table th:first-child, .market-table td:first-child { text-align: left; }
.market-table thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); }
.related-links a span { font-weight: 400; color: var(--color-text-muted); }

/* Town introduction on town pages (country-pages.js townIntroHTML). */
.town-intro { max-width: 860px; margin: 6px 0 14px; }
.town-intro-text { font-size: 1.02rem; line-height: 1.6; margin: 0 0 8px; }
.town-intro-facts { font-size: 0.88rem; color: var(--color-text-muted); margin: 0 0 4px; }
.town-intro-links { font-size: 0.88rem; margin: 8px 0 0; }
.town-intro-links a { font-weight: 600; }

/* Agent articles (server/articles-render.js). */
.article-byline { font-weight: 600; margin: -4px 0 10px; }
.article-body { line-height: 1.75; }
.article-body ul { padding-left: 22px; }
.article-figure { margin: 22px 0; }
.article-figure img { display: block; width: 100%; height: auto; border-radius: 14px; background: var(--color-cream-dim); }
.article-figure figcaption { margin-top: 6px; font-size: 0.8rem; color: var(--color-text-muted); }
.market-card-img { display: block; width: calc(100% + 40px); height: auto; aspect-ratio: 16 / 9; object-fit: cover; margin: -18px -20px 14px; border-radius: 16px 16px 0 0; }

/* Buyer guides (server/guides-render.js). */
.guide-page { max-width: 820px; }
.guide-page p { line-height: 1.7; }
.guide-review { padding: 12px 16px; border-left: 4px solid var(--color-gold); background: rgba(201, 162, 39, 0.1); border-radius: 0 10px 10px 0; font-size: 0.9rem; }
.guide-faq details { padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.guide-faq summary { font-weight: 600; cursor: pointer; }
.guide-page .market-card h3 a { color: var(--color-ink); }
.market-table caption { text-align: left; font-weight: 600; padding: 8px 0; }

/* Investor calculator on listings (public/js/investor-calc.js). */
.investor-calc .calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin: 10px 0; }
.investor-calc label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); }
.investor-calc input { width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--color-border); border-radius: 10px; font: inherit; font-size: 0.92rem; color: var(--color-text); background: var(--color-white); }
.investor-calc .calc-out { margin: 12px 0 8px; display: grid; gap: 6px; font-size: 0.88rem; }
.investor-calc .calc-out div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px dashed var(--color-border); }
.investor-calc .calc-out dt { color: var(--color-text-muted); min-width: 0; }
.investor-calc .calc-out dd { margin: 0; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.investor-calc .calc-out .is-key dd { color: var(--color-ink); font-size: 0.98rem; }
.investor-calc .hint { font-size: 0.78rem; color: var(--color-text-muted); }

/* Email alerts on the Favourites page. */
.alerts-panel h2 { margin: 0 0 6px; }
.alerts-panel h3 { margin: 24px 0 10px; }
.alerts-toggle { display: flex; gap: 10px; align-items: center; font-weight: 600; margin: 14px 0; }
.alerts-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alerts-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-white); }
.alerts-list li div { flex: 1 1 240px; display: flex; flex-direction: column; }
.alerts-list li span { font-size: 0.84rem; color: var(--color-text-muted); }

/* Personal-data consent (public/js/consent.js): the required checkbox on public forms, and the
   cookie notice pinned to the bottom of the screen. Wording comes from the country pack. */
.rc-consent { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; margin: 14px 0; text-align: left; }
.rc-consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--color-ink); }
.rc-consent label { font-size: 0.82rem; line-height: 1.45; color: var(--color-text-muted); font-weight: 400; }
.rc-consent label a { color: var(--color-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.rc-consent-error { grid-column: 1 / -1; margin: 0; font-size: 0.8rem; font-weight: 600; color: var(--color-error); }
/* A slim bar along the bottom edge: one line on a computer, two short rows on a phone. */
.rc-cookie-notice {
  position: fixed; z-index: 2000; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(31, 40, 35, 0.96); color: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.rc-cookie-notice p { flex: 0 1 auto; min-width: 0; margin: 0; font-size: 0.8rem; line-height: 1.4; }
.rc-cookie-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rc-cookie-more { font-size: 0.8rem; font-weight: 600; color: var(--color-gold-soft, #e3c766); margin-right: 4px; }
.rc-cookie-notice .btn { padding: 5px 12px; font-size: 0.78rem; min-height: 0; border-radius: 999px; }
.rc-cookie-notice .btn-outline { color: #fff; border-color: rgba(255, 255, 255, 0.35); background: transparent; }
.rc-cookie-notice .btn-outline:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
.rc-cookie-notice .btn-primary { background: var(--color-gold, #c9a227); border-color: var(--color-gold, #c9a227); color: #1f2823; }
@media (max-width: 560px) { .rc-cookie-notice p { flex-basis: 100%; text-align: center; } }

/* The toast after saving a home ("Le avisamos si baja de precio" + Desactivar). */
.rc-toast {
  position: fixed; z-index: 2100; left: 0; right: 0; margin: 0 auto;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100% - 32px);
  /* 24px is a full pill on one line and a tidy rounded card when a longer message wraps. */
  padding: 10px 12px 10px 18px; border-radius: 24px;
  background: #2f3b34; color: #fff; font-size: 0.88rem; line-height: 1.35;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.45);
}
.rc-toast-text { min-width: 0; }
/* Floating things (the home's "Ver en el mapa" pill, then the toast above it) clear the cookie
   bar while it is still showing: one line tall on a computer, two rows on a phone. */
body:has(.rc-cookie-notice) .home-map-fab { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
body:has(.rc-cookie-notice) .rc-toast { bottom: calc(124px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 560px) {
  body:has(.rc-cookie-notice) .home-map-fab { bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  body:has(.rc-cookie-notice) .rc-toast { bottom: calc(172px + env(safe-area-inset-bottom, 0px)); }
}
.rc-toast-action {
  flex: none; font: inherit; font-weight: 700; color: #e3c766; background: transparent;
  border: 0; padding: 4px 8px; border-radius: 999px; cursor: pointer;
}
.rc-toast-action:hover { background: rgba(255, 255, 255, 0.1); }

/* The [hidden] attribute always wins over a component's own display rule (a few components set
   display:flex/grid, which silently kept "hidden" bars, banners and buttons visible). */
[hidden] { display: none !important; }

/* ---------- Listing page: "How does this price compare?" ---------- */
.price-compare { margin: 0 0 var(--space-5); padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-white); }
.price-compare h2 { margin: 0 0 4px; font-size: 1.15rem; }
.price-compare-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px 12px; min-width: 0; }
.price-compare-head h2 { min-width: 0; flex: 1 1 auto; }
.price-compare-sub { margin: 0 0 var(--space-4); color: var(--color-text-muted); font-size: 0.9rem; }
.price-compare-bar { position: relative; height: 44px; margin: 0 14px; }
.price-compare-track { position: absolute; left: 0; right: 0; top: 30px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, #2f9e6a 0%, #c9a227 50%, #c4473a 100%); }
.price-compare-median { position: absolute; top: 25px; width: 2px; height: 18px; margin-left: -1px; background: var(--color-ink); border-radius: 1px; }
.price-compare-pin { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.price-compare-pin span { padding: 2px 8px; border-radius: 999px; background: var(--color-ink); color: var(--color-white); font-size: 0.74rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-compare-pin::after { content: ''; width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--color-white); border: 3px solid var(--color-ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.price-compare-scale { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 0.84rem; font-weight: 600; color: var(--color-ink); font-variant-numeric: tabular-nums; }
.price-compare-scale span { display: flex; flex-direction: column; }
.price-compare-scale span:last-child { text-align: right; }
.price-compare-scale small { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); }
.price-compare-scale-mid { align-self: flex-end; color: var(--color-text-muted); }
.price-compare-verdict { margin: var(--space-3) 0 0; font-size: 0.95rem; }
.price-compare-verdict.is-above { color: #9a1f17; }
.price-compare-verdict.is-below { color: #1f6b45; }
.price-compare-verdict strong { color: var(--color-ink); }
.price-compare-perm2 { margin: 4px 0 0; font-size: 0.86rem; color: var(--color-text-muted); }
.price-compare-note { margin: var(--space-3) 0 0; font-size: 0.76rem; color: var(--color-text-muted); }
@media (max-width: 560px) { .price-compare-scale-mid { display: none; } }

/* Listing cards: the sale/rent badge plus "▶ Video · 3D · 360°" pills (tourBadgesHTML in app.js
   and server/seo-render.js). */
.card-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.tour-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tour-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--color-ink);
  color: var(--color-white);
  white-space: nowrap;
}
.tour-badge-3d {
  background: var(--color-gold);
  color: var(--color-ink);
}

/* Monthly market report (server/market-report.js): highlights and the month-on-month change. */
.report-highlights {
  margin: 0 0 var(--space-4);
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 1.02rem;
}
.report-change {
  margin-left: 6px;
  font-weight: 700;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.report-change.is-up {
  color: var(--color-success);
}
.report-change.is-down {
  color: var(--color-error);
}

/* The live password checklist under new-password boxes (js/password-rules.js). Specific enough to
   win over form cards' own list styles. */
ul.pw-checklist { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 0.88rem; }
ul.pw-checklist > li.pw-rule { display: flex; gap: 8px; align-items: flex-start; min-width: 0; margin: 0; padding: 0; list-style: none; color: var(--color-text-muted); transition: color 0.15s ease; }
ul.pw-checklist > li.pw-rule::marker { content: none; }
ul.pw-checklist .pw-text { min-width: 0; }
ul.pw-checklist .pw-mark { flex: none; width: 1.2em; text-align: center; font-weight: 700; }
ul.pw-checklist > li.pw-rule.is-ok { color: var(--color-success); }
ul.pw-checklist > li.pw-rule.is-bad { color: var(--color-error); }
ul.pw-checklist > li.pw-rule.is-pending .pw-mark { animation: pw-pulse 1s ease-in-out infinite; }
@keyframes pw-pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) {
  ul.pw-checklist > li.pw-rule { transition: none; }
  ul.pw-checklist > li.pw-rule.is-pending .pw-mark { animation: none; }
}

/* ---------- Home page (index.html): search-first hero → latest-listings rail → ad → provinces ---------- */
/* The hero is short on purpose: headline and search side by side, and the latest listings rise
   into its lower edge, so whole listing cards are on the first screen without scrolling. */
/* The hero and the latest listings fill the first screen together, below the header (and the
   demo banner when it shows; index.html measures both into --home-header): spare height goes
   between the headline and the listings, so the cards sit at the foot of the screen and the ad
   starts just below it. */
.home-stage {
  --home-header: 72px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--home-header)); min-height: calc(100svh - var(--home-header));
}
.home-hero {
  --home-lift: 110px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  padding: var(--space-5) 0 var(--home-lift);
}
.home-hero .hero-video-overlay {
  background:
    linear-gradient(90deg, rgba(18, 24, 20, 0.72) 0%, rgba(18, 24, 20, 0.38) 60%, rgba(18, 24, 20, 0.2) 100%),
    linear-gradient(0deg, rgba(18, 24, 20, 0.7) 0%, rgba(18, 24, 20, 0) 55%);
}
.home-hero .hero-content {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}
.home-hero-copy {
  min-width: 0;
  width: 100%;
  max-width: 940px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
}
/* "Venda una propiedad": a frosted card beside the headline (under it on a phone). */
.home-hero-copy h1 { flex: 1 1 340px; min-width: 0; }
.home-hero-copy .home-sell { flex: 0 0 auto; }
.home-sell {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(228, 199, 101, 0.55);
  border-radius: 18px;
  background: rgba(23, 30, 26, 0.42);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--color-white);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 30px -16px rgba(0, 0, 0, 0.6);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.home-sell:hover { background: rgba(23, 30, 26, 0.6); border-color: var(--color-gold-soft); transform: translateY(-1px); }
.home-sell:focus-visible { outline: 3px solid var(--color-gold); outline-offset: 3px; }
.home-sell-icon {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--color-gold); color: var(--color-ink);
}
.home-sell-icon svg { width: 20px; height: 20px; }
.home-sell-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.home-sell-text strong { font-size: 0.98rem; font-weight: 700; }
.home-sell-text small { font-size: 0.78rem; color: rgba(255, 255, 255, 0.78); }
.home-sell-go { flex: none; display: inline-flex; color: var(--color-gold-soft); }
.home-sell-go svg { width: 18px; height: 18px; transition: transform 180ms ease; }
.home-sell:hover .home-sell-go svg { transform: translateX(3px); }
/* Spare height is shared evenly above and below the headline and search, so they sit in the
   middle of the photo with no dead band before the listings. */
.home-hero .hero-content {
  margin-top: auto;
}
.home-hero h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.7rem);
  line-height: 1.1;
  max-width: 24ch;
  margin: 0;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.25);
}
/* The photo sits in a rounded frame inside the brand green, like a window. */
.home-frame {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--color-ink);
  padding: 12px clamp(8px, 1.2vw, 16px) 0;
}
.home-frame .home-hero {
  border-radius: 28px;
}
.home-search {
  width: 100%;
  max-width: 940px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}
/* One bar in three parts: where (a place or a whole sentence), type, budget. */
.home-search-box {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: center;
  background: var(--color-white);
  border-radius: 999px;
  padding: 8px;
  box-shadow: 0 2px 6px rgba(35, 45, 39, 0.08), 0 24px 60px rgba(35, 45, 39, 0.22);
}
.home-search-field {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 22px;
  border-radius: 999px;
  transition: background 160ms ease;
}
.home-search-field + .home-search-field::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 1px;
  background: var(--color-border);
}
.home-search-field:hover,
.home-search-field:focus-within {
  background: #f4f0e8;
}
.home-search-field label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink);
}
.home-search-spark svg {
  width: 13px;
  height: 13px;
  color: var(--color-gold);
}
.home-search-field input,
.home-search-field select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.95rem;
  color: var(--color-ink);
  padding: 2px 0 0;
  text-overflow: ellipsis;
}
.home-search-field select {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.home-search-field input::placeholder {
  color: var(--color-text-muted);
}
.home-search-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 24px 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--color-ink);
  color: var(--color-white);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.home-search-submit:hover {
  background: var(--color-gold);
  color: var(--color-ink);
}
.home-search-submit:active {
  transform: scale(0.97);
}
.home-search-submit:disabled {
  opacity: 0.7;
  cursor: progress;
}
.home-search-submit svg {
  width: 20px;
  height: 20px;
}
/* One quiet line of proof under the search. */
.home-trust {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}
/* "Buscando: Casa · Guanacaste · hasta $500,000" while the sentence is turned into filters. */
.home-search-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  min-height: 0;
  margin: 0;
  color: var(--color-white);
  font-size: 0.9rem;
}
.home-search-status:empty {
  display: none;
}
.home-search-status:not(:empty) {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(23, 30, 26, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.home-search-status svg {
  width: 14px;
  height: 14px;
  color: var(--color-gold-soft);
}

/* Latest listings: a horizontal rail (swipe on phones, arrows on larger screens). Its heading sits
   on the photo and the cards straddle the hero's lower edge. */
.home-latest {
  position: relative;
  z-index: 3;
  margin-top: calc(-1 * var(--home-lift, 120px));
  padding-top: 0;
  padding-bottom: var(--space-5);
}
.home-latest-head-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: auto;
  padding-top: var(--space-6);
}
.home-latest-head {
  align-items: flex-end;
  margin-bottom: var(--space-3);
  color: var(--color-white);
}
.home-latest-head h2 {
  color: var(--color-white);
}
.home-latest-head p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 62ch;
}
.home-latest-head .home-rail-all {
  color: var(--color-white);
}
.home-latest-head .home-rail-btn {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--color-white);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.home-latest-head .home-rail-btn:hover:not(:disabled) {
  background: var(--color-white);
  border-color: var(--color-white);
  color: var(--color-ink);
}
.home-latest-head h2,
.home-provinces h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  margin-bottom: 4px;
}
.home-rail-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.home-rail-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: var(--space-2);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-ink);
  text-decoration: none;
}
.home-rail-all:hover {
  text-decoration: underline;
}
.home-rail-all svg {
  width: 16px;
  height: 16px;
}
.home-rail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-ink);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}
.home-rail-btn:hover:not(:disabled) {
  border-color: var(--color-ink);
  background: var(--color-ink);
  color: var(--color-white);
}
.home-rail-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.home-rail-btn svg {
  width: 18px;
  height: 18px;
}
.home-rail {
  position: relative;
  margin: 0 calc(-1 * var(--space-3));
}
.home-rail .property-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: none;
  grid-auto-columns: calc((100% - 3 * var(--space-4)) / 4);
  gap: var(--space-4);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--space-3);
  padding: var(--space-2) var(--space-3) var(--space-5);
  scrollbar-width: none;
}
.home-rail .property-grid::-webkit-scrollbar {
  display: none;
}
.home-rail .property-grid > * {
  scroll-snap-align: start;
}
/* Loading text or the empty message: one full-width block, not a squeezed first card. */
.home-rail .property-grid:has(> .empty-state),
.home-rail .property-grid:has(> p) {
  display: block;
}
.home-rail .property-card {
  position: relative;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(47, 59, 52, 0.08), 0 8px 24px rgba(47, 59, 52, 0.08);
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 220ms ease;
}
.home-rail .property-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 4px rgba(47, 59, 52, 0.08), 0 22px 44px rgba(47, 59, 52, 0.18);
}
.home-rail .property-card .thumb {
  aspect-ratio: 16 / 10;
  height: auto;
}
.home-rail .property-card .card-badge-row {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.home-rail .property-card .card-badge-row .badge {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.home-rail .property-card .body {
  gap: 4px;
  padding: 14px 16px 18px;
}
.home-rail .property-price {
  order: 1;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}
.home-rail .property-specs {
  order: 2;
  gap: 0;
  margin-top: 0;
  color: var(--color-ink);
  font-size: 0.9rem;
}
.home-rail .property-specs span + span::before {
  content: '';
  width: 1px;
  height: 14px;
  background: var(--color-border);
  margin: 0 10px;
}
.home-rail .property-specs svg {
  display: none;
}
.home-rail .property-title {
  order: 3;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-rail .property-address {
  order: 4;
  font-size: 0.85rem;
  min-width: 0;
}
.home-rail .property-address span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-rail .result-global-id {
  order: 5;
  margin-top: 4px;
}

/* A latest-listings card's own photo strip: swipe on touch screens, arrows on hover, dots below. */
.home-card-media {
  position: relative;
}
.home-card-track {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.home-card-track::-webkit-scrollbar {
  display: none;
}
.home-card-slide {
  flex: 0 0 100%;
  display: block;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.home-card-slide .thumb {
  display: block;
  width: 100%;
}
.home-rail .home-card .card-badge-row {
  z-index: 2;
  pointer-events: none;
}
.home-card-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--color-ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-50%) scale(0.9);
  transition: opacity 160ms ease, transform 160ms ease;
}
.home-card-nav[data-photo-dir='-1'] {
  left: 10px;
}
.home-card-nav[data-photo-dir='1'] {
  right: 10px;
}
.home-card-nav svg {
  width: 16px;
  height: 16px;
}
.home-card:hover .home-card-nav,
.home-card-nav:focus-visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}
.home-card-nav:hover {
  background: var(--color-white);
}
.home-card .home-card-nav:disabled {
  opacity: 0;
  pointer-events: none;
}
.home-card-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 2;
  display: flex;
  gap: 5px;
  transform: translateX(-50%);
  pointer-events: none;
}
.home-card-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.35);
  transition: background 160ms ease, transform 160ms ease;
}
.home-card-dots span.is-active {
  background: var(--color-white);
  transform: scale(1.3);
}
.home-card .body {
  color: inherit;
  text-decoration: none;
}
@media (hover: none) {
  .home-card-nav {
    display: none;
  }
}

/* Card extras: save heart, how new it is, the listing agent and a 3D mark. */
.home-card-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: var(--color-ink);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 160ms ease;
}
.home-card-fav:hover {
  transform: scale(1.08);
}
.home-card-fav svg {
  width: 19px;
  height: 19px;
}
.home-card-fav[aria-pressed='true'] {
  color: var(--color-error);
}
.home-rail .home-card .card-badge-row {
  right: 56px;
}
/* Status labels whisper: small, sentence case, on a quiet glass pill; the photo and price speak. */
.home-rail .home-card .card-badge-row .badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 9px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: none;
}
.home-card-price-row {
  order: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.home-card-ago {
  flex: none;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.home-card-agent {
  order: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  min-width: 0;
}
.home-card-agent > span:not(.home-card-3d) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-card-agent i {
  flex: none;
  width: 28px;
  height: 28px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-ink);
  color: var(--color-gold-soft);
  font-style: normal;
  font-weight: 700;
  font-size: 0.66rem;
}
/* The agent's photo fills the bubble, with a thin gold ring. */
.home-card-agent i.has-photo {
  background: var(--color-cream, #e4ded2);
  box-shadow: 0 0 0 1.5px var(--color-gold);
}
.home-card-agent i img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.home-card-3d {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--color-ink);
}
.home-card-3d svg {
  width: 15px;
  height: 15px;
}
.home-rail .result-global-id {
  order: 6;
}

/* Quick categories under the listings. */
.home-cats {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}
.home-cats::-webkit-scrollbar {
  display: none;
}
.home-cat {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  color: var(--color-ink);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}
.home-cat:hover {
  border-color: var(--color-ink);
}
.home-cat svg {
  width: 18px;
  height: 18px;
  color: var(--color-gold);
}
.home-cat span {
  color: var(--color-text-muted);
  font-weight: 500;
}

/* "Ver en el mapa": floats once the visitor scrolls past the listings. */
.home-map-fab {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: #232d27;
  color: var(--color-white);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  transition: opacity 220ms ease, transform 220ms ease;
}
.home-map-fab svg {
  width: 18px;
  height: 18px;
  color: var(--color-gold-soft);
}
.home-map-fab:hover {
  transform: translateX(-50%) scale(1.04);
}
.home-map-fab.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(16px);
}

/* Province tiles: an arrow that turns gold on hover. */
.province-card-go {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: var(--color-white);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background 200ms ease, color 200ms ease;
}
.province-card-go svg {
  width: 16px;
  height: 16px;
}
.province-card:hover .province-card-go {
  background: var(--color-gold);
  color: var(--color-ink);
}
.home-provinces .province-card-body {
  padding-right: 64px;
}

/* "Publique su propiedad": a light card on the home page. */
.home-list-cta .list-with-us-banner {
  background: var(--color-white);
  color: var(--color-ink);
  border: 1px solid var(--color-border);
}
.home-list-cta .list-with-us-banner h2 {
  color: var(--color-ink);
}
.home-list-cta .list-with-us-banner p {
  color: var(--color-text-muted);
}

/* Ad: below the latest listings, like a sponsored strip. */
.home-ads {
  padding: 0 0 var(--space-4);
}
.home-ads .ad-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  border: 0;
  border-radius: 20px;
  padding: 18px var(--space-5);
  color: var(--color-white);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(201, 162, 39, 0.35) 0%, rgba(201, 162, 39, 0) 55%),
    linear-gradient(120deg, #2f3b34 0%, #3e5245 100%);
  box-shadow: var(--shadow-card);
}
.home-ads .ad-banner-badge {
  margin: 0;
}
.home-ads .ad-banner h3 {
  color: var(--color-white);
  font-size: clamp(1.05rem, 1.8vw, 1.2rem);
  margin: 0 0 2px;
}
@media (max-width: 760px) {
  .home-ads .ad-banner {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--space-4);
  }
  .home-ads .ad-banner-badge {
    justify-self: start;
  }
}
.home-ads .ad-banner p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
  font-size: 0.95rem;
}

/* Provinces: a bento grid of photo tiles; the first one leads. */
.home-provinces .province-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(180px, auto);
  grid-auto-flow: dense;
  gap: var(--space-3);
}
.home-provinces .province-card {
  aspect-ratio: auto;
  min-height: 180px;
  border-top: 0;
  border-radius: 16px;
}
.home-provinces .province-card:first-child {
  grid-column: span 2;
  grid-row: span 2;
}
/* Exactly seven tiles (Costa Rica): the last two run wide so the grid closes with no gaps. */
.home-provinces .province-card:nth-child(6):nth-last-child(2),
.home-provinces .province-card:nth-child(7):last-child {
  grid-column: span 2;
}
.home-provinces .province-card:first-child .province-card-body strong,
.home-provinces .province-card:first-child .province-card-body h3 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}
.home-provinces .province-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.home-provinces .province-card-body h3 {
  color: var(--color-white);
  font-size: 1.35rem;
  margin: 0;
}

@media (max-width: 1024px) {
  .home-rail .property-grid {
    grid-auto-columns: calc((100% - 2 * var(--space-4)) / 3);
  }
}
@media (max-width: 760px) {
  .home-hero {
    --home-lift: 72px;
    padding: var(--space-5) 0 var(--home-lift);
  }
  /* On a phone the bar becomes a small card: where on top, type and budget side by side. */
  .home-search-box {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    border-radius: 24px;
    gap: 4px;
  }
  .home-search-where,
  .home-search-submit {
    grid-column: 1 / -1;
  }
  .home-search-field {
    border-radius: 16px;
    padding: 8px 14px;
  }
  .home-search-field + .home-search-field::before {
    display: none;
  }
  .home-search-submit {
    justify-content: center;
    height: 50px;
  }
  .home-frame {
    padding: 8px 8px 0;
  }
  .home-trust {
    font-size: 0.8rem;
  }
  .home-frame .home-hero {
    border-radius: 22px;
  }
  .home-latest-head p {
    display: none;
  }
  .home-latest-head-wrap {
    padding-top: var(--space-5);
  }
  .home-rail-btn {
    display: none;
  }
  .home-rail .property-grid {
    grid-auto-columns: 82%;
    gap: var(--space-3);
  }
  .home-provinces .province-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(150px, auto);
  }
  .home-provinces .province-card {
    min-height: 150px;
  }
  .home-provinces .province-card:first-child {
    grid-row: span 1;
    min-height: 200px;
  }
  .home-provinces .province-card:nth-child(6):nth-last-child(2),
  .home-provinces .province-card:nth-child(7):last-child {
    grid-column: span 1;
  }
  .home-ads .ad-banner {
    padding: var(--space-4);
  }
}
@media (max-width: 760px) and (orientation: landscape) {
  .home-rail .property-grid {
    grid-auto-columns: 46%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-rail .property-grid {
    scroll-behavior: auto;
  }
}

/* Similar-properties cards reuse the home cards' photo strip (.home-card-*); the text below links to the listing. */
.property-card.home-card { display: flex; flex-direction: column; }
.home-card > .body-link { color: inherit; text-decoration: none; display: block; flex: 1 1 auto; min-width: 0; }

/* Property page: the nearest places listed under the map. */
.property-nearby { margin-top: var(--space-3, 16px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--space-3, 16px); }
.property-nearby .nearby-status { grid-column: 1 / -1; margin: 0; color: var(--color-text-muted); font-size: 0.9rem; }
.nearby-drive-hint { margin: 6px 0 0; color: var(--color-text-muted); font-size: 0.85rem; }
.nearby-disclaimer { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(201, 162, 39, 0.12); color: var(--color-text); font-size: 0.8rem; line-height: 1.4; }
.nearby-disclaimer svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--color-gold, #c9a227); }
.nearby-disclaimer span { min-width: 0; }
.nearby-group { min-width: 0; }
.nearby-group h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 0.9rem; }
.nearby-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.nearby-group ul { list-style: none; margin: 0; padding: 0; }
.nearby-row { display: flex; align-items: baseline; gap: 6px; min-width: 0; padding: 8px 0; border-bottom: 1px solid var(--color-border, rgba(0,0,0,.1)); cursor: pointer; }
.nearby-item { flex: 0 1 auto; min-width: 0; padding: 0; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.nearby-name { min-width: 0; overflow-wrap: anywhere; }
.nearby-links { flex: none; display: inline-flex; align-items: center; align-self: center; gap: 6px; }
.nearby-web { flex: none; display: inline-flex; align-self: center; color: var(--color-text-muted); }
.nearby-web svg { width: 16px; height: 16px; }
.nearby-web:hover, .nearby-web:focus-visible { color: var(--color-gold, #c9a227); }
.nearby-row .nearby-dist { margin-left: auto; padding-left: 8px; }
.nearby-dist { flex: none; white-space: nowrap; color: var(--color-text-muted); font-size: 0.85rem; }

/* Guides: citation marks after headings and the numbered source list. */
.guide-cite { margin-left: 4px; font-size: 0.7em; font-weight: 600; white-space: nowrap; }
.guide-cite a { text-decoration: none; }
.guide-sources { padding-left: 1.4em; display: flex; flex-direction: column; gap: 8px; }
.guide-sources li { min-width: 0; overflow-wrap: anywhere; }
.guide-source-kind { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--color-cream-dim, rgba(0,0,0,.06)); font-size: 0.72rem; white-space: nowrap; }

/* km / mi switch (app.js distanceUnitToggleHTML). */
.unit-toggle { display: inline-flex; flex: none; border: 1px solid var(--color-border, rgba(0,0,0,.15)); border-radius: 999px; overflow: hidden; vertical-align: middle; }
.unit-toggle button { border: 0; background: transparent; color: inherit; font: inherit; font-size: 0.78rem; font-weight: 600; padding: 4px 10px; min-height: 28px; cursor: pointer; }
.unit-toggle button[aria-pressed="true"] { background: var(--color-ink, #2f3b34); color: #fff; }
.unit-toggle button:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
.nearby-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nearby-head h3 { margin: 0; min-width: 0; }

/* Property map: the drive to a picked place, GPS-style (property.html showDrive). */
#property-mini-map { position: relative; }
#property-mini-map.is-routing { height: 360px; height: min(360px, 60svh); }
.drive-card { position: absolute; z-index: 1000; top: 10px; left: 52px; right: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); box-shadow: 0 8px 28px rgba(15, 23, 42, 0.18), 0 1px 3px rgba(15, 23, 42, 0.12); color: #1b2430; font-size: 0.9rem; animation: drive-card-in 0.25s ease-out; }
.drive-card[hidden] { display: none; }
.drive-card-main { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.drive-card-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; background: var(--color-ink, #2f3b34); color: var(--color-gold-soft, #e4c765); }
.drive-card-icon svg { width: 18px; height: 18px; }
.drive-card-text { flex: 1 1 auto; min-width: 0; }
.drive-card-text p { margin: 0; }
.drive-card-title { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; font-weight: 600; }
.drive-card-title > span { min-width: 0; overflow-wrap: break-word; }
.drive-card-figures { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.drive-card-time { font-size: 1.15rem; color: var(--color-ink, #2f3b34); }
.drive-card-dist { color: #4b5563; }
.drive-card-note { margin-top: 2px; color: #6b7280; font-size: 0.78rem; }
.drive-card-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 8px; margin-top: 10px; }
#property-mini-map .drive-nav { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid rgba(15, 23, 42, 0.14); border-radius: 12px; background: #fff; color: #1b2430; font-weight: 600; font-size: 0.88rem; text-decoration: none; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
#property-mini-map .drive-nav:hover { border-color: var(--color-gold, #c9a227); box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12); transform: translateY(-1px); }
#property-mini-map .drive-nav:focus-visible { outline: 2px solid var(--color-gold, #c9a227); outline-offset: 2px; }
#property-mini-map .drive-nav > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.drive-nav-mark { flex: none; display: inline-flex; width: 20px; height: 20px; }
.drive-nav-mark svg { width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { #property-mini-map .drive-nav { transition: none; } #property-mini-map .drive-nav:hover { transform: none; } }
#property-mini-map .nearby-web { color: var(--color-ink-soft, #454c47); }
#property-mini-map .nearby-web:hover, #property-mini-map .nearby-web:focus-visible { color: var(--color-gold, #c9a227); }
#property-mini-map.is-routing .drive-card { left: 10px; }
.drive-card-close { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(15, 23, 42, 0.06); color: #1b2430; cursor: pointer; }
.drive-card-close:hover { background: rgba(15, 23, 42, 0.12); }
.drive-card-close:focus-visible { outline: 2px solid var(--color-gold, #c9a227); outline-offset: 2px; }
.drive-card-close svg { width: 16px; height: 16px; }
.drive-casing { filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.35)); }
.drive-flow { animation: drive-flow 0.9s linear infinite; }
.drive-start, .drive-pin { background: none; border: 0; }
.drive-start-dot { position: absolute; inset: 5px; border-radius: 50%; background: #2f3b34; border: 3px solid #fff; box-shadow: 0 0 0 2px #c9a227, 0 2px 6px rgba(0, 0, 0, 0.35); }
.drive-pin-head { position: absolute; left: 3px; top: 0; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pin, #2f3b34); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35); animation: drive-pin-drop 0.35s ease-out; }
.drive-pin-core { position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.drive-pin::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 14px; height: 6px; margin-left: -7px; border-radius: 50%; background: rgba(0, 0, 0, 0.25); animation: drive-pin-pulse 1.8s ease-out infinite; }
@keyframes drive-flow { to { stroke-dashoffset: -34; } }
@keyframes drive-card-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes drive-pin-drop { from { opacity: 0; transform: translateY(-12px) rotate(-45deg); } to { opacity: 1; transform: rotate(-45deg); } }
@keyframes drive-pin-pulse { 0% { transform: scale(0.6); opacity: 0.6; } 100% { transform: scale(2.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .drive-flow, .drive-card, .drive-pin-head, .drive-pin::after { animation: none; } }

/* A click outside a pop-up with a form doesn't close it (profile.js guardFormPopups): the box gives
   a small nudge so the person sees it is still open and closes it with ×, Cancel or Esc. */
@keyframes popup-nudge {
  0%, 100% { transform: none; }
  30% { transform: scale(1.015); }
  60% { transform: scale(0.995); }
}
.popup-nudge { animation: popup-nudge 0.28s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .popup-nudge { animation: none; outline: 2px solid var(--color-gold, #c9a227); outline-offset: 2px; }
}

/* Amenities under their headings (Más populares, Áreas Sociales…): amenityGroupsHTML in app.js,
   used by the property form, the listing page, the map filters and a client's Intereses. */
.amenity-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 12px);
  width: 100%;
  min-width: 0;
}
.amenity-group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.amenity-group-title {
  margin: 0 0 6px;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.amenity-group-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  min-width: 0;
}
.amenity-form-box {
  padding: var(--space-3, 12px);
  background: var(--color-cream-dim);
  border-radius: var(--radius-sm);
}
.amenity-form-box .amenity-group-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr));
  gap: 8px;
}
/* The checkbox and its name side by side: a long name ("Dispensador de agua caliente") wraps
   under its own first word, never back under the checkbox. Breaks only between words. */
.amenity-groups .amenity-group-options label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  margin: 0;
  line-height: 1.35;
}
.amenity-groups .amenity-group-options label > input[type='checkbox'] {
  flex: none;
  margin: 0.2em 0 0;
}
.amenity-groups .amenity-group-options label > span {
  min-width: 0;
  overflow-wrap: break-word;
}
