/* ===== Variáveis ===== */
:root {
  --color-primary: #1a5f7a;
  --color-primary-dark: #134c61;
  --color-accent: #f4a261;
  --color-whatsapp: #25d366;
  --color-text: #1f2937;
  --color-muted: #6b7280;
  --color-bg: #ffffff;
  --color-bg-alt: #f6f9fb;
  --color-border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --container: 1140px;
  --font-head: "Poppins", sans-serif;
  --font-body: "Inter", sans-serif;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

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

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Botões ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-primary-dark);
}

.btn--whatsapp {
  background: var(--color-whatsapp);
  color: #fff;
}

.btn--whatsapp:hover {
  background: #1ebe5d;
}

.btn--outline {
  background: transparent;
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
}

/* ===== Cabeçalho ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow 0.2s ease;
}

.header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
}

.logo span {
  color: var(--color-accent);
}

.logo--light {
  color: #fff;
}

.logo--light span {
  color: var(--color-accent);
}

.nav__list {
  display: flex;
  gap: 32px;
}

.nav__link {
  font-weight: 500;
  color: var(--color-text);
  transition: color 0.2s ease;
}

.nav__link:hover {
  color: var(--color-primary);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav__toggle span {
  width: 26px;
  height: 3px;
  background: var(--color-text);
  border-radius: 2px;
  transition: 0.3s;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  background: linear-gradient(135deg, rgba(26, 95, 122, 0.92), rgba(19, 76, 97, 0.92)),
    url("https://images.unsplash.com/photo-1560518883-ce09059eeffa?auto=format&fit=crop&w=1600&q=80")
      center / cover no-repeat;
  color: #fff;
  padding: 96px 0 120px;
}

.hero__inner {
  text-align: center;
}

.hero__title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.15;
}

.hero__subtitle {
  font-size: 1.1rem;
  max-width: 620px;
  margin: 0 auto 40px;
  opacity: 0.92;
}

/* ===== Busca ===== */
.search {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  background: #fff;
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 920px;
  margin: 0 auto;
}

.search__field {
  flex: 1;
  min-width: 160px;
  text-align: left;
}

.search__field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 6px;
}

.search__field select,
.search__field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background: #fff;
}

.search__field select:focus,
.search__field input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.search__btn {
  flex: 0 0 auto;
  height: 46px;
}

/* ===== Seções ===== */
.section {
  padding: 80px 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.section__head {
  text-align: center;
  margin-bottom: 48px;
}

.section__title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 10px;
}

.section__subtitle {
  color: var(--color-muted);
  font-size: 1.05rem;
}

/* ===== Grid de imóveis ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card__media img {
  transform: scale(1.06);
}

.card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card__media { cursor: pointer; }

/* Carrossel no card */
.card__count {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
}
.card__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.card:hover .card__nav { opacity: 1; }
.card__nav:hover { background: rgba(0, 0, 0, 0.75); }
.card__nav--prev { left: 10px; }
.card__nav--next { right: 10px; }

.card__contact {
  margin-top: 16px;
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.card__contact:hover { background: var(--color-primary-dark); }

/* ===== Lightbox (galeria em tela cheia) ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
}
.lightbox__stage {
  margin: 0;
  max-width: min(1100px, 92vw);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lightbox__img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.lightbox__caption {
  display: flex;
  gap: 14px;
  align-items: center;
  color: #fff;
  font-size: 0.95rem;
}
.lightbox__count { color: rgba(255, 255, 255, 0.7); font-size: 0.85rem; }
.lightbox__close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox__nav:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox__nav--prev { left: 3vw; }
.lightbox__nav--next { right: 3vw; }
.lightbox__contact {
  border: none;
  border-radius: 30px;
  background: #25d366;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 26px;
  cursor: pointer;
}
.lightbox__contact:hover { background: #1ebe5b; }

@media (max-width: 640px) {
  .lightbox__nav { width: 42px; height: 42px; font-size: 1.6rem; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
}

.card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card__price {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.card__location {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.card__features {
  display: flex;
  gap: 16px;
  padding-top: 16px;
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-muted);
}

.card__features span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.empty {
  text-align: center;
  color: var(--color-muted);
  font-size: 1.05rem;
  padding: 40px 0;
}

/* ===== Sobre ===== */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.about__text p {
  color: var(--color-muted);
  margin-bottom: 16px;
}

.about__stats {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.about__stats li {
  display: flex;
  flex-direction: column;
}

.about__stats strong {
  font-family: var(--font-head);
  font-size: 1.8rem;
  color: var(--color-primary);
}

.about__stats span {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.about__img {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(26, 95, 122, 0.15), rgba(244, 162, 97, 0.2)),
    url("https://images.unsplash.com/photo-1582268611958-ebfd161ef9cf?auto=format&fit=crop&w=900&q=80")
      center / cover no-repeat;
  box-shadow: var(--shadow-md);
}

/* ===== Contato ===== */
.contact {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
  align-items: start;
}

.form__field {
  margin-bottom: 18px;
}

.form__field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form__field input,
.form__field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
}

.form__field input:focus,
.form__field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.contact__info {
  background: var(--color-bg-alt);
  padding: 32px;
  border-radius: var(--radius);
}

.contact__info h3 {
  font-family: var(--font-head);
  margin-bottom: 18px;
}

.contact__info ul {
  margin-bottom: 24px;
}

.contact__info li {
  margin-bottom: 12px;
  color: var(--color-muted);
}

/* ===== Rodapé ===== */
.footer {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 40px 0;
}

.footer__inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.footer__inner p {
  opacity: 0.85;
  font-size: 0.9rem;
}

.footer__creci {
  font-size: 0.8rem !important;
  opacity: 0.6 !important;
}

/* ===== WhatsApp flutuante ===== */
.whatsapp-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  background: var(--color-whatsapp);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 90;
  transition: transform 0.2s ease;
}

.whatsapp-float:hover {
  transform: scale(1.08);
}

/* ===== Responsivo ===== */
@media (max-width: 860px) {
  .nav {
    position: fixed;
    inset: 72px 0 auto 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-150%);
    transition: transform 0.3s ease;
  }

  .nav.is-open {
    transform: translateY(0);
  }

  .nav__list {
    flex-direction: column;
    gap: 0;
    padding: 12px 20px;
  }

  .nav__link {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
  }

  .header__cta {
    display: none;
  }

  .nav__toggle {
    display: flex;
  }

  .about,
  .contact {
    grid-template-columns: 1fr;
  }

  .about__img {
    order: -1;
  }
}

@media (max-width: 520px) {
  .search {
    padding: 18px;
  }

  .search__btn {
    width: 100%;
  }
}
