/* Shared navigation contract.
   This file owns the final header geometry so page-level CSS cannot push the
   logo or commerce actions outside narrow mobile viewports. */

.nav {
  left: 0;
  right: 0;
  width: 100%;
  transform: none;
}

.nav-inner {
  width: min(100%, var(--maxw));
  min-width: 0;
}

.nav-logo,
.nav-actions,
.nav-menu,
.nav-account,
.nav-cart,
.nav-burger {
  min-width: 0;
}

@media (min-width: 721px) {
  .nav-group > .nav-menu {
    min-width: 184px;
  }

  .nav-group > .nav-menu a {
    width: 100%;
  }
}

.nav-burger,
.nav-cart,
.nav-signin {
  flex: 0 0 auto;
}

.lead-action-bar {
  display: none;
}

.lead-action-sentinel {
  position: absolute;
  top: min(560px, 75vh);
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  opacity: 0;
}

@media (max-width: 720px) {
  /* Reserve for the floating lead bar lives on the footer so the strip
     below the last content stays the footer's dark surface, not bare body. */
  body:has(.lead-action-bar) footer {
    padding-bottom: 116px;
  }

  .nav {
    top: 0;
    border-radius: 0;
    transform: none;
  }

  .nav-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    max-width: none;
    padding-inline: 12px;
  }

  .nav-logo {
    width: 44px;
    overflow: hidden;
  }

  .nav-logo .logo-image {
    height: 44px;
  }

  .nav-menu {
    min-width: 0;
  }

  .nav-actions {
    justify-self: end;
    gap: 8px;
  }

  .nav-signin {
    padding-inline: 12px;
  }

  .nav-cart,
  .nav-burger {
    width: 44px;
    height: 44px;
  }

  .nav-links {
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
  }

  .lead-action-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 48;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 44px rgba(16, 74, 80, .20);
    backdrop-filter: blur(16px) saturate(1.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px);
    transition: opacity .22s var(--ease-out, ease), transform .22s var(--ease-out, ease), visibility .22s var(--ease-out, ease);
  }

  .lead-action-bar.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  /* Keep customer support available without covering the persistent quote action. */
  body:has(.lead-action-bar.is-visible:not(.is-suppressed)) .customer-chat {
    bottom: calc(max(12px, env(safe-area-inset-bottom)) + 76px + var(--customer-chat-avoid, 0px));
  }

  .lead-action-bar.is-suppressed {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px);
  }

  .lead-action-bar a {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
  }

  .lead-action-bar a:last-child {
    background: var(--accent);
    color: #fff;
  }

  @media (prefers-reduced-motion: reduce) {
    .lead-action-bar {
      transition: none;
    }
  }
}

@media (max-width: 720px) {
  .nav.over-dark .nav-links.open > a,
  .nav.over-dark .nav-links.open .nav-group summary,
  .nav.over-dark .nav-links.open .nav-menu a {
    color: var(--ink);
  }

  .nav-links.open .nav-group summary {
    display: grid;
    grid-template-columns: minmax(32px, 1fr) auto minmax(32px, 1fr);
    align-items: center;
    justify-items: center;
    text-align: center;
  }

  .nav-links.open .nav-group summary::after {
    grid-column: 3;
    justify-self: end;
  }

  .nav-links.open .nav-group-label {
    grid-column: 2;
  }
}
