/* ============================================================
   OASIS · mobile shim
   Patches surgicais para viewport ≤ 760px aplicados depois
   dos <style> inline de cada página. Usa !important onde
   precisa vencer especificidades e ordens de source legadas.
   ============================================================ */

@media (max-width: 760px) {

  /* ---------- container + densidade ---------- */
  .container,
  .container-narrow {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* ---------- NAV (compartilhada) ---------- */
  .nav-center { display: none !important; }
  .nav-wrap { gap: 10px !important; }
  .logo-img { height: 30px !important; }
  .nav-cta {
    padding: 9px 14px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    letter-spacing: 0 !important;
  }
  .nav-cta .dot { display: none !important; }
  .menu-btn {
    display: flex !important;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: rgba(10,20,36,.08);
    align-items: center; justify-content: center;
  }
  .menu-btn svg { width: 20px; height: 20px; }

  /* ---------- FOOTER (8 páginas) ---------- */
  .foot-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 28px 24px !important;
  }
  .foot-col:first-child {
    grid-column: 1 / -1;
    margin-bottom: 8px;
  }
  .foot-bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 14px !important;
    text-align: left !important;
  }

  /* ---------- INDEX · pause-credentials ----------
     Bug: a media (max-width:1100px) vem DEPOIS da
     (max-width:760px) no source, então em mobile
     mantinha 3 colunas. Aqui forçamos coluna única. */
  .pause-credentials {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .pause-credentials li {
    padding: 18px 0 !important;
    border-top: 1px solid rgba(244,240,232,.10) !important;
    border-left: none !important;
  }
  .pause-credentials li:first-child { border-top: none !important; }
  .pause-credentials li + li::before { display: none !important; }

  /* ---------- INDEX · misc ---------- */
  .pause-line { font-size: clamp(26px, 7.6vw, 40px) !important; }
  .hero h1 { font-size: clamp(40px, 10.5vw, 64px) !important; }
  .sense-text br { display: none; }

  /* ---------- TIPOGRAFIA defensiva (todas páginas) ---------- */
  h1 { word-break: break-word; }
  .display, h1, h2 { letter-spacing: -.03em; }

  /* clamp em headings de hero quando muito grandes */
  .phero h1, .shero h1, .ghero h1, .dhero h1,
  .ehero h1, .glp1-hero h1, .plan-hero h1 {
    font-size: clamp(38px, 10vw, 60px) !important;
    line-height: .98 !important;
  }
  .closing-quote, .closing h2 {
    font-size: clamp(28px, 7.5vw, 44px) !important;
    line-height: 1.05 !important;
  }

  /* ---------- PRODUTO · subgrids ---------- */
  .phero-grid,
  .system-head, .panel-head, .install-head,
  .panel-grid, .mixer-grid,
  .materials-grid, .install-grid, .dash-grid,
  .stage-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .phero-stage { max-width: 100% !important; aspect-ratio: 5/6; }
  .device { max-width: 280px !important; margin: 0 auto; }
  .spec-row { grid-template-columns: 1fr !important; gap: 6px !important; }

  /* ---------- SABORES · subgrids ---------- */
  .shero-grid, .origins-grid, .exp-grid,
  .flavors-head, .flavors-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .exp-card, .origin, .flavor-card {
    grid-column: span 1 !important;
  }
  .shero h1 { font-size: clamp(40px, 10vw, 64px) !important; }

  /* ---------- SMART-DROPS · subgrids ---------- */
  .ghero-grid, .princ-grid, .exp-grid,
  .caf-grid, .nutri-grid, .glpf-grid,
  .faq-grid, .drops-grid, .protocol-grid,
  .taxo-grid, .science-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .drop-card, .princ-card { padding: 24px !important; }

  /* ---------- GLP-1 · subgrids ---------- */
  .linha-grid, .origin-grid, .motors-grid,
  .mapx-grid, .syn-grid, .formula-grid,
  .honest-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* ---------- EMPRESAS · subgrids ---------- */
  .hero-grid, .context-grid, .pillars-grid,
  .compare-grid, .scenarios-grid, .dash-grid,
  .sla-grid, .stack-grid, .dash-show-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .stack-row {
    grid-template-columns: 64px 1fr !important;
    gap: 16px !important;
  }
  .scn-stats { grid-template-columns: 1fr 1fr !important; gap: 14px !important; }
  .sqrow { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .dmod { grid-template-columns: 56px 1fr !important; gap: 14px !important; }
  .sla-item { grid-template-columns: 56px 1fr !important; gap: 12px !important; }

  /* tabela compare scrolla */
  .compare-table-wrap,
  .compare-wrap,
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 -20px;
    padding: 0 20px;
  }
  .compare-table, .compare-wrap table {
    min-width: 560px;
  }

  /* ---------- PLANOS · subgrids ---------- */
  .incl-grid, .incl-head,
  .price-grid, .price-head,
  .tradeup-grid, .tradeup-head,
  .howp-grid, .howp-head {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .price-card { max-width: 100% !important; }

  /* ---------- CONTACT (todas páginas) ---------- */
  .contact-grid-v2 {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }
  .form-v2 { padding: 32px 22px !important; }
  .form-row { grid-template-columns: 1fr !important; gap: 14px !important; }
  .contact-grid-v2 h2 { font-size: clamp(36px, 9vw, 56px) !important; }

  /* ---------- BOTÕES grandes no mobile ---------- */
  .btn-primary, .btn-secondary, .btn-drops, .form-submit,
  .btn-large, .cta-primary, .cta-secondary {
    width: 100% !important;
    justify-content: center !important;
  }
  .hero-ctas, .ctas, .cta-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  /* ---------- segurança anti-overflow ---------- */
  html, body { overflow-x: hidden !important; }
  img, video, svg { max-width: 100% !important; height: auto; }

  /* tira efeitos pesados do cursor em touch */
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* ============================================================
   DRAWER mobile · controlado por mobile-menu.js
   Sempre presente no DOM, escondido por default;
   só aparece se viewport ≤ 760 (botão menu também).
   ============================================================ */
.m-backdrop,
.m-drawer { display: none; }

@media (max-width: 760px) {
  .m-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(10, 20, 36, 0);
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
    z-index: 998;
    pointer-events: none;
    transition: background .28s ease, backdrop-filter .28s ease;
  }
  .m-drawer {
    display: flex; flex-direction: column;
    position: fixed; top: 0; right: 0;
    width: min(86vw, 360px); height: 100dvh; height: 100vh;
    background: #0A1424;
    color: #E8E2D4;
    padding: 22px 26px 32px;
    z-index: 999;
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.4, 0, .2, 1);
    box-shadow: -30px 0 80px rgba(0, 0, 0, .35);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  html.is-menu-open .m-backdrop {
    background: rgba(10, 20, 36, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: auto;
  }
  html.is-menu-open .m-drawer {
    transform: translateX(0);
  }
  html.is-menu-open,
  html.is-menu-open body {
    overflow: hidden !important;
  }

  .m-drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 28px;
  }
  .m-drawer-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; font-weight: 600;
    letter-spacing: .22em; text-transform: uppercase;
    color: rgba(232, 226, 212, .55);
  }
  .m-drawer-close {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(232, 226, 212, .08);
    color: #E8E2D4;
    display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer;
  }
  .m-drawer-close svg { width: 18px; height: 18px; }
  .m-drawer-close:active { background: rgba(232, 226, 212, .14); }

  .m-drawer-list {
    display: flex; flex-direction: column;
    gap: 2px;
    flex: 1;
  }
  .m-drawer-list a {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-size: 30px;
    letter-spacing: -.02em;
    line-height: 1.15;
    color: #E8E2D4;
    text-decoration: none;
    padding: 14px 0;
    border-bottom: 1px solid rgba(232, 226, 212, .08);
    transition: color .18s ease, padding-left .22s ease;
  }
  .m-drawer-list a:active { color: #00C2B0; padding-left: 6px; }
  .m-drawer-list a.is-glp1 { color: #00C2B0; }

  .m-drawer-cta {
    margin-top: 24px;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 10px;
    padding: 16px 22px;
    border-radius: 999px;
    background: #E8E2D4;
    color: #0A1424;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    letter-spacing: 0;
    white-space: nowrap;
  }
  .m-drawer-cta:active { background: #00C2B0; color: #0A1424; }
}

/* ============================================================
   ≤ 480px · refinamentos para telas muito pequenas
   ============================================================ */
@media (max-width: 480px) {
  .container, .container-narrow {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .foot-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .foot-col:first-child { grid-column: auto; }

  .hero h1, .phero h1, .shero h1, .ghero h1,
  .dhero h1, .ehero h1, .plan-hero h1 {
    font-size: clamp(34px, 11vw, 52px) !important;
  }

  .scn-stats, .sqrow {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   TOUCH DEVICES (hover: none)
   Mata hover effects pesados em mobile que causam o bug do
   double-tap em iOS (primeiro tap acende hover, segundo dispara
   o click). Também remove highlight de tap e o delay de 300ms.
   ============================================================ */
@media (hover: none) {
  a, button, [role="button"], .btn,
  .menu-btn, .nav-cta, .lboard-tab,
  .dsb-period > span, .qa-q, .fcard, .dcard,
  input, select, textarea {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  /* desativa transforms/lift do :hover (causa do double-tap) */
  a:hover, button:hover, .btn:hover,
  .fcard:hover, .dcard:hover, .pillar:hover, .cwave:hover,
  .stack-row:hover, .sla-item:hover, .dmod:hover, .qa-q:hover,
  .crow:hover, .scn-card:hover,
  .lboard-tab:hover, .lrow:hover, .ltrend-card:hover,
  .qcard:hover, .ach:hover,
  .nav-cta:hover, .menu-btn:hover,
  .iitem:hover, .addon:hover, .hstep:hover,
  .motor:hover, .ostep:hover, .hcard:hover, .mchip:hover, .vs-card:hover,
  .forb:hover, .fsel:hover, .ocard:hover,
  .pcard:hover, .ncard:hover, .dsel:hover,
  .hotspot:hover, .fchip:hover, .istep:hover, .spec-row:hover,
  .rb-chip:hover, .glp1-cta:hover, .olditem:hover,
  .btn-drops:hover, .link-massive:hover,
  .nav-center a:hover, .price-card:hover, .flow-node:hover {
    transform: none !important;
  }
}

/* ============================================================
   HOME · REVEAL-SCROLL · alívio mobile
   620vh de stage + 6 blobs com blur(56px) + popTimer matam GPU
   no celular. Aqui reduzimos drasticamente sem perder o efeito.
   O JS também tem guard mobile (ver index.html).
   ============================================================ */
@media (max-width: 760px) {
  .rs-stage { height: 320vh !important; }
  .rs-sticky {
    height: 100svh !important;
    min-height: 100vh;
  }
  .rs-sticky::before {
    width: 70vw !important;
    height: 70vw !important;
    filter: blur(36px) !important;
  }
  .rs-blob {
    width: 70vw !important;
    height: 70vw !important;
    filter: blur(30px) !important;
  }
  /* mantém só 3 blobs animando (corta 4-6) */
  .rs-burst.is-active .rs-blob:nth-child(n+4) {
    display: none !important;
  }
  .rs-pop {
    filter: blur(24px) !important;
    width: 50vw !important;
    height: 50vw !important;
  }
  .rs-text {
    font-size: clamp(22px, 6vw, 36px) !important;
    line-height: 1.32 !important;
  }
  .rs-eyebrow { margin-bottom: 24px !important; }
  .fx-bubble { box-shadow: none !important; }
}

/* ============================================================
   APP · LEADERBOARD "empresa em movimento"
   .lrow tinha 5 colunas (~520px min). Em mobile vira grid
   2-linhas com a barra ocupando a linha de baixo inteira.
   ============================================================ */
@media (max-width: 760px) {
  .lboard-sec { padding: 80px 0 !important; }
  .lead-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  .lead-head {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    margin-bottom: 32px !important;
  }
  .lead-head .right { margin-left: 0 !important; }
  .lboard { padding: 22px 18px !important; }
  .lboard-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .lboard-tab {
    flex: none;
    padding: 8px 14px !important;
    font-size: 10.5px !important;
  }
  .lrow {
    grid-template-columns: 26px 38px 1fr 60px !important;
    grid-template-areas:
      "pos avt info val"
      "bar bar bar bar" !important;
    gap: 8px 10px !important;
    padding: 14px 4px !important;
    row-gap: 10px !important;
  }
  .lrow-pos { grid-area: pos; }
  .lrow-avt {
    grid-area: avt;
    width: 38px !important;
    height: 38px !important;
    font-size: 12px !important;
  }
  .lrow-info { grid-area: info; min-width: 0; }
  .lrow-info b {
    font-size: 13.5px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .lrow-info small { font-size: 9px !important; }
  .lrow-val {
    grid-area: val;
    font-size: 10.5px !important;
    justify-content: flex-end;
  }
  .lrow-bar { grid-area: bar; }
  .ltrend-card { padding: 16px !important; gap: 12px !important; }
  .ltrend-info b { font-size: 15px !important; }
  .ltrend-thumb { width: 42px !important; height: 56px !important; }
}

/* ============================================================
   EMPRESAS · HERO + "A TROCA" tabela
   Hero h1 escapando + spec-floats com left/right negativos
   vazavam horizontalmente. Aqui ficam dentro da tela e a
   tabela vira cards verticais com labels claros.
   ============================================================ */
@media (max-width: 760px) {
  /* hero do empresas */
  body.page-empresas .hero h1,
  body.page-empresas .hero h1 .line {
    font-size: clamp(34px, 9.2vw, 52px) !important;
    line-height: .98 !important;
    letter-spacing: -.025em !important;
  }
  body.page-empresas .hero {
    padding: 90px 0 40px !important;
    min-height: 0 !important;
  }
  body.page-empresas .hero-lead { font-size: 15.5px !important; }
  body.page-empresas .hero-pillars {
    grid-template-columns: 1fr 1fr !important;
    padding-top: 18px !important;
    gap: 14px 18px !important;
    margin-bottom: 24px !important;
  }
  body.page-empresas .hero-visual {
    min-height: 0 !important;
    margin-top: 24px;
  }
  body.page-empresas .hero-stage {
    max-width: 100% !important;
    aspect-ratio: 4/4;
  }
  body.page-empresas .spec-float { display: none !important; }
  body.page-empresas .hero-liquid { display: none !important; }

  /* "A TROCA" — tabela vira cards com headers Hoje/Com Oasis */
  body.page-empresas .ctable {
    border-radius: 16px !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  body.page-empresas .ctable-head { display: none !important; }
  body.page-empresas .crow {
    grid-template-columns: 1fr !important;
    border: 1px solid var(--line) !important;
    border-radius: 18px !important;
    background: #fff !important;
    margin-bottom: 14px !important;
    overflow: hidden;
    padding: 0 !important;
  }
  body.page-empresas .crow:hover { background: #fff !important; }
  body.page-empresas .crow > div {
    border-left: none !important;
    padding: 14px 18px !important;
  }
  body.page-empresas .crow .c-dim {
    background: var(--ink) !important;
    color: var(--paper) !important;
    font-family: 'Fraunces', serif !important;
    font-size: 17px !important;
    padding: 16px 18px !important;
  }
  body.page-empresas .crow .c-now,
  body.page-empresas .crow .c-oasis {
    position: relative;
    padding-top: 34px !important;
    font-size: 14.5px !important;
    line-height: 1.55 !important;
    display: block !important;
  }
  body.page-empresas .crow .c-now::before {
    content: "HOJE" !important;
    position: absolute !important;
    top: 10px !important; left: 18px !important;
    width: auto !important; height: auto !important;
    background: transparent !important;
    border-radius: 0 !important;
    margin: 0 !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 9px !important; font-weight: 700 !important;
    letter-spacing: .22em !important;
    color: var(--ink-mute) !important;
    flex: none !important;
  }
  body.page-empresas .crow .c-oasis {
    background: rgba(0,194,176,.05);
    border-top: 1px solid var(--line);
  }
  body.page-empresas .crow .c-oasis::before {
    content: "COM OASIS" !important;
    position: absolute !important;
    top: 10px !important; left: 18px !important;
    width: auto !important; height: auto !important;
    background: transparent !important;
    transform: none !important;
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 9px !important; font-weight: 700 !important;
    letter-spacing: .22em !important;
    color: var(--aqua-deep) !important;
    opacity: 1 !important;
  }
  body.page-empresas .crow .c-oasis svg {
    width: 14px !important; height: 14px !important;
    margin-right: 8px !important;
  }
  body.page-empresas .ctable-foot {
    padding: 18px 16px !important;
    background: var(--paper-2);
    border-radius: 14px !important;
    margin-top: 8px;
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* dashboard period tabs ficam scrolláveis em mobile */
  body.page-empresas .dash-show-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  body.page-empresas .dsb-period {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }
  body.page-empresas .dsb-period > span {
    flex: none;
    cursor: pointer;
  }
}
