/* ============================================================================
   Mian GSM Lab — global mobile responsiveness fixes (loaded on every page,
   AFTER each page's own CSS so these overrides win). CSS only.
   ============================================================================ */

/* kill the page-level sideways scroll that makes mobile look "broken" */
html { overflow-x: hidden; }
body { max-width: 100%; overflow-x: clip; }   /* clip = no sticky-header break */
img, video, canvas, svg, iframe { max-width: 100%; height: auto; }
pre, code { max-width: 100%; overflow-x: auto; word-break: break-word; }

/* tablets and down */
@media (max-width: 820px) {
  .wrap, .nav, header .nav { padding-left: 14px !important; padding-right: 14px !important; }
}

/* phones */
@media (max-width: 640px) {
  /* nav: keep one row but let it scroll sideways instead of wrapping into a mess */
  nav, header .nav, .nav { flex-wrap: wrap !important; row-gap: 8px; padding: 10px 12px !important; }
  nav { gap: 10px; align-items: center; }
  .nav-links {
    gap: 12px !important; font-size: 13px !important;
    flex-wrap: nowrap !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch;
    white-space: nowrap; max-width: 100%; padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .logo small { display: none; }           /* save space */

  /* single-column grids everywhere */
  .grid, .tools-grid, .modes { grid-template-columns: 1fr !important; }

  /* wide blocks scroll inside their card instead of overflowing the screen */
  .card, .panel, .wrap > section { overflow-x: auto; }
  table { width: 100%; font-size: 13px; }
  table td, table th { white-space: normal; }

  /* smaller headings + tighter spacing */
  h1 { font-size: clamp(22px, 7vw, 28px) !important; line-height: 1.2 !important; }
  h2 { font-size: clamp(19px, 6vw, 24px) !important; }
  .lead, .sub { font-size: 14.5px !important; }

  /* big hero text shrink (home) */
  .hero h1, .hero-title { font-size: clamp(26px, 9vw, 40px) !important; }
  .hero p { font-size: 15px !important; }

  /* button rows wrap; primary/big buttons go full width */
  .row, .wabar, .hero-cta, .cta-row { flex-wrap: wrap !important; }
  .btn.big, .btn.p.big { width: 100% !important; justify-content: center; }

  /* forms / inputs full width, comfortable tap size */
  input, select, textarea { width: 100% !important; font-size: 15px; }

  /* cards padding a touch smaller */
  .card { padding: 14px 16px; }

  /* footers wrap */
  .foot, .foot .wrap { font-size: 12.5px; }

  /* sticky WhatsApp button a bit smaller */
  .stickywa a { padding: 10px 13px; font-size: 14px; }
}

/* very small phones */
@media (max-width: 380px) {
  .nav-links { gap: 10px !important; font-size: 12.5px !important; }
  h1 { font-size: 21px !important; }
  .card { padding: 12px 13px; }
}
