/* ══════════════════════════════════════════════════════
   NAVBAR FIX — BOTTOM SHEET
   Taruh ini PALING BAWAH di style.css
   (atau load terakhir setelah semua CSS lain)
══════════════════════════════════════════════════════ */

/* ── HAMBURGER BASE (semua ukuran) ── */
.hamburger {
  display: none;
  width: 40px; height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 5px; padding: 0;
  margin-left: auto;
  z-index: 1001;
  position: relative;
  transition: background 0.25s, border-color 0.25s;
}
.hamburger:hover {
  background: var(--surface-hover);
  border-color: var(--border-hi);
}
.hamburger span {
  display: block;
  width: 16px; height: 1.5px;
  background: var(--text);
  border-radius: 9px;
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── BACKDROP ── */
.nav-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 15, 60, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.nav-backdrop.visible { opacity: 1; }

/* ══════════════════════════════
   ≤ 900px — hamburger muncul, nav links disembunyikan
══════════════════════════════ */
@media (max-width: 900px) {
  .nav-inner { min-width: unset !important; width: 94vw; padding: 10px 16px; }
  .nav-links { display: none !important; }  /* sembunyikan nav links desktop */
  .hamburger { display: flex !important; }
}

/* ══════════════════════════════
   BOTTOM SHEET (aktif ≤ 900px)
══════════════════════════════ */
@media (max-width: 900px) {

  /* Nav links jadi bottom sheet */
  .nav-links {
    /* Reset */
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;

    /* Layout */
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;

    /* Tampilan sheet */
    background: #ffffff !important;
    border-radius: 24px 24px 0 0 !important;
    border-top: 1px solid var(--border) !important;
    border-left: 1px solid var(--border) !important;
    border-right: 1px solid var(--border) !important;
    border-bottom: none !important;
    box-shadow: 0 -12px 40px rgba(0, 20, 80, 0.12) !important;
    padding: 8px 24px 36px !important;
    overflow-y: auto !important;

    /* Animasi tersembunyi */
    transform: translateY(100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease !important;
    z-index: 999 !important;
  }

  /* State terbuka */
  .nav-links.open {
    transform: translateY(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Safe area iPhone */
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .nav-links {
      padding-bottom: calc(36px + env(safe-area-inset-bottom)) !important;
    }
  }

  /* Handle pill atas */
  .nav-links::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: var(--border-hi);
    border-radius: 9px;
    margin: 10px auto 0;
    flex-shrink: 0;
    order: -2;
  }

  /* Label NAVIGASI */
  .nav-sheet-label {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--text-dim);
    text-align: center;
    padding: 12px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
  }

  /* Nav item */
  .nl {
    font-size: 1.45rem !important;
    font-family: var(--font-display) !important;
    letter-spacing: 0.03em !important;
    color: var(--text) !important;
    padding: 15px 4px !important;
    border-radius: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    background: transparent !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    transition: color 0.2s, padding-left 0.2s !important;
  }
  .nl:last-child { border-bottom: none !important; }

  /* Panah kanan */
  .nl::after {
    content: '↗';
    font-size: 0.9rem;
    color: var(--text-dim);
    font-family: var(--font-body);
    transition: color 0.2s, transform 0.2s;
    flex-shrink: 0;
  }

  .nl:hover {
    color: var(--accent) !important;
    padding-left: 10px !important;
    background: transparent !important;
  }
  .nl:hover::after { color: var(--accent); }

  .nl.active {
    color: var(--accent) !important;
    background: transparent !important;
  }
  .nl.active::after { color: var(--accent); }
}

/* ══════════════════════════════
   ≤ 640px tweaks
══════════════════════════════ */
@media (max-width: 640px) {
  #navbar { top: 12px; }
  .nav-inner { width: 92vw !important; padding: 8px 14px !important; }
  .nav-logo { font-size: 1.2rem; }
  .logo-img { width: 30px; height: 30px; }
  .nav-links { padding: 8px 18px 32px !important; }
  .nl { font-size: 1.3rem !important; padding: 13px 4px !important; }
}

/* ══════════════════════════════
   ≤ 480px tweaks
══════════════════════════════ */
@media (max-width: 480px) {
  .nav-inner { width: 90vw !important; }
  .nav-logo { font-size: 1.1rem; gap: 7px; }
  .logo-img { width: 28px; height: 28px; }
  .nl { font-size: 1.2rem !important; }
}