/* Shared navigation styles — supplement (do not replace) the per-page
 * .topbar / .topbar-* rules in theme.css, order.css, my-orders.css,
 * admin-*.css, design-review.css, and dashboard.css. This file owns
 * three concerns only: skip-link, the active-link state, and the
 * mobile collapse.
 */

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent, #FFD400);
  color: var(--bg, #0A0A0A);
  padding: 0.6rem 1rem;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  z-index: 1000;
  transition: top 0.15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 1rem;
  outline: 2px solid var(--fg, #fff);
  outline-offset: 2px;
}

/* Active link state — must coexist with the per-page ".topbar-link"
 * hover rules. Pair with [aria-current="page"] so server-rendered
 * marking AND client-side toggling both style correctly. */
.topbar-link.active,
.topbar-link[aria-current="page"] {
  color: var(--fg, #fff);
  font-weight: 600;
  position: relative;
}
.topbar-link.active::after,
.topbar-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.6rem;
  height: 2px;
  background: var(--accent, #FFD400);
  border-radius: 2px;
}

/* Language toggle slot in the shared topbar. The legacy nav.css in
 * order.css / dashboard.css already styles .lang-toggle, but the
 * <span data-i18n-toggle> slot needs a baseline color/spacing too. */
.topbar-lang {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
}
.topbar-lang .topbar-link {
  color: var(--fg-muted, #888);
  text-decoration: none;
}
.topbar-lang .topbar-link.lang-toggle--active {
  color: var(--fg, #fff);
  font-weight: 600;
  cursor: default;
}

/* Mobile collapse — only the hamburger appears under 768px. The
 * .topbar-toggle button is hidden by default; the .topbar-right
 * container collapses into a vertical drawer when expanded. */
.topbar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border, #222);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  margin-left: auto;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}
.topbar-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--fg, #fff);
  border-radius: 2px;
}

@media (max-width: 768px) {
  .topbar-toggle {
    display: inline-flex;
  }
  .topbar-right {
    display: none;
    margin-left: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg, #0A0A0A);
    border-bottom: 1px solid var(--border, #222);
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .topbar-right.open {
    display: flex;
  }
  /* When the drawer is open, remove the underline so it doesn't sit
   * awkwardly under each nav link. */
  .topbar-link.active::after,
  .topbar-link[aria-current="page"]::after {
    display: none;
  }
  .topbar {
    position: relative;
  }
}
