/* WanTopup v84.99gu UI audit — loaded last on public pages.
 * 1. Mobile header: the 8 menu buttons used a 2-column grid (~330px, ~40% of the first screen) and
 *    pushed the H1 below the fold. They are now one swipeable row of pills.
 * 2. Mobile join bar: the fixed bar covered ~35% of the viewport on every page. It is now compact
 *    (title + three package buttons + WhatsApp); the subtitle and "Harga diskaun" line are hidden on
 *    small screens. Nothing is removed on desktop. Prices, links and the popup are unchanged.
 */
@media (max-width: 640px) {
  html body header.site-header.wantopup-header {
    padding-bottom: 10px !important;
  }
  html body:not(.wtp-admin-route) > header.site-header.wantopup-header[data-wtp-shared-header="1"] > nav.main-nav[data-wtp-public-main-menu="1"] {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 2px 2px 4px !important;
    margin-top: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
            mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  html body:not(.wtp-admin-route) > header.site-header.wantopup-header[data-wtp-shared-header="1"] > nav.main-nav[data-wtp-public-main-menu="1"]::-webkit-scrollbar {
    display: none;
  }
  html body:not(.wtp-admin-route) > header.site-header.wantopup-header[data-wtp-shared-header="1"] > nav.main-nav[data-wtp-public-main-menu="1"] > a.header-icon-link {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 8px 14px 8px 10px !important;
    border-radius: 999px !important;
    scroll-snap-align: start;
    white-space: nowrap !important;
    font-size: 14px !important;
    gap: 6px !important;
    justify-content: center !important;
  }
  html body:not(.wtp-admin-route) > header.site-header.wantopup-header[data-wtp-shared-header="1"] > nav.main-nav[data-wtp-public-main-menu="1"] > a.header-icon-link .header-icon {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    font-size: 15px !important;
  }

  /* Compact fixed join bar */
  html body aside.wtp-join-bar[data-wtp-join-global="1"] {
    padding: 10px 12px 12px !important;
    gap: 8px !important;
    border-radius: 18px 18px 0 0 !important;
  }
  html body aside.wtp-join-bar[data-wtp-join-global="1"] .wtp-join-copy {
    gap: 0 !important;
    padding-right: 30px !important;
  }
  html body aside.wtp-join-bar[data-wtp-join-global="1"] .wtp-join-copy > strong {
    font-size: 14px !important;
    line-height: 1.25 !important;
    margin: 0 !important;
  }
  html body aside.wtp-join-bar[data-wtp-join-global="1"] .wtp-join-copy > span {
    display: none !important;
  }
  html body aside.wtp-join-bar[data-wtp-join-global="1"] .wtp-join-links {
    gap: 6px !important;
  }
  html body aside.wtp-join-bar[data-wtp-join-global="1"] .wtp-join-links > a[data-wtp-sticky-popup] {
    min-height: 46px !important;
    padding: 6px 4px !important;
  }
  html body aside.wtp-join-bar[data-wtp-join-global="1"] .wtp-sticky-tier-sale {
    display: none !important;
  }
  html body aside.wtp-join-bar[data-wtp-join-global="1"] .wtp-join-whatsapp {
    min-height: 42px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
  }
  html body aside.wtp-join-bar[data-wtp-join-global="1"] .wtp-join-dismiss {
    top: 6px !important;
    right: 8px !important;
  }
}

/* 3. Legibility: on the small join-bar buttons the strike line crossed the middle of the digits, so
 *    "RM9 / RM99 / RM199" read like "RM0 / RM00 / RM100". Thin, offset strike line + slightly larger text. */
html body aside.wtp-join-bar[data-wtp-join-global="1"] .wtp-sticky-tier-was {
  font-size: 12px !important;
  line-height: 1.3 !important;
}
html body aside.wtp-join-bar[data-wtp-join-global="1"] .wtp-sticky-tier-was del,
html body .wtp-promo-old del,
html body .wtp-price-promo-note del {
  text-decoration-line: line-through !important;
  text-decoration-thickness: 1px !important;
  text-decoration-color: currentColor !important;
  font-variant-numeric: tabular-nums;
  opacity: .9;
}

/* 4. Contrast (WCAG AA): header brand text #168fd6 on white was 3.5:1; article section numbers 4.0:1. */
html body header.site-header.wantopup-header .brand > span {
  color: #0e6fa8 !important;
  -webkit-text-fill-color: #0e6fa8 !important;
}
html body .wtp-section-count {
  color: #0a6f6b !important;
  -webkit-text-fill-color: #0a6f6b !important;
}

/* 5. Desktop join bar: same content, less height (was ~170px of an 800px screen). */
@media (min-width: 641px) {
  html body aside.wtp-join-bar[data-wtp-join-global="1"] {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
  html body aside.wtp-join-bar[data-wtp-join-global="1"] .wtp-join-links > a[data-wtp-sticky-popup] {
    min-height: 54px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
  html body aside.wtp-join-bar[data-wtp-join-global="1"] .wtp-join-whatsapp {
    min-height: 44px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }
}

/* 6. Homepage link grids ("Panduan Ikut Topik" + intent hub): the <br> between title and description
 *    became an empty flex row, leaving a large gap. Title and description now sit together. */
html body .wtp-search-intent-hub .seo-link-grid > a > br {
  display: none !important;
}
html body .wtp-search-intent-hub .seo-link-grid > a {
  gap: 4px !important;
  justify-content: center !important;
}

/* 7. /kiraan-untung-topup-bil/: the 3-column example table was 819px wide inside a 367px phone column,
 *    so the "Jumlah" amounts were hidden off-screen. On phones each row becomes a small card:
 *    label on top, calculation left, amount right. */
@media (max-width: 640px) {
  html body table.wtp-profit-table,
  html body table.wtp-profit-table tbody,
  html body table.wtp-profit-table tr,
  html body table.wtp-profit-table th,
  html body table.wtp-profit-table td {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  html body table.wtp-profit-table thead { display: none !important; }
  html body table.wtp-profit-table caption { display: block !important; text-align: left !important; }
  html body table.wtp-profit-table tr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 2px 12px !important;
    padding: 10px 12px !important;
    border-bottom: 1px solid #e2ecec !important;
  }
  html body table.wtp-profit-table tr > th {
    grid-column: 1 / -1 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-size: 14px !important;
  }
  html body table.wtp-profit-table tr > td {
    padding: 0 !important;
    border: 0 !important;
    white-space: normal !important;
  }
  html body table.wtp-profit-table tr > td:last-child {
    font-weight: 800 !important;
    text-align: right !important;
    white-space: nowrap !important;
  }
}
@media (max-width: 640px) {
  html body table.wtp-profit-table tr.wtp-profit-total > td { background: transparent !important; }
}

/* 8. Homepage "Panduan Ikut Topik": 12 full-width cards were ~1,400px tall on phones. Two compact
 *    columns of titles; the one-line descriptions stay in the HTML and show from 641px up. */
@media (max-width: 640px) {
  html body .wtp-keyword-hubs .seo-link-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  html body .wtp-keyword-hubs .seo-link-grid > a {
    min-height: 52px !important;
    padding: 10px 12px !important;
    align-items: flex-start !important;
  }
  html body .wtp-keyword-hubs .seo-link-grid > a > small {
    display: none !important;
  }
  html body .wtp-keyword-hubs .seo-link-grid > a > strong {
    font-size: 15px !important;
    line-height: 1.25 !important;
  }
}

/* 9. Article pages: one visible link to the main guide of the topic (hub), under "Untuk siapa". */
html body .wtp-editorial-article p.wtp-hub-link {
  margin: 14px 0 0 !important;
  padding: 12px 16px !important;
  border: 1px solid #cfe3ee !important;
  border-radius: 12px !important;
  background: #f3f8fc !important;
  color: #24404f !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
}
html body .wtp-editorial-article p.wtp-hub-link a {
  color: #0e6fa8 !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
