/*
  Vértice Imóveis - Página Imóveis
  Passo 2: camada visual completa
  Base: HTML semântico + Tailwind CDN + CSS customizado
*/

:root {
  --vertice-navy: #0d3345;
  --vertice-navy-deep: #071f2d;
  --vertice-ink: #102f41;
  --vertice-muted: #60707a;
  --vertice-soft: #f8f5ef;
  --vertice-surface: #fbfaf7;
  --vertice-line: #e2d9cd;
  --vertice-green: #74c84b;
  --vertice-green-dark: #62b63f;
  --vertice-shadow: 0 24px 70px rgba(16, 47, 65, 0.12);
  --vertice-shadow-soft: 0 14px 36px rgba(16, 47, 65, 0.09);
  --header-height: 72px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--vertice-soft);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 2%, rgba(255, 255, 255, 0.96) 0, rgba(248, 245, 239, 0) 32rem),
    linear-gradient(180deg, #fbfaf7 0%, var(--vertice-soft) 34%, #fbfaf7 100%);
  color: var(--vertice-ink);
}

body.menu-open {
  overflow: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

img {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select,
input,
textarea {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(116, 200, 75, 0.42);
  outline-offset: 3px;
}

::selection {
  background: var(--vertice-green);
  color: white;
}

.page-imoveis {
  isolation: isolate;
}

/* Header */
.site-header {
  transition: transform 320ms ease, background-color 320ms ease, box-shadow 320ms ease, border-color 320ms ease;
}

.site-header.is-scrolled {
  background: rgba(251, 250, 247, 0.98);
  border-color: rgba(207, 196, 181, 0.86);
  box-shadow: 0 14px 34px rgba(16, 47, 65, 0.09);
}

.site-header__inner {
  transition: height 280ms ease;
}

.site-header.is-scrolled .site-header__inner {
  height: 66px;
}

.brand-link img {
  filter: drop-shadow(0 8px 16px rgba(16, 47, 65, 0.04));
}

.main-nav .nav-link {
  position: relative;
  letter-spacing: -0.01em;
}

.main-nav .nav-link::after {
  position: absolute;
  left: 50%;
  bottom: -0.65rem;
  width: 0;
  height: 2px;
  content: "";
  border-radius: 999px;
  background: var(--vertice-green);
  transform: translateX(-50%);
  transition: width 240ms ease;
}

.main-nav .nav-link:hover::after,
.main-nav .nav-link.is-active::after {
  width: 100%;
}

.header-cta,
.mobile-menu-button {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, color 220ms ease, background-color 220ms ease;
}

.header-cta:hover,
.mobile-menu-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(16, 47, 65, 0.1);
}

.mobile-menu-button span span {
  transition: transform 220ms ease, opacity 220ms ease;
}

.mobile-menu-button.is-open span span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-button.is-open span span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-button.is-open span span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-nav {
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  box-shadow: 0 24px 50px rgba(16, 47, 65, 0.12);
}

.mobile-nav.is-open {
  display: block !important;
  animation: mobileMenuIn 260ms ease both;
}

@keyframes mobileMenuIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero */
.listing-hero {
  min-height: 520px;
  background: var(--vertice-soft);
}

.listing-hero::before {
  position: absolute;
  inset: var(--header-height) 0 auto 0;
  z-index: 0;
  height: 350px;
  content: "";
  background:
    linear-gradient(90deg, rgba(248,245,239,1) 0%, rgba(248,245,239,0.96) 36%, rgba(248,245,239,0.68) 51%, rgba(248,245,239,0.06) 70%),
    radial-gradient(circle at 34% 35%, rgba(255,255,255,0.84), rgba(255,255,255,0) 26rem);
  pointer-events: none;
}

.listing-hero__background {
  z-index: 0;
}

.listing-hero__image-wrap {
  clip-path: inset(0 0 0 0 round 0);
}

.listing-hero__image {
  transform: scale(1.015);
  transform-origin: center center;
  will-change: transform;
}

.listing-hero__content {
  z-index: 2;
}

.listing-hero h1 {
  max-width: 11.5em;
  text-wrap: balance;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.36);
}

.listing-hero p {
  letter-spacing: -0.01em;
}

/* Filter */
.listing-filter {
  backdrop-filter: blur(18px);
  transform: translateZ(0);
}

.listing-filter::before {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(251, 250, 247, 0.86));
  z-index: -1;
}

.filter-field {
  position: relative;
  transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.filter-field:hover,
.filter-field:focus-within {
  background: white;
  border-color: rgba(116, 200, 75, 0.55) !important;
  box-shadow: 0 14px 26px rgba(16, 47, 65, 0.08);
  transform: translateY(-1px);
}

.filter-field svg {
  transition: color 220ms ease, transform 220ms ease;
}

.filter-field:hover svg,
.filter-field:focus-within svg {
  color: var(--vertice-green);
  transform: translateY(-1px);
}

.filter-field select {
  cursor: pointer;
  min-height: 1.6rem;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--vertice-muted) 50%),
    linear-gradient(135deg, var(--vertice-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 55%,
    calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 1.4rem;
}

.filter-field select:focus {
  color: var(--vertice-ink);
}

.listing-filter__actions button {
  transition: transform 220ms ease, box-shadow 220ms ease, background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}

.listing-filter__actions button[type="submit"]:hover {
  box-shadow: 0 20px 46px rgba(13, 51, 69, 0.28);
}

/* Results */
.listing-results {
  position: relative;
  z-index: 3;
}

.listing-results__header h2 {
  letter-spacing: -0.03em;
}

.sort-control {
  row-gap: 0.65rem;
}

.sort-button {
  min-width: 112px;
  transition: transform 220ms ease, background-color 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.sort-button:hover {
  transform: translateY(-1px);
  border-color: rgba(116, 200, 75, 0.6);
  color: var(--vertice-green);
  box-shadow: 0 14px 28px rgba(16, 47, 65, 0.08);
}

.sort-button.is-active:hover {
  color: white;
  border-color: transparent;
}

.property-listing-grid {
  align-items: stretch;
}

.property-card {
  position: relative;
  min-width: 0;
  transform: translateZ(0);
  transition: transform 280ms ease, box-shadow 280ms ease, border-color 280ms ease;
}

.property-card:hover {
  transform: translateY(-5px);
  border-color: rgba(116, 200, 75, 0.52);
  box-shadow: 0 22px 50px rgba(16, 47, 65, 0.14);
}

.property-card__media::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 31, 45, 0.16) 0%, rgba(7, 31, 45, 0.02) 45%, rgba(7, 31, 45, 0.1) 100%);
  opacity: 0.92;
}

.property-card__media img {
  min-height: 100%;
  will-change: transform;
}

.property-card__tag {
  z-index: 2;
  box-shadow: 0 10px 22px rgba(16, 47, 65, 0.16);
}

.tag-green {
  background: var(--vertice-green);
  color: white;
}

.tag-navy {
  background: var(--vertice-navy);
  color: white;
}

.favorite-button {
  z-index: 3;
  box-shadow: 0 10px 20px rgba(16, 47, 65, 0.18);
}

.favorite-button.is-active,
.favorite-button[aria-pressed="true"] {
  background: white;
  color: var(--vertice-green);
}

.favorite-button.is-active svg,
.favorite-button[aria-pressed="true"] svg {
  fill: currentColor;
}

.property-card__body h2 {
  text-wrap: balance;
}

.property-card__body p {
  letter-spacing: -0.01em;
}

/* Consultant card */
.consultant-card {
  overflow: hidden;
  position: relative;
  min-width: 0;
}

.consultant-card::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 0%, rgba(116, 200, 75, 0.13), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 250, 247, 0.78));
}

.consultant-card > * {
  position: relative;
  z-index: 1;
}

.consultant-card img {
  border: 7px solid #f4efe7;
  box-shadow: 0 18px 44px rgba(16, 47, 65, 0.13);
}

.consultant-card a {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, color 220ms ease, background-color 220ms ease;
}

.consultant-card a:hover {
  transform: translateY(-2px);
}

.consultant-card a:first-child:hover {
  box-shadow: 0 22px 46px rgba(13, 51, 69, 0.24);
}

/* Offmarket */
.offmarket-banner {
  position: relative;
  isolation: isolate;
  transition: transform 280ms ease, box-shadow 280ms ease, border-color 280ms ease;
}

.offmarket-banner:hover {
  transform: translateY(-3px);
  border-color: rgba(116, 200, 75, 0.4);
  box-shadow: 0 22px 54px rgba(16, 47, 65, 0.12);
}

.offmarket-banner img {
  min-height: 100%;
  transition: transform 900ms ease;
}

.offmarket-banner:hover img {
  transform: scale(1.045);
}

.offmarket-banner__content {
  background:
    radial-gradient(circle at 100% 0%, rgba(116, 200, 75, 0.09), transparent 16rem),
    linear-gradient(135deg, #ffffff 0%, #fbfaf7 100%);
}

.offmarket-banner__content h2 {
  text-wrap: balance;
}

/* Pagination */
.pagination__button,
.pagination__ellipsis {
  flex: 0 0 auto;
}

.pagination__button {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, color 220ms ease, background-color 220ms ease;
}

.pagination__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(16, 47, 65, 0.08);
}

.pagination__button.is-current {
  box-shadow: 0 12px 26px rgba(13, 51, 69, 0.2);
}

/* CTA */
.listing-cta__card {
  isolation: isolate;
  min-height: 170px;
}

.listing-cta__image {
  transform: scale(1.02);
  will-change: transform;
}

.listing-cta__card h2 {
  max-width: 10.5em;
  text-wrap: balance;
}

.listing-cta__card a {
  transition: transform 220ms ease, box-shadow 220ms ease, background-color 220ms ease;
}

.listing-cta__card a:hover {
  box-shadow: 0 22px 52px rgba(116, 200, 75, 0.36);
}

/* Footer */
.site-footer {
  position: relative;
}

.site-footer::before {
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(116, 200, 75, 0.55), transparent);
}

.footer-brand img {
  filter: drop-shadow(0 8px 16px rgba(16, 47, 65, 0.04));
}

.footer-brand a,
.footer-nav a,
.footer-contact a {
  transition: color 200ms ease, transform 200ms ease;
}

.footer-brand a:hover,
.footer-nav a:hover,
.footer-contact a:hover {
  transform: translateX(1px);
}

.footer-contact svg,
.footer-brand svg {
  stroke-width: 1.8;
}

/* Visual polish */
[data-animate] {
  will-change: transform, opacity;
}

[data-parallax] {
  will-change: transform;
}

@supports (text-wrap: balance) {
  .listing-hero h1,
  .listing-cta__card h2,
  .offmarket-banner__content h2,
  .consultant-card h2 {
    text-wrap: balance;
  }
}

/* Responsive */
@media (max-width: 1279px) {
  .listing-filter__grid {
    gap: 0.85rem;
  }

  .filter-field {
    border: 1px solid rgba(226, 217, 205, 0.86);
  }
}

@media (max-width: 1023px) {
  .listing-results__layout {
    grid-template-columns: 1fr !important;
  }

  .consultant-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .consultant-card img {
    width: 8.75rem;
    height: 8.75rem;
  }
}

@media (max-width: 767px) {
  :root {
    --header-height: 68px;
  }

  .site-header__inner {
    height: var(--header-height) !important;
  }

  .brand-link img {
    height: 2.75rem;
  }

  .listing-hero {
    min-height: auto;
    padding-top: var(--header-height);
  }

  .listing-hero::before {
    top: var(--header-height);
    height: 430px;
    background:
      linear-gradient(180deg, rgba(248,245,239,0.98) 0%, rgba(248,245,239,0.9) 36%, rgba(248,245,239,0.78) 100%),
      radial-gradient(circle at 50% 0%, rgba(255,255,255,0.94), transparent 20rem);
  }

  .listing-hero__background {
    top: var(--header-height) !important;
    height: 430px !important;
  }

  .listing-hero__image-wrap {
    width: 100% !important;
    opacity: 0.34;
  }

  .listing-hero__image {
    object-position: center;
    filter: saturate(0.94) contrast(0.96);
  }

  .listing-hero__content {
    min-height: 380px !important;
    align-items: end;
    padding-top: 4rem;
    padding-bottom: 4rem;
  }

  .listing-hero h1 {
    font-size: clamp(2.55rem, 13.2vw, 4.1rem) !important;
    max-width: 8.2em;
  }

  .listing-hero p {
    max-width: 26rem;
    font-size: 0.95rem;
    line-height: 1.75;
  }

  .listing-filter {
    margin-top: 0.5rem;
    padding: 1rem !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 20px 50px rgba(16, 47, 65, 0.12) !important;
  }

  .filter-field {
    min-height: 66px !important;
  }

  .listing-filter__actions button {
    width: 100%;
  }

  .listing-results {
    padding-top: 2.4rem !important;
  }

  .listing-results__header h2 {
    font-size: 1.55rem;
  }

  .sort-control {
    align-items: stretch;
  }

  .sort-control > span {
    flex-basis: 100%;
    margin-bottom: 0.25rem;
  }

  .sort-button {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    padding-inline: 0.85rem !important;
  }

  .property-card__body {
    padding: 1.15rem !important;
  }

  .consultant-card {
    padding: 1.5rem !important;
    text-align: left;
  }

  .consultant-card img {
    margin-inline: 0 auto !important;
  }

  .offmarket-banner {
    margin-top: 2.4rem !important;
  }

  .offmarket-banner__content {
    padding: 1.5rem !important;
  }

  .offmarket-banner__content h2 {
    font-size: 2rem !important;
  }

  .pagination {
    overflow-x: auto;
    justify-content: flex-start !important;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
  }

  .pagination::-webkit-scrollbar {
    display: none;
  }

  .listing-cta {
    padding-bottom: 1.4rem !important;
  }

  .listing-cta__card {
    padding: 1.5rem !important;
  }

  .listing-cta__card h2 {
    font-size: clamp(2.1rem, 10vw, 3.3rem) !important;
  }

  .listing-cta__card .relative {
    grid-template-columns: 1fr !important;
  }

  .site-footer .footer-nav,
  .site-footer .footer-contact {
    border-left: 0 !important;
    padding-left: 0 !important;
  }
}

@media (max-width: 479px) {
  .site-header__inner,
  .listing-hero__content,
  .listing-results,
  .listing-cta,
  .site-footer > div {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .brand-link img {
    height: 2.45rem;
  }

  .mobile-menu-button {
    height: 2.5rem !important;
    width: 2.5rem !important;
  }

  .listing-hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.4rem) !important;
  }

  .listing-filter {
    padding: 0.8rem !important;
  }

  .filter-field {
    gap: 0.75rem !important;
    padding-inline: 0.9rem !important;
  }

  .filter-field svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
  }

  .property-listing-grid {
    gap: 1rem !important;
  }

  .property-card__media {
    aspect-ratio: 1.32 / 1 !important;
  }

  .pagination__button,
  .pagination__ellipsis {
    width: 2.55rem !important;
    height: 2.55rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  [data-parallax],
  .listing-hero__image,
  .listing-cta__image {
    transform: none !important;
  }
}



/* Ajustes finais: filtros, favoritos e paginação da listagem */
.favorite-button {
  cursor: pointer;
  transition: transform .28s ease, background-color .28s ease, border-color .28s ease, color .28s ease;
}

.favorite-button:hover {
  transform: translateY(-1px) scale(1.04);
}

.favorite-button.is-active,
.favorite-button[aria-pressed="true"] {
  background: rgba(116, 200, 75, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.82) !important;
  color: #fff !important;
}

.favorite-button.is-active svg,
.favorite-button[aria-pressed="true"] svg {
  fill: currentColor;
}

.property-listing-grid + .pagination {
  margin-top: 2.25rem;
}

.property-empty-state {
  grid-column: 1 / -1;
  border: 1px solid var(--vertice-line);
  border-radius: 20px;
  background: #fff;
  padding: 2rem;
  text-align: center;
  color: var(--vertice-muted);
  box-shadow: var(--vertice-shadow-soft);
}

.property-empty-state strong {
  display: block;
  margin-bottom: .5rem;
  color: var(--vertice-ink);
  font-size: 1.15rem;
}

.pagination__button[aria-disabled="true"] {
  pointer-events: none;
  opacity: .45;
}


/* Correção final: cards da listagem nunca ficam transparentes em cascata */
.property-listing-grid .property-card {
  opacity: 1 !important;
  visibility: visible !important;
}

.property-listing-grid .property-card * {
  opacity: 1;
}


/* Ajuste final: transição suave entre hero/filtro e listagem */
.listing-hero {
  position: relative;
  overflow: visible;
}

.listing-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 1;
  height: clamp(120px, 14vw, 210px);
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(248, 245, 239, 0) 0%, rgba(248, 245, 239, 0.74) 52%, #f8f5ef 100%);
}

.listing-hero [data-animate="filters"],
.listing-hero .listing-filter {
  position: relative;
  z-index: 4;
}

.listing-results {
  margin-top: -1px;
  padding-top: clamp(54px, 7vw, 92px) !important;
  background: linear-gradient(180deg, #f8f5ef 0%, rgba(248,245,239,0.98) 46%, rgba(251,250,247,0) 100%);
}
