/**
 * Mobile lock — cegah geser kiri/kanan, konten tetap full width
 * Include di semua halaman: <link rel="stylesheet" href="/css/mobile-lock.css">
 */
html {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-text-size-adjust: 100%;
  touch-action: pan-y pinch-zoom;
}

body {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  position: relative !important;
  overscroll-behavior-x: none;
}

/* Semua section utama tidak boleh melebar */
header, nav, main, section, footer, .topbar, .topbar-wrapper,
.bottom-nav, #products-grid, .max-w-6xl, .max-w-7xl {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

img, video, iframe, canvas, svg, table, pre {
  max-width: 100% !important;
  height: auto;
}

/* Grid/flex anak jangan paksa melebar */
.grid > *, .flex > * {
  min-width: 0 !important;
}

/* Input/select full di mobile */
@media (max-width: 640px) {
  input, select, textarea, button {
    max-width: 100% !important;
  }

  .bottom-nav {
    width: calc(100% - 20px) !important;
    max-width: 100% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  /* Tab kategori boleh scroll dalam, bukan geser page */
  #category-tabs-container,
  #game-subchips-container,
  .overflow-x-auto {
    max-width: 100% !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Card produk 3 kolom tetap muat */
  #products-grid {
    width: 100% !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }

  .product-card {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Cegah elemen absolute/fixed melebar viewport */
.absolute, .fixed {
  max-width: 100vw;
}
