/* =================================================================
   NEXRUMO - MOBILE UX ENHANCEMENTS
   Versão corrigida — sem overflow, blocos compactos
   ================================================================= */

/* ============================================
   SAFE AREA SUPPORT
   ============================================ */
:root {
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-bar-height: 68px;
}

/* ============================================
   CRÍTICO: PREVINE OVERFLOW HORIZONTAL
   (causa scroll lateral e esconde o hamburger)
   ============================================ */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* ============================================
   REMOVE HOVER STATES EM TOUCH DEVICES
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  .card:hover,
  .plan-card:hover,
  .use-case-card:hover,
  .differential-card:hover,
  .card-persona:hover {
    transform: none !important;
    box-shadow: var(--shadow-md) !important;
  }

  .btn-primary:hover:not(:disabled),
  .btn-accent:hover:not(:disabled),
  .btn-outline:hover:not(:disabled),
  .btn-secondary:hover:not(:disabled),
  .btn-whatsapp:hover:not(:disabled) {
    transform: none !important;
    box-shadow: inherit !important;
  }

  /* Feedback visual no toque */
  .btn:active:not(:disabled) {
    transform: scale(0.95) !important;
    transition: transform 80ms !important;
  }
}

/* Remove flash azul do iOS no toque */
.btn,
.accordion-header,
.faq-question,
.tab,
.screenshot-dot,
.card-persona,
.header-menu-toggle {
  -webkit-tap-highlight-color: transparent;
}

/* ============================================
   HEADER MOBILE
   ============================================ */
@media (max-width: 768px) {
  .header {
    height: var(--header-height-mobile);
  }

  /* Garante que o hamburger apareça e seja grande o suficiente */
  .header-menu-toggle {
    display: flex !important;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
  }

  .header-logo img {
    height: 40px;
  }
}

/* ============================================
   ESPAÇAMENTO SEÇÕES — MUITO REDUZIDO
   Era 80px, agora 48px
   ============================================ */
@media (max-width: 767px) {
  section {
    padding: 48px 0 !important;
  }

  /* Section headers compactos */
  section h2 {
    margin-bottom: 16px !important;
  }
}

/* ============================================
   HERO — COMPACTO E SEM OVERFLOW
   ============================================ */
@media (max-width: 767px) {
  .hero,
  .hero-empresa,
  .hero-proprietario,
  .hero-planos {
    padding-top: calc(var(--header-height-mobile) + 24px) !important;
    padding-bottom: 36px !important;
  }

  /* Reduz gap entre imagem e texto */
  .hero-container {
    gap: 20px !important;
  }

  /* Imagem do app — oculta no mobile */
  .hero-image {
    display: none !important;
  }

  /* Oculta padrão radial do hero no mobile */
  .hero::before {
    display: none !important;
  }

  /* Títulos compactos */
  .hero-content h1 {
    font-size: 24px !important;
    line-height: 30px !important;
    margin-bottom: 10px !important;
    letter-spacing: -0.01em !important;
  }

  .hero-subtitle {
    font-size: 13px !important;
    margin-bottom: 8px !important;
  }

  .hero-description {
    font-size: 14px !important;
    line-height: 1.55 !important;
    margin-bottom: 16px !important;
  }

  /* CTA Cards — sem min-height enorme */
  .hero-ctas {
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .hero-cta-card {
    min-height: unset !important;
    padding: 14px 12px !important;
    gap: 6px !important;
  }

  .hero-cta-icon {
    font-size: 22px !important;
    margin-bottom: 2px !important;
  }

  .hero-cta-title {
    font-size: 12px !important;
    font-weight: 700 !important;
  }

  .hero-cta-subtitle {
    font-size: 11px !important;
    color: var(--text-muted);
    margin-bottom: 6px;
  }

  .hero-cta-card .btn {
    font-size: 12px !important;
    padding: 7px 14px !important;
    min-height: unset !important;
  }

  /* Features em uma única linha */
  .hero-features {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 4px 8px !important;
    overflow: hidden;
  }

  .hero-feature {
    font-size: 11px !important;
    white-space: nowrap;
  }
}

/* ============================================
   TIPOGRAFIA MOBILE — ESCALA MENOR
   ============================================ */
@media (max-width: 767px) {
  h2 {
    font-size: 20px !important;
    line-height: 26px !important;
  }

  h3 {
    font-size: 17px !important;
    line-height: 22px !important;
  }

  h4 {
    font-size: 15px !important;
  }

  p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
  }

  .what-is-intro,
  .differentials-intro {
    font-size: 14px !important;
    margin-bottom: 20px !important;
  }

  /* Ícones grandes — reduzidos */
  .what-is-icon,
  .use-case-icon,
  .differential-icon {
    font-size: 28px !important;
    margin-bottom: 8px !important;
  }

  .what-is-title,
  .use-case-title,
  .differential-title {
    font-size: 14px !important;
    margin-bottom: 6px !important;
  }

  .what-is-features li {
    font-size: 12px !important;
  }
}

/* ============================================
   WHAT-IS GRID — Card horizontal no mobile
   ============================================ */
@media (max-width: 767px) {
  .what-is-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    max-width: 100% !important;
  }

  .what-is-card {
    padding: 16px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    gap: 8px 14px;
    text-align: left !important;
  }

  .what-is-icon {
    flex-shrink: 0;
    margin-bottom: 0 !important;
  }

  .what-is-title {
    flex: 1;
    min-width: 0;
  }

  /* Lista colapsível — oculta por padrão, expansível via display */
  .what-is-features {
    width: 100%;
    display: none !important;
    margin: 0;
  }

  .what-is-features.visible {
    display: block !important;
  }

  /* Botão toggle ver detalhes */
  .what-is-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: var(--font-primary);
    font-weight: var(--fw-semibold);
    -webkit-tap-highlight-color: transparent;
  }

  .what-is-toggle i {
    width: 14px;
    height: 14px;
    transition: transform 200ms ease;
  }

  .what-is-toggle.open i {
    transform: rotate(180deg);
  }

  .what-is-explanation {
    padding: 16px !important;
    margin-top: 16px !important;
  }
}

/* ============================================
   APP FEATURES — Compacto
   ============================================ */
@media (max-width: 767px) {
  .app-screenshots {
    display: none !important;
  }

  /* Com screenshots ocultas, a lista ocupa 100% */
  .app-features-container {
    grid-template-columns: 1fr !important;
  }

  .screenshot-carousel {
    touch-action: pan-y pinch-zoom;
  }

  .screenshot-dot {
    width: 10px !important;
    height: 10px !important;
  }

  .app-feature-item {
    font-size: 13px !important;
    padding: 5px 0 !important;
  }

  .app-feature-item i {
    font-size: 18px !important;
  }

  .app-features-container {
    gap: 20px !important;
  }
}

/* ============================================
   DIFFERENTIALS — Sem min-width na tabela
   (era este o causador do overflow horizontal!)
   ============================================ */
@media (max-width: 767px) {
  .comparison-table {
    font-size: 13px !important;
    /* NUNCA adicionar min-width aqui — causa overflow horizontal */
  }

  .comparison-cell {
    padding: 10px 8px !important;
    font-size: 12px;
  }

  .differentials-grid {
    gap: 10px !important;
  }

  .differential-card {
    padding: 16px !important;
  }

  .differential-description {
    font-size: 13px !important;
  }
}

/* ============================================
   PAIN POINTS — Compacto
   ============================================ */
@media (max-width: 767px) {
  .pain-item {
    padding: 12px !important;
    gap: 8px !important;
  }

  .pain-problem,
  .pain-solution {
    font-size: 13px !important;
  }

  .pain-points h2 {
    margin-bottom: 16px !important;
  }

  .persona-toggle {
    margin-bottom: 16px !important;
  }
}

/* ============================================
   USE CASES — 2 colunas no mobile (mais compacto)
   ============================================ */
@media (max-width: 767px) {
  .use-cases-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .use-case-card {
    padding: 14px 10px !important;
  }

  .use-case-description {
    font-size: 11px !important;
  }

  .use-cases h2 {
    margin-bottom: 16px !important;
  }
}

/* ============================================
   TESTIMONIALS — Compacto
   ============================================ */
@media (max-width: 767px) {
  .testimonials h2 {
    margin-bottom: 20px !important;
  }

  .testimonial-card {
    padding: 16px !important;
    gap: 12px !important;
  }

  .testimonial-quote {
    font-size: 13px !important;
  }

  .testimonial-photo {
    width: 48px !important;
    height: 48px !important;
  }

  .testimonial-name {
    font-size: 13px !important;
  }
}

/* ============================================
   PLANS PREVIEW — Compacto + Fix featured card
   ============================================ */
@media (max-width: 767px) {
  .plans-preview h2 {
    margin-bottom: 20px !important;
  }

  .plans-grid {
    gap: 20px !important;
    padding-top: 8px;
  }

  .plan-card {
    padding: 20px 16px !important;
  }

  /* Visualmente destacado SEM transform scale */
  .plan-card.featured {
    transform: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 6px 24px rgba(15, 121, 135, 0.18) !important;
    position: relative;
  }

  /* Badge no topo */
  .plan-card.featured::before {
    content: '⭐ Mais Popular';
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 9999px;
    white-space: nowrap;
    font-family: var(--font-primary);
  }

  .plan-price .price {
    font-size: 28px !important;
  }

  .plan-features {
    font-size: 13px !important;
  }
}

/* ============================================
   ROI CALCULATOR — Compacto
   ============================================ */
@media (max-width: 767px) {
  .calculator-container {
    padding: 14px 12px !important;
  }

  .calculator-input-group {
    margin-bottom: 14px !important;
  }

  .calculator-input-group label {
    font-size: 13px !important;
    margin-bottom: 6px !important;
  }

  .calculator-value {
    font-size: 18px !important;
    margin-top: 6px !important;
  }

  .calculator-result {
    padding: 12px !important;
    margin-top: 14px !important;
  }

  .calculator-result-title {
    font-size: 12px !important;
    margin-bottom: 6px !important;
  }

  .calculator-result-value {
    font-size: 26px !important;
    margin-bottom: 2px !important;
  }

  .calculator-result-subtitle {
    font-size: 11px !important;
    margin-bottom: 12px !important;
  }

  .calculator-slider::-webkit-slider-thumb {
    width: 24px !important;
    height: 24px !important;
  }

  .calculator-slider::-moz-range-thumb {
    width: 24px !important;
    height: 24px !important;
  }
}

/* ============================================
   FAQ — Compacto
   ============================================ */
@media (max-width: 767px) {
  .faq-question,
  .accordion-header {
    padding: 14px 16px !important;
    font-size: 14px !important;
    line-height: 1.4;
    min-height: 52px;
  }

  .accordion-content,
  .faq-answer .accordion-content {
    font-size: 13px !important;
    padding: 0 16px 14px !important;
    line-height: 1.6;
  }
}

/* ============================================
   TOUCH TARGETS MÍNIMOS (44px)
   ============================================ */
@media (max-width: 767px) {
  .btn {
    min-height: 44px;
    font-size: 14px;
  }

  .btn-sm {
    min-height: 38px;
    padding: 8px 16px;
    font-size: 13px;
  }

  .btn-lg {
    min-height: 50px;
  }

  .form-control {
    min-height: 48px;
    font-size: 16px !important;
  }

  select.form-control,
  select {
    font-size: 16px !important;
  }

  .modal-close {
    width: 44px !important;
    height: 44px !important;
  }
}

/* ============================================
   WHATSAPP FLOAT — Reposicionar acima da bottom bar
   ============================================ */
@media (max-width: 767px) {
  .whatsapp-float {
    bottom: calc(16px + var(--safe-area-bottom)) !important;
    right: 16px !important;
    width: 48px !important;
    height: 48px !important;
    font-size: 24px !important;
  }
}

/* ============================================
   FOOTER — Padding mobile
   ============================================ */
@media (max-width: 767px) {
  .footer-social a {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ============================================
   MODAL — Bottom Sheet
   ============================================ */
@media (max-width: 767px) {
  .modal.active {
    align-items: flex-end !important;
  }

  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 12px 16px !important;
    padding-bottom: calc(20px + var(--safe-area-bottom)) !important;
    animation: nexrumoSlideUp 300ms ease-out !important;
  }

  .modal-content::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 9999px;
    margin: 0 auto 16px;
  }
}

@keyframes nexrumoSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   MOBILE NAV CTA BUTTON
   ============================================ */

.mobile-nav-cta {
  display: none;
}

@media (max-width: 767px) {
  .mobile-nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 700;
    white-space: nowrap;
    border-radius: 6px !important;
    height: 34px;
    margin-right: 4px;
    flex-shrink: 0;
  }
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */

.scroll-to-top-btn {
  position: fixed;
  left: 16px;
  right: auto;
  bottom: calc(16px + var(--safe-area-bottom));
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 121, 135, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 250ms ease, transform 250ms ease, visibility 250ms ease;
  z-index: 1030;
  -webkit-tap-highlight-color: transparent;
}

.scroll-to-top-btn.stt-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top-btn:active {
  transform: scale(0.88) !important;
}

@media (min-width: 768px) {
  .scroll-to-top-btn {
    left: 24px;
    right: auto;
    bottom: 24px;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

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

/* ============================================
   FOCUS VISIBLE — Acessibilidade
   ============================================ */

:focus-visible {
  outline: 3px solid var(--primary) !important;
  outline-offset: 3px;
  border-radius: 4px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================
   WHAT-IS TOGGLE — Desktop oculta botão
   ============================================ */
@media (min-width: 768px) {
  .what-is-toggle { display: none; }
}

/* ============================================
   SHOW MORE PATTERN GLOBAL
   Cards/itens ocultos e botão de expansão
   ============================================ */
@media (max-width: 767px) {
  /* Itens ocultos por padrão */
  .pain-hidden,
  .card-hidden,
  .feature-hidden {
    display: none !important;
  }

  /* Wrapper do botão show-more */
  .show-more-wrapper {
    text-align: center;
    margin-top: var(--space-4);
  }

  .show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
  }

  .show-more-btn i {
    width: 16px;
    height: 16px;
    transition: transform 200ms ease;
    flex-shrink: 0;
  }

  .show-more-btn.expanded i {
    transform: rotate(180deg);
  }
}

/* Desktop: o @media (max-width: 767px) não se aplica aqui —
   elementos mostram com seu display natural.
   Apenas esconde o botão show-more no desktop. */
@media (min-width: 768px) {
  .show-more-wrapper {
    display: none;
  }
}

/* Revealed: .pain-card-pf e .diferencial-card são flex */
@media (max-width: 767px) {
  .pain-hidden.revealed {
    display: grid !important; /* pain-card-pf usa grid internamente */
  }

  .card-hidden.revealed {
    display: block !important;
  }

  .feature-hidden.revealed {
    display: block !important;
  }
}

/* ============================================
   PLAN SHOW-MORE (index.html plan cards)
   Mesmo padrão de planos.css mas global
   ============================================ */
@media (max-width: 767px) {
  .feature-truncated {
    display: none !important;
  }

  .feature-truncated.shown {
    display: flex !important;
  }

  ul.feature-truncated.shown,
  div.feature-truncated.shown {
    display: block !important;
  }

  .plan-show-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
    margin: 6px 0;
    font-family: var(--font-primary);
    font-weight: var(--fw-medium);
    -webkit-tap-highlight-color: transparent;
  }

  .plan-show-more i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }
}

@media (min-width: 768px) {
  .plan-show-more {
    display: none;
  }
}

/* ============================================
   BENEFITS SECTION — Compacto
   ============================================ */
@media (max-width: 767px) {
  .benefits-grid-vertical {
    gap: 14px !important;
  }

  .benefit-card {
    padding: 14px !important;
  }

  .benefit-header {
    gap: 10px !important;
    margin-bottom: 12px !important;
    grid-template-columns: auto 1fr !important; /* remove highlight column */
  }

  .benefit-highlight {
    display: none !important;
  }

  .benefit-icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 20px !important;
  }

  .benefit-title {
    font-size: 14px !important;
  }

  .benefit-description {
    font-size: 12px !important;
  }

  .benefit-categories {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
  }

  .category-item {
    font-size: 12px !important;
    padding: 6px 8px !important;
    gap: 5px !important;
  }

  .category-item i {
    font-size: 16px !important;
  }

  /* Categorias ocultas por padrão */
  .category-hidden {
    display: none !important;
  }

  .category-hidden.revealed {
    display: flex !important;
  }

  .benefit-impact {
    font-size: 12px !important;
    padding: 8px !important;
    margin-bottom: 10px !important;
  }

  .benefit-impact i {
    font-size: 16px !important;
  }

  /* Indicação card */
  .indication-content-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .indication-tiers {
    gap: 6px !important;
  }

  .tier-item {
    padding: 10px !important;
  }

  .tier-period {
    font-size: 12px !important;
  }

  .tier-discount {
    font-size: 18px !important;
  }

  .tier-description {
    font-size: 11px !important;
  }

  .tier-divider {
    display: none !important;
  }

  .indication-tiers {
    display: flex !important;
    gap: 8px !important;
  }

  .example-title {
    font-size: 12px !important;
    margin-bottom: 8px !important;
  }

  .example-number {
    font-size: 20px !important;
    width: 36px !important;
    height: 36px !important;
  }

  .example-item {
    padding: 6px 10px !important;
    gap: 8px !important;
  }

  /* Process steps — horizontal */
  .process-steps {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }

  .process-step {
    flex: 1;
    text-align: center;
    max-width: 80px;
  }

  .step-number {
    width: 26px !important;
    height: 26px !important;
    font-size: 12px !important;
    margin: 0 auto 4px !important;
  }

  .step-text {
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  .process-arrow {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0;
    margin-top: 6px;
    color: var(--text-muted);
    transform: none !important; /* override rotate(90deg) do home.css */
  }

  .process-title {
    font-size: 13px !important;
    margin-bottom: 8px !important;
    font-weight: var(--fw-semibold);
  }

  .indication-process {
    padding: 12px !important;
    margin-top: 10px !important;
  }
}

/* ============================================
   COMO FUNCIONA — Círculos compactos no mobile
   ============================================ */
@media (max-width: 767px) {
  .cf-step {
    grid-template-columns: 52px 1fr !important;
    gap: 12px !important;
    margin-bottom: 24px !important;
  }

  .cf-circle {
    width: 44px !important;
    height: 44px !important;
    font-size: 18px !important;
  }

  .cf-steps-container ul {
    font-size: 13px !important;
    padding-left: 16px !important;
  }
}

/* ============================================
   FOOTER — Muito mais compacto
   ============================================ */
@media (max-width: 767px) {
  .footer {
    padding-top: 24px !important;
  }

  .footer-main {
    gap: 20px !important;
    margin-bottom: 16px !important;
    padding-bottom: 16px !important;
  }

  .footer-logo img {
    height: 36px !important;
    margin-bottom: 8px !important;
  }

  .footer-description {
    font-size: 12px !important;
    line-height: 1.5 !important;
    margin-bottom: 8px !important;
  }

  .footer-column h4 {
    font-size: 13px !important;
    margin-bottom: 8px !important;
  }

  .footer-links li {
    margin-bottom: 4px !important;
  }

  .footer-links a {
    font-size: 12px !important;
  }

  .footer-contact li {
    font-size: 12px !important;
    margin-bottom: 4px !important;
  }

  .footer-social {
    margin-top: 10px !important;
    gap: 8px !important;
  }

  .footer-social a {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
  }

  .footer-bottom {
    gap: 6px !important;
  }

  .footer-copyright {
    font-size: 11px !important;
  }

  .footer-legal {
    gap: 8px !important;
  }

  .footer-legal a {
    font-size: 11px !important;
  }

  .footer-badges {
    gap: 6px !important;
  }

  .footer-badge {
    font-size: 10px !important;
    padding: 4px 8px !important;
  }
}
