/* ==========================================================================
   INSTITUTO REVIVER: MOBILE ADAPTIVE ENGINE
   Otimização Extrema para Smartphones (360px, 375px, 390px, 414px)
   Sem rolagem horizontal, toque com polegar de 48px+, enquadramento fotorrealista
   ========================================================================== */

/* Prevenção Absoluta de Rolagem Horizontal sem quebrar position: sticky */
html, body {
  max-width: 100vw;
  overflow-x: clip;
  position: relative;
}

@media (max-width: 768px) {
  /* Container e Espaçamentos Proporcionais ao Toque */
  .container {
    padding: 0 1.4rem;
  }

  .section {
    padding: 5.5rem 0;
  }

  .section-tight {
    padding: 4rem 0;
  }

  /* Títulos e Tipografia com Escala Fluida Adaptada */
  h1 {
    font-size: clamp(2.3rem, 7.8vw, 3rem);
    line-height: 1.14;
    letter-spacing: -0.015em;
  }

  h2 {
    font-size: clamp(1.85rem, 6vw, 2.4rem);
    line-height: 1.18;
  }

  h3 {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
  }

  p {
    font-size: 0.98rem;
    line-height: 1.75;
  }

  p.lead {
    font-size: 1.15rem;
    line-height: 1.65;
  }

  /* Barra Utilitária Superior Oculta no Mobile para Economizar Viewport */
  .top-utility-bar {
    display: none;
  }

  /* Header com Altura Compacta e Limpa */
  .site-header {
    height: 72px;
  }

  .header-container {
    padding: 0 1.4rem;
  }

  .brand-logo {
    height: 40px;
  }

  .header-actions .btn {
    display: none;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
  }

  /* Menu Drawer Mobile em Tela Cheia Agradável */
  .mobile-drawer {
    max-width: 100%;
    width: 100%;
    padding: 5.5rem 1.6rem 2.5rem;
  }

  .mobile-nav-link,
  .mobile-submenu-toggle {
    font-size: 1.55rem;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .mobile-submenu-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 0.96rem;
  }

  /* Hero Scrollytelling Adaptado ao Mobile */
  .hero-scrollytelling {
    height: 200vh; /* Scroll confortável no mobile sem cansar o dedo */
    margin-bottom: 0 !important;
  }

  .hero-content-wrapper {
    padding: 0 1.5rem;
  }

  .hero-pure-content {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-editorial-split {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .hero-editorial-split .hero-title,
  .hero-editorial-split .hero-description {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-editorial-split .hero-title {
    margin-bottom: 1.2rem;
  }

  /* Espaço de respiro nas laterais do texto do Hero no mobile */
  .hero-pure-content .hero-description,
  .hero-description {
    font-size: clamp(0.92rem, 3.8vw, 1.02rem);
    line-height: 1.68;
    margin: 0 auto 1.85rem;
    padding: 0 1.5rem; /* Margem de respiro nas laterais do texto */
    max-width: 440px;
    box-sizing: border-box;
  }

  .hero-editorial-split .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.9rem;
  }

  /* Respiro nas laterais e redução do tamanho dos botões no mobile */
  .hero-pure-content .hero-actions,
  .hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 280px; /* Limita a largura do container gerando espaço de respiro nas laterais */
    margin: 0 auto;
    gap: 0.75rem;
    padding: 0;
    box-sizing: border-box;
  }

  .hero-actions .btn,
  .hero-actions .btn.btn-lg {
    width: 100%;
    max-width: 250px; /* Reduz tamanho dos botões em relação à largura da tela */
    min-height: 44px; /* Reduz altura de 52px para 44px */
    padding: 0.72rem 1.35rem; /* Menor padding interno */
    font-size: 0.74rem; /* Tipografia mais delicada e proporcional */
    letter-spacing: 0.12em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hero-visual-frame {
    width: 100%;
    height: 280px;
    border-radius: var(--radius-md);
  }

  .hero-scroll-indicator {
    bottom: 1.8rem;
  }

  /* Seção 02: Apresentação */
  .intro-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .intro-main-image {
    height: 380px;
    border-radius: var(--radius-md);
  }

  /* Seção 03: Especialidades */
  .specialties-featured-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
  }

  .specialty-pillar-card {
    border-radius: var(--radius-md);
  }

  .specialty-pillar-visual {
    height: 200px;
  }

  .specialty-pillar-content {
    padding: 2rem 1.4rem;
  }

  .specialties-catalog-panel {
    padding: 2.2rem 1.4rem;
    border-radius: var(--radius-md);
  }

  .catalog-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .catalog-item {
    min-height: 50px;
    padding: 0.85rem 0;
  }

  .catalog-item-name {
    font-size: 1.15rem;
  }

  /* Seção 04: Tecnologias */
  .tech-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
    margin-top: 2.5rem;
  }

  .tech-card {
    border-radius: var(--radius-md);
  }

  .tech-image-wrapper {
    height: 210px;
  }

  .tech-content {
    padding: 1.6rem 1.4rem;
  }

  /* Seção 05: Corpo Clínico */
  .doctors-editorial-container {
    gap: 3.5rem;
    margin-top: 3rem;
  }

  .doctor-editorial-row,
  .doctor-editorial-row.reverse {
    grid-template-columns: 1fr;
    padding: 1.8rem 1.4rem;
    gap: 2rem;
    border-radius: var(--radius-md);
  }

  .doctor-editorial-row.reverse .doctor-editorial-portrait {
    order: 1;
  }

  .doctor-editorial-row.reverse .doctor-editorial-bio {
    order: 2;
  }

  .doctor-editorial-portrait {
    height: 380px;
    border-radius: var(--radius-md);
  }

  .doctor-editorial-bio h3 {
    font-size: 2rem;
  }

  .doctor-editorial-quote {
    font-size: 1.3rem;
    padding-left: 1rem;
    margin-bottom: 1.2rem;
  }

  .doctor-editorial-bio .btn {
    width: 100%;
    min-height: 50px;
  }

  /* Seção 07: CTA Final */
  .section-dark .hero-actions,
  #cta-final .hero-actions,
  #cta-final div[style*="display: flex;"] {
    flex-direction: column;
    width: 100%;
  }

  #cta-final .btn {
    width: 100%;
    min-height: 52px;
  }

  /* Rodapé no Mobile */
  .site-footer {
    padding: 5rem 0 2rem;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-bottom: 3rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-credit {
    font-size: 0.72rem;
    gap: 0.45rem;
    padding-top: 1.1rem;
    margin-top: 1.1rem;
    justify-content: center;
  }

  .footer-credit-text {
    font-size: 0.72rem;
  }

  .footer-ajprime-logo {
    height: 18px;
  }

  /* Botão Flutuante de WhatsApp */
  .whatsapp-floating {
    bottom: 1.4rem;
    right: 1.4rem;
    width: 52px;
    height: 52px;
  }

  .whatsapp-floating::before {
    display: none; /* Tooltip oculto no mobile para não atrapalhar o toque */
  }
}

/* Ajustes Específicos para Telas Ultra-Estreitas (360px e 390px) */
@media (max-width: 390px) {
  .container {
    padding: 0 1.15rem;
  }

  .header-container {
    padding: 0 1.15rem;
  }

  .brand-logo {
    height: 36px;
  }

  h1 {
    font-size: 2.15rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.35rem;
  }

  .hero-visual-frame {
    height: 240px;
  }

  .intro-main-image {
    height: 320px;
  }

  .doctor-editorial-portrait {
    height: 340px;
  }

  .btn-lg {
    padding: 1rem 1.6rem;
    font-size: 0.78rem;
  }

  .btn {
    padding: 0.9rem 1.4rem;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
  }

  .hero-pure-content .hero-description,
  .hero-description {
    padding: 0 1.25rem;
    font-size: 0.92rem;
    line-height: 1.62;
    margin-bottom: 1.65rem;
  }

  .hero-actions .btn,
  .hero-actions .btn.btn-lg {
    max-width: 240px;
    min-height: 42px;
    padding: 0.68rem 1.2rem;
    font-size: 0.72rem;
  }

  .specialty-pillar-content,
  .tech-content,
  .doctor-editorial-row,
  .specialties-catalog-panel {
    padding: 1.6rem 1.15rem;
  }

  .catalog-item-name {
    font-size: 1.05rem;
  }
}
