/* =========================================================
   CAPITÃO DA INFORMÁTICA — Correção responsiva mobile v5.3
   Carregar DEPOIS de todos os demais arquivos CSS.
   ========================================================= */

/* Proteção geral contra estouro horizontal em navegadores móveis. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html,
  body { overflow-x: clip; }
}

/* Tablets: mantém o painel, mas sempre abaixo do conteúdo e dentro da tela. */
@media only screen and (min-width: 768px) and (max-width: 900px) {
  .hero__inner {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 52px !important;
    width: 100% !important;
    min-height: 0 !important;
    padding-block: 64px 76px !important;
  }

  .hero__content,
  .hero__visual {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .hero__visual {
    min-height: 500px !important;
    margin: 0 auto !important;
    overflow: visible !important;
  }

  .command-panel {
    width: calc(100% - 70px) !important;
    max-width: 500px !important;
    margin-inline: auto !important;
  }

  .floating-card--one {
    left: 0 !important;
    top: 82px !important;
    transform: none !important;
  }

  .floating-card--two {
    right: 0 !important;
    top: 218px !important;
    transform: none !important;
  }

  .floating-card--three {
    left: 24px !important;
    bottom: 30px !important;
    transform: none !important;
  }
}

/* Celulares: layout próprio, sem reaproveitar o painel desktop. */
@media only screen and (max-width: 767px) {
  :root {
    --mobile-gutter: 20px;
  }

  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: var(--mobile-gutter) !important;
    padding-right: var(--mobile-gutter) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .topbar {
    display: none !important;
  }

  .header {
    top: 0 !important;
    width: 100% !important;
  }

  .header__inner {
    width: 100% !important;
    height: 96px !important;
    min-height: 96px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    gap: 16px !important;
  }

  .header .brand--original {
    min-width: 0 !important;
    height: 100% !important;
    justify-content: flex-start !important;
  }

  .header .brand--original .brand__logo-original {
    width: auto !important;
    height: 86px !important;
    max-width: 126px !important;
    object-fit: contain !important;
  }

  .menu-toggle {
    display: block !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    padding: 11px !important;
  }

  .nav {
    position: fixed !important;
    top: 108px !important;
    left: 14px !important;
    right: 14px !important;
    width: auto !important;
    max-height: calc(100dvh - 124px) !important;
    overflow-y: auto !important;
    z-index: 2000 !important;
  }

  .hero {
    width: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .hero__inner {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    padding-top: 48px !important;
    padding-bottom: 58px !important;
  }

  .hero__content {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    text-align: left !important;
  }

  .eyebrow {
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-bottom: 22px !important;
  }

  .eyebrow span {
    padding: 7px 10px !important;
    font-size: .66rem !important;
    line-height: 1.3 !important;
    letter-spacing: .055em !important;
  }

  .hero h1 {
    max-width: 100% !important;
    margin: 0 !important;
    font-size: clamp(3rem, 14.5vw, 4.15rem) !important;
    line-height: .98 !important;
    letter-spacing: -.055em !important;
    overflow-wrap: normal !important;
  }

  .hero__lead {
    width: 100% !important;
    max-width: 100% !important;
    margin: 24px 0 22px !important;
    font-size: 1rem !important;
    line-height: 1.65 !important;
    text-align: left !important;
  }

  .hero__specialty {
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 13px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 26px !important;
    padding: 15px !important;
    text-align: left !important;
  }

  .hero__specialty-mark {
    min-width: 46px !important;
    width: 46px !important;
    height: 46px !important;
  }

  .hero__specialty p {
    min-width: 0 !important;
    margin: 0 !important;
    font-size: .82rem !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere !important;
  }

  .hero__specialty strong {
    font-size: .86rem !important;
  }

  .hero__actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .hero__actions .button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 56px !important;
    padding-inline: 16px !important;
    text-align: center !important;
    white-space: normal !important;
  }

  .hero__proof {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px !important;
    width: 100% !important;
    margin-top: 38px !important;
    padding-top: 26px !important;
    text-align: left !important;
  }

  .hero__proof div,
  .hero__proof strong,
  .hero__proof span {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* O painel é ilustrativo e não deve disputar espaço com a mensagem no celular. */
  .hero__visual {
    display: none !important;
  }

  .trust-strip__grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .section,
  .technology,
  .intelbras,
  .diagnostic {
    overflow-x: hidden !important;
  }

  .technology__grid,
  .intelbras__grid,
  .humanized__grid,
  .industries__grid,
  .diagnostic__grid {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    gap: 46px !important;
  }

  .technology__content,
  .technology__visual,
  .intelbras__content,
  .intelbras__visual,
  .humanized__content,
  .support-card,
  .diagnostic__content,
  .contact-form {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .tech-command {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 20px !important;
  }

  .tech-command__nodes {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .tech-command__nodes article:last-child {
    grid-column: auto !important;
    width: 100% !important;
    max-width: none !important;
  }

  .feature-grid,
  .form-row,
  .differentials-grid,
  .industries__list,
  .services-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .service-card,
  .service-card:last-child {
    grid-column: auto !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
  }

  .footer__signature,
  .footer__grid--v5 {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
  }

  .footer__signature {
    justify-items: center !important;
    gap: 24px !important;
    text-align: center !important;
  }

  .footer__signature .button--footer {
    grid-column: auto !important;
    width: 100% !important;
    max-width: 330px !important;
    justify-self: center !important;
  }

  .footer__bottom {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  /* Mantém o botão próprio pequeno para não disputar espaço com widgets externos. */
  .whatsapp-float {
    right: 12px !important;
    bottom: 12px !important;
    width: 52px !important;
    height: 52px !important;
    min-height: 52px !important;
    padding: 0 !important;
    justify-content: center !important;
  }

  .whatsapp-float span {
    display: none !important;
  }
}

@media only screen and (max-width: 390px) {
  :root { --mobile-gutter: 17px; }

  .header__inner {
    height: 90px !important;
    min-height: 90px !important;
  }

  .header .brand--original .brand__logo-original {
    height: 80px !important;
    max-width: 116px !important;
  }

  .nav { top: 102px !important; }

  .hero__inner {
    padding-top: 42px !important;
    padding-bottom: 52px !important;
  }

  .hero h1 {
    font-size: clamp(2.65rem, 14vw, 3.35rem) !important;
  }

  .hero__lead {
    font-size: .95rem !important;
  }

  .hero__specialty {
    grid-template-columns: 42px minmax(0, 1fr) !important;
    padding: 13px !important;
  }

  .hero__specialty-mark {
    min-width: 42px !important;
    width: 42px !important;
    height: 42px !important;
  }

  .hero__actions .button {
    font-size: .84rem !important;
  }
}
