/* Shared premium navigation polish for homepage + property detail pages */
.site-header {
  --nav-bg: rgba(27,34,80, .94);
  --nav-line: rgba(255,255,255,.11);
  will-change: transform, background, box-shadow, backdrop-filter;
  grid-template-columns: minmax(190px,1fr) auto minmax(330px,1fr);
  column-gap: clamp(18px,2.2vw,34px);
  padding-left: clamp(24px,4.2vw,72px);
  padding-right: clamp(24px,4.2vw,72px);
}

.site-header.nav-mounted { animation: navEnter .62s cubic-bezier(.22,1,.36,1) both; }
.property-page .site-header { animation: navEnter .62s cubic-bezier(.22,1,.36,1) both; }

.site-header::after {
  content: "";
  position: absolute;
  left: 5vw;
  right: 5vw;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  transform: scaleX(.15);
  opacity: 0;
  transition: transform .5s cubic-bezier(.22,1,.36,1), opacity .35s ease;
  pointer-events: none;
}

.site-header.nav-scrolled::after,
.property-page .site-header::after {
  transform: scaleX(1);
  opacity: 1;
}

.site-header.nav-scrolled,
.site-header.scrolled {
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
  box-shadow: 0 12px 34px rgba(0,0,0,.14);
}

/* Detail pages: keep navbar available while scrolling. */
.property-page .site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(27,34,80,.96);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

.property-page .site-header .header-cta,
.property-page .site-header .primary-btn.header-cta {
  color: #1b2250 !important;
  background: #fff !important;
}

.site-header .brand,
.site-header .desktop-nav a,
.site-header .header-actions > * {
  transition: transform .25s cubic-bezier(.22,1,.36,1), opacity .25s ease,
              background .25s ease, border-color .25s ease, color .25s ease,
              box-shadow .25s ease;
}

.site-header .brand:hover { transform: translateY(-1px); }
.site-header .brand:hover .brand-mark { transform: rotate(-7deg) scale(1.04); }
.site-header .brand-mark { transition: transform .35s cubic-bezier(.22,1,.36,1); }
.site-header .desktop-nav {
  gap: clamp(18px,2vw,30px);
  white-space: nowrap;
}
.site-header .desktop-nav a:hover { transform: translateY(-2px); opacity: 1; }
.site-header .header-actions {
  gap: 6px;
  min-width: 0;
  flex-wrap: nowrap;
}
.site-header .header-actions > * { flex: 0 0 auto; }
.site-header .header-actions .compact,
.site-header .saved-nav-link,
.site-header .compare-nav-link {
  min-height: 40px;
  height: 40px;
}
.site-header .header-actions .compact {
  min-width: 48px;
  padding: 0 11px;
}
.site-header .header-actions .ghost-btn:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.58);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.site-header .header-cta {
  min-height: 40px;
  padding: 0 17px;
  white-space: nowrap;
}
.site-header .header-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.16);
}

.site-header.nav-mounted .brand,
.property-page .site-header .brand { animation: navItemIn .55s .05s both; }
.site-header.nav-mounted .desktop-nav,
.property-page .site-header .desktop-nav { animation: navItemIn .55s .12s both; }
.site-header.nav-mounted .header-actions,
.property-page .site-header .header-actions { animation: navItemIn .55s .18s both; }

@keyframes navEnter {
  from { transform: translateY(-18px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes navItemIn {
  from { transform: translateY(-8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Medium desktop: keep utilities compact so the navigation breathes. */
@media (max-width: 1500px) {
  .site-header {
    grid-template-columns: minmax(180px,1fr) auto minmax(285px,1fr);
    column-gap: 18px;
  }
  .site-header .desktop-nav { gap: 21px; }
  .site-header .saved-nav-label,
  .site-header .compare-nav-label { display: none !important; }
  .site-header .saved-nav-link,
  .site-header .compare-nav-link {
    width: 43px;
    padding: 0 7px;
    justify-content: center;
    gap: 4px;
  }
  .site-header .saved-nav-heart,
  .site-header .compare-nav-icon { font-size: 14px; }
  .site-header .saved-count,
  .site-header .compare-count {
    min-width: 17px;
    width: 17px;
    height: 17px;
    padding: 0;
    font-size: 8px;
  }
}

@media (max-width: 1220px) {
  .site-header {
    padding-left: 24px;
    padding-right: 24px;
    grid-template-columns: minmax(170px,1fr) auto minmax(250px,1fr);
  }
  .site-header .desktop-nav { gap: 16px; }
  .site-header .desktop-nav a { font-size: 12px; }
  .site-header .header-cta { display: none; }
}

@media (max-width: 1000px) {
  .site-header {
    grid-template-columns: minmax(0,1fr) auto !important;
    height: 66px !important;
    padding: 0 16px !important;
    gap: 10px !important;
    background: rgba(27,34,80,.95);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
    box-shadow: 0 8px 28px rgba(0,0,0,.12);
  }
  .site-header.scrolled,
  .site-header.nav-scrolled { height: 62px !important; }
  .site-header::after { left: 16px; right: 16px; }
  .site-header .desktop-nav,
  .site-header .header-cta { display: none !important; }
  .site-header .brand {
    min-width: 0;
    gap: 8px;
  }
  .site-header .brand-mark {
    width: 36px !important;
    height: 36px !important;
    font-size: 19px;
    flex: 0 0 36px;
  }
  .site-header .brand strong {
    font-size: 14px !important;
    line-height: 1;
    white-space: nowrap;
  }
  .site-header .brand small {
    margin-top: 3px;
    font-size: 5.5px !important;
    letter-spacing: .18em;
  }
  .site-header .header-actions {
    justify-self: end;
    gap: 5px !important;
  }
  .site-header .saved-nav-label,
  .site-header .compare-nav-label { display: none !important; }
  .site-header .saved-nav-link,
  .site-header .compare-nav-link {
    width: 36px !important;
    min-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    gap: 0 !important;
    justify-content: center !important;
    position: relative;
  }
  .site-header .saved-nav-heart,
  .site-header .compare-nav-icon {
    font-size: 15px !important;
    line-height: 1;
  }
  .site-header .saved-count,
  .site-header .compare-count {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px !important;
    width: 16px !important;
    height: 16px !important;
    padding: 0 !important;
    border: 2px solid #1b2250;
    font-size: 7px !important;
  }
  .site-header .header-actions .compact {
    min-width: 42px !important;
    width: auto !important;
    height: 36px !important;
    min-height: 36px !important;
    padding: 0 10px !important;
    font-size: 10px !important;
    border-color: rgba(255,255,255,.30);
  }
  .site-header .menu-btn {
    display: grid !important;
    place-items: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    margin: 0 0 0 1px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    background: rgba(255,255,255,.035);
    color: #fff;
    font-size: 0;
    line-height: 1;
  }
  .site-header .menu-btn::before {
    content: "";
    width: 15px;
    height: 11px;
    background:
      linear-gradient(#fff,#fff) 0 0/15px 1.5px no-repeat,
      linear-gradient(#fff,#fff) 0 50%/11px 1.5px no-repeat,
      linear-gradient(#fff,#fff) 0 100%/15px 1.5px no-repeat;
    transition: transform .22s ease;
  }
  .site-header .menu-btn[aria-expanded="true"]::before { transform: rotate(90deg); }

  /* Premium mobile sheet */
  .site-header .mobile-menu {
    display: grid !important;
    position: absolute !important;
    top: calc(100% + 10px) !important;
    left: 12px !important;
    right: 12px !important;
    padding: 10px !important;
    gap: 2px !important;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px !important;
    background: rgba(27,34,80,.985) !important;
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    backdrop-filter: blur(22px) saturate(140%);
    box-shadow: 0 24px 60px rgba(0,0,0,.30) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(.985);
    transform-origin: top center;
    transition: opacity .2s ease, transform .22s cubic-bezier(.22,1,.36,1), visibility .2s ease;
  }
  .site-header .mobile-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
  .site-header .mobile-menu a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 13px !important;
    border-bottom: 1px solid rgba(255,255,255,.07) !important;
    border-radius: 10px;
    font-size: 12px;
    color: rgba(255,255,255,.90);
  }
  .site-header .mobile-menu a:last-child { border-bottom: 0 !important; }
  .site-header .mobile-menu a:hover { background: rgba(255,255,255,.06); }
}

@media (max-width: 600px) {
  .site-header {
    height: 62px !important;
    padding: 0 12px !important;
    gap: 7px !important;
  }
  .site-header.scrolled,
  .site-header.nav-scrolled { height: 60px !important; }
  .site-header .brand > span:last-child { display: none !important; }
  .site-header .brand-mark {
    width: 34px !important;
    height: 34px !important;
    flex-basis: 34px;
    font-size: 18px;
  }
  .site-header .header-actions { gap: 4px !important; }
  .site-header .saved-nav-link,
  .site-header .compare-nav-link {
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
  }
  .site-header .header-actions .compact {
    min-width: 38px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 8px !important;
    font-size: 9px !important;
  }
  .site-header .menu-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
  }
  .site-header .mobile-menu {
    left: 8px !important;
    right: 8px !important;
    top: calc(100% + 7px) !important;
  }
}

@media (max-width: 390px) {
  .site-header { padding: 0 9px !important; gap: 5px !important; }
  .site-header .header-actions { gap: 3px !important; }
  .site-header .saved-nav-link,
  .site-header .compare-nav-link {
    width: 32px !important;
    min-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
  }
  .site-header .header-actions .compact {
    min-width: 36px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 7px !important;
  }
  .site-header .menu-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header.nav-mounted,
  .property-page .site-header,
  .site-header.nav-mounted .brand,
  .site-header.nav-mounted .desktop-nav,
  .site-header.nav-mounted .header-actions,
  .property-page .site-header .brand,
  .property-page .site-header .desktop-nav,
  .property-page .site-header .header-actions { animation: none !important; }
  .site-header, .site-header * { transition-duration: .01ms !important; }
}
