/* Performa responsif global — semua halaman, semua perangkat */

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

body {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
.nav-item,
.product-card,
.order-card,
.cart-item,
.qty-btn,
.tab-f {
  touch-action: manipulation;
}

/* Saat scroll: matikan transisi/animasi berat */
html.pm-is-scrolling,
html.pm-is-scrolling * {
  transition-duration: 0.01ms !important;
  animation: none !important;
}

html.pm-is-scrolling .order-card,
html.pm-is-scrolling .product-card {
  transform: none !important;
}

html.pm-is-scrolling .order-card {
  pointer-events: none;
}

/* Touch / APK: kurangi blur & shadow mahal */
@media (max-width: 1024px), (pointer: coarse) {
  .orders-page::before,
  .order-card,
  .orders-hero-actions .topbar-btn,
  .orders-filter-panel,
  .orders-table-wrap,
  .orders-stats .ostat {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .order-card {
    animation: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12) !important;
  }

  .order-card:hover {
    transform: none !important;
  }
}

html.pm-android-shell .order-card,
html.pm-android-shell .orders-table tbody tr {
  animation: none !important;
}

/* Keranjang: hindari layout thrash */
.cart-items {
  contain: layout style;
}

.cart-item {
  contain: layout style paint;
}

/* Daftar pesanan: scroll seluruh halaman (bukan hanya area kartu) */
@media (max-width: 1024px) {
  .page-wrap.orders-page {
    display: block !important;
    flex-direction: column !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    min-height: 0 !important;
  }

  .orders-page .orders-body {
    flex: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: auto !important;
    overscroll-behavior: auto !important;
    contain: none !important;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .orders-page .orders-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .orders-page .orders-filter-status .tab-filter {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .orders-page .orders-filter-status .tab-filter::-webkit-scrollbar {
    display: none !important;
  }

  .orders-page .orders-filter-status .tab-filter .tab-f {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
