/* Mobile layout fixes for official-type pages with large product/funding tables. */
@media (max-width: 767px) {
  html, body { overflow-x: hidden; }
  body.body-hfm .container,
  body.body-hfm .container-fluid {
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  body.body-hfm h1 {
    font-size: clamp(30px, 9vw, 42px) !important;
    line-height: 1.02 !important;
    letter-spacing: -0.03em !important;
    margin-bottom: 12px !important;
    word-break: normal !important;
  }

  body.body-hfm h2 {
    font-size: clamp(24px, 7vw, 34px) !important;
    line-height: 1.12 !important;
    letter-spacing: -0.02em !important;
  }

  body.body-hfm h3,
  body.body-hfm h4,
  body.body-hfm h5 {
    line-height: 1.2 !important;
  }

  body.body-hfm p,
  body.body-hfm li {
    font-size: 15.5px !important;
    line-height: 1.6 !important;
  }

  body.body-hfm .breadcrumb,
  body.body-hfm ol.breadcrumb,
  body.body-hfm ul.breadcrumb {
    flex-wrap: wrap !important;
    gap: 4px !important;
    font-size: 12.5px !important;
    line-height: 1.35 !important;
  }

  /* Make big comparison/funding tables usable on phone instead of squeezing text. */
  body.body-hfm table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
    border-collapse: separate !important;
  }

  body.body-hfm table::before {
    content: "Geser tabel ke samping untuk melihat semua kolom";
    display: block;
    position: sticky;
    left: 0;
    width: max-content;
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #fff3f3;
    color: #9f1d22;
    font-size: 12px;
    font-weight: 700;
  }

  body.body-hfm table th,
  body.body-hfm table td {
    min-width: 116px !important;
    max-width: 190px !important;
    padding: 10px 9px !important;
    font-size: 12.5px !important;
    line-height: 1.35 !important;
    vertical-align: top !important;
    white-space: normal !important;
  }

  body.body-hfm table th:first-child,
  body.body-hfm table td:first-child {
    min-width: 132px !important;
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 6px 0 12px rgba(0,0,0,.06);
  }

  body.body-hfm table thead th,
  body.body-hfm table tr:first-child th {
    font-size: 12px !important;
    line-height: 1.25 !important;
  }

  body.body-hfm .btn,
  body.body-hfm a.btn,
  body.body-hfm input[type="submit"] {
    width: 100% !important;
    max-width: 100% !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.25 !important;
    padding: 12px 14px !important;
    border-radius: 10px !important;
  }

  body.body-hfm .hfm-seo-official-links {
    margin-top: 8px !important;
    padding: 24px 0 !important;
  }

  body.body-hfm .hfm-seo-official-links p {
    max-width: 62ch;
  }

  body.body-hfm .hfm-seo-official-grid {
    grid-template-columns: 1fr !important;
  }

  body.body-hfm .hfm-seo-official-grid a {
    padding: 14px !important;
  }

  body.body-hfm .hfm-bottom-disclosure,
  body.body-hfm #hfmindonesia-bottom-disclosure {
    font-size: 11.5px !important;
    line-height: 1.55 !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}
