/* ==========================================================================
   nav.css — site header & navigation. Classes are namespaced `nv-`.
   Uses the global tokens from styles.css (:root).
   ========================================================================== */

.nv {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid rgba(27,58,92,.08);
  transition: box-shadow .3s ease, background .3s ease;
}
.nv.scrolled { background: rgba(255,255,255,.97); box-shadow: 0 10px 30px -18px rgba(20,33,61,.35); }

.nv-bar {
  max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 72px;
  display: flex; align-items: center; gap: 28px;
}

.nv-logo { flex-shrink: 0; display: flex; align-items: center; gap: 12px; }

/* --- Desktop links ------------------------------------------------------- */
.nv-nav { flex: 1; display: flex; justify-content: center; }
.nv-list { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.nv-list > li { position: relative; }

.nv-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; border-radius: 10px;
  font: 500 15px/1 'Inter', sans-serif; color: var(--dark);
  background: none; border: 0; cursor: pointer; white-space: nowrap;
  transition: color .2s ease, background .2s ease;
}
.nv-link:hover, .nv-item.is-open > .nv-link { color: var(--primary); background: rgba(27,58,92,.06); }
.nv-link[aria-current="page"], .nv-link.is-current { color: var(--primary); font-weight: 600; background: rgba(27,58,92,.09); }
.nv-link:focus-visible, .nv-btn:focus-visible, .nv-burger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.nv-chev { transition: transform .25s ease; opacity: .7; }
.nv-item.is-open .nv-chev { transform: rotate(180deg); opacity: 1; }

/* --- Dropdown panels ----------------------------------------------------- */
.nv-panel {
  position: absolute; top: calc(100% + 14px); left: 50%;
  width: 360px; padding: 22px 22px 18px;
  background: #fff; border-radius: 18px;
  border: 1px solid rgba(27,58,92,.08);
  box-shadow: 0 30px 60px -24px rgba(20,33,61,.35), 0 2px 6px rgba(20,33,61,.04);
  opacity: 0; visibility: hidden; transform: translate(-50%, 8px);
  transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}
/* hover bridge so the panel doesn't close while moving the mouse down */
.nv-panel::before { content: ''; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
/* small pointer */
.nv-panel::after {
  content: ''; position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; margin-left: -6px;
  background: #fff; border-left: 1px solid rgba(27,58,92,.08); border-top: 1px solid rgba(27,58,92,.08);
  transform: rotate(45deg);
}
.nv-item.is-open .nv-panel {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
  transition: opacity .22s ease, transform .22s ease, visibility 0s;
}

.nv-panel--wide { width: 620px; display: grid; grid-template-columns: 1fr 210px; gap: 22px; padding: 22px; }

.nv-panel-title {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--mid); margin: 0 0 10px 10px;
}
.nv-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
.nv-grid a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  font-size: 14.5px; font-weight: 500; color: var(--dark);
  transition: background .18s ease, color .18s ease;
}
.nv-grid a::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: rgba(27,58,92,.2); transition: background .18s ease, box-shadow .18s ease;
}
.nv-grid a:hover { background: var(--bg); color: var(--primary); }
.nv-grid a:hover::before { background: var(--accent); box-shadow: 0 0 0 3px rgba(201,154,59,.2); }
.nv-grid a[aria-current="page"] { color: var(--primary); font-weight: 600; }
.nv-grid a[aria-current="page"]::before { background: var(--accent); }

.nv-all {
  display: inline-flex; align-items: center; gap: 6px; margin: 12px 0 0 10px;
  font-size: 14px; font-weight: 600; color: var(--primary);
}
.nv-all span { transition: transform .2s ease; }
.nv-all:hover span { transform: translateX(3px); }

.nv-panel-aside {
  position: relative; overflow: hidden; border-radius: 14px; padding: 20px 18px;
  background: linear-gradient(160deg, var(--primary), var(--dark));
  color: rgba(255,255,255,.75); font-size: 13.5px; line-height: 1.55;
}
.nv-panel-aside::after {
  content: ''; position: absolute; width: 180px; height: 180px; right: -80px; bottom: -90px; border-radius: 50%;
  border: 2px solid rgba(201,154,59,.45);
}
.nv-panel-aside img { width: 40px; height: 40px; border-radius: 10px; margin-bottom: 14px; display: block; }
.nv-aside-title { color: #fff; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.nv-aside-call {
  position: relative; z-index: 1; display: inline-block; margin-top: 14px; padding: 9px 14px; border-radius: 10px;
  background: var(--accent); color: var(--dark); font-weight: 700; font-size: 14px;
  transition: background .2s ease;
}
.nv-aside-call:hover { background: #fff; }

/* --- Right side ---------------------------------------------------------- */
.nv-cta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.nv-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: 11px; font-weight: 600; font-size: 15px; white-space: nowrap;
  border: 1.5px solid transparent; transition: background .2s ease, transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.nv-btn--solid { background: var(--primary); color: #fff; box-shadow: 0 8px 20px -10px rgba(27,58,92,.7); }
.nv-btn--solid:hover { background: var(--primary-dark); transform: translateY(-1px); }
.nv-btn--line { color: var(--primary); border-color: rgba(27,58,92,.25); }
.nv-btn--line:hover { border-color: var(--primary); background: rgba(27,58,92,.04); }
.nv-call { gap: 8px; }
.nv-call svg { color: var(--accent); }

.nv-burger {
  display: none; position: relative; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(27,58,92,.06); border: 0; cursor: pointer;
}
.nv-burger span {
  position: absolute; left: 12px; width: 20px; height: 2px; border-radius: 2px; background: var(--dark);
  transition: transform .3s ease, opacity .2s ease, top .3s ease;
}
.nv-burger span:nth-child(1) { top: 15px; }
.nv-burger span:nth-child(2) { top: 21px; }
.nv-burger span:nth-child(3) { top: 27px; }
.nv-open .nv-burger span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nv-open .nv-burger span:nth-child(2) { opacity: 0; }
.nv-open .nv-burger span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

.nv-mobile-cta { display: none; }

/* --- Medium desktops: tighten ------------------------------------------- */
@media (max-width: 1240px) {
  .nv-bar { gap: 18px; }
  .nv-link { padding: 10px 10px; font-size: 14.5px; }
}

/* --- Mobile / tablet ----------------------------------------------------- */
@media (max-width: 1060px) {
  .nv-bar { height: 66px; padding: 0 16px; justify-content: space-between; }
  .nv-burger { display: block; }
  .nv-book { display: none; }
  .nv-call { padding: 10px 14px; }

  .nv-nav {
    /* absolute, not fixed: the header's backdrop-filter makes it the containing block */
    position: absolute; top: 100%; left: 0; right: 0;
    height: calc(100vh - 66px); height: calc(100dvh - 66px);
    border-top: 1px solid rgba(27,58,92,.08);
    display: flex; flex-direction: column; justify-content: space-between;
    background: #fff; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding: 8px 16px 24px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
  }
  .nv-open .nv-nav {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .25s ease, transform .25s ease, visibility 0s;
  }

  .nv-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nv-list > li { border-bottom: 1px solid rgba(27,58,92,.08); }
  .nv-link {
    width: 100%; justify-content: space-between; padding: 18px 4px; border-radius: 0;
    font-size: 17px; font-weight: 600; font-family: 'Space Grotesk', sans-serif;
  }
  .nv-link:hover, .nv-item.is-open > .nv-link { background: none; }
  .nv-link[aria-current="page"], .nv-link.is-current { color: var(--primary); background: rgba(27,58,92,.07); border-radius: 10px; padding-left: 12px; padding-right: 12px; }

  /* Panels become accordions */
  .nv-panel, .nv-panel--wide {
    position: static; width: auto; display: block; padding: 0 0 16px; margin: 0;
    border: 0; border-radius: 0; box-shadow: none; background: none;
    opacity: 1; visibility: visible; transform: none; transition: none;
    display: none;
  }
  .nv-panel::before, .nv-panel::after { display: none; }
  .nv-item.is-open .nv-panel { display: block; transform: none; animation: nv-drop .25s ease; }
  .nv-panel-title { display: none; }
  .nv-panel-aside { display: none; }
  .nv-grid a { padding: 11px 10px; font-size: 15.5px; }
  .nv-all { margin: 8px 0 0 10px; }

  .nv-mobile-cta { display: grid; gap: 10px; padding-top: 24px; }
  .nv-mobile-cta .nv-btn { padding: 15px 20px; font-size: 16px; }

  body.nv-lock { overflow: hidden; }
}
@media (max-width: 400px) {
  .nv-grid { grid-template-columns: 1fr; }
  .nv-call span { display: none; }
  .nv-call { width: 44px; height: 44px; padding: 0; }
}

@keyframes nv-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .nv *, .nv-panel, .nv-nav { transition: none !important; animation: none !important; }
}
