/* Admin sidebar toggle — hidden desktop */
.admin-sb-toggle { display: none; }

/* ═══════════════════════════════════════════════
   ftarastore — MOBILE RESPONSIVE
   assets/css/mobile.css
   Link di header.php setelah style.css
   ═══════════════════════════════════════════════ */

/* ── Hamburger & Mobile Nav Toggle ── */
.mob-menu-btn {
  display: none;
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 9px;
  border: 1.5px solid var(--b2);
  background: var(--card);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  transition: all .2s;
}
.mob-menu-btn span {
  display: block;
  width: 18px; height: 2px;
  background: var(--t2);
  border-radius: 99px;
  transition: all .3s;
}
.mob-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mob-menu-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mob-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile search toggle button */
.mob-search-btn {
  display: none;
  width: 38px; height: 38px;
  border-radius: 9px;
  border: 1.5px solid var(--b2);
  background: var(--card);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s;
}
.mob-search-btn svg { color: var(--t2); }

/* Mobile nav drawer */
.mob-nav-drawer {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity .25s, visibility .25s;
}
.mob-nav-drawer.open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.mob-nav-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  opacity: 1;
  backdrop-filter: blur(4px);
}

.mob-nav-panel {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  background: var(--card);
  border-right: 1.5px solid var(--b1);
  box-shadow: 4px 0 32px rgba(0,0,0,.5);
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 1;
}
.mob-nav-drawer.open .mob-nav-panel { transform: translateX(0); }

.mob-nav-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--b1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mob-nav-logo {
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 2.5px;
  color: var(--t1);
}
.mob-nav-logo .la { color: #0ea5e9; font-weight: 700; }
.mob-nav-logo .ls { color: #0ea5e9; }
.mob-nav-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--b2);
  background: var(--card2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--t2);
  font-size: 1.1rem;
  transition: all .2s;
}
.mob-nav-close:hover { color: var(--t1); border-color: var(--b3); }

.mob-nav-links { padding: 10px 0; flex: 1; }
.mob-nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--t2);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .18s;
}
.mob-nav-links a:hover,
.mob-nav-links a.on {
  background: var(--card2);
  color: #7dd3fc;
  border-left-color: #38bdf8;
}
.mob-nav-links a svg { flex-shrink: 0; opacity: .7; }
.mob-nav-links a:hover svg,
.mob-nav-links a.on svg { opacity: 1; color: #38bdf8; }

.mob-nav-divider {
  height: 1px;
  background: var(--b1);
  margin: 6px 20px;
}
.mob-nav-label {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--t3);
  padding: 10px 20px 4px;
  font-weight: 700;
}

.mob-nav-actions {
  padding: 14px 16px;
  border-top: 1px solid var(--b1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mob-nav-actions a,
.mob-nav-actions button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border-radius: 9px;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--f-body);
  transition: all .2s;
}
.mob-btn-ghost {
  background: var(--card2);
  border: 1.5px solid var(--b2);
  color: var(--t1);
}
.mob-btn-primary {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  border: none;
  color: #03111f;
  font-weight: 800;
  box-shadow: 0 3px 16px rgba(56,189,248,.4);
}

/* Mobile search bar overlay */
.mob-search-overlay {
  display: flex;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9995;
  padding: 12px 14px;
  background: var(--card);
  border-bottom: 1.5px solid var(--b1);
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
  gap: 10px;
  align-items: center;
  transform: translateY(-110%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  visibility: hidden;
  pointer-events: none;
}
.mob-search-overlay.open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}
.mob-search-overlay .search-bar {
  flex: 1;
  max-width: none;
}
.mob-search-cancel {
  background: none;
  border: none;
  color: var(--t2);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  padding: 8px 4px;
}

/* ════════════════════════════════
   BREAKPOINTS
   ════════════════════════════════ */

/* ── Tablet 768px ── */
@media (max-width: 768px) {
  /* Header */
  .hdr-top { padding: 10px 14px; gap: 8px; }
  .search-bar { display: none; } /* hide desktop search */
  .mob-search-btn { display: flex; }
  .hdr-actions { gap: 6px; }

  /* Hide text-only actions, keep icons or abbreviate */
  .hdr-actions .btn-ghost span,
  .hdr-actions .btn-ghost .action-label { display: none; }

  /* Nav horizontal scroll sudah ada — pastikan padding ok */
  .hdr-nav-inner { padding: 0 14px; gap: 0; }
  .nav-link { padding: 10px 14px; font-size: .82rem; }

  /* Hero */
  .hero-default { padding: 36px 24px; min-height: 320px; }
  .hero-grid { grid-template-columns: 1fr !important; }
  .hero-games { display: none; } /* hide mini cards on mobile */
  .hero-title { font-size: 2rem !important; }
  .hero-sub { font-size: .85rem !important; }
  .hero-stats { gap: 16px !important; }
  .hero-stat-num { font-size: 1.4rem !important; }

  /* Popular grid — handled in index.php inline style */

  /* Games grid */
  .games-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }

  /* Product grid */
  .product-grid { grid-template-columns: repeat(2, 1fr); }

  /* Game layout */
  .game-layout { grid-template-columns: 1fr; gap: 18px; }
  .order-panel { position: static; top: auto; }

  /* Checkout */
  .checkout-wrap { margin: 20px auto; padding: 0 14px; }
  .ck-body { padding: 18px 18px; }
  .ck-head { padding: 16px 18px; }

  /* Auth */
  .auth-page { margin: 28px auto; padding: 0 14px; }
  .auth-card { padding: 26px 20px; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; padding: 0 14px; }
  .footer-brand { grid-column: 1 / -1; }

  /* Admin */
  .admin-sb { width: 200px; }
  .admin-main { padding: 16px 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Cek transaksi */
  .cek-page { margin: 28px auto; padding: 0 14px; }

  /* Container */
  .container { padding: 0 14px; }
  .sec { padding: 20px 0; }
}

/* ── Mobile 480px ── */
@media (max-width: 480px) {
  /* Header — hamburger */
  .hdr-top { padding: 10px 12px; gap: 8px; }
  .mob-menu-btn { display: flex; }

  /* Hide desktop nav, use drawer instead */
  .hdr-nav { display: none; }

  /* Hide action buttons di header — ada di drawer */
  .hdr-actions .btn-ghost,
  .hdr-actions .btn-gold { display: none; }

  /* Hanya tampilkan: status, search icon, hamburger */
  .hdr-actions { gap: 6px; }

  /* Logo ukuran lebih kecil */
  .logo-name { font-size: 18px !important; letter-spacing: 1.5px !important; }
  .logo-tag { display: none; }

  /* Hero */
  .hero-default { padding: 28px 18px; min-height: 280px; border-radius: 14px; }
  .hero-title { font-size: 1.7rem !important; line-height: 1.2 !important; }
  .hero-eyebrow { font-size: .7rem !important; }
  .hero-sub { font-size: .82rem !important; display: none; }
  .hero-cta-row { gap: 8px !important; }
  .hero-cta, .hero-cta2 { padding: 10px 16px !important; font-size: .82rem !important; }
  .hero-stats { gap: 12px !important; padding-top: 16px !important; }
  .hero-stat-num { font-size: 1.2rem !important; }
  .hero-stat-label { font-size: .65rem !important; }

  /* Banner */
  .banner-slide img { height: 220px !important; }
  .banner-arrow { width: 34px; height: 34px; font-size: 1rem; }

  /* Popular — handled in index.php inline style */

  /* Games */
  .games-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .game-card-name { font-size: .7rem; }

  /* Section */
  .sec-title h2 { font-size: 1.05rem !important; }
  .container { padding: 0 12px; }
  .sec { padding: 18px 0; }
  .sec-hd { margin-bottom: 14px; }

  /* Cat tabs */
  .cat-tab { padding: 7px 13px; font-size: .78rem; }

  /* Product grid */
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .p-card { padding: 10px; }
  .p-name { font-size: .78rem; }
  .p-price { font-size: .95rem; }

  /* Game detail hero */
  .game-hero-inner { gap: 14px; }
  .game-hero-img, .game-hero-ph { width: 72px; height: 72px; }
  .game-hero-name { font-size: 1.5rem !important; }

  /* Checkout */
  .checkout-wrap { padding: 0 10px; margin: 14px auto; }
  .ck-head { padding: 14px 16px; }
  .ck-body { padding: 16px 16px; }
  .total-amount { font-size: 1.3rem; }
  .btn-pay { font-size: .95rem; padding: 13px; }

  /* Auth */
  .auth-page { margin: 16px auto; padding: 0 12px; }
  .auth-card { padding: 22px 16px; border-radius: 14px; }
  .auth-card h1 { font-size: 1.25rem; }

  /* Footer */
  .footer { padding: 28px 0 80px; margin-top: 20px; }
  .footer-inner { grid-template-columns: repeat(3, 1fr); gap: 18px 10px; padding: 0 14px; align-items: start; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand p { font-size: .77rem; margin-bottom: 12px; }
  .footer-logo img { height: 48px !important; max-width: 130px !important; }
  .footer-social { gap: 5px; margin-bottom: 12px; }
  .footer-social a { width: 30px; height: 30px; border-radius: 7px; }
  .footer-pay-icons { gap: 3px; }
  .pay-badge { padding: 2px 6px; font-size: .6rem; }
  .footer-col h4 { font-size: .8rem; margin-bottom: 10px; }
  .footer-col ul { gap: 7px; }
  .footer-col li a { font-size: .73rem; }
  .footer-bottom { flex-direction: column; gap: 4px; text-align: center; padding: 12px 14px; font-size: .7rem; }

  /* Admin — basic stats grid */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-val { font-size: 1.4rem; }
  .admin-title { font-size: 1.15rem; margin-bottom: 14px; }

  /* Table scroll */
  .table-wrap, .dtable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dtable { min-width: 560px; }

  /* Cek transaksi */
  .cek-page { padding: 0 12px; margin: 16px auto; }
  .cek-card { padding: 24px 18px; border-radius: 14px; }

  /* Success */
  .success-page { padding: 0 12px; margin: 16px auto; }
  .success-head { padding: 26px 20px; }

  /* Leaderboard */
  .lb-wrap { padding: 16px 0; }

  /* Kalkulator */
  .kalk-wrap { padding: 0 12px; margin: 20px auto; }
  .kalk-card { padding: 22px 16px; border-radius: 14px; }

  /* Flash message */
  .flash { top: 12px; right: 12px; left: 12px; max-width: none; font-size: .82rem; }

  /* Load more */
  .btn-load-more { padding: 10px 28px; font-size: .82rem; }

  /* CS FAB — sedikit lebih kecil */
  .cs-fab { bottom: 16px; right: 14px; }
  .cs-fab-btn { height: 42px; padding: 0 14px 0 5px; font-size: .78rem; }
  .cs-fab-icon { width: 32px; height: 32px; }
  .cs-fab-icon svg { width: 16px; height: 16px; }

  /* CS Panel */
  .cs-panel { width: 240px; }
}

/* ── Small mobile 375px ── */
@media (max-width: 375px) {
  .hero-title { font-size: 1.5rem !important; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .pop-icon-wrap { width: 40px; height: 40px; }
  .auth-card { padding: 18px 14px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Touch targets — semua tombol min 44px ── */
@media (max-width: 768px) {
  button, a, .nav-link, .cat-tab, .btn-ghost, .btn-gold, .btn-submit, .btn-pay {
    min-height: 44px;
  }
  .cat-tab { min-height: 38px; } /* exception — compact */
  .nav-link { min-height: 40px; }
  input, select, textarea { min-height: 44px; font-size: 16px !important; } /* prevent zoom on iOS */
}
/* ═══════════════════════════════════════════════════
   MOBILE REDESIGN — DG Style
   Bottom nav, compact header, 3-col grid
   ═══════════════════════════════════════════════════ */

/* ── Sembunyikan dg-sidebar di mobile, ganti bottom nav ── */
@media (max-width: 899px) {
  .dg-sidebar { display: none !important; }
  main.wrap, .wrap, .gp-wrap, .ck-wrap,
  .admin-wrap, .checkout-wrap { margin-left: 0 !important; }

  /* Beri ruang untuk bottom nav */
  body { padding-bottom: 64px !important; }
  .admin-layout body { padding-bottom: 0 !important; }
}

/* ════════════════════════════════════════════
   BOTTOM NAVIGATION BAR — DG Style
   ════════════════════════════════════════════ */
.mob-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 800;
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  height: 60px;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.4);
}
@media (max-width: 899px) {
  .mob-bottom-nav { display: flex !important; }
  .admin-layout .mob-bottom-nav { display: none !important; }
}
.mob-bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  padding: 8px 4px;
  text-decoration: none;
  color: #4a5568;
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .02em;
  transition: color .15s;
  min-height: 60px;
  position: relative;
}
.mob-bn-item svg { width: 22px; height: 22px; stroke-width: 1.7; }
.mob-bn-item.on { color: #e31837; }
.mob-bn-item.on::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: #e31837;
  border-radius: 0 0 3px 3px;
}
.mob-bn-item:hover { color: #8892a4; }

/* ════════════════════════════════════════════
   HEADER COMPACT — DG Style
   ════════════════════════════════════════════ */
@media (max-width: 480px) {
  .hdr { position: sticky; top: 0; z-index: 700; }
  .hdr-top {
    padding: 0 12px !important;
    height: 52px !important;
  }
  .logo-name { font-size: 17px !important; letter-spacing: 1px !important; }
  .search-bar { margin: 0 8px !important; }
  .hdr-nav2 {
    padding: 0 10px !important;
    height: 36px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }
  .hdr-nav2::-webkit-scrollbar { display: none !important; }
  .hdr-nav2-left .nav-link {
    padding: 5px 8px !important;
    font-size: .72rem !important;
    white-space: nowrap !important;
  }
  .nav-avatar-name { display: none !important; }
  .nav-avatar-btn { padding: 3px 6px 3px 3px !important; gap: 4px !important; }

  /* Banner — proporsional seperti DG */
  .banner-slider, .banner-wrap {
    height: auto !important;
    max-height: none !important;
    border-radius: 0 !important;
  }
  .banner-slide {
    height: auto !important;
  }
  .banner-slide img {
    height: auto !important;
    max-height: 180px !important;
    object-fit: cover !important;
  }
}

/* ════════════════════════════════════════════
   GAME GRID — 3 kolom seperti DG
   ════════════════════════════════════════════ */
@media (max-width: 899px) {
  .games-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  .game-card-name {
    font-size: .68rem !important;
    padding: 5px 7px 7px !important;
  }
}
@media (max-width: 380px) {
  .games-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 6px !important; }
  .game-card-name { font-size: .62rem !important; }
}

/* ════════════════════════════════════════════
   PRODUCT CARDS — 2 kolom
   ════════════════════════════════════════════ */
@media (max-width: 480px) {
  .product-grid, .p-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .p-card, .p-card2 {
    padding: 10px 10px !important;
  }
  .p-name { font-size: .78rem !important; line-height: 1.3 !important; }
  .p-price { font-size: .88rem !important; }
  .p-original { font-size: .65rem !important; }
}

/* Popular — handled in index.php inline style */

/* ════════════════════════════════════════════
   SECTION TITLES — compact
   ════════════════════════════════════════════ */
@media (max-width: 480px) {
  .sec-hd { margin-bottom: 10px !important; }
  .sec-title h2 { font-size: .95rem !important; }
  .sec { padding: 14px 0 !important; }
  .container { padding: 0 12px !important; }
  .sec-hd .btn-ghost { font-size: .72rem !important; padding: 5px 10px !important; }
}

/* ════════════════════════════════════════════
   CATEGORY TABS — scroll horizontal
   ════════════════════════════════════════════ */
@media (max-width: 480px) {
  .cat-tabs-wrap, .cats-row {
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 4px !important;
    flex-wrap: nowrap !important;
  }
  .cat-tab {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    padding: 6px 14px !important;
    font-size: .76rem !important;
    min-height: 34px !important;
  }
}

/* ════════════════════════════════════════════
   GAME PAGE (halaman produk) — DG style
   ════════════════════════════════════════════ */
@media (max-width: 480px) {
  .game-layout { grid-template-columns: 1fr !important; gap: 12px !important; }
  .game-hero-inner { gap: 10px !important; }
  .game-hero-img, .game-hero-ph { width: 60px !important; height: 60px !important; border-radius: 12px !important; }
  .game-hero-name { font-size: 1.2rem !important; }
  .order-panel {
    position: fixed !important;
    bottom: 60px !important; /* di atas bottom nav */
    left: 0 !important; right: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 12px 16px !important;
    z-index: 600 !important;
    box-shadow: 0 -4px 24px rgba(0,0,0,.5) !important;
  }
}

/* ════════════════════════════════════════════
   TOUCH TARGETS
   ════════════════════════════════════════════ */
@media (max-width: 480px) {
  button, .btn-gold, .btn-submit, .btn-pay { min-height: 42px !important; }
  .cat-tab { min-height: 34px !important; }
  input, select, textarea { min-height: 42px !important; font-size: 16px !important; }
  .mob-bn-item { min-height: 56px !important; }
}

/* ════════════════════════════════════════════════════════════
   FINAL FIXES — Bersih, tanpa duplikat
   ════════════════════════════════════════════════════════════ */

/* ── 1. HAMBURGER MENU: pastikan mob-nav-drawer terlihat saat .open ──
   JS menambah class .open → drawer harus visible + panel slide masuk  */
/* (sudah benar di atas: display:block, visibility:hidden, opacity:0) */

/* ── 2. SEARCH: z-index harus di atas header ── */
.mob-search-btn {
  display: none; /* default hidden, ditampilkan via @media di bawah */
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--b2);
  cursor: pointer;
  color: var(--t2);
  flex-shrink: 0;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 900;
}
.mob-search-btn:hover { border-color: var(--red); color: var(--t1); }

/* ── 3. HEADER: search bar desktop sembunyi di mobile ── */
@media (max-width: 899px) {
  /* Sembunyikan search bar di header row (desktop version) */
  .hdr-top > .search-bar { display: none !important; }
  /* Tampilkan tombol search mobile */
  .mob-search-btn { display: flex; }
  /* Hamburger button */
  .mob-menu-btn { display: flex; }
}

/* ── 4. BANNER: fix terpotong di mobile ── */
@media (max-width: 767px) {
  /* Reset semua konflik dari style.css dan index.php <style> */
  .banner-slider {
    overflow: hidden !important;
    font-size: 0 !important;
    line-height: 0 !important;
  }
  .banner-slide {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .banner-slide.active {
    display: block !important;
  }
  /* Hapus aspect-ratio:3/1 dari index.php <style> */
  .banner-frame {
    aspect-ratio: unset !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    display: block !important;
  }
  .banner-frame img {
    width: 100% !important;
    height: auto !important;
    max-height: 56vw !important;
    min-height: 120px !important;
    object-fit: cover !important;
    display: block !important;
    vertical-align: bottom !important;
  }
  .banner-arrow {
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 1rem !important;
  }
  .banner-arrow--prev { left: 6px !important; }
  .banner-arrow--next { right: 6px !important; }
  .banner-dots { bottom: 6px !important; }
}

/* ── 5. LAYOUT MOBILE: semua section rapi ── */
@media (max-width: 767px) {
  /* Container padding */
  .container,
  section.container,
  section.sec.container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* Hero wrap */
  .hero-wrap { margin-bottom: 16px !important; }

  /* Hero default (tanpa banner) */
  .hero-default {
    min-height: 0 !important;
    padding: 24px 16px !important;
    border-radius: 12px !important;
    margin: 0 12px 16px !important;
  }
  .hero-grid { grid-template-columns: 1fr !important; gap: 0 !important; }
  .hero-games { display: none !important; }
  .hero-title { font-size: 1.7rem !important; letter-spacing: -.5px !important; line-height: 1.15 !important; margin-bottom: 12px !important; }
  .hero-sub { display: none !important; }
  .hero-cta-row { gap: 8px !important; margin-bottom: 20px !important; }
  .hero-cta, .hero-cta2 { padding: 10px 16px !important; font-size: .82rem !important; flex: 1 !important; justify-content: center !important; }
  .hero-stats { gap: 16px !important; padding-top: 14px !important; }
  .hero-stat-num { font-size: 1.2rem !important; }
  .hero-stat-label { font-size: .6rem !important; }

  /* Section header */
  .sec { margin-bottom: 24px !important; }
  .sec-hd { margin-bottom: 12px !important; }
  .sec-title h2 { font-size: .95rem !important; }
  .sec-ico { width: 32px !important; height: 32px !important; border-radius: 9px !important; }

  /* Popular — handled in index.php inline style */
  .pop-card-v2 { border-radius: 10px !important; }
  .pop-topup-btn { font-size: .7rem !important; padding: 6px 0 !important; }

  /* All games grid: 3 kolom di mobile */
  .games-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  .game-card {
    aspect-ratio: unset !important;
    position: relative !important;
    border-radius: 10px !important;
  }
  .game-card-img {
    position: static !important;
    inset: unset !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1/1 !important;
    object-fit: cover !important;
  }
  .game-card-placeholder {
    position: static !important;
    inset: unset !important;
    width: 100% !important;
    aspect-ratio: 1/1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Category tabs: scroll horizontal */
  .cat-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 2px !important;
    gap: 6px !important;
    margin-bottom: 12px !important;
  }
  .cat-tabs::-webkit-scrollbar { display: none !important; }
  .cat-tab {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 6px 12px !important;
    font-size: .75rem !important;
  }

  /* Games wrap */
  .games-wrap.clamped { max-height: none !important; overflow: visible !important; }
  .load-more-box { text-align: center !important; margin-top: 10px !important; }
}

/* ═══════════════════════════════════════════════════════════
   CRITICAL FIX — Popular, Games Grid, Search Input
   ═══════════════════════════════════════════════════════════ */

/* ── POPULAR GRID — horizontal scroll (geser kiri-kanan) ── */
@media (max-width: 899px) {
  .pop-grid {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 10px !important;
    padding-bottom: 6px !important;
    scrollbar-width: none !important;
  }
  .pop-grid::-webkit-scrollbar { display: none !important; }
  .pop-card-v2 {
    flex: 0 0 130px !important;
    width: 130px !important;
    min-width: 130px !important;
    aspect-ratio: 3/4 !important;
    padding: 0 !important;
  }
}

/* ── FIX: GAMES GRID — 3 kolom di mobile seperti DG ──
   Override semua rule yang konflik */
@media (max-width: 899px) {
  .games-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
}
@media (max-width: 360px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ── FIX: SEARCH INPUT bisa diketik di mobile ──
   Masalah: pointer-events:none pada overlay parent tidak direset ke child
   Fix: pastikan input bisa diinteraksi saat overlay .open */
.mob-search-overlay.open,
.mob-search-overlay.open * {
  pointer-events: auto !important;
}
.mob-search-overlay.open input,
.mob-search-overlay.open input[type="text"],
.mob-search-overlay.open input[name="q"] {
  pointer-events: auto !important;
  -webkit-user-select: text !important;
  user-select: text !important;
  cursor: text !important;
  font-size: 16px !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: relative !important;
  z-index: 10 !important;
  display: block !important;
  width: 100% !important;
}
/* search-bar wrapper juga harus interaktif */
.mob-search-overlay.open .search-bar {
  pointer-events: auto !important;
  position: relative !important;
  z-index: 9 !important;
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
}
/* Cancel button */
.mob-search-cancel {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 10 !important;
  -webkit-tap-highlight-color: transparent !important;
  padding: 10px 8px !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
}

/* ═══════════════════════════════════════════════════════════════════
   ADMIN MOBILE LAYOUT — Override sidebar.php yang load di body
   Semua pakai !important karena sidebar.php <style> load setelah CSS
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 899px) {

  /* 1. Admin wrap: susun VERTIKAL (column), bukan horizontal */
  .admin-layout .admin-wrap,
  .admin-wrap {
    flex-direction: column !important;
    width: 100% !important;
    margin-left: 0 !important;
    gap: 0 !important;
  }

  /* 2. Admin sidebar: jadi COLLAPSIBLE BAR di atas (bukan sticky side) */
  .admin-layout .admin-sb,
  .admin-layout aside#admin-sb,
  aside.admin-sb {
    /* Reset dari sidebar.php */
    position: relative !important;
    top: auto !important;
    height: auto !important;
    min-height: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 0 !important;
    flex: none !important;
    /* Collapse state: tersembunyi penuh (logo & toggle sudah ada di header atas) */
    max-height: 0 !important;
    overflow: hidden !important;
    border-right: none !important;
    border-bottom: none !important;
    display: flex !important;
    flex-direction: column !important;
    transition: max-height .35s cubic-bezier(.4,0,.2,1) !important;
    z-index: 10 !important;
  }

  /* 3. Sidebar expanded: tampilkan semua menu (dropdown dari header) */
  .admin-layout .admin-sb.expanded,
  .admin-layout aside#admin-sb.expanded,
  aside.admin-sb.expanded {
    max-height: 1200px !important;
    overflow-y: auto !important;
    border-bottom: 1.5px solid rgba(255,255,255,.10) !important;
  }

  /* 4. Toggle button: selalu terlihat, sticky saat scroll */
  .admin-sb-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 16px !important;
    cursor: pointer !important;
    font-size: .84rem !important;
    font-weight: 600 !important;
    color: var(--t1) !important;
    background: var(--card2) !important;
    border-bottom: 1px solid rgba(255,255,255,.06) !important;
    min-height: 50px !important;
    height: 50px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 11 !important;
  }

  /* 5. Admin main: full width di bawah sidebar */
  .admin-layout .admin-main {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding: 12px 12px 80px !important;
    overflow-x: hidden !important;
    flex: 1 1 auto !important;
  }

  /* 6. main.wrap di admin: no left margin */
  .admin-layout main.wrap {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 !important;
  }

  /* 7. Admin sidebar logo & profile: tampil normal */
  .admin-sb .sb-logo,
  .admin-sb .sb-profile {
    display: flex !important;
  }

  /* 8. Sidebar items: full width */
  .admin-sb a,
  .admin-sb .sb-link,
  .admin-sb nav a {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 14px !important;
    white-space: nowrap !important;
  }
}

/* Tablet admin (481-899px): same column layout */
@media (max-width: 899px) and (min-width: 481px) {
  .admin-layout .admin-sb,
  aside.admin-sb {
    max-height: 0 !important;
  }
  .admin-layout .admin-sb.expanded,
  aside.admin-sb.expanded {
    max-height: 1200px !important;
  }
}

/* ════════════════════════════════════════════════════════
   ADMIN LAYOUT — Reset semua margin left akibat dg-sidebar
   ════════════════════════════════════════════════════════ */
@media (max-width: 899px) {
  body.admin-layout main.wrap,
  body.admin-layout .wrap,
  body.admin-layout .admin-wrap {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   ADMIN SIDEBAR — DRAWER MODE (slide dari kiri)
   Override semua rule accordion lama
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 899px) {

  /* Sembunyikan sidebar dari flow dokumen */
  .admin-layout .admin-sb,
  .admin-layout aside#admin-sb,
  aside.admin-sb {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    width: 280px !important;
    max-width: 80vw !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 1100 !important;
    transform: translateX(-100%) !important;
    transition: transform .3s cubic-bezier(.4,0,.2,1) !important;
    flex-direction: column !important;
    display: flex !important;
    border-right: 1px solid rgba(255,255,255,.08) !important;
    border-bottom: none !important;
    box-shadow: 4px 0 32px rgba(0,0,0,.6) !important;
    flex-shrink: 0 !important;
    flex: none !important;
  }

  /* Saat .open: slide masuk */
  .admin-layout .admin-sb.open,
  .admin-layout aside#admin-sb.open,
  aside.admin-sb.open {
    transform: translateX(0) !important;
  }

  /* Hapus expanded (accordion lama) — tidak dipakai lagi */
  .admin-layout .admin-sb.expanded,
  aside.admin-sb.expanded {
    max-height: none !important;
    transform: translateX(0) !important;
  }

  /* Overlay backdrop */
  .admin-sb-overlay {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,.65) !important;
    backdrop-filter: blur(3px) !important;
    z-index: 1099 !important;
    cursor: pointer !important;
  }
  .admin-sb-overlay.open {
    display: block !important;
  }

  /* Toggle lama di dalam sidebar: sembunyikan */
  .admin-sb-toggle {
    display: none !important;
  }

  /* Admin wrap: tidak perlu column lagi, sidebar sudah fixed */
  .admin-layout .admin-wrap,
  .admin-wrap {
    flex-direction: row !important;
    width: 100% !important;
    margin-left: 0 !important;
  }

  /* Admin main: full width (sidebar fixed, tidak ambil ruang) */
  .admin-layout .admin-main {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding: 12px 12px 80px !important;
  }

  /* main.wrap di admin */
  body.admin-layout main.wrap,
  .admin-layout main.wrap {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 0 !important;
  }

  /* Sidebar items */
  .admin-sb a,
  .admin-sb .sb-link,
  .admin-sb nav a {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}


/* ── Drawer admin mulai DI BAWAH header sticky (52px) ──
   Sebelumnya drawer top:0 → logo-nya tertutup header → muncul "gumpalan merah"
   kepotong di atas. Geser turun 52px supaya logo & isi drawer tampil utuh. */
@media (max-width: 899px) {
  .admin-layout .admin-sb,
  .admin-layout aside#admin-sb,
  aside.admin-sb {
    top: 52px !important;
    height: calc(100vh - 52px) !important;
    bottom: auto !important;
  }
  /* Backdrop juga mulai di bawah header → header tetap jelas (tidak ikut gelap) */
  .admin-sb-overlay { top: 52px !important; }
}

/* ── Sembunyikan notif di admin mobile ── */
@media (max-width: 899px) {
  .admin-layout #notif-wrap,
  .admin-layout #notif-btn,
  .admin-layout #notif-badge {
    display: none !important;
  }
}

/* ── Sembunyikan hdr-nav2 (row kedua header: notif+avatar) di mobile ──
   Konten sudah ada di dalam mobile drawer  */
@media (max-width: 899px) {
  .hdr-nav2-wrap { display: none !important; }
}

/* ════════════════════════════════════════════════════════════
   ADMIN MOBILE — Rapikan konten halaman fitur (anti TABRAKAN).
   Banyak halaman admin pakai grid/flex INLINE yang tidak ikut
   media query → paksa stack 1 kolom & kecilkan agar muat di HP.
   ════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  /* Tombol buka menu (☰) selalu di atas konten & bisa diklik */
  #hdr-admin-sb-toggle { position: relative !important; z-index: 60 !important; }

  /* Cegah scroll samping (konten "meluber") — kartu/tabel di dalam tetap bisa
     scroll sendiri lewat .card/.table-wrap di bawah. */
  .admin-layout .admin-wrap { overflow-x: hidden !important; max-width: 100vw !important; }
  .admin-layout .admin-main { padding: 12px 11px 90px !important; max-width: 100% !important; }

  /* Kartu statistik (class) → 2 kolom RINGKAS, tidak 1 kolom besar */
  .admin-layout .stats-grid,
  .admin-layout .kpi-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  /* Grid inline N-kolom → KARTU RINGKAS adaptif (≈2 kolom), bukan 1 kolom besar.
     Konten lebar tetap muat; kartu statistik jadi rapat & tidak kebesaran. */
  .admin-layout .admin-main [style*="grid-template-columns"] {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
  }
  /* Baris flex padat → boleh turun baris, tidak meluber */
  .admin-layout .admin-main [style*="display:flex"],
  .admin-layout .admin-main [style*="display: flex"] {
    flex-wrap: wrap !important;
  }
  /* Tabel data → bisa digeser ke samping, tidak menumpuk */
  .admin-layout .admin-main table { width: 100% !important; }
  .admin-layout .admin-main .table-wrap,
  .admin-layout .admin-main .dtable-wrap,
  .admin-layout .admin-main .admin-card,
  .admin-layout .admin-main .card {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Kecilkan & rapatkan elemen biar tidak kebesaran di HP */
  .admin-layout .admin-title { font-size: 1.02rem !important; }
  .admin-layout .admin-main h1 { font-size: 1.1rem !important; }
  .admin-layout .admin-main h2 { font-size: .98rem !important; }
  .admin-layout .admin-main h3 { font-size: .9rem !important; }
  .admin-layout .btn-sm { font-size: .7rem !important; padding: 6px 9px !important; }
  .admin-layout .stat-val, .admin-layout .kpi-val { font-size: 1.2rem !important; }
  /* Kartu/panel: padding lebih kecil (target pola inline padding besar) */
  .admin-layout .admin-main [style*="padding:24"],
  .admin-layout .admin-main [style*="padding: 24"],
  .admin-layout .admin-main [style*="padding:22"],
  .admin-layout .admin-main [style*="padding:28"],
  .admin-layout .admin-main [style*="padding:20"] { padding: 14px !important; }
  /* input 16px → cegah HP auto-zoom saat fokus ketik */
  .admin-layout input, .admin-layout select, .admin-layout textarea { font-size: 16px !important; }
}

/* ════════════════════════════════════════════
   TAMBAHAN RESPONSIVE — Halaman-halaman spesifik
   ════════════════════════════════════════════ */

/* ── Order Success: tombol stack vertikal di mobile ── */
@media (max-width: 480px) {
  .success-btn-row {
    flex-direction: column !important;
  }
  .success-btn-row a {
    flex: none !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

/* ── Horizontal scroll game cards: ukuran tepat di mobile ── */
@media (max-width: 480px) {
  .hscroll-row .game-card {
    flex: 0 0 100px !important;
    width: 100px !important;
  }
  .hscroll-row {
    gap: 8px !important;
  }
}
@media (max-width: 375px) {
  .hscroll-row .game-card {
    flex: 0 0 90px !important;
    width: 90px !important;
  }
}

/* ── Expanded grid (Lainnya) di mobile ── */
@media (max-width: 480px) {
  .hscroll-row.expanded .game-card {
    flex: 0 0 calc(33.33% - 6px) !important;
    width: auto !important;
  }
  .hscroll-row.expanded {
    gap: 8px !important;
  }
}
@media (max-width: 360px) {
  .hscroll-row.expanded .game-card {
    flex: 0 0 calc(50% - 4px) !important;
  }
}

/* ── Stats bar: kompak di mobile kecil ── */
@media (max-width: 375px) {
  .stats-num { font-size: 1rem !important; }
  .stats-lbl { font-size: .6rem !important; }
  .stats-item { padding: 12px 4px !important; }
}

/* ── Profile page: padding & stats di mobile kecil ── */
@media (max-width: 480px) {
  .up-wrap { padding: 0 12px 60px !important; }
  .up-identity { padding: 0 14px 16px !important; gap: 12px !important; }
  .up-actions { display: none !important; } /* tampilkan di dalam card */
  .up-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .up-stat-val { font-size: 1.1rem !important; }
}

/* ── Explore: hero padding ── */
@media (max-width: 480px) {
  .ex-hero { padding: 24px 0 18px !important; }
  .ex-hero h1 { font-size: 1.3rem !important; }
  .ex-wrap { padding: 0 12px 36px !important; }
  .ex-tab { padding: 10px 14px !important; font-size: .8rem !important; }
  .ex-ev-grid { grid-template-columns: 1fr !important; }
}

/* ── Search page: form & grid ── */
@media (max-width: 480px) {
  .container > div > div[style*="max-width:640px"] {
    margin-bottom: 20px !important;
  }
}

/* ── Promo page ── */
@media (max-width: 480px) {
  .pm-grid { padding-top: 16px !important; gap: 16px !important; }
  .ev-grid { gap: 10px !important; }
  .vc-grid { gap: 8px !important; }
}

/* ── Game hero: tinggi proporsional ── */
@media (max-width: 480px) {
  .gp-hero { height: clamp(180px, 48vw, 280px) !important; }
  .gp-wrap { padding: 0 12px 80px !important; }
}

/* ── Voucher home grid ── */
@media (max-width: 375px) {
  .voucher-home-grid { grid-template-columns: 1fr !important; }
}

/* ── Footer: bottom padding agar tidak ketutup bottom nav ── */
@media (max-width: 899px) {
  .footer { padding-bottom: 76px !important; }
  footer + * { margin-bottom: 0 !important; }
}

/* ── Flash message: tidak overflow ── */
@media (max-width: 375px) {
  .flash { font-size: .78rem !important; padding: 10px 12px !important; }
}

/* ── Announcement: jarak dari popular section ── */
@media (max-width: 899px) {
  #ann-section { margin-bottom: 16px !important; padding-bottom: 12px !important; }
}

/* ── CS Button: di atas bottom nav (nav = 60px) ── */
@media (max-width: 899px) {
  .chat-cs-wrap { bottom: 80px !important; right: 16px !important; }
}