/* ============================================================
   AshvaMitra — Global mobile responsive overrides
   Applied across all pages. Keeps desktop design intact.
   ============================================================ */

@media (max-width: 768px) {

  /* -------- Base / container -------- */
  :root {
    --gutter: 20px;
  }
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  body { font-size: 16px; }
  img, svg, video { max-width: 100%; height: auto; }

  .container {
    padding: 0 20px;
    max-width: 100%;
  }

  /* -------- Typography caps -------- */
  .h-xl,
  h1, h1.h-xl {
    font-size: 32px !important;
    line-height: 1.1 !important;
    letter-spacing: -0.02em !important;
  }
  .h-lg { font-size: 28px !important; line-height: 1.15 !important; }
  .h-md { font-size: 24px !important; line-height: 1.2 !important; }
  .h-sm { font-size: 20px !important; line-height: 1.25 !important; }
  h2 { font-size: 24px !important; }
  h3 { font-size: 20px !important; }
  h4 { font-size: 18px !important; }
  .lead { font-size: 16px !important; line-height: 1.55 !important; }
  p, li, label, input, select, textarea, button { font-size: 16px; }
  .mono, .eyebrow, .pill { font-size: 11px !important; }

  /* -------- Navigation -------- */
  .nav-inner { height: 64px; position: relative; }
  .nav-logo img { height: 32px !important; }
  .nav-logo-text { font-size: 15px; }

  /* hide desktop links */
  .nav-links {
    display: none !important;
  }

  /* hamburger button */
  .nav-hamburger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 60;
  }
  .nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink, #0B0B0C);
    transition: all 0.2s;
  }
  .nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-hamburger.open span:nth-child(2) { opacity: 0; }
  .nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* mobile menu drawer */
  .mobile-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--paper, #F7F4EC);
    border-bottom: 1px solid var(--line, #E7E4DE);
    padding: 16px 20px 24px;
    z-index: 55;
    flex-direction: column;
    gap: 4px;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    box-shadow: 0 12px 24px rgba(0,0,0,0.06);
  }
  .mobile-menu.open { display: flex; }
  .mobile-menu a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 8px;
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-2, #1A1A1C);
    border-bottom: 1px solid var(--line, #E7E4DE);
    text-decoration: none;
  }
  .mobile-menu a:last-child { border-bottom: none; }
  .mobile-menu a.active { color: var(--red, #E30613); }
  .mobile-menu a.nav-cta {
    background: var(--ink, #0B0B0C);
    color: #fff !important;
    justify-content: center;
    margin-top: 12px;
    border-radius: 2px;
    border-bottom: none;
    font-weight: 600;
  }

  /* -------- Buttons -------- */
  .btn,
  a.btn,
  button.btn,
  .btn-primary, .btn-dark, .btn-ghost {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    padding: 14px 20px;
    font-size: 16px;
    box-sizing: border-box;
  }
  /* button containers - stack */
  .btn + .btn { margin-top: 12px; }

  /* -------- Sections / Hero -------- */
  .section,
  section.section,
  .section-sm {
    padding: 56px 0 !important;
  }
  section[style*="paddingTop"],
  section[style*="padding-top"] {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }

  /* -------- Grids: collapse to single column -------- */
  /* Catch any inline-style two/three/four column grid */
  [style*="grid-template-columns"],
  [style*="gridTemplateColumns"] {
    grid-template-columns: 1fr !important;
  }
  [style*="display: grid"][style*="gap: 64px"],
  [style*="display: grid"][style*="gap: 80px"],
  [style*="display: grid"][style*="gap: 48px"] {
    gap: 32px !important;
  }

  /* Multi-column flex rows */
  [style*="display: flex"][style*="gap: 12px"],
  [style*="display: flex"][style*="gap: 16px"],
  [style*="display: flex"][style*="gap: 24px"] {
    flex-wrap: wrap;
  }

  /* -------- Hero-specific -------- */
  section[style*="minHeight"] { min-height: auto !important; }

  /* -------- Footer -------- */
  .footer { padding: 48px 0 24px !important; }
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    margin-bottom: 32px !important;
  }
  .footer-brand p { max-width: 100%; }
  .footer h4 { margin-bottom: 12px; }
  .footer ul { gap: 4px; }
  .footer ul a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 15px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start !important;
    text-align: left;
  }
  .footer-revenue {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  /* -------- Stats / numbers -------- */
  .stat-num {
    font-size: 48px !important;
  }

  /* -------- Forms -------- */
  form input,
  form select,
  form textarea {
    width: 100% !important;
    min-height: 48px;
    font-size: 16px !important; /* prevents iOS zoom */
    padding: 12px 14px !important;
    box-sizing: border-box;
  }
  form textarea { min-height: 96px; }
  form label { display: block; width: 100%; }
  form button[type="submit"] {
    width: 100% !important;
    min-height: 48px;
  }

  /* -------- Tables: stack rows -------- */
  /* ROI row label/value pairs */
  div[style*="justifyContent: space-between"][style*="padding: 14px 0"],
  div[style*="justify-content: space-between"][style*="padding: 14px 0"] {
    flex-wrap: wrap;
  }

  /* Corridor / spec / data tables built from grids — make horizontally scrollable */
  .table-scroll,
  [data-mobile-scroll] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-scroll > *,
  [data-mobile-scroll] > * {
    min-width: 720px;
  }

  /* -------- Cards -------- */
  .card { padding: 20px !important; }

  /* -------- Marquee — keep but reduce -------- */
  .marquee { padding: 14px 0; }
  .marquee-item { font-size: 11px; }

  /* -------- Pricing tiers (Fleet) -------- */
  .pricing-grid,
  [class*="pricing"] {
    grid-template-columns: 1fr !important;
  }

  /* -------- Spec rows (Product) -------- */
  .spec-row,
  [data-spec-row] {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
  }

  /* -------- Eyebrow + kicker spacing -------- */
  .kicker { margin-bottom: 16px; }

  /* -------- Tap targets -------- */
  a, button {
    min-height: 44px;
  }
  /* Inline links inside paragraphs shouldn't be forced */
  p a, li a, .footer-bottom a, span a {
    min-height: 0;
  }
}

/* iPad / small tablets */
@media (min-width: 769px) and (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 32px; }
  .h-xl { font-size: 64px !important; }
}

/* Show hamburger only on mobile */
.nav-hamburger { display: none; }
.mobile-menu { display: none; }
