/* Mobile + layout fixes — v20260564 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.site-zillow {
  overflow-x: hidden;
  max-width: 100vw;
}

@media (max-width: 768px) {
  img,
  video,
  iframe,
  input,
  select,
  textarea,
  button {
    max-width: 100%;
  }
}

/* —— Header: thin Zillow-style —— */
.homes-city-search-bottom,
.hero-search-filters-bottom {
  margin-top: 1rem;
  padding-top: 0.75rem;
}

.homes-city-search-bottom {
  margin-top: 0.85rem;
  padding: 0 0.25rem 0.5rem;
}

.homes-city-search-bottom .hero-filter-city {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 768px) {
  .hero-search-filters-bottom {
    margin-top: 0.75rem;
    padding-bottom: 0.5rem;
  }

  .homes-city-search-bottom {
    margin-top: 0.65rem;
    margin-bottom: 0.25rem;
  }

  .site-zillow.site-premium {
    --header-h: 44px;
    padding-top: 0;
    background: #fff;
  }
  .site-zillow .site-header {
    position: sticky;
    top: 0;
    z-index: 900;
  }
  .site-zillow .header-wrap {
    min-height: var(--header-h);
    max-height: var(--header-h);
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.5rem;
  }
  .site-zillow .logo,
  .site-zillow .logo-lg {
    font-size: 0.82rem;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .site-zillow .header-cta.header-cta--mobile,
  .site-zillow .nav-toggle {
    height: 34px;
    min-height: 34px;
    max-height: 34px;
    padding: 0 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .site-zillow .nav-toggle {
    margin-left: 0.15rem;
  }

  /* Mobile menu panel: light text on navy (fixes invisible Homes / Sell / Contact) */
  .site-zillow .site-header.is-solid .nav-toggle {
    color: #071526 !important;
    border: 1.5px solid #071526 !important;
    background: #fff !important;
  }

  .site-premium .header-nav.is-open,
  .site-zillow .header-nav.is-open {
    z-index: 220;
    box-shadow: 0 14px 36px rgba(7, 21, 38, 0.22);
  }

  .site-premium .header-nav.is-open a,
  .site-premium .header-nav.is-open .header-nav-link-btn,
  .site-zillow .header-nav.is-open a,
  .site-zillow .header-nav.is-open .header-nav-link-btn {
    color: rgba(255, 255, 255, 0.96) !important;
    width: 100%;
    text-align: left;
    padding: 0.7rem 0.55rem !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    background: transparent !important;
  }

  .site-premium .header-nav.is-open a:hover,
  .site-premium .header-nav.is-open .header-nav-link-btn:hover,
  .site-zillow .header-nav.is-open a:hover,
  .site-zillow .header-nav.is-open .header-nav-link-btn:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
  }

  .site-premium .header-nav.is-open .header-nav-cta,
  .site-zillow .header-nav.is-open .header-nav-cta {
    display: block !important;
    width: 100%;
    margin-top: 0.35rem;
    text-align: center;
    color: #071526 !important;
  }
}

/* Tablet / mobile menu (premium.css hides nav below 960px) */
@media (max-width: 960px) {
  .site-premium .header-nav.is-open a,
  .site-premium .header-nav.is-open .header-nav-link-btn,
  .site-zillow .header-nav.is-open a,
  .site-zillow .header-nav.is-open .header-nav-link-btn {
    color: rgba(255, 255, 255, 0.96) !important;
    background: transparent !important;
  }

  .site-zillow .site-header.is-solid .nav-toggle {
    color: #071526 !important;
    border: 1.5px solid #071526 !important;
    background: #fff !important;
  }
}

/* —— Hero: shorter —— */
.site-zillow .hero-cover {
  min-height: clamp(280px, 38vh, 420px);
}
.site-zillow .hero-cover__inner {
  padding: 0.75rem 0.85rem 0.85rem;
}
.site-zillow .hero-cover__kw {
  width: 84px;
  margin-bottom: 0.35rem;
}
.site-zillow .hero-cover h1 {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  margin-bottom: 0.2rem;
}
.site-zillow .hero-cover .hero-lead {
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
  line-height: 1.35;
}
.site-zillow .hero-search-bar {
  margin-bottom: 0.4rem;
}
.site-zillow .hero-search-bar .btn.btn-gold {
  font-weight: 700;
}
.site-zillow .hero-cta-row--cover {
  margin-bottom: 0.35rem;
}
.site-zillow .hero-cta-row--cover .btn {
  font-size: 0.8rem;
  padding: 0.45rem 0.65rem;
}
.site-zillow .hero-cta-row--cover .btn-secondary-hero {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
}
.hero-trust-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.9);
}
.hero-trust-bar .hero-rating {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.hero-trust-bar .hero-trust-sep {
  opacity: 0.5;
}
@media (max-width: 768px) {
  .site-zillow .hero-cover {
    min-height: auto;
  }
  .site-zillow .hero-cover__inner {
    padding: 0.55rem 0.75rem 0.65rem;
  }
  .site-zillow .hero-cover h1 {
    font-size: 1.2rem;
  }
  .site-zillow .hero-cover .hero-lead {
    font-size: 0.76rem;
    margin-bottom: 0.35rem;
  }
  .site-zillow .hero-trust-chips {
    display: none;
  }
  .hero-search-bar {
    gap: 0.3rem;
    margin-bottom: 0.3rem;
  }
  .hero-search-bar input,
  .hero-search-bar select {
    min-height: 40px;
    font-size: 16px;
  }
  .hero-search-bar .btn {
    min-height: 40px;
    font-size: 0.85rem;
  }
  .site-zillow .hero-cta-row--cover {
    margin-bottom: 0.25rem;
  }
  .site-zillow .hero-cta-row--cover .btn-secondary-hero {
    width: 100%;
    text-align: center;
  }
  .hero-trust-bar {
    font-size: 0.68rem;
    gap: 0.25rem 0.45rem;
  }
}

/* —— List / Map pill tabs —— */
.explorer-view-tabs {
  display: flex !important;
  position: sticky;
  top: var(--header-h, 48px);
  z-index: 50;
  margin-bottom: 0.5rem;
  padding: 0.2rem;
  gap: 0.25rem;
  border-radius: 999px;
  background: var(--zillow-bg, #f0f2f5);
  border: 1px solid var(--zillow-border, #e2e6ea);
  box-shadow: 0 2px 8px rgba(7, 21, 38, 0.06);
}
.explorer-view-tabs .view-tab {
  flex: 1;
  border-radius: 999px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.explorer-view-tabs .view-tab.is-active {
  background: var(--navy, #071526);
  color: #fff;
  box-shadow: 0 2px 6px rgba(7, 21, 38, 0.2);
}
@media (min-width: 769px) {
  .explorer-view-tabs {
    display: none !important;
  }
}

/* —— Cards: mobile stacked layout —— */
@media (max-width: 768px) {
  .zillow-card {
    min-height: 0;
    grid-template-columns: 1fr !important;
  }
  .zillow-card-photo-btn {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #e8ecf0;
    min-height: 0;
  }
  .zillow-card-photo-btn img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center;
  }
  .zillow-card-body {
    padding: 0.65rem 0.75rem 0.75rem !important;
  }
  .premium-card-photo {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e8ecf0;
  }
  .premium-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* —— Consent / forms overflow —— */
.consent,
.consent--compact {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  font-size: 0.72rem;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.consent input[type='checkbox'] {
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.lead-modal-dialog,
.home-lead-form,
.lead-modal-form {
  max-width: 100%;
  overflow-x: hidden;
}
@media (max-width: 768px) {
  .consent,
  .consent--compact {
    flex-direction: column;
    align-items: stretch;
    font-size: 0.68rem;
    padding-right: 0.25rem;
  }
  .consent input[type='checkbox'] {
    align-self: flex-start;
  }
  .lead-modal-dialog {
    width: 92vw;
    max-width: 92vw;
    max-height: min(92dvh, 92svh);
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* —— Bottom expert bar: compact —— */
body.has-expert-cta {
  padding-bottom: calc(3.6rem + env(safe-area-inset-bottom, 0px));
}
.expert-cta-bar {
  padding: 0.38rem 0.55rem calc(0.38rem + env(safe-area-inset-bottom, 0px));
  gap: 0.35rem;
}
.expert-cta-bar__primary {
  padding: 0.5rem 0.65rem;
  font-size: 0.78rem;
  border-radius: 8px;
}
.expert-cta-bar__icon {
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 10px;
}
.expert-cta-bar__icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

/* —— Zillow vs portals section —— */
.zillow-diff-band {
  padding: 1.25rem 0;
  background: #fff;
  border-top: 1px solid var(--zillow-border, #e2e6ea);
  border-bottom: 1px solid var(--zillow-border, #e2e6ea);
}
.zillow-diff-band h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  color: var(--navy);
}
.zillow-diff-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}
.zillow-diff-list li {
  font-size: 0.88rem;
  padding-left: 1.35rem;
  position: relative;
  color: var(--navy);
  line-height: 1.4;
}
.zillow-diff-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--gold-dark, #9a7b1a);
  font-weight: 700;
}

/* —— Search by area —— */
.search-by-area {
  padding: 0.85rem 0;
  background: var(--zillow-bg, #f7f8fa);
}
.search-by-area h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--navy);
}

/* —— Lead steps —— */
.lead-form-steps .lead-step-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.lead-form-steps .lead-step-actions .btn {
  flex: 1;
}
.lead-step-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}

.lead-capture-band--promo {
  padding: 1.75rem 0 2rem;
}

/* Mobile explorer heights — see layout-fixes.css */
