.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.28s ease, visibility 0s linear 0s;
}
.nav-mobile-only,
.nav-mobile-text {
  display: none;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  display: inline;
  list-style: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-600);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  user-select: none;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: "▾";
  margin-left: 0.35rem;
  font-size: 0.7rem;
}

.nav-dropdown[open] summary,
.nav-dropdown summary:hover,
nav ul a:hover {
  color: var(--black);
  background: var(--gray-100);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 220;
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 0.15rem;
  width: min(440px, calc(100vw - 2rem));
  padding: 0.65rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 45px rgba(0,0,0,0.14);
}

.nav-dropdown-store .nav-dropdown-menu {
  width: min(220px, calc(100vw - 2rem));
  grid-template-columns: 1fr;
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.58rem 0.65rem;
  white-space: nowrap;
}

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

  .nav-mobile-only,
  .nav-mobile-text {
    display: inline;
  }

  .nav-mobile-only {
    display: list-item;
  }

  .nav-dropdown summary {
    display: block;
    padding: 14px 4px;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--black);
  }

  .nav-dropdown summary::after {
    float: right;
    margin-top: 0.15rem;
  }

  .nav-dropdown-menu,
  .nav-dropdown-store .nav-dropdown-menu {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    padding: 0 0 0.45rem 0.85rem;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .nav-dropdown-menu a {
    padding: 0.5rem 0.35rem;
    font-size: 0.96rem;
    color: var(--gray-600);
    white-space: normal;
  }

  nav ul {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: min(88vw, 360px);
    max-width: 360px;
    height: 100dvh;
    background: var(--white);
    padding: 72px 24px 32px;
    z-index: 200;
    box-shadow: -4px 0 32px rgba(0,0,0,0.14);
    gap: 0;
    overflow-y: auto;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.28s ease, visibility 0s linear 0.28s;
  }

  nav.nav-open {
    z-index: 210;
  }

  nav.nav-open ul {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.28s ease, visibility 0s linear 0s;
  }

  nav ul li {
    border-bottom: 1px solid var(--gray-200);
  }

  nav ul li:last-child {
    border-bottom: none;
  }

  nav ul a {
    display: block;
    padding: 14px 4px;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--black);
  }

  nav.nav-open .hamburger {
    position: relative;
    z-index: 201;
  }

  nav.nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  nav.nav-open .hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
  nav.nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}