/* =========================================================
   PARK27 — PROPERTY STYLESHEET
   Unified styles for:
     - Exclusive Listings (templates/exclusive-listings.php)
     - All Properties     (templates/all-properties.php)
     - Property Detail    (templates/property-detail.php)

   Also provides the shared .exclusive-hero used by the News and
   Contact pages (fencegrid variant scoped via page body class).

   Sections:
     1. Shared hero (.exclusive-hero) — base + fencegrid variant
     2. Browser bar / search / filters
     3. Featured property-card frame (decorative border + star bar)
     4. Listing pagination
     5. Exclusive Listings page
     6. All Properties page
     7. Property Detail page (hero, gallery, tabs, body, related, sidebar)
     8. Responsive (per-section)
   ========================================================= */


/* =========================================================
   1. EXCLUSIVE LISTINGS HERO — border-grade tile pattern.
   Base .exclusive-hero + fencegrid variant live in shared.css.
   ========================================================= */

/* Hero art = the theme-default full-height fencegrid (shared.css), on the
   listings pages too — client standardized it site-wide 2026-06-30. The old
   border-grade tile strip override that lived here was removed then. */


/* =========================================================
   2. BROWSER BAR — search, filters, view toggle
   ========================================================= */

.exclusive-browser {
  padding: 50px 0 150px;
  background: var(--bg);
}

.listing-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 391px;
  align-items: stretch;
  gap: 60px;
  margin-bottom: 40px;
}

.search-field {
  min-height: 81px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid rgba(var(--green-rgb), 0.32);
  padding: 10px 0;
  color: rgba(var(--green-rgb), 0.32);
}

.search-field .cnm-icon {
  flex: 0 0 auto;
  font-size: 30px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-family: var(--sans);
  font-size: clamp(1.5rem, 2.86vw, 3.125rem);
  font-weight: 300;
  line-height: 1.21;
}

.search-field input::placeholder {
  color: rgba(var(--green-rgb), 0.32);
  opacity: 1;
}

.view-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid #AAB6A8;
}

.view-toggle button,
.listing-filters button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-family: var(--sans);
  font-size: clamp(1rem, 1.15vw, 1.25rem);
  font-weight: 300;
  line-height: 1.21;
  cursor: pointer;
  text-decoration: none;
}

.view-toggle button {
  min-height: 79px;
  padding: 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #AAB6A8;
}

.view-toggle button + button {
  border-left: 1px solid #AAB6A8;
}

.view-toggle .is-active {
  background: var(--green);
  color: var(--bg);
}

.listing-filters {
  display: flex;
  align-items: center;
  gap: 52px;
}

.listing-filters button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0;
  white-space: nowrap;
  border-bottom: 1px solid rgba(var(--green-rgb), 0.32);
}

.listing-filters button:last-child {
  margin-left: auto;
}

.listing-filters span {
  color: rgba(var(--green-rgb), 0.32);
}

.listing-filters .cnm-icon {
  color: rgba(var(--green-rgb), 0.55);
  font-size: 12px;
}

.listing-filters .icon-sliders-up {
  font-size: 15px;
}


/* =========================================================
   3. FEATURED PROPERTY CARD — decorative frame + star bar
   ========================================================= */

.property-card.is-featured .img-wrap {
  --exclusive-frame-color: var(--white);
  aspect-ratio: 1628 / 678;
  margin-bottom: 20px;
}

.property-card.is-featured .img-wrap::before {
  opacity: 1;
  inset: 51px 58px 51px;
  width: auto;
  aspect-ratio: auto;
  border: 6px solid var(--exclusive-frame-color);
  border-bottom: 0;
  background: none;
  transform: none;
  z-index: 2;
}

.property-card.is-featured .img-wrap::after {
  opacity: 1;
  left: 64px;
  right: 64px;
  bottom: 25px;
  width: auto;
  height: 58px;
  aspect-ratio: auto;
  background-color: var(--exclusive-frame-color);
  -webkit-mask:
    url('../img/star.svg') center / auto 100% no-repeat,
    linear-gradient(to right,
      #000 calc(50% - 31px),
      transparent calc(50% - 31px),
      transparent calc(50% + 31px),
      #000 calc(50% + 31px)) 0 50% / 100% 6px no-repeat;
          mask:
    url('../img/star.svg') center / auto 100% no-repeat,
    linear-gradient(to right,
      #000 calc(50% - 31px),
      transparent calc(52% - 31px),
      transparent calc(48% + 31px),
      #000 calc(50% + 31px)) 0 50% / 100% 6px no-repeat;
  transform: none;
  z-index: 3;
}

.property-card.is-featured .corner {
  display: none;
}


/* Listing pagination styles live in shared.css (used by news as well). */


/* =========================================================
   5. EXCLUSIVE LISTINGS PAGE
   ========================================================= */

.page-exclusive-listings {
  background: var(--bg);
  color: var(--ink);
}

.featured-listing {
  margin-top: -90px;
  padding: 0 0 90px;
  background: linear-gradient(to bottom, var(--bg) 0 90px, var(--white) 90px);
}

.featured-listing .property-card {
  display: block;
}

.page-exclusive-listings .property-card.is-featured .img-wrap,
.page-all-properties .view-list .property-card.is-featured .img-wrap {
  aspect-ratio: 1628 / 678;
  margin-bottom: 20px;
}

.exclusive-stack .properties {
  padding: 0 0 90px;
  background: var(--white);
  position: relative;
  z-index: 2;
}

.exclusive-stack .banner-sell + .properties {
  padding-top: 90px;
}

.exclusive-stack .properties-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 90px 30px;
  margin: 0;
}

.exclusive-stack .properties-footer,
.exclusive-stack .properties-tabs {
  display: none;
}

.page-exclusive-listings .banner-sell,
.page-all-properties .view-list .banner-sell {
  padding: 145px 0;
}

.page-exclusive-listings .banner-sell-inner,
.page-all-properties .view-list .banner-sell-inner {
  justify-content: center;
  gap: 150px;
  max-width: none;
}

.page-exclusive-listings .banner-sell-right .park27-divider,
.page-all-properties .view-list .banner-sell-right .park27-divider {
  width: 250px;
  height: 57px;
}

/* Italy (exclusive-listings, block-built): repaint the sell banner to the
   maroon/cream scheme (matches /idx/featured) with a green hover. With the
   contact form now moved ABOVE testimonials, its default sticky positioning
   double-pins it under the sticky banner (blue-on-blue) and breaks the reveal —
   drop it to static so the form scrolls cleanly over the banner. */
.page-exclusive-listings .banner-sell {
  --banner-bg: var(--brand);
  --banner-fg: var(--bg);
  --banner-accent: var(--green);
  --banner-accent-fg: var(--bg);
}
.page-exclusive-listings .contact-form { position: static; }

/* base.css forces `a.btn-layout.hollow-green { color: var(--green) !important }`,
   turning the button label green on the maroon banner. Repaint it cream (the
   banner foreground) on the maroon banners — matching !important + specificity. */
.page-property-detail .banner-sell a.btn-layout.hollow-green,
.page-exclusive-listings .banner-sell a.btn-layout.hollow-green {
  color: var(--banner-fg) !important;
}


/* =========================================================
   6. ALL PROPERTIES PAGE
   ========================================================= */

.page-all-properties {
  background: var(--bg);
  color: var(--ink);
}

/* View toggle — same page swaps between list layout and map layout. */
.property-views .view-pane[hidden] {
  display: none !important;
}

.property-views.has-toggled .view-pane:not([hidden]) {
  animation: view-fade-in 320ms ease-out both;
}

@keyframes view-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .property-views.has-toggled .view-pane:not([hidden]) {
    animation: none;
  }
}

/* Results layout — cards left, map right. Cream of the search bleeds 90px
   into this section via gradient + negative margin, then flips to white. */
.all-properties-results {
  background: linear-gradient(to bottom, var(--bg) 0 90px, var(--white) 90px);
  padding: 0 0 150px;
  margin-top: -90px;
  position: relative;
  z-index: 2;
}

.all-properties-layout {
  display: grid;
  grid-template-columns: minmax(0, 977px) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.all-properties-layout .properties-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 50px 23px;
  margin: 0;
}

/* Compact card overrides — 477x298 image, smaller fonts (Fraunces 31/300 for
   price, Inter 24/400 for location and stats) */
.all-properties-layout .property-card .img-wrap {
  aspect-ratio: 477 / 298;
  margin-bottom: 24px;
}

.all-properties-layout .property-card .price {
  font-size: clamp(1.5rem, 1.77vw, 1.9375rem);
  line-height: 1.2;
}

.all-properties-layout .property-card .location,
.all-properties-layout .property-card .stats li {
  font-size: clamp(1.125rem, 1.37vw, 1.5rem);
  line-height: 1.2;
}

.all-properties-layout .property-card .stats {
  gap: 10px;
}

.all-properties-layout .property-card .stats li {
  min-height: 44px;
  padding: 8px 14px;
}

/* Scale down hover corner accents for the compact 477x298 cards. */
.all-properties-layout .property-card .img-wrap::before,
.all-properties-layout .property-card .img-wrap::after,
.all-properties-layout .property-card .img-wrap > .corner {
  width: clamp(56px, 6.5vw, 110px);
}

.all-properties-map {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  align-self: start;
  aspect-ratio: 691 / 898;
  overflow: hidden;
}

.all-properties-map img,
.all-properties-map iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
}

/* Parallax stack — banner-sell + contact-form are sticky (from shared.css).
   Testimonials between them needs z-index to slide over the stuck banner. */
.page-all-properties .testimonials {
  position: relative;
  z-index: 1;
}


/* =========================================================
   7. PROPERTY DETAIL PAGE
   ========================================================= */

.page-property-detail {
  background: var(--white);
}

/* ---- Property gallery hero ---- */
.property-hero {
  background: rgba(242, 237, 229, 1);
  padding: 40px 0 0;
}

.property-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.property-back a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 300;
  line-height: normal;
  color: #000;
  text-decoration: none;
}

.property-back a:hover { color: var(--brand); }

.property-back__icon {
  width: clamp(20px, 1.7vw, 28px);
  height: auto;
  display: block;
}

.property-hero-card.property-card.is-featured { display: block; }

.property-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1243fr) minmax(0, 427fr);
  gap: 20px;
  margin-bottom: 40px;
}

.property-gallery__main {
  margin: 0;
  position: relative;
  overflow: hidden;
}

.property-gallery__main a,
.property-gallery__thumbs a {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

/* Overflow gallery photos (image 4+) render as Fancybox-only <a hidden> links
   inside the thumbs grid. The display:block above re-shows them as zero-height
   grid items, so the grid's 20px row-gap stacks up across every one of them —
   galleries can have 100+ photos — inflating the thumbs column to thousands of
   px. The main image then stretches to match and turns into a blurry strip.
   Honour the hidden attribute so these stay out of layout. */
.property-gallery__thumbs a.property-gallery__hidden {
  display: none;
}

.property-gallery__main img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1243 / 678;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.property-gallery__main:hover img { transform: scale(1.02); }

.property-gallery__thumbs {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 20px;
}

.property-gallery__thumbs figure {
  margin: 0;
  position: relative;
  overflow: hidden;
}

.property-gallery__thumbs img {
  width: 100%;
  height: 100%;
  aspect-ratio: 427 / 329;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.property-gallery__thumbs figure:hover img { transform: scale(1.04); }

/* Half-circle corner accents on thumbnails — re-enable .corner spans
   hidden by .property-card.is-featured rule. */
.property-card.is-featured .property-gallery__thumb > .corner { display: block; }

.property-gallery__thumb::before,
.property-gallery__thumb::after,
.property-gallery__thumb > .corner {
  content: '';
  position: absolute;
  width: clamp(36px, 6vw, 110px);
  aspect-ratio: 202 / 179;
  background: url('../img/half-circle.svg') center / contain no-repeat;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.property-gallery__thumb::before { top: 0; right: 0; }
.property-gallery__thumb::after  { bottom: 0; left: 0; transform: rotate(180deg); }
.property-gallery__thumb > .corner.tl { top: 0; left: 0; transform: scaleX(-1); }
.property-gallery__thumb > .corner.br { bottom: 0; right: 0; transform: scaleY(-1); }

.property-gallery__thumb:hover::before,
.property-gallery__thumb:hover::after,
.property-gallery__thumb:hover > .corner { opacity: 1; }

/* Diamond frame on the featured main image — tuned for 1243x678 aspect.
   Reuses .property-card.is-featured pseudo-elements with tighter mask gap. */
.property-hero-card.property-card.is-featured .img-wrap {
  --exclusive-frame-color: var(--white);
  aspect-ratio: auto;
  margin-bottom: 0;
}

.property-hero-card .property-gallery__main.img-wrap::before {
  inset: 50px 56px 64px;
  border-width: 7px;
}

.property-hero-card .property-gallery__main.img-wrap::after {
  left: 56px;
  right: 56px;
  bottom: 41px;
  height: 46px;
  background-size: auto 100%;
  -webkit-mask:
    url('../img/star.svg') center / auto 100% no-repeat,
    linear-gradient(to right,
      #000 calc(50% - 18px),
      transparent calc(50% - 18px),
      transparent calc(50% + 18px),
      #000 calc(50% + 18px)) 0 50% / 100% 5px no-repeat;
          mask:
    url('../img/star.svg') center / auto 100% no-repeat,
    linear-gradient(to right,
      #000 calc(50% - 18px),
      transparent calc(50% - 18px),
      transparent calc(50% + 18px),
      #000 calc(50% + 18px)) 0 50% / 100% 7px no-repeat;
}

/* Always show diamond + frame on the featured hero (not just hover) */
.property-hero-card.property-card.is-featured .property-gallery__main::before,
.property-hero-card.property-card.is-featured .property-gallery__main::after {
  opacity: 1 !important;
}

/* ---- Hero info block ---- */
.property-hero-info .top {
  align-items: flex-end;
  gap: 40px;
}

.property-hero-address {
  letter-spacing: 0;
  color: #000;
  font-family: var(--sans);
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 400;
  line-height: normal;
}

/* ---- Sticky tab navigation ---- */
.property-tabs {
  position: sticky;
  top: calc(var(--header-h) - 1px);
  z-index: 99;
  background: var(--green);
  margin-top: 70px;
}

.property-tabs-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 3vw, 47px);
  padding: 10px 20px;
}

.property-tabs a {
  font-family: var(--sans);
  font-size: clamp(14px, 1.25vw, 18px);
  font-weight: 300;
  color: var(--white);
  text-decoration: none;
  padding: 8px 12px;
  line-height: 1.2;
  transition: color 0.2s ease;
}

.property-tabs a:hover,
.property-tabs a:focus-visible {
  color: rgba(var(--white-rgb), 0.75);
}

/* ---- Two-column body: tab panels + sticky agent sidebar ---- */
.property-detail {
  background: var(--white);
  padding: 80px 0;
}

.property-detail-inner {
  display: grid;
  grid-template-columns: minmax(0, 1084fr) minmax(0, 474fr);
  gap: 70px;
  align-items: start;
}

.property-detail-main {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.property-panel {
  scroll-margin-top: calc(var(--header-h) + 64px);
}

.property-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.property-panel__head-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.property-panel__title {
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 40px);
  font-weight: 400;
  line-height: normal;
  margin: 0 0 40px;
  color: var(--ink);
}

.property-panel__head .property-panel__title { margin-bottom: 0; }

.property-status {
  display: inline-block;
  font-family: var(--sans);
  font-size: clamp(14px, 1.25vw, 18px);
  font-weight: 400;
  color: var(--brand);
  letter-spacing: 0.02em;
}

.property-status--pill {
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 999px;
  padding: 6px 22px;
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.2;
}

.property-favorite {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--brand);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.property-favorite svg {
  width: clamp(22px, 1.7vw, 28px);
  height: auto;
  display: block;
}

.property-favorite:hover,
.property-favorite:focus-visible { color: var(--green); }

.property-panel__lede {
  color: #000;
  font-family: var(--sans);
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 300;
  line-height: 1.5;
  margin: 0;
  column-count: 2;
  column-gap: 60px;
}

/* Key-value info — label stacked above value */
.property-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 40px;
  row-gap: 40px;
  margin: 0;
}

.property-info--two-col {
  grid-template-columns: 0.8fr 1fr;
  column-gap: 30px;
  row-gap: 0;
  position: relative;
}

/* Continuous vertical rule splitting label/value columns */
.property-info--two-col::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 40%;
  width: 1px;
  background: rgba(var(--green-rgb), 0.35);
  transform: translateX(-50%);
  pointer-events: none;
}

.property-info__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  margin: 0;
}

.property-info--two-col .property-info__row { display: contents; }

.property-info--two-col .property-info__row dt,
.property-info--two-col .property-info__row dd {
  padding: 24px 0;
  font-family: var(--sans);
  font-size: clamp(15px, 1.4vw, 24px);
  font-weight: 400;
  line-height: 1.4;
}

.property-info--two-col .property-info__row dt { grid-column: 1; color: var(--ink); }
.property-info--two-col .property-info__row dd { grid-column: 2; color: var(--ink); }

.property-info dt {
  font-family: var(--sans);
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 400;
  line-height: normal;
  letter-spacing: 0.01em;
  color: #000;
  margin: 0;
}

.property-info dd {
  font-family: var(--sans);
  font-size: clamp(18px, 2.4vw, 20px);
  font-weight: 400;
  line-height: normal;
  color: #000;
  margin: 0;
}

/* ---- Floor plans grid (image thumbnails, click → Fancybox) ---- */
.property-floor-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.property-floor-plans__item { margin: 0; }
.property-floor-plans__item img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(var(--green-rgb), 0.16);
  background: #fff;
}

.property-map { margin: 40px 0 0; }
.property-map img,
.property-map iframe {
  width: 100%;
  max-width: 100%;
  display: block;
  border: 0;
}
.property-map img    { height: auto; }
.property-map iframe { height: 500px; aspect-ratio: 1084 / 500; }

/* ---- Agent sidebar (sticky) ---- */
.property-agent {
  position: sticky;
  top: calc(var(--header-h) + 72px);
  align-self: start;
}

.property-agent__inner {
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 30px;
  text-align: left;
}

.property-agent__price {
  font-family: var(--sans);
  font-size: clamp(26px, 2.8vw, 40px);
  font-weight: 400;
  line-height: normal;
  color: var(--ink);
  margin: 0 0 8px;
}

.property-agent__photo {
  margin: 0;
  aspect-ratio: 1200 / 857;
  overflow: hidden;
}

.property-agent__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.property-agent__name {
  font-family: var(--sans);
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 400;
  line-height: normal;
  margin: 0;
  color: var(--ink);
}

.property-agent__title {
  margin: 0;
  color: #000;
  font-family: var(--serif);
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 400;
  line-height: normal;
}

.property-agent__name + .property-agent__title { margin-top: -22px; }

.property-agent__cta {
  align-self: flex-start;
  margin-top: 8px;
  width: 100%;
}

/* ---- Related properties (light blue) ---- */
.related-properties {
  background: var(--bg-blue);
  padding: 80px 0;
}

.related-properties__head { margin-bottom: 50px; }

.related-properties__head h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 400;
  line-height: normal;
  color: var(--ink);
  margin: 0;
}

/* Flex column so the cards get vertical spacing — as plain `display: block`
   the intended `gap` (incl. the 36px mobile override below) never applied and
   the stats pills of one card touched the next card. */
.related-properties__track { display: flex; flex-direction: column; gap: 50px; }

.related-properties__card.property-card { display: block; max-width: none; }

.related-properties__card .img-wrap {
  aspect-ratio: 1628 / 678;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.related-properties__card .img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Green diamond divider between info panels */
.property-detail .property-divider.park27-divider {
  color: var(--green);
  display: flex;
  align-items: center;
  width: 100%;
  max-width: none;
  height: 32px;
  margin: 0;
  border: 0;
  background: none;
  -webkit-mask: none;
          mask: none;
  gap: 0;
}

.property-detail .property-divider__line {
  flex: 1 1 auto;
  height: 5px;
  background: currentColor;
}

.property-detail .property-divider__icon {
  flex: 0 0 30px;
  width: 41px;
  height: 41px;
  background-color: currentColor;
  -webkit-mask: url('../img/star.svg') center / contain no-repeat;
          mask: url('../img/star.svg') center / contain no-repeat;
}

/* ---- Banner-sell — maroon repaint via themable --banner-* vars ---- */
.page-property-detail .banner-sell {
  --banner-bg: var(--brand);
  --banner-fg: var(--bg);
  --banner-accent: var(--green);
  --banner-accent-fg: var(--bg);
  padding: 120px 0;
}

/* Parallax stack stacking context — surrounding sections need higher z-index
   to paint OVER the stuck banner-sell while scrolling. Order (top→bottom):
   banner-sell (sticky) → contact-form → testimonials, so the form reveals the
   banner first and testimonials sits on top. */
.page-property-detail .related-properties,
.page-property-detail .contact-form {
  position: relative;
  z-index: 1;
  /* Cancel the inherited `top: var(--header-h)` from the base `.contact-form`
     (shared.css) — harmless while it was position:sticky, but once demoted to
     relative here that `top` shifts the box down ~156px, opening a gap above the
     form. Mirrors the `top: auto` reset `.page-default .contact-form` already has. */
  top: auto;
}

.page-property-detail .testimonials { position: relative; z-index: 2; }

.page-property-detail .testimonials,
.page-property-detail .contact-form {
  padding: var(--section-pad) 0;
}


/* =========================================================
   8. RESPONSIVE
   ========================================================= */

@media (max-width: 1399px) {
  .all-properties-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  }

  .property-detail-inner { gap: 50px; }
}

@media (max-width: 1200px) {
  .listing-search { grid-template-columns: 1fr; }
  .view-toggle { width: 100%; }

  .listing-filters {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 24px 42px;
  }

  .listing-filters button:last-child { margin-left: 0; }
}

@media (max-width: 1199px) {
  .property-detail-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 60px;
  }

  .property-agent {
    position: static;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }

  .property-info,
  .property-info--two-col { column-gap: 32px; }
}

@media (max-width: 991px) {
  .exclusive-browser { padding: 40px 0 70px; }

  .featured-listing {
    margin-top: -40px;
    background: linear-gradient(to bottom, var(--bg) 0 40px, var(--white) 40px);
  }

  .exclusive-stack .properties-grid { grid-template-columns: 1fr; }

  .page-exclusive-listings .banner-sell,
  .page-all-properties .view-list .banner-sell { padding: 70px 0; }

  .page-exclusive-listings .banner-sell-inner,
  .page-all-properties .view-list .banner-sell-inner {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  /* All-properties */
  .all-properties-results {
    padding: 0;
    margin-top: -40px;
    background: linear-gradient(to bottom, var(--bg) 0 40px, var(--white) 40px);
  }

  .all-properties-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .all-properties-map {
    position: static;
    aspect-ratio: 16 / 9;
    max-height: 480px;
  }

  /* Property detail */
  .property-gallery { grid-template-columns: 1fr; }

  .property-gallery__thumbs {
    grid-template-rows: none;
    grid-template-columns: 1fr 1fr;
  }

  .property-hero-card .property-gallery__main.img-wrap::before {
    inset: 28px 28px 44px;
  }

  .property-hero-card .property-gallery__main.img-wrap::after {
    left: 28px;
    right: 28px;
    bottom: 24px;
    height: 38px;
  }

  .property-tabs-inner {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .property-tabs a { white-space: nowrap; }

  .property-detail { padding: 60px 0; }
  .property-detail-main { gap: 60px; }

  .property-panel__head {
    gap: 16px;
    margin-bottom: 24px;
  }

  .property-info {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 24px;
    column-gap: 24px;
  }

  .property-info--two-col {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 40px;
  }

  .related-properties { padding: 60px 0; }
  .related-properties__head { margin-bottom: 32px; }
  .related-properties__track { gap: 36px; }
}

@media (max-width: 767px) {
  .search-field {
    min-height: 64px;
    padding: 0 18px;
    gap: 12px;
  }

  .search-field .cnm-icon { font-size: 20px; }
  .search-field input { font-size: 1rem; }

  .view-toggle button {
    min-height: 58px;
    padding: 0 14px;
  }

  .property-card.is-featured .img-wrap::before {
    inset: 24px 24px 26px;
    border-width: 4px;
  }

  .property-card.is-featured .img-wrap::after {
    left: 24px;
    right: 24px;
    bottom: 11px;
    height: 34px;
    -webkit-mask:
      url('../img/star.svg') center / auto 100% no-repeat,
      linear-gradient(to right,
        #000 calc(50% - 17px),
        transparent calc(50% - 17px),
        transparent calc(50% + 17px),
        #000 calc(50% + 17px)) 0 50% / 100% 4px no-repeat;
            mask:
      url('../img/star.svg') center / auto 100% no-repeat,
      linear-gradient(to right,
        #000 calc(50% - 17px),
        transparent calc(54% - 17px),
        transparent calc(45% + 17px),
        #000 calc(50% + 17px)) 0 50% / 100% 4px no-repeat;
  }

  /* All-properties */
  .all-properties-layout .properties-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .all-properties-map {
    margin-inline: calc(var(--gutter) * -1);
    max-height: none;
    aspect-ratio: 16 / 11;
  }

  /* Property detail */
  .property-hero { padding-top: 20px; }
  .property-hero-inner { gap: 24px; }
  .property-gallery { margin-bottom: 24px; }
  .property-gallery__thumbs { gap: 12px; }

  .property-hero-card .property-gallery__main.img-wrap::before {
    inset: 16px 16px 24px;
    border-width: 5px;
  }

  .property-hero-card .property-gallery__main.img-wrap::after {
    left: 16px;
    right: 16px;
    bottom: 8px;
    height: 32px;
  }

  .property-tabs { top: calc(var(--header-h) - 1px); }
  .property-agent__inner { padding: 32px 24px; }
  .property-panel__lede { column-count: 1; }
}

@media (max-width: 575px) {
  .all-properties-results { padding: 0; }

  .property-gallery { gap: 12px; }
  .property-gallery__thumbs { grid-template-columns: 1fr; }

  .property-info {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 20px;
  }

  .property-info--two-col { grid-template-columns: minmax(0, 1fr); }
  .property-info--two-col::before { display: none; }

  .property-info--two-col .property-info__row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
  }

  .property-info--two-col .property-info__row dt,
  .property-info--two-col .property-info__row dd {
    padding: 0;
    grid-column: auto;
  }

  .property-address { font-size: 18px; }
}
