/* ============================================================
   ROBERTA LOPES · LAYOUT STABILITY
   Camada final e isolada para eixo, header e mobile.
   ============================================================ */

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ---------- HEADER PÚBLICO: uma única geometria ---------- */
.site-header,
.public-header {
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: none !important;
}

/* ---------- HERO HOME: centro pela viewport ---------- */
.hero {
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.hero > .hero-content {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  display: block !important;
}

.hero .hero-copy-expanded {
  position: absolute !important;
  left: 50vw !important;
  right: auto !important;
  top: 53% !important;
  width: min(900px, calc(100vw - 80px)) !important;
  max-width: 900px !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: translate(-50%, -50%) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

.hero .hero-heading-group,
.hero .hero-bottom-group,
.hero .hero-copy-expanded h1,
.hero .hero-copy-expanded .hero-line,
.hero .hero-heading-group .eyebrow,
.hero .hero-bottom-group p {
  width: 100% !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
}

.hero .hero-copy-expanded h1 {
  display: block !important;
  max-width: 900px !important;
}

.hero .hero-copy-expanded .hero-line {
  display: block !important;
  white-space: normal !important;
}

.hero .hero-copy-expanded .hero-line-accent {
  display: inline !important;
  width: auto !important;
}

.hero .hero-bottom-group {
  margin-top: 34px !important;
}

.hero .hero-bottom-group p {
  max-width: 650px !important;
}

.hero .hero-actions {
  width: auto !important;
  margin: 22px auto 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 14px !important;
}

/* filtros centralizados */
.buildings-strip .container {
  width: 100% !important;
  max-width: none !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
  margin: 0 !important;
  overflow-x: auto !important;
  scrollbar-width: none;
}
.buildings-strip .container::-webkit-scrollbar { display: none; }
.buildings-tabs {
  width: max-content !important;
  min-width: 100% !important;
  margin: 0 auto !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

@media (max-width: 820px) {
  /* ----- HEADER MOBILE ----- */
  .site-header,
  .public-header {
    height: 80px !important;
    min-height: 80px !important;
    padding: 0 !important;
  }

  .site-header .header-inner,
  .public-header .header-inner {
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 80px !important;
    height: 80px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .site-header .logo,
  .public-header .logo {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: translate(-50%, -50%) !important;
  }

  .site-header .logo img,
  .public-header .logo img {
    width: auto !important;
    height: 52px !important;
    max-width: 165px !important;
  }

  /* Hambúrguer: dimensões fechadas; não pode herdar 100% do header */
  .site-header .nav-toggle,
  .public-header .nav-toggle {
    position: absolute !important;
    display: block !important;
    right: 16px !important;
    left: auto !important;
    top: 50% !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(-50%) !important;
    border: 0 !important;
    background: transparent !important;
    overflow: hidden !important;
    z-index: 120 !important;
  }

  .site-header .nav-toggle span,
  .public-header .nav-toggle span {
    position: absolute !important;
    display: block !important;
    top: 21px !important;
    left: 9px !important;
    right: auto !important;
    width: 26px !important;
    height: 2px !important;
    margin: 0 !important;
    background: #fff !important;
    border-radius: 2px !important;
  }

  .site-header .nav-toggle span::before,
  .site-header .nav-toggle span::after,
  .public-header .nav-toggle span::before,
  .public-header .nav-toggle span::after {
    content: "" !important;
    position: absolute !important;
    display: block !important;
    left: 0 !important;
    right: auto !important;
    width: 26px !important;
    height: 2px !important;
    margin: 0 !important;
    background: #fff !important;
    border-radius: 2px !important;
  }

  .site-header .nav-toggle span::before,
  .public-header .nav-toggle span::before { top: -8px !important; }
  .site-header .nav-toggle span::after,
  .public-header .nav-toggle span::after { top: 8px !important; }

  .site-header.is-scrolled .nav-toggle span,
  .site-header.is-scrolled .nav-toggle span::before,
  .site-header.is-scrolled .nav-toggle span::after,
  .public-header.is-scrolled .nav-toggle span,
  .public-header.is-scrolled .nav-toggle span::before,
  .public-header.is-scrolled .nav-toggle span::after,
  .privacy-page .public-header .nav-toggle span,
  .privacy-page .public-header .nav-toggle span::before,
  .privacy-page .public-header .nav-toggle span::after {
    background: var(--cocoa-dark) !important;
  }

  /* menu lateral previsível */
  .site-header .main-nav,
  .public-header .main-nav {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    right: -110% !important;
    width: min(82vw, 330px) !important;
    max-width: 330px !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 110px 30px 40px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 26px !important;
    background: var(--cream) !important;
    box-shadow: -12px 0 34px rgba(31,23,19,.18) !important;
    transition: right .28s ease !important;
    z-index: 110 !important;
  }

  .site-header .main-nav.is-open,
  .public-header .main-nav.is-open {
    right: 0 !important;
  }

  .site-header .main-nav a,
  .public-header .main-nav a {
    color: var(--cocoa-dark) !important;
    font-size: 1rem !important;
  }

  .site-header .main-nav .header-cta,
  .public-header .main-nav .header-cta {
    width: 100% !important;
    justify-content: center !important;
  }

  /* ----- HOME HERO MOBILE: centro absoluto da viewport ----- */
  .hero {
    min-height: 610px !important;
    height: 610px !important;
  }

  .hero .hero-copy-expanded {
    left: 50vw !important;
    top: 54% !important;
    width: calc(100vw - 40px) !important;
    max-width: 430px !important;
    transform: translate(-50%, -50%) !important;
    align-items: center !important;
    text-align: center !important;
  }

  .hero .hero-heading-group,
  .hero .hero-bottom-group,
  .hero .hero-copy-expanded h1,
  .hero .hero-copy-expanded .hero-line,
  .hero .hero-heading-group .eyebrow,
  .hero .hero-bottom-group p {
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    align-items: center !important;
  }

  .hero .hero-copy-expanded h1 {
    font-size: clamp(2.45rem, 11vw, 3.35rem) !important;
    line-height: .98 !important;
    letter-spacing: -.025em !important;
  }

  .hero .hero-copy-expanded .hero-line + .hero-line {
    margin-top: 7px !important;
  }

  .hero .hero-bottom-group {
    margin-top: 30px !important;
  }

  .hero .hero-bottom-group p {
    font-size: .98rem !important;
    line-height: 1.58 !important;
  }

  .hero .hero-actions {
    width: min(100%, 360px) !important;
    margin: 24px auto 0 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .hero .hero-actions .btn {
    width: 100% !important;
    min-height: 54px !important;
    justify-content: center !important;
  }

  .buildings-strip .container {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  .buildings-tabs { gap: 8px !important; }

  /* ----- INTERNA MOBILE ----- */
  .detail-hero {
    position: relative !important;
    width: 100% !important;
    min-height: 430px !important;
    height: 430px !important;
    overflow: hidden !important;
  }

  .detail-hero .detail-hero-content {
    position: absolute !important;
    left: 50vw !important;
    top: 0 !important;
    right: auto !important;
    width: calc(100vw - 40px) !important;
    max-width: 430px !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 90px 0 28px !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .detail-hero .detail-hero-copy {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .detail-hero .detail-hero-copy .eyebrow,
  .detail-hero .detail-hero-copy h1,
  .detail-hero .hero-summary {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }

  .detail-hero .detail-hero-copy h1 {
    font-size: clamp(2.35rem, 10.5vw, 3.15rem) !important;
    line-height: .98 !important;
  }

  .detail-hero .hero-summary {
    margin-top: 10px !important;
    font-size: .92rem !important;
    line-height: 1.45 !important;
  }

  .detail-hero .hero-specs {
    width: 100% !important;
    margin: 16px auto 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 6px !important;
  }

  .gallery-section {
    padding-top: 42px !important;
  }

  .gallery-heading {
    width: calc(100% - 40px) !important;
    margin: 0 auto 20px !important;
    padding: 0 !important;
    text-align: center !important;
  }

  .gallery-heading > div,
  .gallery-heading p {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
  }
}

@media (max-width: 390px) {
  .hero {
    min-height: 590px !important;
    height: 590px !important;
  }

  .hero .hero-copy-expanded {
    width: calc(100vw - 30px) !important;
  }

  .hero .hero-copy-expanded h1 {
    font-size: clamp(2.25rem, 10.8vw, 2.95rem) !important;
  }

  .detail-hero .detail-hero-content {
    width: calc(100vw - 30px) !important;
  }
}

/* ============================================================
   INTERNA · MOVIMENTO EDITORIAL
   ============================================================ */

/* O conteúdo nunca depende da animação para existir. A classe é
   aplicada pelo JS somente quando a experiência está disponível. */
body.apartment-motion-ready [data-apartment-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity .72s cubic-bezier(.2,.72,.2,1),
    transform .72s cubic-bezier(.2,.72,.2,1);
  will-change: opacity, transform;
}

body.apartment-motion-ready [data-apartment-reveal="hero"] {
  transform: translate3d(0, 18px, 0) scale(.992);
}

body.apartment-motion-ready [data-apartment-reveal="side"] {
  transform: translate3d(22px, 18px, 0);
}

body.apartment-motion-ready [data-apartment-reveal].is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Hero: entrada suave da fotografia e sensação de profundidade. */
.detail-hero .apartment-hero-media img {
  transform: scale(1.045);
  transition: transform 1.25s cubic-bezier(.2,.72,.2,1);
  will-change: transform;
}

body.apartment-motion-ready .detail-hero .apartment-hero-media.is-loaded img {
  transform: scale(1.015);
}

/* Especificações aparecem em sequência dentro do hero. */
.detail-hero-copy.is-inview .hero-spec {
  animation: apartmentSpecIn .58s cubic-bezier(.2,.72,.2,1) both;
}
.detail-hero-copy.is-inview .hero-spec:nth-child(1) { animation-delay: .12s; }
.detail-hero-copy.is-inview .hero-spec:nth-child(2) { animation-delay: .19s; }
.detail-hero-copy.is-inview .hero-spec:nth-child(3) { animation-delay: .26s; }
.detail-hero-copy.is-inview .hero-spec:nth-child(4) { animation-delay: .33s; }

@keyframes apartmentSpecIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Galeria em sequência, mantendo o clique intacto. */
.property-gallery .gallery-item,
.property-gallery .gallery-more {
  transition:
    opacity .68s cubic-bezier(.2,.72,.2,1),
    transform .68s cubic-bezier(.2,.72,.2,1),
    box-shadow .42s ease;
}
.property-gallery .gallery-item:nth-child(1) { transition-delay: .03s; }
.property-gallery .gallery-item:nth-child(2) { transition-delay: .10s; }
.property-gallery .gallery-item:nth-child(3) { transition-delay: .17s; }
.property-gallery .gallery-item:nth-child(4) { transition-delay: .24s; }
.property-gallery .gallery-item:nth-child(5) { transition-delay: .31s; }
.property-gallery .gallery-more { transition-delay: .35s; }

@media (hover: hover) and (pointer: fine) {
  .property-gallery .gallery-item:hover {
    z-index: 2;
    transform: translateY(-4px) scale(1.008) !important;
    box-shadow: 0 18px 38px rgba(53,39,32,.13);
  }

  .property-gallery .gallery-item img {
    transition: transform .7s cubic-bezier(.2,.72,.2,1), filter .4s ease;
  }

  .property-gallery .gallery-item:hover img {
    transform: scale(1.035);
    filter: saturate(1.03) contrast(1.015);
  }

  .detail-specs-icons .detail-spec,
  .amenity-list li,
  .booking-card {
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  }

  .detail-specs-icons .detail-spec:hover {
    transform: translateY(-4px);
    border-color: rgba(151,111,67,.22) !important;
    box-shadow: 0 16px 34px rgba(74,57,49,.075) !important;
  }

  .amenity-list li:hover {
    transform: translateX(4px);
  }

  .booking-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 48px rgba(74,57,49,.10);
  }
}

/* Comodidades reveladas em cascata após o bloco entrar na tela. */
.amenities-block.is-inview .amenity-list li {
  animation: amenityIn .48s cubic-bezier(.2,.72,.2,1) both;
}
.amenities-block.is-inview .amenity-list li:nth-child(1)  { animation-delay: .04s; }
.amenities-block.is-inview .amenity-list li:nth-child(2)  { animation-delay: .08s; }
.amenities-block.is-inview .amenity-list li:nth-child(3)  { animation-delay: .12s; }
.amenities-block.is-inview .amenity-list li:nth-child(4)  { animation-delay: .16s; }
.amenities-block.is-inview .amenity-list li:nth-child(5)  { animation-delay: .20s; }
.amenities-block.is-inview .amenity-list li:nth-child(6)  { animation-delay: .24s; }
.amenities-block.is-inview .amenity-list li:nth-child(7)  { animation-delay: .28s; }
.amenities-block.is-inview .amenity-list li:nth-child(8)  { animation-delay: .32s; }
.amenities-block.is-inview .amenity-list li:nth-child(9)  { animation-delay: .36s; }
.amenities-block.is-inview .amenity-list li:nth-child(10) { animation-delay: .40s; }
.amenities-block.is-inview .amenity-list li:nth-child(n+11) { animation-delay: .44s; }

@keyframes amenityIn {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile: movimento menor para preservar fluidez e leitura. */
@media (max-width: 720px) {
  body.apartment-motion-ready [data-apartment-reveal] {
    transform: translate3d(0, 14px, 0);
    transition-duration: .55s;
  }

  body.apartment-motion-ready [data-apartment-reveal="side"] {
    transform: translate3d(0, 14px, 0);
  }

  .detail-hero .apartment-hero-media img {
    transform: scale(1.025);
  }

  body.apartment-motion-ready .detail-hero .apartment-hero-media.is-loaded img {
    transform: scale(1.005);
  }

  .property-gallery .gallery-item:nth-child(n),
  .property-gallery .gallery-more {
    transition-delay: 0s;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.apartment-motion-ready [data-apartment-reveal],
  body.apartment-motion-ready [data-apartment-reveal].is-inview {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .detail-hero .apartment-hero-media img,
  body.apartment-motion-ready .detail-hero .apartment-hero-media.is-loaded img {
    transform: none !important;
    transition: none !important;
  }

  .detail-hero-copy.is-inview .hero-spec,
  .amenities-block.is-inview .amenity-list li {
    animation: none !important;
  }
}
