/* ============================================
   NAV / HEADER  — v5.13 complete rebuild
   Dropdown: JS-toggled slide+fade, no hover dependency
   Mobile: slide-down overlay with stagger animation
============================================ */

/* ── HEADER ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 64px;
  background: rgba(6,8,16,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.25s, box-shadow 0.25s;
}
.site-header.scrolled {
  background: rgba(6,8,16,0.98);
  box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}
.header-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 1rem;
  width: 100%;
}

/* ── LOGO ── */
.site-logo {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; flex-shrink: 0;
}
.logo-icon { display: flex; align-items: center; }
.logo-text {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.logo-text span { color: var(--cyan); }

/* ── PRIMARY NAV (desktop) ── */
.primary-nav { flex: 1; }
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}
.nav-item { position: static; } /* no relative — dropdown is portal-style */

.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 8px 13px;
  font-size: 0.855rem; font-weight: 500;
  color: var(--text3);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
  text-decoration: none;
  border: none; background: transparent;
  font-family: inherit;
  user-select: none;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}
.nav-arrow {
  font-size: 0.55rem; opacity: 0.5;
  display: inline-block;
  transition: transform 0.22s ease;
}
.nav-item.open .nav-arrow { transform: rotate(180deg); }
.nav-item.open .nav-link  { color: var(--cyan); background: var(--cyan-glow); }

/* ── DROPDOWN PANEL ──
   Fixed to viewport, full-width strip below header.
   No overflow clipping possible.
──────────────────────────────── */
.nav-dropdown {
  position: fixed;
  top: 64px;
  left: 0; right: 0;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  z-index: 999;
  /* Animate: slide down + fade in */
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.16,1,0.3,1),
              opacity 0.18s ease,
              visibility 0s linear 0.2s;
}
.nav-dropdown.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.22s cubic-bezier(0.16,1,0.3,1),
              opacity 0.18s ease;
}
.nav-dropdown-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  gap: 6px;
}
.dropdown-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  text-decoration: none;
  flex: 1;
  min-width: 160px;
  transition: background 0.15s;
}
.dropdown-item:hover { background: rgba(255,255,255,0.06); }
.di-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--cyan-glow);
  border: 1px solid var(--border2);
  border-radius: 9px;
  color: var(--cyan); font-size: 0.75rem;
  margin-top: 1px;
}
.dropdown-item strong {
  display: block; font-size: 0.84rem; font-weight: 600;
  color: var(--text); margin-bottom: 2px;
}
.dropdown-item em {
  display: block; font-size: 0.73rem; font-style: normal;
  color: var(--text3); line-height: 1.45;
}
.dropdown-divider {
  width: 1px; background: var(--border); margin: 0 6px;
  align-self: stretch;
}

/* ── NAV ACTIONS ── */
.nav-actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; margin-left: auto;
}

/* ── HAMBURGER — now inside nav-actions, always last ── */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 9px;
  border-radius: 8px;
  border: 1.5px solid var(--border3);
  background: rgba(255,255,255,0.06);
  cursor: pointer; flex-shrink: 0;
  order: 99; /* always last in flex row */
}
.nav-toggle span {
  display: block; height: 1.5px;
  background: var(--text2); border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s; width: 100%;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── MOBILE NAV — slide in from top ── */
.mobile-nav {
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  z-index: 998;
  box-shadow: 0 16px 48px rgba(0,0,0,0.45);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  /* Slide animation */
  transform: translateY(-12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.16,1,0.3,1),
              opacity 0.22s ease,
              visibility 0s linear 0.28s;
}
.mobile-nav.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: transform 0.28s cubic-bezier(0.16,1,0.3,1),
              opacity 0.22s ease;
}

.mobile-menu { list-style: none; padding: 8px 0; }
.mobile-menu li a {
  display: flex; align-items: center;
  padding: 14px 0;
  font-size: 1rem; font-weight: 500;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  transition: color 0.15s, padding-left 0.15s;
  text-decoration: none;
}
.mobile-menu li:last-child a { border-bottom: none; }
.mobile-menu li a:hover { color: var(--cyan); padding-left: 6px; }

.mobile-nav-actions {
  display: flex; gap: 10px; padding: 12px 0 16px;
  border-top: 1px solid var(--border);
}
.mobile-nav-actions .btn { flex: 1; justify-content: center; }

/* ── LIGHT MODE ── */
body.dph-light .site-header {
  background: rgba(255,255,255,0.95) !important;
  border-bottom-color: rgba(0,0,0,0.10);
}
body.dph-light .site-header.scrolled {
  background: rgba(255,255,255,0.99) !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}
body.dph-light .logo-text { color: #0A1628; }
body.dph-light .logo-text span { color: var(--cyan); }
body.dph-light .nav-link { color: #000000; font-weight: 500; }
body.dph-light .nav-link:hover,
body.dph-light .nav-link.active { color: var(--cyan); background: rgba(0,98,204,0.06); }
body.dph-light .nav-item.open .nav-link { color: #0062CC; background: rgba(0,98,204,0.08); }
body.dph-light .nav-dropdown {
  background: #FFFFFF;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}
body.dph-light .dropdown-item:hover { background: #F0F5FF; }
body.dph-light .dropdown-item strong { color: #0A1628; }
body.dph-light .dropdown-item em { color: #6B7280; }
body.dph-light .dropdown-divider { background: rgba(0,0,0,0.07); }
body.dph-light .mobile-nav { background: #FFFFFF; }
body.dph-light .mobile-menu li a { color: #000000; border-bottom-color: rgba(0,0,0,0.07); }
body.dph-light .mobile-menu li a:hover { color: var(--cyan); }
body.dph-light .nav-toggle { border-color: rgba(0,0,0,0.18); background: rgba(0,0,0,0.04); }
body.dph-light .nav-toggle span { background: #000000; }
body.dph-light .mobile-nav-actions { border-top-color: rgba(0,0,0,0.08); }

/* ── SOCIAL / FOOTER LINKS ── */
.social-link {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text3); transition: all 0.18s; text-decoration: none;
}
.social-link:hover { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-glow); }
.social-link.whatsapp:hover  { border-color:#25D366; color:#25D366; background:rgba(37,211,102,0.08); }
.social-link.facebook:hover  { border-color:#1877F2; color:#1877F2; background:rgba(24,119,242,0.08); }

/* ── FOOTER ── */
.footer-trust {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--bg2); padding: 18px 0;
}
.footer-trust-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 2.5rem; flex-wrap: wrap;
}
.trust-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text3); white-space: nowrap; }
.trust-item svg { flex-shrink: 0; opacity: 0.8; }
.footer-main { background: var(--bg2); padding: 56px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 2.5rem; }
.footer-logo {
  display: flex; align-items: center; gap: 9px; text-decoration: none;
  font-family: var(--font-head); font-weight: 800; font-size: 1rem;
  color: var(--text); margin-bottom: 14px;
}
.footer-brand p { font-size: 0.82rem; color: var(--text3); line-height: 1.75; margin-bottom: 1.2rem; }
.footer-social { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-col h5 { font-family: var(--font-head); font-size: 0.82rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul a { font-size: 0.82rem; color: var(--text3); transition: color 0.18s; text-decoration: none; }
.footer-col ul a:hover { color: var(--cyan); }
.footer-bottom { background: var(--bg); border-top: 1px solid var(--border); padding: 18px 0; }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-copy { font-size: 0.78rem; color: var(--text3); }
.footer-legal { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-legal a { font-size: 0.78rem; color: var(--text3); text-decoration: none; transition: color 0.18s; }
.footer-legal a:hover { color: var(--text2); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .primary-nav { display: none; }
  .nav-toggle  { display: flex !important; }
  /* Hide text nav buttons on tablet — keep theme toggle + hamburger */
  .nav-auth-btn { display: none !important; }
}
@media (max-width: 600px) {
  .site-header { height: 58px; }
  .mobile-nav  { top: 58px; max-height: calc(100vh - 58px); }
  .header-inner { height: 58px; gap: 0.5rem; padding: 0 16px; }
  .logo-text { font-size: 1rem; }
  /* On mobile: theme toggle stays visible, auth buttons hidden (they're in mobile nav) */
  .nav-auth-btn { display: none !important; }
  .nav-actions .dph-theme-toggle { display: flex !important; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-trust-inner { gap: 1rem; justify-content: flex-start; }
  .trust-item { font-size: 0.75rem; }
  .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
}
