/* ==========================================================================
   Laudo Pro — Responsividade global
   Mobile · Tablet · Desktop · TV · safe areas
   ========================================================================== */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

.container {
  width: min(var(--container), calc(100% - clamp(1rem, 4vw, 2.5rem)));
}

/* Evita estouro em grids e flex */
.split > *,
.comparison-split > *,
.hiw-flow > *,
.hiw-pains > *,
.diferenciais-benefits > *,
.testimonials-grid > *,
.sst-docs-grid > *,
.trust-grid > *,
.grid-2 > *,
.grid-3 > *,
.grid-4 > *,
.whatsapp-grid > *,
.footer-grid > * {
  min-width: 0;
}

/* Vídeos em containers com aspect-ratio */
.whatsapp-media video,
.comparison-media video {
  height: 100%;
  max-height: none;
}

/* ─── Telas grandes / TV ─── */

@media (min-width: 1440px) {
  :root {
    --container: min(1280px, 88vw);
    --section-py: clamp(3rem, 5vw, 5rem);
  }
}

@media (min-width: 1920px) {
  :root {
    --container: min(1400px, 82vw);
    --text-lead: 1rem;
    --text-body: 0.9375rem;
    --text-sm: 0.875rem;
  }

  .hero-slider {
    max-height: 920px;
  }

  .hero-slide-inner {
    max-width: min(1440px, 92vw);
  }
}

@media (min-width: 2560px) {
  :root {
    --container: 1600px;
  }

  .hero-slider {
    max-height: 1080px;
  }
}

/* ─── Celulares pequenos ─── */

@media (max-width: 374px) {
  :root {
    --nav-height: 72px;
  }

  .navbar-logo {
    width: 158px;
  }

  .navbar-logo img {
    height: 30px;
    max-width: 158px;
  }

  .mobile-menu-header img {
    max-width: 148px;
    height: auto;
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .sst-docs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
  }

  .sst-doc-card {
    padding: 1rem 0.625rem;
  }

  .sst-doc-card__desc {
    font-size: 0.6875rem;
  }

  .comparison-header > div,
  .comparison-row > div {
    padding: 0.75rem 0.875rem;
  }

  .testimonial-card blockquote {
    font-size: 0.8125rem;
  }
}

/* ─── Mobile (até 639px) ─── */

@media (max-width: 639px) {
  section {
    padding-block: clamp(2rem, 6vw, 3rem);
  }

  .section-header h2,
  #camadas-sst-title,
  #documentos-sst-title {
    font-size: clamp(1.25rem, 5.2vw, 1.625rem);
    line-height: 1.22;
  }

  .section-header p,
  .split-content > p {
    font-size: var(--text-body);
  }

  .split-content {
    max-width: none;
  }

  .split-visual img {
    max-height: min(320px, 55vw);
  }

  .split--trust .split-visual img {
    max-height: min(380px, 62vw);
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .diferenciais-benefits {
    grid-template-columns: 1fr;
  }

  .cta-final .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-final .btn {
    width: 100%;
  }

  .footer-grid,
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-nav {
    justify-content: center;
    gap: 1rem 1.25rem;
  }

  .comparison-split {
    grid-template-columns: 1fr;
  }

  .comparison-media {
    max-width: min(100%, 15.5rem);
    max-height: none;
    height: auto;
    aspect-ratio: 9 / 16;
    margin-inline: auto;
    position: static;
  }

  .disclaimer {
    flex-direction: column;
    gap: 0.625rem;
  }

  .hiw-pains-block__intro {
    font-size: 0.8125rem;
  }

  .hiw-bridge {
    font-size: 0.8125rem;
    padding-inline: 0.25rem;
  }

  .op-flow__node {
    width: min(112px, 24vw);
  }

  .op-flow__node-label {
    font-size: 0.625rem;
  }

  .op-flow__story {
    min-height: 10.5rem;
  }

  .op-flow__panel h3 {
    font-size: 1rem;
  }

  .op-flow__track-wrap::after {
    content: 'Deslize para ver as etapas →';
    display: block;
    text-align: center;
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 0.375rem;
  }
}

/* ─── Tablet (640px – 1023px) ─── */

@media (min-width: 640px) and (max-width: 1023px) {
  .whatsapp-grid {
    grid-template-columns: 1fr;
  }

  .whatsapp-media {
    order: -1;
    max-width: min(100%, 560px);
  }

  .ai-layers__figure {
    max-width: min(100%, 680px);
  }
}

@media (max-width: 1023px) {
  .hiw-flow {
    gap: 1.25rem;
  }

  .hiw-step {
    justify-self: center;
    width: min(100%, 22rem);
  }

  .hiw-step-label {
    text-align: center;
  }

  .hiw-ai-hub {
    width: 9.5rem;
    height: 9.5rem;
    margin-inline: auto;
  }

  .hiw-pains-block {
    padding: 0.875rem;
  }

  .section-navy .split-visual {
    position: static;
  }
}

/* ─── Comparativo: empilha abaixo de 960px ─── */

@media (max-width: 959px) and (min-width: 640px) {
  .comparison-split {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .comparison-media {
    max-width: min(100%, 17rem);
    margin-inline: auto;
    position: static;
  }
}

/* ─── Hero refinements ─── */

@media (max-width: 768px) {
  .hero-slider > .navbar .navbar-logo,
  .hero-navbar .navbar-logo {
    width: 180px;
    height: 32px;
  }

  .hero-slider > .navbar .navbar-logo img,
  .hero-navbar .navbar-logo img {
    height: 32px;
    max-width: 180px;
  }

  .hero-slide-inner {
    padding-inline: clamp(1rem, 4vw, 1.5rem);
  }
}

@media (max-width: 480px) {
  .hero-slide-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-slide-cta .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .hero-features--4 {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .hero-kpi-row {
    flex-wrap: wrap;
    gap: 0.625rem;
  }
}

/* Textos de interação — desktop vs touch */

.hint-touch {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .hint-desktop {
    display: none;
  }

  .hint-touch {
    display: inline;
  }

  .op-flow__autoplay {
    font-size: 0.6875rem;
  }
}

/* Tablet — splits e comparativo empilhados */

@media (max-width: 1023px) {
  .split--personalizacao .split-visual {
    order: -1;
  }

  .split--trust .split-visual {
    order: -1;
  }
}

/* ─── Landscape / celular deitado ─── */

@media (max-height: 520px) and (orientation: landscape) {
  .hero-slider {
    min-height: 100svh;
    height: auto;
  }

  .hero-slide-inner {
    min-height: 100svh;
    align-items: center;
    padding-bottom: 3rem;
  }

  .mobile-menu-panel {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  }
}

/* ─── Safe areas (notch / home indicator) ─── */

.whatsapp-float {
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  right: max(1.25rem, env(safe-area-inset-right, 0px));
}

.hero-pagination {
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
}

@media (max-width: 768px) {
  .hero-pagination {
    padding-bottom: 0;
  }
}

.mobile-menu-panel {
  padding-top: max(1.5rem, env(safe-area-inset-top, 0px));
  padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
}

/* ─── Touch / sem hover ─── */

@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .sst-doc-card:hover,
  .card--compact:hover,
  .testimonial-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .op-flow__node,
  .op-flow__btn,
  .op-flow__dot,
  .faq-question,
  .menu-toggle {
    min-height: 44px;
    min-width: 44px;
  }

  .op-flow__node {
    min-width: min(112px, 24vw);
  }
}

/* ─── Impressão ─── */

@media print {
  .whatsapp-float,
  .hero-controls,
  .hero-nav,
  .hero-pagination,
  .hero-progress,
  .menu-toggle,
  .mobile-menu,
  .op-flow__controls,
  .op-flow__autoplay {
    display: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  section {
    break-inside: avoid;
  }
}
