/*
 * BorThong Mobile Base — ใช้ร่วมทุกแอป
 * ป้องกัน zoom iOS, touch target, scroll ตาราง
 */

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

button,
a,
[role="button"],
input[type="submit"],
input[type="button"] {
  touch-action: manipulation;
}

@media (max-width: 768px) {

  /* ป้องกัน iOS zoom เมื่อ focus input */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Touch target ขั้นต่ำ ~44px */
  button:not(.nav-subitem):not(.topbar-icon-btn),
  .btn,
  .btn-primary,
  .btn-secondary,
  .theme-btn-primary,
  .nav-item,
  .prpo-bnav-item,
  .prpo-hbr {
    min-height: 44px;
  }

  /* ตาราง scroll แนวนอนได้ */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-content,
  .container,
  main {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* Modal กว้างเต็มจอ */
  .modal-content,
  .modal-dialog {
    max-width: calc(100vw - 24px) !important;
    margin: 12px auto !important;
  }

  /* Card padding บนมือถือ */
  .card,
  .theme-card {
    padding: 1rem !important;
  }

  /* Topbar hamburger แสดงชัด */
  .topbar-hamburger {
    display: flex !important;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.35rem !important;
  }

  h2 {
    font-size: 1.15rem !important;
  }
}
