/* mobile-fix.css — overrides aplicados apenas em telas < 768px
   Mantém o design original em desktop, corrige bugs de layout em mobile.

   Nota: as PNGs de Sobre/Serviços/Contato têm proporção 16:9 (5880x3308)
   e o conteúdo (foto + texto) está dentro delas, então em mobile fixamos
   aspect-ratio: 16/9 nos containers pra a imagem aparecer inteira sem cortar. */

@media (max-width: 768px) {
  /* Logo gigante (w-96 = 384px) quebra em telas estreitas */
  img[src*="logo.png"] {
    width: min(70vw, 280px) !important;
    max-width: 280px;
    height: auto;
  }

  /* Menu nav: linha com wrap, fonte menor */
  nav {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.6rem 0.9rem !important;
    padding: 0 0.5rem;
    font-size: 0.72rem;
  }

  /* Header sobreposto da home (top:6 px) — empurra menu pro topo */
  body > div.absolute.top-6 {
    top: 0.75rem !important;
    left: 0 !important;
    transform: none !important;
    width: 100%;
    padding: 0 0.5rem;
  }

  /* Hero swiper — altura adaptada à tela do celular */
  .hero-swiper {
    height: 70vh !important;
    min-height: 480px;
  }

  /* Galeria Instagram — botões prev/next sem sair da tela */
  .gallery-button-prev { left: 0.25rem !important; }
  .gallery-button-next { right: 0.25rem !important; }

  /* ========== pages/sobre.html ==========
     Tem 2 blocos: <header> com Img Fundo Sobre 1 (foto Karol + bio) e
     <section> com Img Fundo Sobre 2 (foto laptop + manifesto) + CTA.
     Como o conteúdo está DENTRO das PNGs (não em HTML), forçamos cada
     bloco a ter aspect-ratio 16/9 — a PNG aparece inteira sem cortar. */

  body > header[style*="Img Fundo Sobre 1"],
  body > section[style*="Img Fundo Sobre 2"] {
    min-height: 0 !important;
    aspect-ratio: 16 / 9;
    background-size: cover !important;
    background-position: center !important;
    height: auto !important;
    padding: 0 !important;
  }

  /* O <header> ainda mostra logo + menu sobrepostos. Tira eles do header
     e empurra pro topo da página separadamente. */
  body > header[style*="Img Fundo Sobre 1"] > div {
    padding-top: 0 !important;
    height: auto !important;
    position: absolute;
    inset: 0;
    pointer-events: none;
  }
  body > header[style*="Img Fundo Sobre 1"] > div > * {
    pointer-events: auto;
  }
  body > header[style*="Img Fundo Sobre 1"] > div img[src*="logo.png"] {
    margin-top: 0.5rem;
  }

  /* CTA da segunda section: sai do absolute, vira bloco centralizado abaixo */
  body > section[style*="Img Fundo Sobre 2"] > div {
    position: relative !important;
    height: 100% !important;
  }
  body > section[style*="Img Fundo Sobre 2"] > div > div[style*="6.8cm"] {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
  }
  /* Solução: empurro o CTA pra DEPOIS da PNG, num bloco independente */
  body > section[style*="Img Fundo Sobre 2"]::after {
    content: '';
    display: block;
    height: 0;
  }
  body > section[style*="Img Fundo Sobre 2"] {
    margin-bottom: 0;
  }
  /* CTA flutuando absoluto vira flex centralizado embaixo */
  body > section[style*="Img Fundo Sobre 2"] > div > div[style*="6.8cm"] {
    position: absolute !important;
    left: 50% !important;
    bottom: 1rem !important;
    transform: translateX(-50%);
    width: max-content;
  }

  /* ========== pages/servicos.html ==========
     Mesmo esquema: 2 sections com PNG 16:9, conteúdo dentro da imagem,
     CTA absoluto na segunda. */

  body > section[style*="Servicos 1"],
  body > section[style*="Servicos 2"] {
    min-height: 0 !important;
    aspect-ratio: 16 / 9;
    background-size: cover !important;
    background-position: center !important;
    height: auto !important;
    padding: 0 !important;
  }
  body > section[style*="Servicos 2"] > div {
    position: relative !important;
    height: 100% !important;
    padding-top: 0 !important;
    min-height: 0 !important;
  }
  body > section[style*="Servicos 2"] a[style*="left: 2cm"] {
    position: absolute !important;
    left: 50% !important;
    bottom: 1rem !important;
    transform: translateX(-50%);
    width: max-content;
    padding: 0.6rem 1.2rem !important;
    font-size: 0.7rem;
  }

  /* ========== pages/contato.html ==========
     Section com PNG contato + ícones e botão WhatsApp absolutos. */

  body > section[style*="contato.png"] {
    min-height: 0 !important;
    aspect-ratio: 16 / 9;
    background-size: cover !important;
    background-position: center !important;
    height: auto !important;
  }

  /* Os ícones e o botão WhatsApp estão em divs absolutos no body
     com left:1300px etc. Tira tudo isso da tela e empilha em coluna abaixo. */
  body > div.absolute {
    position: static !important;
    inset: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 1rem !important;
    width: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }
  body > div.absolute > div.flex {
    justify-content: center !important;
    gap: 1.5rem !important;
  }
  /* Ícones de redes sociais (Instagram + Facebook) — tira do absolute */
  .contato-social {
    position: static !important;
    inset: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
  }
  /* Botão Solicite um orçamento */
  .contato-cta {
    position: static !important;
    inset: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 0 !important;
    padding: 1rem !important;
    width: 100%;
    text-align: center;
  }
  .contato-cta a {
    display: inline-block;
  }

  /* ========== pages/projetos.html ========== */
  /* Header absolute (logo + menu) — vira fluxo normal */
  body > div.absolute.top-0 {
    position: relative !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem;
  }
  /* Tira o pt-48 que foi feito pra caber o header absolute do desktop */
  section.pt-48 {
    padding-top: 1rem !important;
  }
  /* Cards com width fixo em px viram fluidos (50vw cada, em pares) */
  .rect, .sq {
    width: calc(50vw - 0.75rem) !important;
    height: calc(50vw - 0.75rem) !important;
    max-width: none;
    max-height: none;
  }
  /* .rect (rectangle horizontal) ocupa linha inteira em mobile */
  .rect {
    width: calc(100vw - 1rem) !important;
    height: calc((100vw - 1rem) * 0.55) !important;
    max-height: 220px;
  }
  /* Espaçamentos das linhas */
  section .flex.justify-center.gap-4 {
    gap: 0.5rem !important;
    flex-wrap: wrap;
  }
  section .space-y-8 > * {
    margin-top: 0.5rem !important;
  }
}

/* Telas muito pequenas (< 480px): mais ajustes */
@media (max-width: 479px) {
  img[src*="logo.png"] {
    width: 60vw !important;
    max-width: 220px;
  }
  nav {
    gap: 0.5rem 0.7rem !important;
    font-size: 0.65rem;
  }
  .hero-swiper {
    height: 60vh !important;
    min-height: 400px;
  }
}
