/* =========================================================
   HEADER / NAV ONLY (NO CONFLICT WITH style.css)
   File: assets/css/header-nav.css
========================================================= */

:root {
  /* If these vars are already in style.css, this will just reuse them */
  --nav-height: 72px;
  --transition-fast: 0.2s ease;
}

/* HEADER BASE */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 999;

  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.6), transparent);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.navbar .container,
.navbar-inner,
.nav-links-wrap,
.nav-links {
  overflow: visible !important;
}

.navbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* BRAND */
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: radial-gradient(circle at 20% 20%, var(--accent-2), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 35px rgba(79, 70, 229, 0.7);
  font-size: 1.05rem;
}
.brand-text { display: flex; flex-direction: column; }
.brand-title {
  font-family: Poppins, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.brand-subtitle { font-size: 0.78rem; color: var(--text-muted); }

/* DESKTOP LINKS */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  position: relative;
  padding: 0.25rem 0;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.15rem;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.nav-links a:hover { color: var(--text-main); }
.nav-links a:hover::after { width: 100%; }

/* ACTIVE */
.nav-links a.active { color: var(--text-main); }
.nav-links a.active::after { width: 100%; }

/* CTA BUTTONS */
.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 0.65rem 1.35rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.55);
  font-weight: 500;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 60px rgba(79, 70, 229, 0.7);
}
.btn-outline {
  border-color: rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-main);
}
.btn-outline:hover {
  background: rgba(30, 64, 175, 0.4);
  border-color: rgba(129, 140, 248, 0.8);
}

/* MOBILE TOGGLE */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 8px;
}
.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text-main);
  border-radius: 999px;
  transition: all var(--transition-fast);
}

/* MOBILE MENU */
.nav-mobile { display: none; }

/* =========================================================
   DROPDOWN FIX (NO DISAPPEAR + COMPACT + SOLID)
========================================================= */

/* Hover bridge so cursor doesn’t lose hover between parent and submenu */
.nav-links > li {
  position: relative;
  padding-bottom: 14px;
}

/* Submenu panel */
.nav-links > li > ul.sub-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);

  min-width: 260px;
  max-width: 320px;
  padding: 8px;

  border-radius: 16px;
  background: var(--bg-section);               /* SOLID */
  border: 1px solid rgba(148, 163, 184, 0.30);
  box-shadow: 0 22px 70px rgba(0,0,0,0.55);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 10000;
}

/* Invisible bridge area */
.nav-links > li > ul.sub-menu::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -14px;
  height: 14px;
  background: transparent;
}

/* Show submenu */
.nav-links > li:hover > ul.sub-menu,
.nav-links > li:focus-within > ul.sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Submenu items */
.nav-links ul.sub-menu {
  list-style: none;
  margin: 0;
}
.nav-links ul.sub-menu li + li { margin-top: 6px; }

.nav-links ul.sub-menu li a {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.20);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.nav-links ul.sub-menu li a:hover {
  transform: translateY(-1px);
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(34, 211, 238, 0.45);
}

/* Keep parent highlighted when child active */
.nav-links > li.current-menu-ancestor > a,
.nav-links > li.current_page_ancestor > a {
  color: var(--text-main);
}
.nav-links > li.current-menu-ancestor > a::after,
.nav-links > li.current_page_ancestor > a::after {
  width: 100%;
}

/* =========================================================
   RESPONSIVE NAV
========================================================= */
@media (max-width: 820px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }

  .nav-mobile {
    display: block;
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0;

    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);

    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 998;
  }
  .nav-mobile.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-mobile-inner {
    padding: 0.7rem 1.5rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }

  .nav-mobile-links a {
    display: block;
    padding: 0.45rem 0;
    font-size: 0.9rem;
    color: var(--text-main);
  }

  .nav-mobile-links a + a {
    border-top: 1px solid rgba(148, 163, 184, 0.3);
  }

  .nav-mobile-links a.active { color: var(--accent-2); }

  .nav-mobile-cta {
    margin-top: 0.6rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
}

/* Prevent scroll when mobile menu open */
html.nav-open, body.nav-open { overflow: hidden; }



/* =========================================================
   WP ADMIN BAR FIX (prevents overlap on logged-in users)
========================================================= */

/* Desktop admin bar (usually 32px) */
body.admin-bar .navbar{
  top: 32px;
}

/* WP admin bar becomes taller on smaller screens (usually 46px) */
@media (max-width: 782px){
  body.admin-bar .navbar{
    top: 46px;
  }
}

/* Optional: if your layout uses any top padding/margin for the hero,
   ensure the first section doesn't hide under the fixed navbar */
body.admin-bar .site-wrapper{
  padding-top: 0;
}
