/* =====================================================================
   mobile-fix.css  -  loaded LAST on every page.
   Fixes broken phone/tablet layouts. Desktop (>=901px) is untouched.
   ===================================================================== */

/* ---- 1. Side-by-side layouts must stack on tablets/phones ---------- */
@media (max-width: 900px) {
  .xt-2col,
  .xt-g-8149bd6d, .xt-g-ed08b3ab, .xt-g-50b53635, .xt-g-283a47cd,
  .xt-g-232b864c, .xt-g-75b5b3d2, .xt-g-4e38043b, .xt-g-91552b41,
  .xt-g-ef7f8b8c, .xt-hero-grid {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 20px;
  }
  .xt-g-283a47cd { gap: 0; }
  .xt-2col > *,
  .xt-g-8149bd6d > *, .xt-g-ed08b3ab > *, .xt-g-50b53635 > *, .xt-g-283a47cd > *,
  .xt-g-232b864c > *, .xt-g-75b5b3d2 > *, .xt-g-4e38043b > *, .xt-g-91552b41 > *,
  .xt-g-ef7f8b8c > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 0 auto !important;
  }
}

/* ---- 2. Phones ------------------------------------------------------ */
@media (max-width: 767.98px) {
  /* long words / tags wrap at word boundaries, never letter-by-letter */
  main, section, footer { overflow-wrap: break-word; word-break: normal; }
  main [class*="xt-g-"] a, main [class*="xt-g-"] p, main [class*="xt-g-"] h1,
  main [class*="xt-g-"] h2, main [class*="xt-g-"] h3, main [class*="xt-g-"] h4,
  main [class*="xt-g-"] summary { overflow-wrap: break-word; word-break: normal; }
  code, pre, .xt-g-4ccfe905, .xt-g-ef9c268c { overflow-wrap: anywhere; }

  /* buttons and pill links may wrap and never exceed their card */
  a[class*="xt-g-"], button[class*="xt-g-"] { white-space: normal !important; max-width: 100%; }
  [class*="xt-g-"][style*="nowrap"] { white-space: normal !important; }

  /* images always fill their column */
  section img.xt-image-slot, section img.xt-rect { width: 100% !important; height: auto; }

  /* wide tables scroll inside themselves */
  :not(.table-responsive) > table:not(.xt-table) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .blog-main-content .table-responsive > table { min-width: 0 !important; }
  .blog-main-content .table-responsive > table th,
  .blog-main-content .table-responsive > table td { padding: 8px 9px !important; font-size: 13px !important; line-height: 1.4 !important; }
}

/* ---- 3. Component fixes ---------------------------------------------- */
@media (max-width: 767.98px) {
  /* "From RM80 - per filing..." row */
  .xt-g-31c55f9c { flex-wrap: wrap; align-items: baseline; }
  .xt-g-56f6f852 { flex: 0 0 auto; white-space: nowrap; }
  .xt-g-2e970360 { flex: 1 1 200px; }

  /* SSM / MBRS credential logos + badges */
  .xt-g-3d1ed867 { flex-shrink: 1 !important; max-width: 100%; flex-wrap: wrap; gap: 16px; justify-content: flex-start; }
  .xt-g-013a3029 { width: auto !important; max-width: 140px !important; height: auto !important; max-height: 70px; object-fit: contain; }
  .xt-g-c0c5f941 { width: auto !important; max-width: 120px !important; height: auto !important; max-height: 60px; object-fit: contain; }
  .xt-g-ad74976b { display: none; }
  .xt-g-685cf01f { max-width: 100%; }
  .xt-g-83e48b60, .xt-g-bee77a6a { white-space: normal !important; }

  /* Footer wordmark: sit above the logo instead of floating over it */
  .site-footer-wrap .xt-h-1b6446e6 {
    position: static !important;
    font-size: 28px !important;
    max-width: 100% !important;
    margin: 0 0 12px;
    white-space: normal;
  }
}

/* ---- 4. Stat strips: 2 x 2 on phones, no stray divider lines ---------- */
@media (max-width: 767.98px) {
  body .xt-stats4, body .xt-stats-grid, body .xt-global-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 !important;
  }
  .xt-stats4 > div, .xt-stats-grid > div, .xt-global-stats > div {
    border-right: 0 !important;
    padding: 22px 8px !important;
  }
  .xt-stats4 > div > div:first-child, .xt-stats-grid > div > div:first-child,
  .xt-global-stats > div > div:first-child { font-size: 30px !important; }
}

/* ---- 5. Tablet: image + text cards stack once the card gets narrow ---- */
@media (max-width: 900px) {
  .xt-g-aa2227ea { width: 100% !important; height: auto !important; max-height: 320px; flex: 0 0 100% !important; }
}

/* ---- 6. Label / value rows (pricing cards) ---------------------------- */
@media (max-width: 767.98px) {
  .xt-g-4833f67c { gap: 12px; align-items: baseline; }
  .xt-g-5165baff { flex: 0 0 auto; white-space: nowrap; }
  .xt-g-56de607c { flex: 1 1 auto; text-align: right; min-width: 0; }
}

/* ---- 7. Hero statement card: keep amounts on one line ------------------ */
@media (max-width: 767.98px) {
  .xt-stmt-row { gap: 12px; align-items: baseline; }
  .xt-stmt-row > span:first-child { flex: 1 1 auto; min-width: 0; }
  .xt-g-085665f8 { flex: 0 0 auto; white-space: nowrap; }
}
