/* ==========================================================================
   Zander · camada única de layout (substitui os remendos de encaixe)
   Regras:
     1. Nada passa da largura da tela, em nenhum aparelho.
     2. Toda imagem tem caixa com proporção definida e recorte (object-fit).
     3. Os carrosséis do celular rolam DENTRO deles, nunca a página.
   As classes is-phone / is-tablet / is-desktop vêm de zander-dispositivo.js.
   ========================================================================== */

/* ---------- 1. trava da largura ---------- */
html, body { max-width: 100%; overflow-x: clip; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }
img, video, svg, iframe, picture { max-width: 100%; }
main, section, header, footer, .shell { min-width: 0; }

/* altura real da tela (barra do navegador do celular não corta o conteúdo) */
:root { --zd-vh: 1vh; --zd-gutter: clamp(16px, 4.5vw, 40px); }

/* ---------- 2. imagens bem encaixadas ---------- */
.product-card img,
.hm-obras img,
.hm-rv img,
.automation-image img,
.automation-image video,
.solution-card img,
#loja-online img,
#comprar-com-instalacao img,
.final-cta img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ---------- 3. hero ---------- */
.hero img { object-fit: cover; object-position: 62% center; }

/* ---------- CELULAR ---------- */
@media (max-width: 760px) {
  /* hero: ocupa a tela visível, sem crescer além dela */
  .hero {
    min-height: calc(var(--zd-vh) * 100 - 64px) !important;
    max-height: calc(var(--zd-vh) * 100 + 40px);
  }
  .hero h1 { font-size: clamp(30px, 8.6vw, 38px) !important; line-height: 1.08 !important; overflow-wrap: anywhere; }

  /* carrossel: a animação de entrada não empurra mais a página para o lado */
  .hm-m-anim.hm-m-car.hm-m-pre { translate: none !important; }
  .hm-m-car { max-width: 100vw; contain: paint; }

  /* imagens dos cartões com proporção fixa */
  #colecao .product-card,
  .hm-obras figure,
  .hm-obras .hm-obra { aspect-ratio: 4 / 5; overflow: hidden; }
  #loja-online picture, #comprar-com-instalacao picture,
  #loja-online figure, #comprar-com-instalacao figure { display: block; aspect-ratio: 4 / 3; overflow: hidden; max-width: 100%; }
  .automation-image { aspect-ratio: 4 / 3; min-height: 0 !important; height: auto !important; }

  /* loja online: título abaixo da foto, véu escurece só a base da foto */
  .hm-on-conteudo { margin-top: -56px !important; }
  .hm-on-veu {
    background: linear-gradient(180deg, rgba(7,26,45,.55) 0, rgba(7,26,45,0) 22%,
      rgba(7,26,45,0) 150px, rgba(7,26,45,.85) 235px, #071a2d 281px) !important;
  }

  /* aviso de cookies e botão do WhatsApp dentro da tela */
  .cookie-banner {
    left: 8px !important; right: 8px !important;
    width: auto !important; max-width: calc(100vw - 16px) !important;
    box-sizing: border-box;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .cookie-banner button { white-space: normal; }
  .floating-wa {
    right: calc(14px + env(safe-area-inset-right, 0px)) !important;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* textos longos e tabelas não estouram */
  h1, h2, h3, p, a, li { overflow-wrap: break-word; }
  table { display: block; max-width: 100%; overflow-x: auto; }
}

/* ---------- TABLET ---------- */
@media (min-width: 761px) and (max-width: 1100px) {
  /* menu: o do computador não cabe; usa o menu sanfona do celular */
  .header { height: 76px; }
  .site-nav {
    display: none; position: absolute; top: 76px; left: 0; right: 0; z-index: 130;
    width: 100%; height: calc(100dvh - 76px); max-height: none;
    flex-direction: column; align-items: stretch; gap: 0 !important;
    padding: 8px 28px calc(24px + env(safe-area-inset-bottom));
    background: #071a2d; border-bottom: 1px solid rgba(201,163,93,.22);
    overflow: hidden auto; overscroll-behavior: contain;
    box-shadow: rgba(3,17,30,.35) 0 20px 40px;
  }
  .site-nav.open { display: flex; }
  .nav-home-link { color: rgba(255,255,255,.86); border-bottom: 1px solid rgba(255,255,255,.1); min-height: 58px; padding: 0 9px; font-size: 16px !important; display: flex; }
  .nav-group { border-bottom: 1px solid rgba(255,255,255,.1); display: block; }
  .nav-group summary { justify-content: space-between; min-height: 58px; padding: 0 9px; font-size: 16px !important; }
  .nav-group:hover summary { background: none; }
  .mega-menu { visibility: visible; opacity: 1; box-shadow: none; background: #0a2135; border: 0; margin: 0 -28px; transition: none; display: none; position: static; transform: none; width: auto !important; }
  .nav-group:hover .mega-menu, .nav-group:focus-within .mega-menu { display: none; }
  .nav-group[open] .mega-menu, .nav-group[open]:hover .mega-menu, .nav-group[open]:focus-within .mega-menu { display: block; }
  .mega-grid, .mega-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 29px 23px; width: 100%; padding: 27px 28px 31px; }
  .mega-intro { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.1); grid-column: 1 / -1; padding: 0 0 25px; }
  .mobile-menu-cta { background: var(--gold); min-height: 54px; color: var(--navy); letter-spacing: .1em; justify-content: space-between; align-items: center; margin: 18px 9px 0; padding: 0 17px; font-size: 14px; display: flex; }
  .menu-button { display: block; }
  .menu-button span { transition: transform .2s, opacity .2s; }
  .menu-button[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
  .menu-button[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-button[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }

  /* grades: sem cartão sozinho na última linha */
  .hm-on-passos, .hm-on-prods, #colecao .product-grid { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .hm-cam-grade, .credibility-cards { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .search-paths-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  #processo .process-grid { display: flex !important; flex-wrap: wrap; justify-content: center; gap: 18px; }
  #processo .process-grid > * { flex: 0 1 calc(33.333% - 12px); min-width: 0; }

  .hero { min-height: min(78vh, 760px) !important; }
  .automation-image { aspect-ratio: 16 / 10; min-height: 0 !important; }
}

/* ---------- DESKTOP ---------- */
@media (min-width: 1101px) {
  .hero { min-height: min(88vh, 900px); }
}

/* aparelho com tela de toque: alvo de toque confortável */
.is-touch a.btn, .is-touch button { min-height: 44px; }

/* ---------- acessibilidade: quem pede menos movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  .hm-m-anim, .hm-fx, .hm-rev { transition: none !important; translate: none !important; transform: none !important; opacity: 1 !important; }
}


/* ---------- 05/11/2026 · abertura com dois caminhos do mesmo peso ----------
   "Solicitar orçamento" (visita, WhatsApp) e "Comprar online" (loja): mesmo
   tamanho, mesma altura, lado a lado no computador e empilhados no celular. */
#inicio .hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; max-width: 600px; }
#inicio .hero-actions .button { width: 100%; justify-content: space-between; white-space: nowrap; letter-spacing: 1px; padding-inline: 20px; gap: 12px; }
.button.button-loja { background: #f4f1eb; color: #0b1b28; border: 1px solid #f4f1eb; }
.button.button-loja:hover { background: #fff; border-color: #fff; }
.button.button-loja svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
@media (max-width: 760px) {
  #inicio .hero-actions { grid-template-columns: 1fr; gap: 10px; max-width: none; }
}
