/* ============================================================
   Merlins Group shared navbar styles.
   All selectors are scoped under nav#navbar so they cannot
   leak into the rest of the page.
   ============================================================ */
nav#navbar {
  --nav-gold: var(--gold, #2563eb);
  --nav-accent: var(--accent, #10b981);

  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 0.7rem 2rem;
  display: flex;
  align-items: center;
  width: 94%;
  max-width: 1400px;
  border-radius: 60px;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  background: rgba(13, 27, 42, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: 'DM Sans', sans-serif;
}
nav#navbar.scrolled {
  background: rgba(13, 27, 42, 0.92);
  border-color: rgba(37, 99, 235, 0.12);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
  top: 0.6rem;
}

/* Logo */
nav#navbar .nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}
nav#navbar .nav-brand img {
  height: 72px;
  width: 72px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 50%;
  padding: 6px;
}

/* The right-hand cluster: socials + links + green CTA */
nav#navbar .nav-links {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  list-style: none;
  margin: 0 0 0 auto; /* push the whole row to the right */
  padding: 0;
}
nav#navbar .nav-links > li { list-style: none; }
nav#navbar .nav-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.3s;
  position: relative;
}
nav#navbar .nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--nav-gold);
  transition: width 0.3s;
}
nav#navbar .nav-links a:hover { color: var(--nav-gold); }
nav#navbar .nav-links a:hover::after { width: 100%; }
nav#navbar .nav-links a.active { color: var(--nav-gold); }
nav#navbar .nav-links a.active::after { width: 100%; }

/* Socials (LinkedIn + Instagram), positioned right before "Services" */
nav#navbar .nav-socials-li {
  display: flex;
  align-items: center;
  gap: 8px;
}
nav#navbar .nav-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.3s;
}
nav#navbar .nav-social:hover {
  background: var(--nav-gold);
  border-color: var(--nav-gold);
  color: #ffffff;
  transform: translateY(-2px);
}
nav#navbar .nav-social::after { display: none !important; }
nav#navbar .nav-social svg { width: 16px; height: 16px; display: block; }

/* Green "Book Your Free Review" button */
nav#navbar .nav-cta {
  background: var(--nav-accent) !important;
  color: #ffffff !important;
  padding: 9px 24px;
  border-radius: 40px;
  font-weight: 700 !important;
  text-decoration: none !important;
  transition: transform 0.3s, box-shadow 0.3s !important;
  display: inline-block;
}
nav#navbar .nav-cta:hover { transform: translateY(-2px); text-decoration: none !important; }
nav#navbar .nav-cta::after { display: none !important; }
nav#navbar .nav-cta-li { list-style: none; }

/* Hamburger toggle (mobile only) , morphs into an X when the menu is open */
nav#navbar .mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
nav#navbar .mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--nav-gold);
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
}
nav#navbar .mobile-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
nav#navbar .mobile-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
nav#navbar .mobile-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Lock background scroll while the mobile menu is open */
body.navbar-menu-open { overflow: hidden; touch-action: none; }

/* ============================================================
   Desktop ( ≥ 1101px ) , menu-only items are hidden up here
   ============================================================ */
@media (min-width: 1101px) {
  nav#navbar .menu-logo { display: none; }
}

/* ============================================================
   Mobile + tablet ( ≤ 1100px )
   Logo + hamburger in the top bar ; everything else folds
   into a full-screen menu that opens on toggle.
   ============================================================ */
@media (max-width: 1100px) {
  nav#navbar { padding: 0.5rem 1rem; }
  nav#navbar .nav-brand img { height: 50px; width: 50px; padding: 4px; }

  nav#navbar .nav-links {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(13, 27, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    z-index: 999;
    border-radius: 0;
    margin: 0;
  }
  nav#navbar .nav-links.active { display: flex; }
  nav#navbar .nav-links a { font-size: 1.4rem; color: rgba(255, 255, 255, 0.8) !important; }
  nav#navbar .nav-links .nav-cta { font-size: 1rem !important; padding: 12px 26px !important; }

  /* Logo at the top of the open menu */
  nav#navbar .menu-logo { list-style: none; margin: 0 0 1rem; }
  nav#navbar .menu-logo img {
    width: 72px; height: 72px; object-fit: contain;
    background: #ffffff; border-radius: 50%; padding: 6px; display: block;
  }

  /* Bigger socials inside the open menu */
  nav#navbar .nav-socials-li { gap: 1rem; }
  nav#navbar .nav-social {
    width: 46px; height: 46px;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
  }
  nav#navbar .nav-social svg { width: 20px; height: 20px; }

  nav#navbar .mobile-toggle {
    display: flex;
    z-index: 1000;
    flex-shrink: 0;
    margin-left: auto; /* push the hamburger to the far right of the top bar */
  }
}

@media (max-width: 380px) {
  nav#navbar .nav-brand img { height: 42px; width: 42px; }
}
