/**
 * PropGlen Commercial Detail Premium V1.2
 * Scoped to commercial listing detail only.
 * Does not alter Residential, Sale, Discovery, Map, Homepage, or the shared footer.
 *
 * Canvas matches the approved Residential detail rhythm (#f4f7f5).
 * The recommendation band (#eaf1ed) is painted only on sections that SSR emits
 * when genuine commercial related cards exist. Footer stays #f8f9f6.
 *
 * Final parity V1 (2026-11-13): hero Available-now hide when trust strip is present,
 * soft-sage Listing Checked strip, mosaic counter weight, and hide of the longform
 * evidence card only because ref + Copy ref already live in the aside.
 *
 * Phase 1 final consistency (2026-11-13): restrained Residential price language,
 * soft-sage fact chips, compact sticky header, Enquire chat-icon geometry.
 * Overrides earlier Commercial R1 chip/price accents in style.css for this page only.
 */
html body.pg-public.commercial-detail-page {
  --pg-com-detail-gap: 16px;
  --pg-com-detail-canvas: #f4f7f5;
  --pg-com-detail-soft: #eef3f1;
  --pg-com-detail-recs: #eaf1ed;
  --pg-com-detail-border: #d9e2de;
  --pg-com-detail-muted: #556070;
  --pg-com-detail-heading: #1a2332;
  --pg-com-detail-accent: #0ba360;
  background: var(--pg-com-detail-canvas);
}

html body.pg-public.commercial-detail-page main {
  padding-bottom: 0;
  background: transparent;
}

html body.pg-public.commercial-detail-page .detail-portal-section,
html body.pg-public.commercial-detail-page .detail-enquiry-section {
  background: transparent;
}

/* —— Title / hierarchy (size and weight only; the title string stays as stored) —— */
html body.pg-public.commercial-detail-page .detail-title-block {
  gap: 10px;
  margin-bottom: 4px;
}

html body.pg-public.commercial-detail-page .detail-title-block h1 {
  margin: 0;
  max-width: 42rem;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  font-weight: 750;
  letter-spacing: -0.021em;
  line-height: 1.22;
  text-wrap: balance;
  color: var(--pg-com-detail-heading);
  text-transform: none;
}

/*
 * Shared flex order already paints H1 → locality → rent → facts.
 * When the trust strip carries Availability confirmed + Listing Checked,
 * hide the redundant hero "Available now" line (same frozen Residential rule).
 * Source status / confirmation date remain on the strip.
 */
html body.pg-public.commercial-detail-page.has-detail-trust-strip .detail-hero-available {
  display: none !important;
}

/* Compact Listing Checked ribbon — match Residential: badge left, meta right. */
html body.pg-public.commercial-detail-page .detail-trust-strip {
  margin-top: 10px;
  margin-bottom: 4px;
  padding: 0;
  background: var(--pg-com-detail-soft);
  border: 1px solid var(--pg-com-detail-border);
  border-radius: 10px;
  box-shadow: none;
}

html body.pg-public.commercial-detail-page .detail-trust-strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 6px 10px;
}

html body.pg-public.commercial-detail-page .detail-trust-meta {
  margin: 0 0 0 auto;
  color: var(--pg-com-detail-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: right;
}

/*
 * Reference & Copy ref already render in .detail-aside-ref beside the price.
 * The longform evidence card now only repeats "Submitted by" (also shown as Listed by
 * in the aside). Hide the duplicate card; keep aside ref + Copy ref interactive.
 */
html body.pg-public.commercial-detail-page .detail-evidence-card {
  display: none !important;
}

/* Match frozen Residential mosaic counter weight (commercial sheet only). */
html body.pg-public.commercial-detail-page .detail-mosaic-count,
html body.pg-public.commercial-detail-page .detail-gallery-expand,
html body.pg-public.commercial-detail-page .detail-gallery-count {
  font-weight: 650;
  letter-spacing: 0.01em;
}

html body.pg-public.commercial-detail-page .detail-longform {
  gap: var(--pg-com-detail-gap);
}

html body.pg-public.commercial-detail-page .detail-longform > .content-card,
html body.pg-public.commercial-detail-page .detail-longform .detail-inline-section .content-card,
html body.pg-public.commercial-detail-page .detail-portal-aside.detail-summary-card,
html body.pg-public.commercial-detail-page .detail-media-card {
  background: #ffffff;
  border-color: var(--pg-com-detail-border);
  box-shadow: 0 8px 22px rgba(10, 16, 32, 0.04);
}

html body.pg-public.commercial-detail-page .detail-longform > .content-card,
html body.pg-public.commercial-detail-page .detail-longform .detail-inline-section .content-card {
  padding: 18px 18px 16px;
}

html body.pg-public.commercial-detail-page .detail-longform > .content-card > h2,
html body.pg-public.commercial-detail-page .detail-longform .content-card > h2,
html body.pg-public.commercial-detail-page .detail-features-card__head h2 {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 720;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--pg-com-detail-heading);
  text-align: left;
  text-transform: none;
}

html body.pg-public.commercial-detail-page .detail-description-body {
  color: #2c3544;
  font-size: 0.98rem;
  line-height: 1.62;
}

html body.pg-public.commercial-detail-page .detail-description-body p {
  margin: 0 0 0.7em;
}

html body.pg-public.commercial-detail-page .detail-description-body p:last-child {
  margin-bottom: 0;
}

/* Trust / report sits in the longform column, before the recommendation band. */
html body.pg-public.commercial-detail-page .detail-inline-section.detail-trust-section {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
  max-width: 100%;
  background: transparent;
}

html body.pg-public.commercial-detail-page .detail-trust-card {
  border-left: 3px solid var(--pg-com-detail-accent);
}

html body.pg-public.commercial-detail-page .detail-trust-card .eyebrow {
  color: var(--pg-com-detail-accent);
  font-weight: 700;
}

html body.pg-public.commercial-detail-page .detail-longform .detail-trust-card > h2,
html body.pg-public.commercial-detail-page .detail-trust-card h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 720;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--pg-com-detail-heading);
  text-align: left;
  text-transform: none;
}

html body.pg-public.commercial-detail-page .detail-trust-card .check-list {
  margin: 10px 0;
}

html body.pg-public.commercial-detail-page .detail-enquire-cta {
  background: var(--pg-com-detail-accent);
  border-color: var(--pg-com-detail-accent);
}

/* —— Recommendations: one band, then the warm ivory footer —— */
html body.pg-public.commercial-detail-page .detail-more-from-section,
html body.pg-public.commercial-detail-page .detail-similar-checked-section {
  background: var(--pg-com-detail-recs);
  border-top: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 28px;
  padding-bottom: 10px;
}

html body.pg-public.commercial-detail-page .detail-more-from-section + .detail-similar-checked-section {
  margin-top: 0;
  padding-top: 8px;
}

html body.pg-public.commercial-detail-page .detail-similar-checked-section,
html body.pg-public.commercial-detail-page .detail-more-from-section:not(:has(~ .detail-similar-checked-section)) {
  padding-bottom: 36px;
}

html body.pg-public.commercial-detail-page .detail-similar-checked-section .section-heading,
html body.pg-public.commercial-detail-page .detail-more-from-section .section-heading,
html body.pg-public.commercial-detail-page .detail-similar-checked-heading,
html body.pg-public.commercial-detail-page .detail-more-from-heading {
  margin-bottom: 14px;
  text-align: left;
}

html body.pg-public.commercial-detail-page .detail-similar-checked-section .section-heading h2,
html body.pg-public.commercial-detail-page .detail-more-from-section .section-heading h2,
html body.pg-public.commercial-detail-page .detail-similar-checked-heading h2,
html body.pg-public.commercial-detail-page .detail-more-from-heading h2 {
  margin: 0;
  color: var(--pg-com-detail-heading);
  font-size: 1.2rem;
  font-weight: 720;
  letter-spacing: -0.015em;
  line-height: 1.3;
  text-align: left;
  text-transform: none;
}

html body.pg-public.commercial-detail-page .detail-similar-card {
  background: #ffffff;
  text-transform: none;
}

html body.pg-public.commercial-detail-page .detail-similar-card__title {
  text-transform: none;
  -webkit-line-clamp: 3;
}

html body.pg-public.commercial-detail-page .detail-more-from-grid,
html body.pg-public.commercial-detail-page .detail-similar-checked-grid {
  gap: 14px;
}

@media (min-width: 960px) {
  html body.pg-public.commercial-detail-page .detail-more-from-grid,
  html body.pg-public.commercial-detail-page .detail-similar-checked-grid {
    display: grid;
    grid-auto-flow: row;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-columns: auto;
    overflow-x: visible;
  }

  html body.pg-public.commercial-detail-page .detail-similar-checked-grid > .detail-similar-card,
  html body.pg-public.commercial-detail-page .detail-more-from-grid > .detail-similar-card {
    width: auto;
    min-width: 0;
    max-width: none;
    flex: none;
  }

  /* Sparse recommendation rails: one authentic card stays card-width, not full-bleed. */
  html body.pg-public.commercial-detail-page .detail-similar-checked-grid:has(> .detail-similar-card:only-child),
  html body.pg-public.commercial-detail-page .detail-more-from-grid:has(> .detail-similar-card:only-child) {
    grid-template-columns: minmax(0, 280px);
  }
}

/* Mobile: longform is display:contents, so the trust card needs an explicit order
   after location and before the page leaves the portal (enquiry, then recommendations). */
@media (max-width: 1079px) {
  html body.pg-public.commercial-detail-page .detail-trust-section {
    order: 12;
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 959px) {
  html body.pg-public.commercial-detail-page .detail-title-block h1 {
    font-size: 1.38rem;
  }

  html body.pg-public.commercial-detail-page .detail-longform > .content-card,
  html body.pg-public.commercial-detail-page .detail-longform .detail-inline-section .content-card {
    padding: 16px 14px 14px;
  }

  /*
   * Dual chrome (sticky CTA above glass nav) already reserved via UX01 body
   * padding-bottom (~154px). A hard 78px footer pad stacked empty space under
   * the last footer line (~75px gap to sticky). Match Residential dual-chrome
   * breathing room; keep glass nav visible (do not copy Sale nav-hide).
   */
  html body.pg-public.commercial-detail-page.has-detail-mobile-cta .site-footer.pg-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

/*
 * Tablet closeout (761–959): style.css only applies fixed glass-nav chrome at
 * ≤760px. UX01 still forces .mobile-app-nav { display:grid } through 959 and
 * parks the sticky CTA at bottom:90px for dual-chrome. Result at 768: in-flow
 * single-column Home/Rent/Buy/Map after the footer + ~90px empty strip under
 * Enquire. Restore fixed 4-col glass nav for Commercial detail only — keeps
 * Founder-accepted ≤760 mobile and ≥960 desktop unchanged; does not hide nav.
 */
@media (min-width: 761px) and (max-width: 959px) {
  html body.pg-public.commercial-detail-page.listing-detail-page.has-detail-mobile-cta .mobile-app-nav {
    position: fixed !important;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 35;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 2px;
    padding: 8px 6px;
    overflow: visible;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(16, 35, 58, 0.1);
    border-radius: 18px;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.55) inset,
      0 8px 22px rgba(16, 24, 40, 0.08);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    touch-action: manipulation;
  }

  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    html body.pg-public.commercial-detail-page.listing-detail-page.has-detail-mobile-cta .mobile-app-nav {
      background: rgba(255, 255, 255, 0.96);
    }
  }

  /* Mirror ≤760 icon-above-label stack (those rules live inside max-width:760). */
  html body.pg-public.commercial-detail-page.listing-detail-page.has-detail-mobile-cta .mobile-app-nav a:not(:last-child) {
    border-right: 1px solid rgba(16, 24, 40, 0.1);
  }

  html body.pg-public.commercial-detail-page.listing-detail-page.has-detail-mobile-cta .mobile-app-nav a {
    position: relative;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 2px;
    color: #5b6778;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 14px;
    touch-action: manipulation;
    user-select: none;
  }

  html body.pg-public.commercial-detail-page.listing-detail-page.has-detail-mobile-cta .mobile-app-nav a > * {
    pointer-events: none;
  }

  html body.pg-public.commercial-detail-page.listing-detail-page.has-detail-mobile-cta .mobile-app-nav__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 36px;
    border-radius: 12px;
  }

  html body.pg-public.commercial-detail-page.listing-detail-page.has-detail-mobile-cta .mobile-app-nav .icon {
    width: 24px;
    height: 24px;
  }

  html body.pg-public.commercial-detail-page.listing-detail-page.has-detail-mobile-cta .mobile-app-nav__label {
    display: block;
    max-width: 100%;
    margin-top: 1px;
    overflow: hidden;
    color: inherit;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html body.pg-public.commercial-detail-page.listing-detail-page.has-detail-mobile-cta .mobile-app-nav a[aria-current="page"] .mobile-app-nav__icon {
    color: #ffffff;
    background: var(--primary, #0ba360);
    box-shadow: 0 4px 10px rgba(10, 157, 106, 0.22);
  }

  html body.pg-public.commercial-detail-page.listing-detail-page.has-detail-mobile-cta .mobile-app-nav a[aria-current="page"] .icon {
    color: #ffffff;
  }
}

/* Company logo: the shared aside rule paints a white tile. Nivasa's asset is not a white square, so drop only that tile. */
html body.pg-public.commercial-detail-page .detail-portal-aside .detail-agent-avatar.is-company-logo {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

html body.pg-public.commercial-detail-page .detail-portal-aside .detail-agent-avatar.is-company-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

/* —— Phase 1: hero price = restrained Residential treatment —— */
html body.pg-public.listing-detail-page.commercial-detail-page .detail-hero-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  order: 3;
  gap: 6px 14px;
  margin: 0;
}

html body.pg-public.listing-detail-page.commercial-detail-page .detail-hero-rent {
  margin: 0;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
}

html body.pg-public.listing-detail-page.commercial-detail-page .detail-hero-rent strong,
html body.pg-public.listing-detail-page.commercial-detail-page [data-listing-hero-rent] {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 780;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--pg-com-detail-heading);
}

html body.pg-public.listing-detail-page.commercial-detail-page .detail-hero-rent span {
  color: var(--pg-com-detail-muted);
  font-size: 0.92rem;
  font-weight: 550;
  letter-spacing: 0;
  line-height: 1.2;
}

html body.pg-public.listing-detail-page.commercial-detail-page .detail-rent-amount,
html body.pg-public.listing-detail-page.commercial-detail-page [data-listing-rent] {
  color: var(--pg-com-detail-heading);
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  font-weight: 780;
  letter-spacing: -0.02em;
}

/* Soft-sage quick-fact chips — match frozen Residential (override Commercial R1 white/primary chips). */
html body.pg-public.listing-detail-page.commercial-detail-page .detail-location-facts {
  margin-top: 4px;
  gap: 12px;
}

html body.pg-public.listing-detail-page.commercial-detail-page .detail-location-facts .detail-quick-stats,
html body.pg-public.listing-detail-page.commercial-detail-page .detail-quick-stats {
  gap: 8px;
}

html body.pg-public.listing-detail-page.commercial-detail-page .detail-location-facts .detail-quick-stats > li,
html body.pg-public.listing-detail-page.commercial-detail-page .detail-quick-stats > li,
html body.pg-public.listing-detail-page.commercial-detail-page .detail-location-facts .detail-quick-stats > li:nth-child(1),
html body.pg-public.listing-detail-page.commercial-detail-page .detail-quick-stats > li:nth-child(1),
html body.pg-public.listing-detail-page.commercial-detail-page .detail-location-facts .detail-quick-stats__item--rate,
html body.pg-public.listing-detail-page.commercial-detail-page .detail-quick-stats__item--rate,
html body.pg-public.listing-detail-page.commercial-detail-page .detail-location-facts .detail-quick-stats > li:not(:nth-child(1)):not(.detail-quick-stats__item--rate),
html body.pg-public.listing-detail-page.commercial-detail-page .detail-quick-stats > li:not(:nth-child(1)):not(.detail-quick-stats__item--rate) {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--pg-com-detail-border);
  border-radius: 8px;
  background: var(--pg-com-detail-soft);
  color: var(--pg-com-detail-heading);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.2;
}

/* —— Phase 1: compact sticky header + Enquire chat flex group —— */
html body.pg-public.listing-detail-page.commercial-detail-page .detail-scroll-bar {
  padding-top: 8px;
  padding-bottom: 8px;
}

html body.pg-public.listing-detail-page.commercial-detail-page .detail-scroll-bar-title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
}

html body.pg-public.listing-detail-page.commercial-detail-page .detail-scroll-bar .detail-scroll-bar-enquire.button,
html body.pg-public.listing-detail-page.commercial-detail-page .detail-mobile-cta .detail-mobile-cta-enquire.button,
html body.pg-public.listing-detail-page.commercial-detail-page .detail-portal-aside .detail-enquire-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--pg-com-detail-accent);
  border-color: var(--pg-com-detail-accent);
}

html body.pg-public.listing-detail-page.commercial-detail-page .detail-portal-aside .detail-enquire-cta {
  margin-top: 4px;
  min-height: 48px;
  font-weight: 720;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(11, 163, 96, 0.22);
}

/*
 * Commercial sticky aside — clear the fixed detail-scroll-bar.
 * propglen-premium-header.css pins top to 12px (non-sticky masthead). When the
 * compact scroll header is visible, JS sets --header-height to the bar height;
 * use that so the aside price/label stay fully below the bar.
 */
@media (min-width: 1080px) {
  html body.pg-public.listing-detail-page.commercial-detail-page .detail-portal-aside {
    position: sticky;
    top: calc(12px + env(safe-area-inset-top, 0px));
    align-self: start;
    max-height: none;
    overflow: visible;
  }

  html body.pg-public.listing-detail-page.commercial-detail-page.has-detail-scroll-bar .detail-portal-aside {
    top: calc(
      var(--detail-scroll-bar-measured, var(--header-height, 52px))
      + 10px
      + env(safe-area-inset-top, 0px)
    );
  }
}

/* Section rhythm — headings already set above; keep soft strip / white cards / maps. */
html body.pg-public.listing-detail-page.commercial-detail-page .detail-longform > .content-card + .content-card,
html body.pg-public.listing-detail-page.commercial-detail-page .detail-longform .detail-inline-section + .detail-inline-section {
  margin-top: 0;
}

@media (min-width: 1280px) {
  html body.pg-public.listing-detail-page.commercial-detail-page .detail-hero-rent strong,
  html body.pg-public.listing-detail-page.commercial-detail-page [data-listing-hero-rent] {
    font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  }

  html body.pg-public.listing-detail-page.commercial-detail-page .detail-location-facts .detail-quick-stats,
  html body.pg-public.listing-detail-page.commercial-detail-page .detail-quick-stats {
    gap: 8px;
  }

  html body.pg-public.listing-detail-page.commercial-detail-page .detail-location-facts .detail-quick-stats > li,
  html body.pg-public.listing-detail-page.commercial-detail-page .detail-quick-stats > li {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 8px;
  }
}
