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

/* Real-estate header: stable layout, no overlapping utilities, responsive nav. */
.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 {
  min-height: var(--header-height);
  max-width: var(--header-max-width);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}

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

.logo-wrapper {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-width: 148px;
}

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

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

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

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

.nav-center {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

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

.property-tabs li {
  margin: 0;
}

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

.property-tabs a .tab-icon {
  color: var(--color-primary, #ff385c);
  font-size: 14px;
  opacity: 0.85;
}

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

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

.account-utilities.nav-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.nav-listing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  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: 42px;
  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;
}

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

.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: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted, #6a6a6a);
  font-size: 28px;
}

.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 {
    gap: 14px;
    padding: 0 18px;
  }

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

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

@media (max-width: 900px) {
  .top-nav-inner {
    min-height: auto;
    padding: 12px 16px;
    flex-wrap: wrap;
  }

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

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

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

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

  .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: 40px;
  }

  .property-tabs a {
    font-size: 12px;
    padding: 9px 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 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;
}
