/* ===== Tokens ===== */
:root {
  --blue: #1D286D;
  --white: #FFFFFF;
  --sky: #008aff;
  --radius: 28px;
  --container: 1100px;
  --ease: cubic-bezier(.22, .8, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--blue);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; }

.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 30px; border-radius: 999px; border: 2px solid transparent;
  font: 400 1rem/1 'Inter', sans-serif; cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease),
              border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}
.btn:hover, .btn:focus-visible {
  background: var(--sky); border-color: var(--sky); color: var(--white);
  transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 138, 255, .35);
}
.btn-primary { background: var(--blue); color: var(--white); border-color: var(--blue); }
.btn-white { background: var(--white); color: var(--blue); border-color: var(--white); }
.btn-outline-white { background: transparent; color: var(--white); border-color: var(--white); }

/* ===== Navbar ===== */
@keyframes navSlideDown {
  0% {
    transform: translateY(-150%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.navbar-wrap { 
  position: fixed; top: 18px; left: 0; right: 0; z-index: 100; 
  animation: navSlideDown 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.navbar {
  width: min(100% - 32px, 1000px); margin-inline: auto;
  background: var(--white); border-radius: 999px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 10px 22px; position: relative;
  box-shadow: 0 10px 30px rgba(29, 40, 109, .15);
  transition: box-shadow .3s var(--ease);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--blue); }

.nav-menu { display: flex; align-items: center; justify-content: flex-end; }
.nav-links { 
  display: flex; gap: 28px; 
  position: absolute; left: 50%; transform: translateX(-50%);
}
.nav-links a { position: relative; font-size: .95rem; padding: 4px 0; transition: color .3s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
  background: var(--sky); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav-links a:hover { color: var(--sky); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none; background: none; border: 0; width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2.5px; background: var(--blue); border-radius: 2px;
  transition: transform .35s var(--ease), opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-start; justify-content: center; text-align: center;
  color: var(--white); overflow: hidden; background: var(--sky);
}
.hero-bg, .hero-bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-bg img { object-fit: cover; object-position: center bottom; animation: heroZoom 14s ease-out both; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 90, 200, .35) 0%, rgba(0, 90, 200, 0) 45%);
}
.hero-content { position: relative; padding-top: clamp(120px, 17vh, 170px); max-width: 820px; }
.hero h1 { font-size: clamp(2.1rem, 5.6vw, 3.6rem); text-shadow: 0 2px 14px rgba(0, 60, 150, .35); }
.hero p { margin: 22px auto 30px; max-width: 640px; font-size: clamp(1rem, 2vw, 1.2rem); text-shadow: 0 1px 10px rgba(0, 60, 150, .4); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
@keyframes heroZoom { from { transform: scale(1.08); } to { transform: scale(1); } }

/* ===== Sections ===== */
.section { padding: clamp(64px, 10vw, 120px) 0; }
.section h2 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 28px; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split-reverse { grid-template-columns: .8fr 1.2fr; }
.split-text p { font-size: clamp(1rem, 1.6vw, 1.15rem); margin-bottom: 22px; }
.split-text .btn { margin-top: 10px; }

.about-media img { width: 100%; max-width: 480px; margin-inline: auto; }

.why-media { border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 4; max-height: 560px; }
.why-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.why-media:hover img { transform: scale(1.05); }
.why-list { margin-bottom: 26px; }
.why-list li {
  position: relative; padding: 8px 0 8px 26px; font-size: clamp(1.05rem, 1.9vw, 1.3rem);
}
.why-list li::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 10px; height: 10px; border-radius: 50%;
  background: var(--sky); transform: translateY(-50%);
}

/* ===== Services ===== */
.services { background: var(--blue); color: var(--white); border-radius: 40px 40px 0 0; }
.category { font-size: clamp(1.2rem, 2.4vw, 1.5rem); margin: 44px 0 22px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--white); display: flex; align-items: center; gap: 16px; }
.category::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .3); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.card {
  position: relative; overflow: hidden; border-radius: 24px; min-height: 340px;
  display: flex; align-items: flex-end; isolation: isolate;
  background: linear-gradient(160deg, #008aff, #14205c);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}
.card-bg {
  position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center;
  transition: transform .9s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(29, 40, 109, 0) 25%, rgba(15, 22, 70, .92) 100%);
}
.card:hover .card-bg { transform: scale(1.12); }
.card-body { padding: 24px; transition: transform .5s var(--ease); }
.card:hover .card-body { transform: translateY(-6px); }
.card h4 { font-size: 1.25rem; margin-bottom: 8px; }
.card p { font-size: .95rem; opacity: .92; }
.services-cta { text-align: center; margin-top: 56px; }

/* ===== Scroll reveal ===== */
.reveal { opacity: 0; transform: translateY(32px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal.is-visible { opacity: 1; transform: none; }
.hero .reveal { animation: heroIn 1s var(--ease) both; animation-delay: var(--d, 0s); opacity: 1; transform: none; transition: none; }
@keyframes heroIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* ===== Tablet ===== */
@media (max-width: 992px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .nav-links { gap: 18px; } /* Ajuste de espaçamento pro tablet */
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .navbar-wrap { top: 12px; }
  .navbar { border-radius: 30px; padding: 8px 10px 8px 18px; flex-wrap: wrap; }
  .nav-toggle { display: flex; }
  .nav-menu {
    flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0;
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height .5s var(--ease), opacity .35s, padding .4s var(--ease);
  }
  .nav-menu.is-open { max-height: 420px; opacity: 1; padding: 8px 4px 14px; }
  
  /* Ajuste de Override: Resetando o Position Absolute para Mobile */
  .nav-links { 
    position: relative; left: 0; transform: none; 
    flex-direction: column; gap: 0; 
  }
  .nav-links a { display: block; padding: 14px 8px; border-bottom: 1px solid rgba(29, 40, 109, .1); }
  .nav-links a::after { display: none; }
  .nav-cta { margin-top: 14px; }

  .hero { align-items: flex-start; }
  .hero-content { padding-top: 120px; }
  .hero-actions .btn { flex: 1 1 100%; max-width: 320px; }
  .hero-overlay { background: linear-gradient(180deg, rgba(0, 90, 200, .25) 0%, rgba(0, 90, 200, 0) 50%); }

  .split, .split-reverse { grid-template-columns: 1fr; }
  
  /* A classe about-media não tem mais order: -1 aqui, então ela cai pro final da grid naturalmente */
  .about-media img { max-width: 300px; }
  
  /* A classe why-media recebe order: 1 para ser forçada a ficar embaixo do texto */
  .why-media { max-height: 460px; aspect-ratio: 4 / 5; order: 1; }
  
  .split-text .btn { width: 100%; }

  .services { border-radius: 28px 28px 0 0; }
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .card { min-height: 280px; }
  .services-cta .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================
   ===== FINAL CTA SECTION ===== 
   ========================================= */

/* Estilo do botão secundário azul */
.btn-outline-blue { 
  background: transparent; 
  color: var(--blue); 
  border-color: var(--blue); 
}
.btn-outline-blue:hover, 
.btn-outline-blue:focus-visible {
  background: var(--blue);
  color: var(--white);
}

/* Espaçamentos e Tipografia do bloco */
.final-cta { 
  background: var(--white); 
  color: var(--blue); 
  padding-bottom: clamp(80px, 12vw, 160px); 
}
.final-cta-content { 
  max-width: 860px; 
  margin-bottom: clamp(32px, 5vw, 48px); 
}
.final-cta-content h2 { 
  font-size: clamp(2.4rem, 5vw, 4.2rem); 
  margin-bottom: 18px; 
  letter-spacing: -1px; 
  line-height: 1.1;
}
.final-cta-content p { 
  font-size: clamp(1rem, 2vw, 1.25rem); 
  margin-bottom: 32px; 
  opacity: 0.9; 
  max-width: 700px; 
}
.final-cta-actions { 
  display: flex; 
  gap: 14px; 
  flex-wrap: wrap; 
}

/* Grid: Imagem e Mapa lado a lado */
.final-cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 32px);
}

/* Estilização da caixa da imagem e do mapa */
.final-cta-media, 
.final-cta-map {
  width: 100%;
  border-radius: clamp(20px, 4vw, 36px); 
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(29, 40, 109, 0.15); 
  aspect-ratio: 4 / 3; /* Proporção ideal para Desktop */
  position: relative;
  transform: translateZ(0); /* Evita falhas visuais na borda arredondada */
}

/* Configurações internas do Iframe e das Imagens */
.final-cta-media picture,
.final-cta-media img,
.final-cta-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Garante que o homem limpando a piscina não fique cortado no desktop */
  object-position: 25% center; 
}

.final-cta-media img { 
  transition: transform 1.5s var(--ease); 
}
.final-cta-media:hover img { 
  transform: scale(1.03); 
}

/* ===== RESPONSIVIDADE MOBILE DA SEÇÃO ===== */
@media (max-width: 768px) {
  /* Botões passam a ocupar 100% no celular */
  .final-cta-actions .btn { 
    width: 100%; 
  }
  
  /* Quebra as duas colunas para ficarem uma embaixo da outra */
  .final-cta-grid {
    grid-template-columns: 1fr;
  }
  
  /* Inversão da ordem: Mapa sobe, Imagem desce */
  .final-cta-map {
    order: 1; 
  }
  .final-cta-media {
    order: 2; 
  }
  
  /* Retorna a foto para o centro exato no celular */
  .final-cta-media img {
    object-position: center; 
  }
  
  /* Deixa as caixas um pouco mais verticais no celular para preencher a tela */
  .final-cta-media, 
  .final-cta-map {
    aspect-ratio: 4 / 5; 
  }
}

/* Agrupamento dos botões no About Us (Desktop e base) */
.about-actions {
  display: flex !important; /* Previne que a classe reveal quebre o flexbox */
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap; 
}

/* O botão de texto restaura seu tamanho original e não estica no desktop */
.about-actions .btn {
  flex: none;
  width: auto;
  margin-top: 0;
  padding: 14px 30px !important; /* Garante a largura gordinha e original do botão */
}

/* Estilo do botão circular para ícones */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Impede que os botões amassem */
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  transition: background-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}

.btn-icon:hover, 
.btn-icon:focus-visible {
  background: var(--sky);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 138, 255, .35);
  color: var(--white);
}

/* =========================================
   MOBILE - COMPORTAMENTO ESPECÍFICO
   ========================================= */
@media (max-width: 768px) {
  /* Força a mesma linha */
  .about-actions {
    flex-wrap: nowrap;
    width: 100%;
  }
  
  /* O Contact Us expande para preencher o espaço que sobra */
  .about-actions .btn { 
    flex: 1; 
    width: auto;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  
  /* Outros botões isolados continuam com 100% (ex: Why Choose) */
  .split-text > .btn { width: 100%; }
}

@media (max-width: 768px) {
  .reveal-right { transform: translateY(32px); }
  .reveal.is-visible { transform: none; }
}

@supports not (overflow: clip) {
  html, .about { overflow-x: hidden; }
}