/* The shop and product headers use different markup for the same navigation. */
:root :is(header.topbar .nav, header.seo-store-header .seo-store-nav) a:any-link {
  position: relative;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: var(--muted-strong, var(--text));
  text-decoration: none;
}

:is(.topbar .nav, .seo-store-nav) a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 4px;
  display: block;
  width: min(65%, 2.5em);
  height: 2px;
  margin-inline: auto;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0;
  transform: scaleX(.45);
  transition: none;
  pointer-events: none;
}

.topbar .nav.mobile-open {
  border-radius: 16px;
  background: var(--store-panel, var(--surface));
}

.topbar .nav.mobile-open a::after {
  display: block;
  inset-inline-start: 12px;
  inset-inline-end: auto;
  bottom: 6px;
  width: 1.8em;
  margin: 0;
}

:is(.topbar, .seo-store-header, .account-page .admin-topbar)
  :is(.locale-switch, .account-link, .loyalty-chip, .cart-toggle, .mobile-nav-toggle, .seo-store-account, .seo-store-cart, .button.ghost) {
  position: relative;
  border-radius: 999px;
  box-shadow: none;
  transform: none;
  transition: none;
}

:is(.topbar .top-actions, .seo-store-actions, .account-page .admin-topbar) :is(a:not(.brand), button)::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 18%, transparent);
  pointer-events: none;
  opacity: 0;
}

:is(.topbar, .seo-store-header, .account-page .admin-topbar)
  :is(.locale-switch, .account-link, .loyalty-chip, .mobile-nav-toggle, .seo-store-account, .button.ghost) {
  border-color: var(--line-strong);
  background: var(--store-panel, var(--surface));
  color: var(--text);
}

.topbar .loyalty-chip :is(span, strong) {
  color: inherit;
}

:root .topbar .mobile-nav-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent-dark);
}

html[data-storefront-style="c"] .seo-store-header .seo-store-cart {
  color: var(--bg);
}

html[data-storefront-style="c"] :is(.topbar .cart-count, .seo-store-header .seo-store-cart-count) {
  background: var(--bg);
  color: var(--text);
}

@media (hover: hover) and (pointer: fine) {
  :root :is(header.topbar .nav, header.seo-store-header .seo-store-nav) a:hover {
    color: var(--accent-dark);
  }

  :is(.topbar .nav, .seo-store-nav) a:hover::after {
    opacity: 1;
    transform: scaleX(1);
  }

  :is(.topbar, .seo-store-header, .account-page .admin-topbar)
    :is(.locale-switch, .account-link, .loyalty-chip, .mobile-nav-toggle, .seo-store-account, .button.ghost):hover {
    border-color: var(--accent);
    color: var(--accent-dark);
  }

  :is(.topbar .top-actions, .seo-store-actions, .account-page .admin-topbar) :is(a:not(.brand), button):hover::before {
    opacity: 1;
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  :is(.topbar .nav, .seo-store-nav) a::after {
    transition: opacity 120ms ease-out, transform 160ms ease-out;
  }

  :is(.topbar .top-actions, .seo-store-actions, .account-page .admin-topbar) :is(a:not(.brand), button)::before {
    transition: opacity 140ms ease-out;
  }
}

:is(.topbar, .seo-store-header, .account-page .admin-topbar) :is(a, button):focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 3px;
}

:is(.topbar .nav, .seo-store-nav) a:focus-visible::after {
  opacity: 1;
  transform: none;
  transition: none;
}
