:root {
  --header-height: 72px;
  --header-max-width: 1520px;
}

/* Real-estate header: optically centered nav, equal side columns. */
.top-nav {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  position: sticky;
  top: 0;
  z-index: 9999;
}

.top-nav-inner,
.top-nav-inner.top-nav-wide {
  min-height: var(--header-height);
  max-width: var(--header-max-width);
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(140px, 1fr);
  align-items: center;
  column-gap: 16px;
  box-sizing: border-box;
}

.top-nav.scrolled {
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.12);
}

.logo-wrapper {
  justify-self: start;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 100%;
}

.logo-link {
  color: var(--color-primary, #ff385c);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 0;
}

.logo-link:hover,
.logo-link:focus {
  color: var(--color-primary-active, #e00b41);
  text-decoration: none;
}

.logo-wrapper .logo-img {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.nav-center {
  justify-self: center;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.property-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.property-tabs li {
  margin: 0;
  display: flex;
  align-items: center;
}

.property-tabs a {
  color: var(--color-muted, #6a6a6a);
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  line-height: 1.2;
  min-height: 40px;
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease;
}

.property-tabs a .tab-icon {
  color: var(--color-primary, #ff385c);
  font-size: 13px;
  opacity: 0.9;
  line-height: 1;
  width: 1em;
  text-align: center;
  flex-shrink: 0;
}

.property-tabs a:hover,
.property-tabs a:focus {
  color: var(--color-ink, #222222);
  background: rgba(255, 56, 92, 0.08);
  text-decoration: none;
  transform: none;
}

.property-tabs a.active {
  color: var(--color-ink, #222222);
  background: rgba(255, 56, 92, 0.12);
}

.account-utilities.nav-right {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: 100%;
  min-width: 0;
}

.nav-listing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 9999px;
  background: var(--color-primary, #ff385c);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(255, 56, 92, 0.18);
}

.nav-listing-cta:hover,
.nav-listing-cta:focus {
  background: var(--color-primary-active, #e00b41);
  color: #ffffff;
  text-decoration: none;
}

.account-utilities .nav-icon {
  color: var(--color-muted, #6a6a6a);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 9999px;
}

.account-utilities .nav-icon:hover,
.account-utilities .nav-icon:focus {
  color: var(--color-ink, #222222);
  background: var(--color-surface-soft, #f7f7f7);
  text-decoration: none;
}

/* Keep header search / notif / account controls on one baseline */
.account-utilities .pb-header-search,
.account-utilities .pb-header-dd,
.account-utilities .dropdown {
  display: inline-flex;
  align-items: center;
  height: 40px;
}

.account-utilities .pb-header-search-shell {
  height: 40px;
}

.account-utilities .pb-header-notif {
  width: 40px;
  height: 40px;
  margin: 0;
}

.dropdown-toggle.account-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  height: 40px;
  padding: 4px 8px 4px 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 9999px;
  background: #ffffff;
  color: var(--color-ink, #222222);
  text-decoration: none;
  box-sizing: border-box;
}

.dropdown-toggle.account-dropdown-toggle:hover,
.dropdown-toggle.account-dropdown-toggle:focus {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  text-decoration: none;
}

.account-icon-wrapper {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted, #6a6a6a);
  font-size: 24px;
  line-height: 1;
}

.search-wrapper {
  display: flex;
  justify-content: center;
  padding: 14px 24px 8px;
  background: #ffffff;
}

.search-bar-pill {
  background-color: rgba(255, 255, 255, 0.96);
  border-radius: 9999px;
  min-height: 62px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  padding: 0 12px 0 24px;
  max-width: 980px;
  width: 100%;
}

.search-bar-pill .search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 16px;
  padding: 12px 16px;
  background: transparent;
}

.search-bar-pill .search-action {
  background: var(--color-primary, #ff385c);
  color: #ffffff;
  border-radius: 9999px;
  padding: 12px 16px;
  margin-left: 8px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(255, 56, 92, 0.18);
}

@media (max-width: 1180px) {
  .top-nav-inner,
  .top-nav-inner.top-nav-wide {
    padding: 0 18px;
    column-gap: 10px;
  }

  .property-tabs a {
    padding: 8px 10px;
    font-size: 13px;
    min-height: 36px;
  }

  .nav-phone-text,
  .nav-listing-cta {
    display: none;
  }
}

@media (max-width: 900px) {
  .top-nav-inner,
  .top-nav-inner.top-nav-wide {
    display: flex;
    flex-wrap: wrap;
    min-height: auto;
    padding: 12px 16px;
    column-gap: 0;
    row-gap: 8px;
  }

  .logo-wrapper {
    min-width: 0;
  }

  .nav-center {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    justify-self: stretch;
    overflow-x: auto;
    padding-top: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .property-tabs {
    justify-content: flex-start;
    padding-bottom: 2px;
  }

  .account-utilities.nav-right {
    margin-left: auto;
    justify-self: end;
  }

  .search-wrapper {
    padding: 10px 12px 6px;
  }
}

@media (max-width: 560px) {
  .property-tabs a .tab-icon,
  .account-utilities .nav-icon,
  .account-utilities.nav-right > form,
  .account-utilities.nav-right > .btn-group {
    display: none;
  }

  .logo-wrapper .logo-img {
    height: 36px;
  }

  .property-tabs a {
    font-size: 14px;
    padding: 8px 10px;
  }

  .search-bar-pill {
    min-height: 54px;
    padding-left: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .property-tabs a,
  .top-nav,
  .search-bar-pill {
    transition: none !important;
  }
}

/* Floating controls container: theme toggle + back to top */
.pb-floating-controls {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pb-floating-controls .pb-public-theme-toggle {
  margin-left: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.pb-floating-controls .pb-back-top {
  position: static;
}

/* Floating Back to Top Button */
.pb-back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9990;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.pb-back-top.is-on {
  display: inline-flex;
}

.pb-back-top:hover {
  background: #ff385c;
  color: #ffffff;
}

/* Global print: hide sticky header, account menu, and chrome on every page.
   Profile pages already use profile-print.css; this covers Terms, tools, etc. */
@media print {
  .top-nav,
  header.top-nav,
  footer,
  .footer,
  .account-utilities,
  .pb-header-search,
  .pb-header-dd,
  .pb-header-notif,
  .dropdown-menu,
  .pb-acct-menu,
  .account-dropdown-menu,
  .pb-floating-controls,
  .pb-back-top,
  .pb-public-theme-toggle,
  .cookie,
  .alert,
  [data-pb-no-print] {
    display: none !important;
  }

  body {
    background: #fff !important;
  }

  a[href]::after {
    content: none !important;
  }

  @page {
    margin: 12mm;
  }
}
