/*
 * engine.css — /properties/ villa search engine UI (Phase 5a).
 *
 * The horizontal search bar that anchors the page, plus the dropdown panels
 * (Where / Dates / Guests) and the quick-filter chip row underneath.
 *
 * Design language matches the site: ivory background #f7f4ee, deep navy
 * text #354766, gold accent #c7b08f. Motion is subtle — 160ms ease on
 * dropdowns, 120ms on chip hovers. Nothing bouncy.
 */

/* ---------- The search bar ---------- */

.engine-bar {
  background: #fff;
  border: 1px solid rgba(230, 221, 201, 0.75);
  border-radius: 999px;
  box-shadow:
    0 2px 8px rgba(53, 71, 102, 0.10),
    0 18px 44px rgba(19, 27, 45, 0.14);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  align-items: stretch;
  gap: 0;
  padding: 0.4rem 0.5rem 0.4rem 0.4rem;
  max-width: 920px;
  /* Overlap the hero: pull the bar up so ~half of it sits over the bottom
     of the .engine-hero. Section above must not clip. */
  margin: -84px auto 1.5rem;
  position: relative;
  z-index: 15;
}

/* The section that hosts the engine sits AFTER the hero; give it a
   little bottom breathing room but let overflow show so the bar can
   bleed over the hero above. */
section.section:has(> .container > .engine-bar) { overflow: visible; }

@media (max-width: 720px) {
  .engine-bar {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(56px, auto);
    border-radius: 18px;
    padding: 0.4rem;
    margin: -60px 0.75rem 1rem;
  }
  .engine-bar__go { grid-column: 1 / -1; }
}

.engine-bar__field {
  background: transparent;
  border: none;
  border-right: 1px solid #f0e8d6;
  padding: 0.55rem 1rem;
  text-align: left;
  cursor: pointer;
  border-radius: 999px;
  transition: background 120ms ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
  font: inherit;
  color: #354766;
}
.engine-bar__field:last-of-type { border-right: none; }
.engine-bar__field:hover,
.engine-bar__field.is-open {
  background: #f7f4ee;
}
.engine-bar__field:focus-visible {
  outline: 2px solid #c7b08f;
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .engine-bar__field { border-right: none; border-bottom: 1px solid #f0e8d6; }
  .engine-bar__field:nth-child(2) { border-right: 1px solid #f0e8d6; border-bottom: 1px solid #f0e8d6; }
  .engine-bar__field:nth-child(3) { grid-column: 1 / -1; }
}

.engine-bar__label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a8496;
  font-weight: 600;
}
.engine-bar__value {
  font-size: 0.95rem;
  color: #354766;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.engine-bar__value.is-placeholder { color: #a8b0c0; font-weight: 400; }

.engine-bar__go {
  background: #354766;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 140ms ease, transform 140ms ease;
}
.engine-bar__go:hover { background: #263657; }
.engine-bar__go:active { transform: scale(0.98); }
.engine-bar__go svg { width: 16px; height: 16px; }

/* ---------- Dropdown panels ---------- */

.engine-panel {
  position: absolute;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid #e6ddc9;
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(53, 71, 102, 0.12),
              0 4px 12px rgba(53, 71, 102, 0.06);
  padding: 1rem 1.1rem;
  min-width: 320px;
  max-width: 560px;
  z-index: 20;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}
.engine-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 720px) {
  .engine-panel {
    position: fixed;
    inset: auto 0.75rem auto 0.75rem;
    top: 72px;
    max-width: none;
    min-width: 0;
  }
}

.engine-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}
.engine-panel__title {
  font-size: 0.95rem;
  color: #354766;
  margin: 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.engine-panel__help {
  color: #7a8496;
  cursor: help;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid #d5cbb2;
  border-radius: 50%;
  background: #fbf8f1;
  transition: background 120ms ease, color 120ms ease;
}
.engine-panel__help:hover { background: #f0e8d6; color: #354766; }
.engine-panel__close {
  background: none;
  border: none;
  color: #7a8496;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}
.engine-panel__close:hover { color: #354766; background: #f7f4ee; }

/* ---------- "Where" panel: category-grouped POI chips ---------- */

.engine-where__cat {
  margin: 0 0 0.75rem;
}
.engine-where__cat:last-child { margin-bottom: 0; }
.engine-where__cat-label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a8496;
  font-weight: 600;
  margin: 0 0 0.4rem;
}
.engine-where__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.engine-where__chip {
  background: #f7f4ee;
  border: 1px solid #e6ddc9;
  color: #354766;
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.engine-where__chip:hover {
  background: #f0e8d6;
  border-color: #c7b08f;
  transform: translateY(-1px);
}
/* Phase 5q: highlight the matched substring within each chip name.
   Subtle warm underline + bold instead of the default yellow slab. */
.engine-where__chip mark {
  background: transparent;
  color: inherit;
  font-weight: 700;
  border-bottom: 2px solid #c7b08f;
  padding-bottom: 0;
  border-radius: 0;
}
/* On the active dark chip, keep the underline visible against navy. */
.engine-where__chip.is-active mark {
  border-bottom-color: #f4e7c8;
}

/* Keyboard focus ring — clearly visible without shouting. Matches search
   input's focus glow so the whole panel feels like one keyboard surface. */
.engine-where__chip:focus-visible {
  outline: none;
  border-color: #354766;
  box-shadow: 0 0 0 3px rgba(53, 71, 102, 0.24);
  transform: translateY(-1px);
  z-index: 1; /* keep the ring above adjacent chip borders */
}
.engine-where__chip.is-active {
  background: #354766;
  border-color: #354766;
  color: #f4e7c8;
}
.engine-where__chip--partner {
  border-color: #c7b08f;
  background: linear-gradient(180deg, #fbf8f1 0%, #f4e7c8 100%);
}

/* Phase 5t: recent-searches row at the top of the Where dropdown */
.engine-where__cat--recent {
  margin-bottom: 0.7rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px dashed #e6ddc9;
}
.engine-where__cat--recent .engine-where__cat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.engine-where__recent-clear {
  background: transparent;
  border: 0;
  color: #7a8496;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  padding: 0 0.3rem;
  cursor: pointer;
  text-decoration: underline;
}
.engine-where__recent-clear:hover { color: #354766; }
.engine-where__chip--recent {
  background: #fbf8f1;
  border-style: dashed;
  border-color: #c7b08f;
}
.engine-where__chip--recent .engine-where__chip-name { font-style: italic; }

/* Phase 5m/n: search input at the very top of the Where dropdown */
.engine-where__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1.5px solid #d9d2c1;
  border-radius: 999px;
  padding: 0.4rem 0.75rem 0.4rem 0.9rem;
  margin: 0 0 0.8rem;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.engine-where__search:focus-within {
  border-color: #354766;
  box-shadow: 0 0 0 3px rgba(53, 71, 102, 0.12);
}
.engine-where__search-icon {
  color: #7a8496;
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.7;
  flex-shrink: 0;
}
.engine-where__search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.15rem 0;
  font-size: 0.92rem;
  color: #1c2635;
  outline: none;
  font-family: inherit;
}
.engine-where__search-input::placeholder {
  color: #a0a898;
  font-style: italic;
}
.engine-where__search-clear {
  flex-shrink: 0;
  background: #eee6d3;
  border: 0;
  border-radius: 999px;
  width: 22px;
  height: 22px;
  color: #596478;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.engine-where__search-clear:hover { background: #d9cfb4; color: #1c2635; }

/* Override display:flex/inline-flex on hidden chips + sections. The
   HTML `hidden` attribute normally hides via `display: none`, but our
   chip/cat rules set an explicit display value that wins in specificity.
   `[hidden]` here is the same attribute the JS toggles. */
.engine-where__chip[hidden],
.engine-where__cat[hidden],
.engine-where__divider[hidden] { display: none !important; }

/* Empty state when nothing matches the typed query */
.engine-where__empty {
  padding: 0.9rem 0.5rem;
  color: #7a8496;
  font-size: 0.88rem;
  font-style: italic;
  text-align: center;
}
.engine-where__empty span { margin-right: 0.35rem; opacity: 0.7; }
.engine-where__empty em {
  font-style: normal;
  color: #354766;
  font-weight: 600;
  border-bottom: 1px dashed #c7b08f;
  padding-bottom: 1px;
}

/* Phase 5m: neighborhood picker at the top of the Where dropdown —
   larger chips, more prominent than the POI chips below. */
.engine-where__cat--neighborhoods { margin-bottom: 0.5rem; }
.engine-where__cat--neighborhoods .engine-where__chips { gap: 0.4rem; }
.engine-where__chip--neighborhood {
  padding: 0.5rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  background: #fff;
  border: 1.5px solid #d9d2c1;
  box-shadow: 0 1px 2px rgba(53, 71, 102, 0.04);
}
.engine-where__chip--neighborhood:hover {
  background: #f7f2e7;
  border-color: #c7b08f;
  transform: translateY(-1px);
}
.engine-where__chip--neighborhood.is-active {
  background: #354766;
  border-color: #354766;
  color: #f4e7c8;
  box-shadow: 0 2px 8px rgba(53, 71, 102, 0.24);
}

/* Soft rule between neighborhoods and the POI groups */
.engine-where__divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.75rem 0 0.6rem;
  color: #a0a898;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: none;
}
.engine-where__divider::before,
.engine-where__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e6ddc9 40%, #e6ddc9 60%, transparent);
}
.engine-where__divider span { white-space: nowrap; font-style: italic; }

.engine-where__tip {
  background: #fbf8f1;
  border: 1px dashed #d5cbb2;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: #596478;
  margin: 0 0 0.75rem;
}

/* ---------- "Guests" panel: steppers ---------- */

.engine-guests__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0e8d6;
}
.engine-guests__row:last-child { border-bottom: none; }
.engine-guests__label { color: #354766; font-weight: 500; }
.engine-guests__sub { display: block; font-size: 0.75rem; color: #7a8496; font-weight: 400; margin-top: 2px; }
.engine-guests__stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.engine-guests__btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #d5cbb2;
  color: #354766;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background 120ms ease, border-color 120ms ease;
}
.engine-guests__btn:hover:not(:disabled) { background: #f7f4ee; border-color: #c7b08f; }
.engine-guests__btn:disabled { opacity: 0.35; cursor: not-allowed; }
.engine-guests__count { min-width: 20px; text-align: center; color: #354766; font-weight: 500; }

/* ---------- "Dates" panel — placeholder inline calendar for now ---------- */

.engine-dates__note {
  font-size: 0.85rem;
  color: #596478;
  margin: 0 0 0.5rem;
}
.engine-dates__inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.engine-dates__inputs label {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.75rem; color: #7a8496; text-transform: uppercase; letter-spacing: 0.08em;
}
.engine-dates__inputs input {
  border: 1px solid #d5cbb2;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  color: #354766;
  background: #fbf8f1;
}
.engine-dates__inputs input:focus {
  outline: none;
  border-color: #c7b08f;
  background: #fff;
}

/* ---------- Curated collections row ---------- */

.engine-collections {
  max-width: 1100px;
  margin: 0 auto 1.25rem;
  padding: 0 0.75rem;
}
.engine-collections__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.6rem;
  padding: 0 0.25rem;
}
.engine-collections__title {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7a8496;
  font-weight: 600;
}
.engine-collections__sub {
  font-size: 0.72rem;
  color: #a8b0c0;
  font-style: italic;
}
.engine-collections__scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0.25rem 0.85rem;
  scroll-snap-type: x proximity;
  scroll-padding: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: #d5cbb2 transparent;
  /* Fade edges to hint at horizontal scroll on desktop. */
  mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
}
.engine-collections__scroll::-webkit-scrollbar { height: 6px; }
.engine-collections__scroll::-webkit-scrollbar-thumb { background: #d5cbb2; border-radius: 3px; }

/* Give each tile a stable minimum width so labels don't truncate. Tiles
   still fit ~5 across on wide desktop; overflow scrolls smoothly. */
.engine-collection { min-width: 220px; }

.engine-collection {
  background: #fff;
  border: 1px solid #e6ddc9;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  text-align: left;
  scroll-snap-align: start;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 1px 2px rgba(53, 71, 102, 0.04);
  font: inherit;
  color: #354766;
}
.engine-collection:hover {
  background: #fbf8f1;
  border-color: #c7b08f;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(53, 71, 102, 0.08);
}
.engine-collection.is-active {
  background: #354766;
  border-color: #354766;
  color: #f4e7c8;
  box-shadow: 0 4px 12px rgba(53, 71, 102, 0.18);
}
.engine-collection__icon {
  font-size: 1.4rem;
  line-height: 1;
}
.engine-collection__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.engine-collection__label {
  font-weight: 600;
  font-size: 0.9rem;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.engine-collection__desc {
  font-size: 0.72rem;
  color: #7a8496;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.engine-collection.is-active .engine-collection__desc { color: #d5cbb2; }
.engine-collection__count {
  font-size: 0.75rem;
  color: #7a8496;
  background: #f7f4ee;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  min-width: 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.engine-collection__count:empty { display: none; }
.engine-collection.is-active .engine-collection__count {
  background: rgba(255, 255, 255, 0.15);
  color: #f4e7c8;
}

/* ---------- Quick filter chip row (below the bar) ---------- */

.engine-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto 2rem;
  padding: 0 0.75rem;
}
.engine-quick__chip {
  background: #fff;
  border: 1px solid #e6ddc9;
  color: #354766;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 1px 2px rgba(53, 71, 102, 0.04);
}
.engine-quick__chip:hover {
  background: #f7f4ee;
  border-color: #c7b08f;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(53, 71, 102, 0.08);
}
.engine-quick__chip.is-active {
  background: #354766;
  border-color: #354766;
  color: #f4e7c8;
}

/* ---------- Selected-filters ribbon (shows above grid when anything active) ---------- */

.engine-selected {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.65rem 1rem;
  background: #fbf8f1;
  border: 1px solid #e6ddc9;
  border-radius: 10px;
  margin: 0 0 1rem;
  font-size: 0.85rem;
}
.engine-selected[hidden] { display: none; }
.engine-selected__pill {
  background: #fff;
  border: 1px solid #d5cbb2;
  border-radius: 999px;
  padding: 0.2rem 0.55rem 0.2rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #354766;
}
.engine-selected__pill button {
  background: none;
  border: none;
  color: #7a8496;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
}
.engine-selected__pill button:hover { color: #354766; }
.engine-selected__clear {
  margin-left: auto;
  background: none;
  border: none;
  color: #596478;
  cursor: pointer;
  font-size: 0.82rem;
  text-decoration: underline;
}

/* ---------- Cinematic rotating hero for /properties/ ---------- */

.engine-hero {
  position: relative;
  overflow: hidden;
  height: 520px;
  color: #fff;
  isolation: isolate; /* Contain the stacked slides */
}
@media (max-width: 900px) {
  .engine-hero { height: 460px; }
}
@media (max-width: 600px) {
  .engine-hero { height: 420px; }
}

.engine-hero__stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #1a2439; /* Fallback while first slide loads */
}
.engine-hero__slide {
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 1400ms ease;
  will-change: opacity, transform;
}
.engine-hero__slide.is-active {
  opacity: 1;
  /* Slow Ken Burns zoom-out over the full 7s slide interval. Not parallax
     — no pixel-map depth. Just a linear transform on a real photograph. */
  animation: engineHeroKenBurns 8000ms ease-out forwards;
}
@keyframes engineHeroKenBurns {
  from { transform: scale(1.09); }
  to   { transform: scale(1.00); }
}
@media (prefers-reduced-motion: reduce) {
  .engine-hero__slide.is-active { animation: none; transform: scale(1); }
  .engine-hero__slide { transition: opacity 220ms ease; }
}

.engine-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg,
      rgba(19, 27, 45, 0.55) 0%,
      rgba(19, 27, 45, 0.15) 40%,
      rgba(19, 27, 45, 0.30) 70%,
      rgba(19, 27, 45, 0.70) 100%);
}

.engine-hero__inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Reserve room at the bottom for the overlapping search bar (~104px
     tall + 44px negative margin = 148px). */
  padding: 0 1.25rem 8rem;
  gap: 0.4rem;
}
@media (max-width: 720px) {
  .engine-hero__inner { padding-bottom: 6rem; }
}

.engine-hero__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #f4e7c8;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.engine-hero__title {
  font-family: var(--font-serif, Georgia, serif);
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 400;
  line-height: 1.05;
  color: #fff;
  margin: 0.2rem 0 0.15rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.35);
  max-width: 18ch;
}

.engine-hero__sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.94);
  max-width: 560px;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
  line-height: 1.5;
}
.engine-hero__sub a {
  color: #f4e7c8;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.engine-hero__sub a:hover { color: #fff; }

/* ---------- Card enhancements (Phase 5a #3) ---------- */

.villa-bestfor {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  margin: 0.5rem 0 0.6rem;
  background: linear-gradient(180deg, #fbf8f1 0%, #f4ead3 100%);
  border: 1px solid #d5cbb2;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #354766;
  letter-spacing: 0.01em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.villa-bestfor::first-letter { text-transform: uppercase; }

/* Total-price override injected by engine.js when dates are picked. */
.villa-price[data-total] {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  line-height: 1.15;
}
.villa-price[data-total]::before {
  content: attr(data-total);
  font-weight: 700;
  font-size: 1.05rem;
  color: #354766;
  order: 0;
}
.villa-price[data-total]::after {
  content: attr(data-total-note);
  font-size: 0.72rem;
  color: #7a8496;
  font-weight: 400;
  order: 2;
}
.villa-price[data-total] {
  /* Hide the original nightly text inside */
  font-size: 0;
}

/* ---------- Skeleton loading cards ---------- */

.mps-skeleton-card {
  display: block;
  background: #fff;
  border: 1px solid #f0e8d6;
  border-radius: 14px;
  overflow: hidden;
  pointer-events: none;
}
.mps-skeleton-media {
  aspect-ratio: 4 / 3;
  background: linear-gradient(90deg, #f0e8d6 0%, #fbf8f1 50%, #f0e8d6 100%);
  background-size: 200% 100%;
  animation: mpsSkeleton 1400ms ease-in-out infinite;
}
.mps-skeleton-body {
  padding: 1rem;
  display: grid;
  gap: 0.65rem;
}
.mps-skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0e8d6 0%, #fbf8f1 50%, #f0e8d6 100%);
  background-size: 200% 100%;
  animation: mpsSkeleton 1400ms ease-in-out infinite;
  animation-delay: 200ms;
}
.mps-skeleton-line--title { width: 72%; height: 16px; }
.mps-skeleton-line--sub   { width: 48%; }
.mps-skeleton-line--foot  { width: 36%; height: 14px; margin-top: 0.5rem; }
@keyframes mpsSkeleton {
  0%   { background-position: 200% 50%; }
  100% { background-position: -200% 50%; }
}

/* ---------- Hide legacy filter-bar/proximity-picker when engine is active ---------- */

body.engine-active .filter-bar { display: none; }
body.engine-active .proximity-picker { display: none; }
