/* Service Conecte — otimização exclusiva para celulares/tablets
   Este arquivo é carregado depois dos estilos atuais e não altera o desktop. */

@media (max-width: 900px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  body { -webkit-text-size-adjust: 100%; }
  img, video, iframe, svg { max-width: 100%; height: auto; }

  /* Cabeçalho: o menu passa a ocupar o fluxo normal da página.
     Isso evita links/actions escondidos ou sobrepostos em telas estreitas. */
  .site-header {
    height: auto;
    min-height: 70px;
    padding: 10px 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  .brand { display: inline-flex; align-items: center; min-width: 0; }
  .brand img { height: 42px; width: auto; max-width: 190px; }
  .menu-toggle {
    display: inline-flex;
    margin-left: auto;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .menu-toggle:focus-visible { outline: 3px solid rgba(23,132,91,.2); outline-offset: 2px; }

  .main-nav,
  .nav-actions {
    display: none;
    position: static !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100%;
    flex: 0 0 100%;
    background: #fff;
    padding: 0;
  }
  .main-nav.show {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }
  .main-nav.show a {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 46px;
    padding: 12px 3px;
    border-bottom: 1px solid #edf1ee;
    font-size: 14px;
    font-weight: 650;
    color: #425249;
  }
  .nav-actions.show {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    padding: 12px 0 4px;
  }
  .nav-actions.show .btn,
  .nav-actions.show .role-mode-switch,
  .nav-actions.show .notification-bell {
    width: 100%;
    min-height: 44px;
    margin: 0;
    justify-content: center;
    text-align: center;
  }
  .nav-actions.show .role-mode-switch { grid-column: 1 / -1; }
  .nav-actions.show .notification-bell {
    display: flex;
    align-items: center;
    position: relative;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }
  .nav-actions.show .notification-bell b { position: static; margin-left: 6px; }
  body.mobile-menu-open { overflow: hidden; }

  /* Espaçamento e tipografia */
  .section, .pro-section, .prof-section { padding-left: 22px; padding-right: 22px; }
  .hero { padding-left: 22px; padding-right: 22px; min-height: auto; }
  .hero h1 { font-size: clamp(38px, 11vw, 52px); line-height: 1.02; letter-spacing: -2px; }
  .hero p { font-size: 16px; }
  .section h2, .pro-section h2, .cta h2 { font-size: clamp(30px, 8vw, 38px); }

  /* Formulários: evita zoom automático do iPhone e campos cortados */
  input, select, textarea, button { max-width: 100%; }
  input, select, textarea { font-size: 16px !important; }
  .form-grid { grid-template-columns: 1fr !important; }
  .form-stack input,
  .form-stack select,
  .form-stack textarea { min-height: 46px; }
  input[type="file"] { width: 100%; overflow: hidden; }

  /* Conteúdo e cards */
  .auth-shell, .dashboard-shell { padding: 30px 16px; }
  .content-card, .auth-card, .setup-card { width: 100%; max-width: 100%; }
  .dashboard-head, .detail-head { gap: 12px; flex-wrap: wrap; }
  .dashboard-actions, .status-actions { width: 100%; }
  .dashboard-actions .btn, .status-actions .btn { min-height: 44px; }
  .list-item { gap: 12px; flex-wrap: wrap; }
  .list-item > :last-child { max-width: 100%; }
  .proposal-card, .compare-card { min-width: 0; }

  /* Tabelas/admin: rolagem horizontal sem quebrar a tela */
  table { min-width: 680px; }
  .table-wrap,
  .table-responsive,
  .admin-table-wrap,
  .content-card:has(> table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .content-card > table { width: 100%; }

  /* Checkout e textos compridos */
  .checkout-summary b,
  .checkout-summary span,
  .payment-message,
  .setup-note,
  code,
  pre,
  .public-pro-bio,
  .portfolio-card p { overflow-wrap: anywhere; word-break: break-word; }
  .copy-row input { width: 100%; }
  .fee-card { top: auto; }

  /* Rodapé */
  .site-footer { padding-left: 22px; padding-right: 22px; gap: 26px; }
  .site-footer img { max-width: 180px; }
  .site-footer a { min-height: 34px; display: flex; align-items: center; }

  /* Botão WhatsApp respeita a área segura dos aparelhos */
  .whatsapp-float {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 900;
  }
}

@media (max-width: 620px) {
  .site-header { padding-left: 14px; padding-right: 14px; }
  .brand img { height: 38px; max-width: 170px; }

  .nav-actions.show { grid-template-columns: 1fr; }
  .nav-actions.show .role-mode-switch { grid-column: auto; }

  .section, .pro-section, .prof-section { padding: 46px 16px; }
  .hero { padding: 42px 16px; }
  .hero h1 { font-size: clamp(36px, 12vw, 46px); }
  .hero-search { gap: 8px; padding: 10px; }
  .hero-search div { border-right: 0 !important; border-bottom: 1px solid var(--line); padding: 10px 8px; }
  .hero-search div:last-of-type { border-bottom: 0; }
  .hero-search .btn, .hero-search button { width: 100%; min-height: 46px; }

  .category-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .category-card { padding: 16px 12px; min-width: 0; }
  .category-card span { margin-bottom: 12px; }

  .steps, .finance-stats, .proposal-compare-grid { grid-template-columns: 1fr !important; }
  .site-footer { grid-template-columns: 1fr !important; padding: 36px 18px 26px; }

  .auth-shell, .dashboard-shell { padding: 24px 12px 42px; }
  .content-card, .auth-card, .setup-card { padding: 20px 16px !important; border-radius: 14px; }
  .dashboard-head, .detail-head, .proposal-bottom,
  .payment-banner, .location-alert, .location-summary,
  .proposal-request-head, .waiting-proposals { align-items: stretch !important; flex-direction: column !important; }
  .dashboard-head .btn,
  .detail-head .btn,
  .proposal-bottom .btn,
  .payment-banner .btn,
  .location-alert .btn,
  .location-summary .btn { width: 100%; }

  .meta-grid { grid-template-columns: 1fr !important; }
  .meta-grid div + div { border-left: 0 !important; border-top: 1px solid var(--line); }

  .proposal-person { align-items: flex-start; }
  .proposal-bottom { gap: 10px; }

  .checkout-summary > div { flex-direction: column; gap: 5px; }
  .checkout-summary b { text-align: left; }
  .pix-box { padding: 18px 12px; }
  .pix-box img { width: min(220px, 75vw); height: auto; }
  .copy-row { grid-template-columns: 1fr !important; }
  .copy-row .btn { width: 100%; }

  /* Página de profissionais/portfólio */
  .prof-hero { padding: 42px 16px !important; gap: 26px; }
  .prof-hero h1 { font-size: clamp(38px, 11vw, 46px) !important; }
  .prof-hero p { font-size: 16px; }
  .prof-hero-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .prof-hero-actions .btn { width: 100%; }
  .prof-demo-stats { gap: 6px; }
  .prof-demo-stats div { padding: 10px 5px; }
  .prof-demo-stats b { font-size: 17px; }
  .prof-demo-stats small { font-size: 9px; }
  .prof-demo-portfolio { gap: 6px; }
  .prof-demo-portfolio span { font-size: 22px; }
  .prof-benefit-grid, .prof-step-grid, .portfolio-grid { grid-template-columns: 1fr !important; }
  .prof-showcase-grid { grid-template-columns: 1fr !important; }
  .prof-cta-panel { margin: 0 14px 45px !important; padding: 26px 20px !important; }
  .prof-cta-panel .btn { width: 100%; white-space: normal !important; }
  .profile-photo-uploader { grid-template-columns: 1fr !important; }
  .portfolio-head { flex-direction: column; }
  .portfolio-head .btn { width: 100%; }
  .public-pro-shell { padding: 0 12px; margin-top: 22px; }
  .public-pro-header { grid-template-columns: 1fr !important; padding: 20px 16px; }
  .public-pro-actions { grid-column: auto !important; flex-direction: column !important; width: 100%; }
  .public-pro-actions .btn { width: 100%; }

  /* Touch targets */
  .btn, button, .menu-toggle, .role-mode-switch, .notification-bell { min-height: 44px; }
}

@media (max-width: 380px) {
  .brand img { max-width: 150px; height: 34px; }
  .site-header { padding-left: 10px; padding-right: 10px; }
  .menu-toggle { width: 42px; height: 42px; }
  .category-grid { grid-template-columns: 1fr !important; }
  .prof-demo-stats { grid-template-columns: 1fr !important; }
}
