/* ═══════════════════════════════════════════════════
   DebtView — hamburger.css
   Menu hambúrguer mobile (substitui o bottom nav)
   ═══════════════════════════════════════════════════ */

/* ── BOTÃO HAMBÚRGUER (só mobile) ─────────────────── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  padding: 0;
  flex-shrink: 0;
}
.hamburger-btn:hover {
  border-color: var(--text-muted);
  background: var(--surface2);
}
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s, width 0.3s;
  transform-origin: center;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── OVERLAY ──────────────────────────────────────── */
.hbg-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 400;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.hbg-overlay.visible {
  display: block;
}
.hbg-overlay.open {
  opacity: 1;
}

/* ── GAVETA (drawer) ──────────────────────────────── */
.hbg-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 85vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 401;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.34, 1.1, 0.64, 1);
  overflow-y: auto;
  box-shadow: -8px 0 40px rgba(0,0,0,0.35);
}
.hbg-drawer.open {
  transform: translateX(0);
}

/* ── DRAWER HEADER ────────────────────────────────── */
.hbg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.hbg-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--text);
}
.hbg-logo span { color: var(--red); }
.hbg-close {
  width: 32px;
  height: 32px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: color 0.2s, border-color 0.2s;
}
.hbg-close:hover { color: var(--text); border-color: var(--text-muted); }

/* ── NAV ITEMS ────────────────────────────────────── */
.hbg-nav {
  flex: 1;
  padding: 10px 12px;
}

.hbg-section-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px 4px;
}

.hbg-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 12px;
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  position: relative;
}
.hbg-item:hover {
  background: var(--surface2);
  color: var(--text);
}
.hbg-item.active {
  background: rgba(124, 92, 252, 0.1);
  color: var(--accent);
}
.hbg-item.active .hbg-item-icon {
  color: var(--accent);
}
.hbg-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
  transition: background 0.18s;
}
.hbg-item.active .hbg-item-icon {
  background: rgba(124, 92, 252, 0.15);
  border-color: rgba(124, 92, 252, 0.3);
}
.hbg-item-text { flex: 1; line-height: 1.1; }
.hbg-item-sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}
.hbg-item.active .hbg-item-sub { color: rgba(124,92,252,0.6); }

/* Divider */
.hbg-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 10px;
}

/* ── AÇÃO PRIMÁRIA (ex: Nova Dívida) ─────────────── */
.hbg-primary-action {
  padding: 14px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.hbg-primary-action .btn {
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  font-size: 15px;
  border-radius: 12px;
}
/* hidden by default; shown per-page */
.hbg-primary-action:empty { display: none; }

/* ── FOOTER DO DRAWER ─────────────────────────────── */
.hbg-footer {
  padding: 12px 20px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.hbg-footer-ver {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-align: center;
}

/* ── RESPONSIVE — só ativo no mobile ─────────────── */
@media (max-width: 600px) {
  /* Mostrar hambúrguer */
  .hamburger-btn { display: flex; }

  /* Esconder botões do header e nav bottom */
  .header-right  { display: none !important; }
  .mobile-nav    { display: none !important; }

  /* Garantir que o header tenha espaço pro botão */
  header {
    padding: 0 16px;
    height: 54px;
  }
}

@media (min-width: 601px) {
  /* Garantir que drawer e overlay nunca apareçam no desktop */
  .hbg-overlay,
  .hbg-drawer { display: none !important; }
}

/* ── ANIMAÇÃO DE ENTRADA DOS ITENS ────────────────── */
.hbg-drawer.open .hbg-item {
  animation: hbgItemIn 0.3s ease both;
}
.hbg-drawer.open .hbg-item:nth-child(1) { animation-delay: 0.04s; }
.hbg-drawer.open .hbg-item:nth-child(2) { animation-delay: 0.08s; }
.hbg-drawer.open .hbg-item:nth-child(3) { animation-delay: 0.12s; }
.hbg-drawer.open .hbg-item:nth-child(4) { animation-delay: 0.16s; }
.hbg-drawer.open .hbg-item:nth-child(5) { animation-delay: 0.20s; }
.hbg-drawer.open .hbg-item:nth-child(6) { animation-delay: 0.24s; }

@keyframes hbgItemIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
