/* ── Desktop navigation ── */
.desktop-nav {
  margin-left: auto;
}

.desktop-nav__list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.desktop-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.desktop-nav__link:hover,
.desktop-nav__link.is-active {
  color: var(--brand);
  background: var(--surface-3);
}

.desktop-nav__link--group {
  cursor: default;
}

.desktop-nav__item--sub > .desktop-nav__link--group::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.55;
  margin-top: 2px;
}

.desktop-nav__drop-item--nested {
  position: relative;
}

.desktop-nav__drop .desktop-nav__sub {
  position: absolute;
  left: calc(100% + 4px);
  top: -8px;
  min-width: 240px;
  padding: 8px;
  margin: 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateX(6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
  z-index: 60;
}

.desktop-nav__drop-item--nested:hover > .desktop-nav__sub,
.desktop-nav__drop-item--nested:focus-within > .desktop-nav__sub {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.desktop-nav__drop-item--nested > a::after {
  content: '›';
  float: right;
  opacity: 0.45;
  font-size: 1.1em;
  line-height: 1;
}

.desktop-nav__item--sub > .desktop-nav__link:not(.desktop-nav__link--group)::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.55;
  margin-top: 2px;
}

.desktop-nav__item--sub {
  position: relative;
}

.desktop-nav__drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
  z-index: 50;
}

.desktop-nav__item--sub:hover .desktop-nav__drop,
.desktop-nav__item--sub:focus-within .desktop-nav__drop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.desktop-nav__drop ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.desktop-nav__drop a {
  display: block;
  padding: 10px 12px;
  font-size: 0.88rem;
  line-height: 1.35;
  text-decoration: none;
  color: var(--ink-2);
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.desktop-nav__drop a:hover {
  background: var(--surface-3);
  color: var(--brand);
}

/* ── Burger ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 310;
  transition: border-color 0.2s, background 0.2s;
}

.nav-toggle:hover {
  border-color: var(--brand-light);
  background: var(--surface-3);
}

.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--brand);
  border-radius: 2px;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}

body.nav-open .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile drawer (outside header — not clipped by backdrop-filter) ── */
.nav-backdrop {
  display: none;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1024px) {
  .desktop-nav {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 280;
    background: rgba(10, 37, 64, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s var(--ease), visibility 0.25s;
  }

  .nav-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
  }

  .mobile-nav {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 100vw);
    z-index: 290;
    background: #fff;
    box-shadow: -12px 0 40px rgba(10, 37, 64, 0.15);
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s var(--ease), visibility 0.3s;
    overflow: hidden;
  }

  .mobile-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-nav__panel {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .mobile-nav__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    min-height: var(--header-h);
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: #fff;
  }

  .mobile-nav__phone {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
    white-space: nowrap;
  }

  .mobile-nav__phone:hover {
    color: var(--brand-light);
  }

  .mobile-nav__close {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    flex-shrink: 0;
  }

  .mobile-nav__close:hover {
    border-color: var(--brand-light);
    background: var(--surface-3);
  }

  .mobile-nav__close-bar {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 2px;
    margin-left: -9px;
    margin-top: -1px;
    background: var(--brand);
    border-radius: 2px;
  }

  .mobile-nav__close-bar:first-child {
    transform: rotate(45deg);
  }

  .mobile-nav__close-bar:last-child {
    transform: rotate(-45deg);
  }

  .mobile-nav__list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    overflow-y: auto;
    flex: 1;
  }

  .mobile-nav__list > li {
    border-bottom: 1px solid var(--line);
  }

  .mobile-nav__list > li > a,
  .mobile-nav__row > a {
    display: block;
    padding: 16px 20px;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink-2);
    transition: color 0.15s, background 0.15s;
  }

  .mobile-nav__list > li > a.is-active,
  .mobile-nav__row > a.is-active {
    color: var(--brand);
    font-weight: 600;
  }

  .mobile-nav__list > li > a:hover,
  .mobile-nav__row > a:hover {
    background: var(--surface-2);
    color: var(--brand);
  }

  .mobile-nav__row {
    display: flex;
    align-items: stretch;
  }

  .mobile-nav__row > a {
    flex: 1;
    min-width: 0;
  }

  .mobile-nav__toggle {
    flex-shrink: 0;
    width: 52px;
    border: none;
    border-left: 1px solid var(--line);
    background: var(--surface-2);
    cursor: pointer;
    color: var(--brand);
    transition: background 0.15s;
  }

  .mobile-nav__toggle:hover {
    background: var(--surface-3);
  }

  .mobile-nav__toggle::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s var(--ease);
    margin-top: -4px;
  }

  .mobile-nav__toggle[aria-expanded='true']::before {
    transform: rotate(-135deg);
    margin-top: 2px;
  }

  .mobile-nav__sub {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface-2);
    border-top: 1px solid var(--line);
  }

  .mobile-nav__sub[hidden] {
    display: none;
  }

  .mobile-nav__sub a {
    display: block;
    padding: 12px 20px 12px 28px;
    font-size: 0.92rem;
    line-height: 1.4;
    text-decoration: none;
    color: var(--ink-2);
    border-bottom: 1px solid var(--line);
    transition: color 0.15s, background 0.15s;
  }

  .mobile-nav__sub li:last-child a {
    border-bottom: none;
  }

  .mobile-nav__sub a:hover {
    color: var(--brand);
    background: #fff;
  }

  .mobile-nav__row--label {
    background: var(--surface-2);
  }

  .mobile-nav__label {
    flex: 1;
    padding: 16px 20px;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-2);
    font-weight: 600;
  }

  .mobile-nav__sub .mobile-nav__sub {
    background: var(--surface-3);
  }

  .mobile-nav__sub .mobile-nav__sub a {
    padding-left: 36px;
  }

  .mobile-nav__sub--deep a {
    padding-left: 48px;
  }

  .mobile-nav__sub .mobile-nav__row > a {
    padding-left: 28px;
    font-size: 0.92rem;
    text-transform: none;
    letter-spacing: 0;
  }

  .mobile-nav__sub .mobile-nav__label {
    padding-left: 28px;
    font-size: 0.92rem;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
  }

  .mobile-nav__foot {
    flex-shrink: 0;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--surface-2);
  }

  .mobile-nav__schedule {
    margin: 12px 0 0;
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .site-header {
    z-index: 300;
  }

  body.nav-open .mobile-call {
    display: none;
  }
}

@media (max-width: 560px) {
  .nav-toggle {
    width: 40px;
    height: 40px;
  }

  .nav-toggle__bar {
    width: 16px;
  }

  .mobile-nav {
    width: 100vw;
  }
}

@media (min-width: 1025px) {
  .nav-toggle,
  .nav-backdrop,
  .mobile-nav {
    display: none !important;
  }
}
