/* ==========================================================
   mobile-fix.css  (v2, disesuaikan dengan styles.css kamu)
   Taruh SETELAH <link rel="stylesheet" href="/styles.css">
   ========================================================== */

/* ---------- 1. ANTI GESER KANAN ---------- */
/* "clip" tidak bikin scroll container baru (sticky header aman),
   beda dengan "hidden" yang dipasang di html + body sekaligus. */
html, body {
  max-width: 100%;
  overflow-x: hidden;   /* fallback browser lama */
  overflow-x: clip;
  overscroll-behavior-x: none;
}

/* Penyebab utama: drawer lama diparkir di luar layar kanan
   (right:0 + translateX(100%)). Di Chrome Android itu bikin
   halaman bisa digeser. Drawer baru parkir di kiri + visibility:hidden. */

/* header jangan melebihi layar di HP kecil (320-360px) */
.header-inner { min-width: 0; }
.nav-actions { flex-shrink: 0; }
.brand { min-width: 0; }
.brand-text { white-space: nowrap; }
@media (max-width: 480px) {
  .header-inner { gap: 12px; }
  .brand-text { font-size: 11px; }
  .nav-actions { gap: 8px; }
}

/* chat & sheet yang tertutup tidak ikut dihitung */
.chat-panel:not(.open) { visibility: hidden; pointer-events: none; }

/* ---------- 2. DRAWER ALA KIPAY (dark + neon) ---------- */
.drawer-bg {
  z-index: 998;
  background: rgba(0, 0, 0, 0.65);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.drawer-bg.open { visibility: visible; }

.drawer {
  z-index: 999;
  left: 0; right: auto;
  width: min(84vw, 320px);
  background: var(--bg-card);
  border-left: 0;
  border-right: 1px solid var(--border);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.55);
  transform: translateX(-102%);
  visibility: hidden;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.28s;
}
.drawer.open { transform: translateX(0); visibility: visible; }

/* header: logo + tombol X berbingkai */
.drawer-head { height: auto; padding: 16px 18px; flex: 0 0 auto; }
.drawer-brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--white);
}
.drawer-head .drawer-brand span {
  font-family: var(--mono);
  font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--white);
}
.drawer-head .drawer-brand span .neon { color: var(--neon); font-size: inherit; }
.drawer-brand-logo { width: 30px; height: 30px; object-fit: contain; }
.drawer-close { width: 40px; height: 40px; border-radius: 8px; flex: 0 0 auto; }

/* area scroll */
.drawer-scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; padding: 24px 0 12px; }

/* label seksi MENU / AKUN */
.drawer-section {
  padding: 0 22px; margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 12px; font-weight: 600; letter-spacing: 0.22em;
  color: var(--text-mute); text-transform: uppercase;
}
.drawer-links { padding: 0; gap: 0; flex: none; }
.drawer-section + .drawer-links { margin-bottom: 26px; }

/* item menu: ikon + teks, tanpa kotak border */
.drawer-links a {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 22px;
  font-family: var(--sans);
  font-size: 16px; font-weight: 500;
  text-transform: none; letter-spacing: 0;
  color: var(--text-soft);
  border: 0; background: transparent;
}
.drawer-links a svg { width: 22px; height: 22px; flex: 0 0 22px; }
.drawer-links a:hover,
.drawer-links a:active { color: var(--white); background: rgba(255, 255, 255, 0.04); }

/* penanda aktif (garis kiri neon) — tambahkan class "active" ke link */
.drawer-links a.active,
.drawer-links a[aria-current="page"] {
  color: var(--neon); font-weight: 700; background: var(--neon-bg);
}
.drawer-links a.active::before,
.drawer-links a[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--neon);
}

/* footer: tombol beli + kartu dukungan */
.drawer-foot {
  flex: 0 0 auto;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 10px;
}
.drawer-buy { display: block; width: 100%; padding: 10px 14px; font-size: 10.5px; letter-spacing: 0.1em; line-height: 1.2; }
.drawer-doc { display: flex; align-items: center; gap: 14px; padding: 10px 4px; color: var(--text-soft); }
.drawer-doc > svg:first-child { width: 24px; height: 24px; flex: 0 0 24px; }
.drawer-doc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.drawer-doc-text strong { color: var(--white); font-size: 16px; font-weight: 700; }
.drawer-doc-text small { color: var(--text-mute); font-size: 13px; }
.drawer-doc-arrow { width: 18px; height: 18px; flex: 0 0 18px; }
.drawer-doc:hover .drawer-doc-arrow { color: var(--neon); }

/* drawer hanya dipakai saat tombol hamburger tampil (<= 960px) */
@media (min-width: 961px) { .drawer, .drawer-bg { display: none; } }


/* ==========================================================
   3. ANIMASI
   (otomatis mati kalau HP/browser pakai "reduce motion")
   ========================================================== */
:root { --ease: cubic-bezier(0.2, 0.8, 0.2, 1); }

@keyframes fadeUp   { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink    { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes shine    { 0% { left: -60%; } 55%, 100% { left: 130%; } }
@keyframes glowFloat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.18); }
}
@keyframes neonGlow {
  from { text-shadow: 0 0 10px rgba(180, 255, 57, 0.2); }
  to   { text-shadow: 0 0 34px rgba(180, 255, 57, 0.65); }
}
@keyframes popularGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(180, 255, 57, 0); }
  50%      { box-shadow: 0 0 30px rgba(180, 255, 57, 0.16); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes drawerItemIn {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: none; }
}

/* progress bar scroll + header */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--neon-dim), var(--neon));
  box-shadow: 0 0 10px var(--neon);
  pointer-events: none;
}
.header { transition: border-color 0.3s, box-shadow 0.3s; }
.header.scrolled { border-bottom-color: var(--neon-border); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }

/* hero: masuk berurutan, glow melayang (grid sudah global di styles.css) */
.hero-status                { animation: fadeUp 0.7s var(--ease) both; }
.hero h1                    { animation: fadeUp 0.9s var(--ease) 0.12s both; }
.hero-inner > p             { animation: fadeUp 0.9s var(--ease) 0.28s both; }
.hero-inner .hero-actions   { animation: fadeUp 0.9s var(--ease) 0.42s both; }
.hero-meta                  { animation: fadeIn 1s ease 0.8s both; }
.hero h1 .neon              { animation: neonGlow 3s ease-in-out infinite alternate; }
.hero::before               { animation: glowFloat 8s ease-in-out infinite; }

/* label ala terminal (kursor berkedip) */
.section-label::after { content: "_"; margin-left: 4px; animation: blink 1s steps(1) infinite; }

/* tombol: kilau lewat */
.btn-lg.neon, .btn-neon, .product-buy { position: relative; overflow: hidden; }
.btn-lg.neon::after, .btn-neon::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-20deg); pointer-events: none;
  animation: shine 3.8s ease-in-out infinite;
}
.btn-neon::after { animation-delay: 1.5s; }

/* kartu produk & teknologi */
.product { transition: transform 0.25s var(--ease), border-color 0.2s, background-color 0.2s; }
.product:hover { transform: translateY(-6px); }
.product-icon, .tech-icon { transition: box-shadow 0.25s, border-color 0.25s, transform 0.25s, filter 0.25s; }
.product:hover .product-icon { border-color: var(--neon-border); box-shadow: 0 0 22px rgba(180, 255, 57, 0.3); }
.tech-item:hover .tech-icon  { transform: translateY(-3px); filter: drop-shadow(0 0 10px rgba(180, 255, 57, 0.5)); }
.grid-products .product:nth-child(2) { border-color: var(--neon-border); animation: popularGlow 3s ease-in-out infinite; }
.tech-status::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--neon); margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 8px var(--neon); animation: pulse 2s infinite;
}

/* muncul saat di-scroll (class ditambah oleh JS) */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition:
    opacity 0.7s var(--ease) var(--d, 0ms),
    transform 0.7s var(--ease) var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

/* tombol chat muncul memantul */
.chat-widget { animation: popIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s both; }

/* drawer: item masuk berurutan dari kiri */
.drawer.open .drawer-scroll > .drawer-section,
.drawer.open .drawer-links a,
.drawer.open .drawer-foot > * { animation: drawerItemIn 0.4s var(--ease) both; }
.drawer.open .drawer-scroll > .drawer-section:first-child        { animation-delay: 0.08s; }
.drawer.open .drawer-scroll > nav:first-of-type a:nth-child(1)   { animation-delay: 0.12s; }
.drawer.open .drawer-scroll > nav:first-of-type a:nth-child(2)   { animation-delay: 0.17s; }
.drawer.open .drawer-scroll > nav:first-of-type a:nth-child(3)   { animation-delay: 0.22s; }
.drawer.open .drawer-scroll > .drawer-section:nth-child(3)       { animation-delay: 0.28s; }
.drawer.open .drawer-scroll > nav:last-of-type a:nth-child(1)    { animation-delay: 0.32s; }
.drawer.open .drawer-scroll > nav:last-of-type a:nth-child(2)    { animation-delay: 0.37s; }
.drawer.open .drawer-foot > :nth-child(1)                        { animation-delay: 0.42s; }
.drawer.open .drawer-foot > :nth-child(2)                        { animation-delay: 0.48s; }

/* hormati pengaturan "kurangi animasi" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
