/* ============================================================
   MAIN MENU — shared across all pages (loaded after page styles)
   Adds the link menu + dropdowns + mobile hamburger panel to the
   existing fixed nav bar. Existing per-page rules keep styling
   .nav-inner / .nav-logo / .nav-phone / .nav-call / .nav-cta.
   ============================================================ */

nav .nav-inner {
  justify-content: flex-start;
  gap: 20px;
}
nav .nav-phone { margin-left: auto; }

/* ---- Link row ---- */
.nav-links {
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links li { position: relative; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  padding: 10px 9px;
  border-radius: 4px;
  transition: color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}
.nav-link:hover { color: var(--sky, #90CAF9); }
.nav-link .nav-caret {
  transition: transform 0.2s;
  flex-shrink: 0;
}

/* ---- Dropdowns (desktop) ---- */
.nav-sub {
  list-style: none;
  margin: 0;
  padding: 8px;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  background: var(--navy-light, #162438);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(13,27,42,0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.16s, transform 0.16s, visibility 0.16s;
  z-index: 110;
}
.nav-drop:hover > .nav-sub,
.nav-drop:focus-within > .nav-sub,
.nav-drop.open > .nav-sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-drop:hover > .nav-link .nav-caret,
.nav-drop.open > .nav-link .nav-caret { transform: rotate(180deg); }
.nav-sub a {
  display: block;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  padding: 10px 12px;
  border-radius: 5px;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.nav-sub a:hover {
  background: rgba(30,136,229,0.18);
  color: var(--white, #FFFFFF);
}

/* Mobile-only quote button inside the panel */
.nav-links-cta { display: none; }

/* ---- Hamburger ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--white, #FFFFFF);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
nav.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
nav.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
nav.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   MOBILE / TABLET (hamburger panel)
   ============================================================ */
@media (max-width: 1099px) {
  .nav-toggle { display: flex; }
  nav .nav-phone { display: none; }
  nav .nav-call { display: inline-flex; margin-left: auto; }

  /* nav has backdrop-filter, so it is the containing block for fixed/absolute
     descendants — anchor the panel to the bar and size it to the viewport. */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: calc(100vh - 112px);
    height: calc(100dvh - 112px);
    margin: 0;
    padding: 12px 20px 40px;
    background: var(--navy, #0D1B2A);
    border-top: 1px solid rgba(255,255,255,0.08);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 105;
  }
  nav.nav-open .nav-links { display: flex; }

  .nav-links > li { border-bottom: 1px solid rgba(255,255,255,0.07); }
  .nav-link {
    display: flex;
    width: 100%;
    justify-content: space-between;
    font-size: 15px;
    padding: 16px 4px;
    border-radius: 0;
  }

  /* Dropdowns become accordions */
  .nav-sub {
    position: static;
    min-width: 0;
    background: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0 0 8px 14px;
    opacity: 1;
    transform: none;
    visibility: visible;
    display: none;
  }
  .nav-drop.open > .nav-sub { display: block; }
  .nav-drop:hover > .nav-sub { display: none; }
  .nav-drop.open:hover > .nav-sub { display: block; }
  .nav-sub a {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    padding: 11px 10px;
  }

  .nav-links-cta {
    display: block;
    border-bottom: none !important;
    padding-top: 20px;
  }
  .nav-links-cta a {
    display: block;
    text-align: center;
    background: var(--blue, #1E88E5);
    color: var(--white, #FFFFFF);
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 15px 22px;
    border-radius: var(--radius, 6px);
    text-decoration: none;
  }
  .nav-links-cta a:hover { background: var(--blue-dark, #1565C0); }

  /* Lock page scroll while the panel is open */
  body.nav-menu-open { overflow: hidden; }
}

@media (max-width: 640px) {
  /* Call button + hamburger only; Free Quote lives inside the panel */
  nav .nav-cta { display: none; }
}
