/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVO GLOBAL — Reescrito para não quebrar componentes
   Sem wildcards agressivos. Cada regra é cirúrgica.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Garantir que nada transborde ──────────────────────── */
html, body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ── Visibilidade responsive ───────────────────────────── */
.desktop-only { display: block; }
.mobile-only  { display: none; }
.show-mobile  { display: none; }
.hide-mobile  { display: flex; }

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT: max-width 768px (Tablets)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* ── Navbar ──────────────────────────────────────────── */
  .nav-links { display: none !important; }
  .hamburger, .show-mobile { display: flex !important; }
  .hide-mobile { display: none !important; }
  .desktop-only { display: none !important; }
  .mobile-only  { display: block !important; }
  .nav-bar { padding: 0 14px; height: 48px; }
  .logo-text { font-size: 14px; }

  /* ── Hero ────────────────────────────────────────────── */
  .hero { padding-top: 0; padding-bottom: 48px; min-height: auto; }
  .hero-title { font-size: 2rem; }
  .hero-sub { font-size: 15px; }
  .hero-badge { font-size: 12px; padding: 4px 12px; }
  .hero-stats { gap: 16px; }
  .hstat strong { font-size: 20px; }
  .hero-input-wrap { max-width: 100%; }
  .hero-cta-row { flex-direction: column; max-width: 100%; }
  .hero-cta-row .btn { width: 100%; border-radius: 50px; }

  /* ── Platform carousel ───────────────────────────────── */
  .platform-carousel-wrap { gap: 10px; }
  .plat-slide-icon { width: 60px; height: 60px; }
  .plat-slide-icon img, .plat-slide-icon svg { width: 36px; height: 36px; }
  .carousel-arrow { width: 36px; height: 36px; font-size: 15px; }
  .plat-slide-name { font-size: 11px; }

  /* ── Grids → 2 colunas ───────────────────────────────── */
  .services-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .why-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

  /* ── Steps → horizontal cards stacked ─────────────────── */
  .steps-row { flex-direction: column; gap: 12px; }
  .step-arrow { display: none; }
  .step-card {
    display: flex; align-items: center; gap: 16px;
    text-align: left; padding: 18px 20px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid rgba(124,58,237,.15);
  }
  .step-card:hover { transform: none; }
  .step-num {
    width: 36px; height: 36px; font-size: 14px;
    margin: 0; flex-shrink: 0;
  }
  .step-icon { font-size: 22px; margin: 0; flex-shrink: 0; }
  .step-card h3 { font-size: 14px; margin-bottom: 2px; }
  .step-card p { font-size: 12px; line-height: 1.4; }

  /* ── Container ───────────────────────────────────────── */
  .container { padding: 0 16px; }

  /* ── Sections ────────────────────────────────────────── */
  .section { padding: 48px 0; }
  .section-header h2 { font-size: 1.6rem; }
  .big-stat strong { font-size: 32px; }

  /* ── CTA ──────────────────────────────────────────────── */
  .cta-card { padding: 32px 20px; }
  .cta-card h2 { font-size: 1.6rem; }
  .cta-btns { flex-direction: column; align-items: stretch; }

  /* ── Footer ──────────────────────────────────────────── */
  .footer-trust { gap: 6px; }
  .footer-links { gap: 12px; }

  /* ── Panel layout (Dashboard/Orders) ─────────────────── */
  .sidebar:not(.admin-sidebar) {
    position: fixed; left: -100%; top: 0; width: 260px;
    height: 100vh; background: var(--surface);
    z-index: 1000; transition: left 0.3s ease;
    overflow-y: auto;
  }
  .sidebar:not(.admin-sidebar).open { left: 0; }
  .mobile-sidebar-btn { display: block !important; }
  .panel-main { margin-left: 0 !important; padding: 14px 14px 20px; }
  .panel-header { padding-left: 44px; }
  .panel-header { flex-direction: column; gap: 10px; }
  .panel-header h1 { font-size: 20px; }

  /* ── Tabelas ─────────────────────────────────────────── */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 400px; }

  /* ── Auth pages ──────────────────────────────────────── */
  .auth-card { padding: 28px 20px; }

  /* ── Guarantee ───────────────────────────────────────── */
  .guarantee-band { padding: 48px 0; }
  .guarantee-inner h2 { font-size: 1.5rem; }

  /* ── Program grid ────────────────────────────────────── */
  .program-compare { grid-template-columns: 1fr; }
  .prog-diff { grid-template-columns: 1fr; gap: 12px; }
  .prog-diff-vs { justify-self: center; }

  /* ── Testimonials ────────────────────────────────────── */
  .t-card { min-width: 260px !important; max-width: 260px !important; padding: 18px !important; }
}

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT: max-width 480px (Smartphones)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  /* ── Promo bar ───────────────────────────────────────── */
  .promo-bar { padding: 5px 32px 5px 10px; gap: 6px; flex-direction: row !important; flex-wrap: wrap !important; justify-content: center !important; }
  .promo-text { font-size: 11px; flex: 1 1 100%; text-align: center; line-height: 1.3; }
  .promo-unit { min-width: 26px; padding: 2px 4px; }
  .promo-unit span { font-size: 11px; }
  .promo-unit small { font-size: 6px; }
  .promo-close { position: absolute !important; right: 6px !important; top: 6px !important; }
  .co-promo { font-size: 11px; padding: 5px 10px; flex-wrap: nowrap; }
  .co-promo-timer { font-size: 11px; }

  /* ── Navbar ──────────────────────────────────────────── */
  .nav-bar { padding: 0 10px; height: 44px; }
  .logo-text { font-size: 14px; }
  .logo-img { width: 26px; height: 26px; }
  .theme-btn { width: 30px; height: 30px; font-size: 13px; }
  .mobile-menu a { padding: 10px 12px; font-size: 14px; }

  /* ── Hero ────────────────────────────────────────────── */
  .hero { padding-bottom: 36px; }
  .hero-title { font-size: 1.6rem; }
  .hero-sub { font-size: 14px; margin-bottom: 20px; }
  .hero-badge { font-size: 11px; padding: 4px 10px; text-align: center; line-height: 1.4; }
  .hero-stats { gap: 12px; justify-content: center; }
  .hstat strong { font-size: 18px; }
  .hstat span { font-size: 11px; }
  .stat-sep { height: 28px; }
  .trust-row { gap: 10px; justify-content: center; }
  .trust-row span { font-size: 11px; }
  .hero-input-wrap { padding: 4px 4px 4px 14px; }
  .hero-input { font-size: 14px; }

  /* ── Platform carousel ───────────────────────────────── */
  .platform-carousel-wrap { gap: 6px; margin: 18px 0 0; }
  .plat-slide-icon { width: 52px; height: 52px; border-radius: 14px; }
  .plat-slide-icon img, .plat-slide-icon svg { width: 32px; height: 32px; }
  .carousel-arrow { width: 32px; height: 32px; font-size: 14px; }
  .plat-slide-name { font-size: 10px; }
  .plat-slide { transform: scale(.75); }
  .plat-slide.active { transform: scale(.95); }
  .plat-hint { font-size: 13px; margin: 8px 0 12px; }

  /* ── Platform checkout header ────────────────────────── */
  .co-header { padding: 10px 12px 8px; }
  .co-header h1 { font-size: 1rem; }
  .co-header p { font-size: 11px; }
  .co-header-icon { font-size: 20px; }
  .co-header-icon img, .co-header-icon svg { width: 28px; height: 28px; }
  .co-steps { gap: 3px; }
  .co-step-dot { width: 24px; height: 24px; font-size: 10px; }
  .co-step-dot-line { width: 12px; }

  /* ── Platform checkout body ──────────────────────────── */
  .co-body { padding: 12px 10px 28px; gap: 14px; }
  .co-card { padding: 16px 12px; border-radius: 12px; }
  .co-panel-title { font-size: 14px; gap: 8px; margin-bottom: 14px; }
  .co-profile-row input { font-size: 16px; padding: 12px; }
  .co-svc-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .co-svc-card { padding: 16px 14px; }
  .co-form-grid { grid-template-columns: 1fr !important; }
  .co-pay-grid { grid-template-columns: 1fr; }
  .co-qty-num { font-size: 36px; }
  .co-qty-presets { gap: 6px; }
  .co-qty-btn { padding: 6px 10px; font-size: 12px; }
  .co-nav-row { gap: 8px; flex-wrap: wrap; }
  .co-btn-back { padding: 11px 14px; font-size: 13px; min-width: 0; }
  .co-btn-next { padding: 11px; font-size: 14px; min-width: 0; flex: 1; }
  .co-btn-finish-cta { font-size: 13px; }
  .co-summary { padding: 18px 14px; }
  .co-sum-row { flex-wrap: wrap; }
  .co-sum-value { word-break: break-all; }
  .co-coupon-row { flex-wrap: wrap; gap: 6px; }
  .co-coupon-row input { min-width: 0; flex: 1; }
  .co-quality-btn { font-size: 12px !important; padding: 5px 12px !important; }
  #co-quality-toggle { flex-wrap: wrap; gap: 6px !important; }
  #co-quality-hint { font-size: 10px !important; }
  .co-success { padding: 32px 14px; }
  .co-success-icon { font-size: 48px; }
  .co-success h2 { font-size: 20px; }

  /* ── Grids → 1 coluna ────────────────────────────────── */
  .services-grid { grid-template-columns: 1fr; gap: 10px; }
  .svc-card { padding: 18px; }
  .why-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .grid-2 { grid-template-columns: 1fr; }

  /* ── Sections ────────────────────────────────────────── */
  .section { padding: 36px 0; }
  .section-header { margin-bottom: 28px; }
  .section-header h2 { font-size: 1.3rem; }
  .section-header p { font-size: 14px; }
  .container { padding: 0 12px; }

  /* ── Stats band ──────────────────────────────────────── */
  .stats-band { padding: 36px 0; }
  .big-stat strong { font-size: 28px; }
  .big-stat span { font-size: 12px; }

  /* ── CTA ──────────────────────────────────────────────── */
  .cta-card { padding: 28px 16px; border-radius: 16px; }
  .cta-card h2 { font-size: 1.3rem; }
  .cta-card p { font-size: 14px; }

  /* ── Footer ──────────────────────────────────────────── */
  .footer { padding: 28px 0; }
  .trust-badge { padding: 5px 10px; font-size: 11px; }
  .footer-links { gap: 10px; }
  .footer-links a { font-size: 12px; }
  .footer-legal { font-size: 10px; padding: 0 12px; }

  /* ── FAQ ──────────────────────────────────────────────── */
  .faq-q { padding: 14px 16px; font-size: 14px; }
  .faq-a p { padding: 0 16px 14px; font-size: 13px; }

  /* ── Auth ─────────────────────────────────────────────── */
  .auth-card { padding: 24px 18px; border-radius: 16px; }
  .auth-logo h2 { font-size: 20px; }

  /* ── Panel pages ─────────────────────────────────────── */
  .panel-main { padding: 14px 10px; }
  .panel-header h1 { font-size: 18px; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card .si { font-size: 22px; }
  .stat-card strong { font-size: 16px; }
  .stat-card span { font-size: 11px; }

  /* ── Testimonials ────────────────────────────────────── */
  .t-card { min-width: 240px !important; max-width: 240px !important; padding: 16px !important; }
  .t-card p { font-size: 12px !important; }
  .t-author strong { font-size: 12px; }

  /* ── Guarantee ───────────────────────────────────────── */
  .guarantee-band { padding: 36px 0; }
  .guarantee-icon { font-size: 42px; }
  .guarantee-inner h2 { font-size: 1.3rem; }
  .guarantee-inner p { font-size: 14px; }

  /* ── Badges ──────────────────────────────────────────── */
  .badge { font-size: 10px; padding: 2px 8px; }
}

/* ═══════════════════════════════════════════════════════════
   BREAKPOINT: max-width 360px (Smartphones muito pequenos)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .hero-title { font-size: 1.4rem; }
  .hero-badge { font-size: 10px; }
  .hero-stats { flex-direction: column; gap: 8px; align-items: center; }
  .stat-sep { display: none; }
  .platform-carousel-wrap { gap: 4px; }
  .plat-slide-icon { width: 46px; height: 46px; }
  .plat-slide-icon img, .plat-slide-icon svg { width: 28px; height: 28px; }
  .services-grid { gap: 8px; }
  .svc-card { padding: 14px; }
  .why-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .co-body { padding: 8px 6px 24px; }
  .co-card { padding: 14px 10px; }
}

/* ═══════════════════════════════════════════════════════════
   SOCIAL PROOF + CHAT WIDGET — Mobile positioning
   Evita sobreposição entre os dois componentes
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Chat FAB: canto inferior direito */
  #mamba-chat-fab {
    bottom: 10px !important;
    right: 12px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
    z-index: 9999 !important;
  }

  /* Chat box: acima do FAB, menor */
  #mamba-chat-box {
    right: 8px !important;
    bottom: 56px !important;
    width: calc(100vw - 16px) !important;
    max-height: 40vh !important;
    overflow-y: auto !important;
  }

  /* Social proof: acima do chat FAB */
  #sp-container {
    bottom: 56px !important;
    left: 8px !important;
    right: 56px !important;
    max-width: none !important;
  }

  .sp-toast {
    padding: 6px 8px !important;
    touch-action: pan-y !important;
  }

  .sp-avatar {
    width: 26px !important;
    height: 26px !important;
  }

  .sp-name { font-size: 11px !important; }
  .sp-action { font-size: 10px !important; }
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS — Mobile
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  #toast-container {
    right: 8px !important;
    bottom: 64px !important;
    left: 8px !important;
    max-width: none !important;
  }

  .toast {
    max-width: none !important;
    font-size: 12px !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   SERVICES SELECTOR PAGE — Mobile
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .admin-tabs, .services-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }

  .tab-btn {
    padding: 6px 12px;
    font-size: 11px;
  }

  /* Recharge page grid - 2 cols on mobile */
  .recharge-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   iOS FIXES
   ═══════════════════════════════════════════════════════════ */
/* Prevent zoom on inputs in iOS */
@media (max-width: 480px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="search"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px;
  }
}

/* Touch targets minimum size */
@media (max-width: 768px) {
  button, .btn, a.btn {
    min-height: 44px;
  }
}

/* Scrollbar on touch */
@supports (-webkit-touch-callout: none) {
  * { -webkit-overflow-scrolling: touch; }
}

/* Viewport fix */
html {
  -ms-touch-action: manipulation;
  touch-action: manipulation;
}
