/* =====================================================================
   RESPONSIVE FIXES  (loaded last on every page)
   Tightens spacing on tablets and phones and stops layouts from
   spilling sideways. Desktop (above 1024px) is unchanged except for
   the home hero, which now clears the fixed header.
   ===================================================================== */

/* ── Home hero: keep the badge clear of the fixed header ─────── */
.hero .ctn.hero-in { padding-top: 56px; padding-bottom: 64px; }

/* Home stats row: five figures */
.stats-row { grid-template-columns: repeat(5, 1fr); }
.stats-row .stat .l { max-width: 220px; margin-left: auto; margin-right: auto; }

/* Wide tables scroll inside their own box instead of the page */
.comp-table,
.compare-table { max-width: 100%; }

/* ── HEADER: hamburger below 1100px ──────────────────────────
   The full menu needs about 1100px; narrower screens squashed it. */
@media (max-width: 1100px) {
  .n-links { display: none; }
  .n-right { display: none !important; }
  .hamburger { display: block !important; }
  .mm-panel { display: none; }
  .mobile-menu-bottom { padding: 20px 24px 28px; margin-top: 8px; }
}

/* ── TABLET (≤1024px) ────────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Section rhythm */
  .sec-w, .sec-off, .sec-dk, .sec-dk2 { padding: 72px 0; }
  .section { padding: 72px 0; }
  .page-hero { padding: 72px 0 60px; }
  .sec-head { margin-bottom: 36px; }

  /* Stacked two-column blocks: the gap was sized for side-by-side */
  .hero-in, .about-grid, .cta-grid, .founder-grid { gap: 32px; }
  .about-grid .sec-head, .cta-grid .sec-head { margin-bottom: 0; }

  /* Inline two-column layouts with very wide gaps */
  [style*="gap:72px"] { gap: 40px !important; }

  /* Contact: form and details stack */
  .contact-grid { grid-template-columns: 1fr; gap: 44px; }
}

/* ── TABLET CARD GRIDS (600–1024px): two per row instead of one ── */
@media (min-width: 600px) and (max-width: 1024px) {
  .why-grid, .test-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 600px) and (max-width: 768px) {
  .cases-grid, .blog-grid, .hub-panel.active { grid-template-columns: repeat(2, 1fr); }
}

/* ── PHONE & SMALL TABLET (≤768px) ───────────────────────────── */
@media (max-width: 768px) {
  /* Section rhythm: about 56px between sections instead of 200px */
  .sec-w, .sec-off, .sec-dk, .sec-dk2 { padding: 56px 0; }
  .section { padding: 52px 0; }
  .section-sm { padding: 40px 0; }
  .page-hero { padding: 48px 0 44px; }
  .sec-head { margin-bottom: 28px; }
  .svc-group { margin-top: 36px; }

  /* Home hero */
  .hero { min-height: 0; }
  .hero .ctn.hero-in { padding-top: 36px; padding-bottom: 48px; gap: 28px; }
  .hero-visual { margin-top: 0; }

  /* Home blocks */
  .hero-in, .about-grid, .cta-grid, .founder-grid { gap: 24px; }
  .stats-row { margin-top: 32px; padding-top: 28px; gap: 24px 16px; grid-template-columns: repeat(2, 1fr); }
  .stats-row .stat:last-child { grid-column: 1 / -1; }
  .stats-row .stat:nth-child(2n)::after { display: none; }
  .sec-row { gap: 20px; }
  .sec-row .sec-head { margin-bottom: 0; }
  .why-item { padding: 32px 24px; }
  .case-visual { height: 170px; }
  .form-box { padding: 24px 20px; }
  .founder-img { height: 260px; }


  /* Inner-page CTA band */
  .cta-band { padding: 40px 22px; border-radius: 16px; }

  /* Inline layouts written for desktop */
  /* (compact grids with 12-16px gaps, such as stat boxes and office cards, stay two across) */
  [style*="grid-template-columns:1fr 1fr"]:not([style*="gap:12px"]):not([style*="gap:16px"]),
  [style*="grid-template-columns:repeat(3,1fr)"] { grid-template-columns: 1fr !important; }
  [style*="gap:72px"], [style*="gap:56px"] { gap: 28px !important; }
  [style*="margin-top:80px"] { margin-top: 44px !important; }
  [style*="padding:44px"], [style="padding:48px"] { padding: 28px 22px !important; }
  [style*="width:280px"] { width: 100% !important; }

  .contact-grid { gap: 36px; }
}

/* ── PRICING CARDS (≤900px): stack, centred ─────────────────── */
@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: 1fr !important; max-width: 560px; margin-left: auto; margin-right: auto; }
}

/* ── COMPARISON TABLES (≤600px): readable columns, swipe sideways ─ */
@media (max-width: 600px) {
  .comp-table, .compare-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .comp-table th, .comp-table td,
  .compare-table th, .compare-table td { width: 170px; min-width: 170px; }
  .comp-table th:first-child, .comp-table td:first-child,
  .compare-table th:first-child, .compare-table td:first-child { width: 128px; min-width: 128px; }
}

/* Hero figure rows: a tidy 2x2 on phones instead of 3 + 1 */
@media (max-width: 560px) {
  .stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 16px; margin-top: 36px; }
}

/* ── SMALL PHONE (≤420px) ────────────────────────────────────── */
@media (max-width: 420px) {
  .sec-w, .sec-off, .sec-dk, .sec-dk2 { padding: 48px 0; }
  .section { padding: 46px 0; }
}

/* Hide the floating WhatsApp button while the mobile menu is open,
   so it doesn't sit on top of the menu's "Get Free Audit" button */
body:has(.mobile-menu.open) .wa-float { opacity: 0; visibility: hidden; pointer-events: none; }
