/* ============================================================
   Mobile optimization overrides — Hi Way Road Tech site
   Applied on top of the pages' inline styles via attribute
   selectors + !important. The DC runtime serializes inline
   styles as "property: value" (space after colon), so selectors
   below match that normalized form.
   ============================================================ */

img { max-width: 100%; height: auto; }
* { box-sizing: border-box; }

/* --- Tablet / phone layout (<= 860px) --- */
@media (max-width: 860px) {

  html, body { overflow-x: hidden; max-width: 100%; }

  /* Collapse every multi-column grid into a single column */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
  }

  /* Let content wrappers use full width */
  [style*="max-width: 1280px"],
  [style*="max-width: 1180px"],
  [style*="max-width: 1120px"] {
    max-width: 100% !important;
  }

  /* Tame the site-wide 40px / 48px horizontal padding */
  [style*="px 40px"] { padding-left: 18px !important; padding-right: 18px !important; }
  [style*="px 48px"] { padding-left: 18px !important; padding-right: 18px !important; }

  /* Grid/flex images sized to fill a fixed cell */
  img[style*="height: 100%"] { height: auto !important; min-height: 0 !important; }

  /* Fixed min-height panels shouldn't force tall empty space */
  [style*="min-height: 380px"] { min-height: 0 !important; }
}

/* --- Phone typography + spacing (<= 640px) --- */
@media (max-width: 640px) {

  /* Scale down oversized display headings (Barlow Condensed) */
  [style*="900 58px"] { font-size: 32px !important; }
  [style*="900 54px"] { font-size: 30px !important; }
  [style*="900 46px"] { font-size: 32px !important; }
  [style*="900 44px"] { font-size: 30px !important; }
  [style*="900 42px"] { font-size: 28px !important; }
  [style*="900 40px"] { font-size: 27px !important; }
  [style*="900 38px"] { font-size: 26px !important; }
  [style*="900 36px"] { font-size: 25px !important; }
  [style*="900 34px"] { font-size: 24px !important; }
  [style*="900 32px"] { font-size: 23px !important; }
  [style*="900 30px"] { font-size: 22px !important; }
  [style*="800 30px"] { font-size: 22px !important; }

  /* Ease vertical rhythm on the big section wrappers */
  [style*="padding: 80px 40px"],
  [style*="padding: 72px 40px"] { padding-top: 44px !important; padding-bottom: 44px !important; }
  [style*="padding: 64px 40px"] { padding-top: 40px !important; padding-bottom: 40px !important; }

  /* Header: tighten nav so the 8 links wrap cleanly */
  nav[style*="gap: 26px"] { gap: 14px 16px !important; }

  /* Hide secondary phone + email to keep contact strips compact */
  a[href="tel:+917338811950"],
  a[href="mailto:office@hiwayroadtech.com"] { display: none !important; }

  /* Bottom/CTA bars: give stacked groups breathing room */
  [style*="justify-content: space-between"] { row-gap: 14px !important; }
}
