/* KHR — global mobile fixes (loads on EVERY page incl. theme/blog pages) */

/* 1. Never show two WhatsApp/contact bars stacked.
      Theme pages render .sticky-btn (Call Us + WhatsApp) — richer, so keep that
      and hide the single-action #khr-wa-bar there. */
body:has(.sticky-btn) #khr-wa-bar { display: none !important; }

/* 2. Reserve room so content is never hidden behind whichever bar is showing */
@media (max-width: 782px) {
  body:has(.sticky-btn),
  body:has(#khr-wa-bar) { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  .sticky-btn, #khr-wa-bar { padding-bottom: env(safe-area-inset-bottom, 0px) !important; }
}

/* 3. Tap targets on the bars >= 44px */
.sticky-btn a, #khr-wa-bar a { min-height: 44px; display: flex; align-items: center; justify-content: center; }

/* 4. No horizontal scroll anywhere on phones */
@media (max-width: 782px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  img, iframe, video, table { max-width: 100%; }
}

/* 5. Content tables (blog posts / guides) scroll inside themselves instead of
      pushing the whole page sideways on small phones */
@media (max-width: 782px) {
  .entry-content table, article table, .elementor-widget-container table,
  .wp-block-table table, .khr-content table {
    display: block; width: 100%; max-width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .entry-content table th, .entry-content table td,
  article table th, article table td { white-space: normal; min-width: 92px; }
}
