/* Shared public navbar — extracted from home.css (navbar-only) */

:root {
  --home-panel-padding: clamp(1.5rem, 4vw, 4rem);
  --home-content-width: 90rem;
}

/* Account / avatar */
.hero-nav-user-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.hero-nav-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(147, 235, 13, 0.15);
  color: #93eb0d;
  flex-shrink: 0;
  overflow: hidden;
}

.hero-nav-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hero-nav-avatar svg {
  fill: currentColor;
  opacity: 0.8;
}

.hero-nav-username {
  font-size: 0.68rem;
  color: #f4f6f3;
  opacity: 0.8;
  max-width: 8ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.hero-nav-cart,
.hero-nav-login {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(147, 235, 13, 0.3);
  background: rgba(10, 14, 12, 0.48);
  color: #edf6e4;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 0 12px rgba(147, 235, 13, 0.1);
  text-shadow: none;
}

.hero-nav-cart-icon,
.hero-nav-login-icon {
  width: 22px;
  height: 22px;
  display: block;
}

.hero-nav-link.hero-nav-cart:hover,
.hero-nav-link.hero-nav-cart:focus-visible,
.hero-nav-link.hero-nav-login:hover,
.hero-nav-link.hero-nav-login:focus-visible,
.hero-header.is-scrolled .hero-nav-link.hero-nav-cart:hover,
.hero-header.is-scrolled .hero-nav-link.hero-nav-cart:focus-visible,
.hero-header.is-scrolled .hero-nav-link.hero-nav-login:hover,
.hero-header.is-scrolled .hero-nav-link.hero-nav-login:focus-visible {
  color: #93eb0d;
  background: rgba(147, 235, 13, 0.14);
  border-color: rgba(147, 235, 13, 0.75);
  box-shadow: 0 0 0 1px rgba(147, 235, 13, 0.16), 0 0 16px rgba(147, 235, 13, 0.3);
  text-shadow: none;
  transform: translateY(-1px);
}

.hero-nav-badge {
  position: absolute;
  top: -0.12rem;
  right: -0.18rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: #93eb0d;
  color: #111411;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
}

/* ── 12. Homepage navigation system ── */
.hero-header {
  display: grid;
  align-items: center;
  --hero-header-compact-height: 43px;
  position: fixed;
  top: clamp(0.6rem, 1.4vw, 1.25rem);
  left: 50%;
  right: auto;
  width: min(calc(100% - (var(--home-panel-padding) * 2)), var(--home-content-width));
  min-height: 6.25rem;
  padding: 0.6rem clamp(0.55rem, 1.15vw, 1.05rem);
  /* Restore ~original logo track (~19vw/300px) so the large logo box matches pre-rebalance size;
     reclaim menu room via tighter padding/gap/search max — not by shrinking the logo. */
  grid-template-columns: minmax(210px, clamp(250px, 19vw, 300px)) clamp(155px, 14.5vw, 250px) minmax(0, 1fr);
  gap: clamp(0.45rem, 0.75vw, 0.85rem);
  transform: translateX(-50%);
  border: 1px solid transparent;
  border-radius: 1.35rem;
  box-sizing: border-box;
  color: #f4f6f3;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  overflow: visible;
  z-index: 6;
  transition:
    min-height 240ms ease,
    padding 240ms ease,
    gap 240ms ease,
    background-color 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease,
    backdrop-filter 240ms ease;
}

.hero-header.is-scrolled {
  height: var(--hero-header-compact-height, 52px);
  min-height: var(--hero-header-compact-height, 52px);
  padding-block: 0;
  color: #f4f6f3;
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.hero-logo {
  width: 100%;
  height: 5.25rem;
  position: relative;
  display: block;
  z-index: 2;
  transition: height 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-header.is-scrolled .hero-logo {
  height: 2.25rem;
  width: 100%;
}

.hero-logo-stage {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.hero-logo-img {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
  transition: opacity 240ms ease, transform 300ms cubic-bezier(0.22, 1, 0.36, 1), filter 240ms ease;
}

.hero-logo-img--full {
  opacity: 1;
  transform: translateY(0) scale(1.08);
  transform-origin: left center;
  filter: blur(0);
}

.hero-logo-img--compact {
  opacity: 0;
  transform: translateY(5px) scale(0.94);
  filter: blur(3px);
}

.hero-header.is-scrolled .hero-logo-img--full {
  opacity: 0;
  transform: translateY(-5px) scale(0.96);
  filter: blur(3px);
}

.hero-header.is-scrolled .hero-logo-img--compact {
  opacity: 1;
  height: 4.5rem;
  width: auto;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  filter: blur(0);
}

.hero-header.is-scrolled .hero-logo-stage {
  height: 100%;
  display: flex;
  align-items: center;
  overflow: visible;
}

.hero-nav {
  position: static;
  z-index: 2;
  justify-self: stretch;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.75rem, 1.5vw, 1.5rem);
  width: 100%;
  margin: 0;
  overflow: visible;
}

.hero-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid rgba(147, 235, 13, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.hero-search--desktop {
  justify-self: stretch;
}

.hero-search--mobile {
  display: none;
}

.hero-search__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-search__input {
  min-width: 0;
  width: 100%;
  padding: 0.65rem 0 0.65rem 0.9rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
}

.hero-search__input::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.hero-search__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #dfffc2;
  cursor: pointer;
}

.hero-search__submit svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.hero-search:focus-within {
  border-color: rgba(147, 235, 13, 0.9);
  background: rgba(255, 255, 255, 0.085);
  box-shadow: 0 0 0 3px rgba(147, 235, 13, 0.12), 0 0 18px rgba(147, 235, 13, 0.18);
}

.hero-search__submit:focus-visible {
  outline: 2px solid #93eb0d;
  outline-offset: -3px;
}

.hero-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: clamp(0.25rem, 0.8vw, 0.85rem);
}

.hero-nav-item {
  list-style: none;
  position: relative;
  flex: 0 0 auto;
}

.hero-nav-link {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  padding: 0.6rem 0.72rem;
  border: 0;
  border-radius: 999px;
  color: #f4f6f3;
  background: transparent;
  font: inherit;
  font-size: clamp(0.98rem, 0.9vw, 1.08rem);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-shadow: 0 0 4px rgba(147, 235, 13, 0.35), 0 0 10px rgba(147, 235, 13, 0.16);
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease, text-shadow 180ms ease;
}

.hero-nav-link::after {
  display: none;
}

.hero-nav-link:hover,
.hero-nav-link:focus-visible,
.hero-nav-item.is-open > .hero-nav-trigger {
  color: #111411;
  background: rgba(147, 235, 13, 0.88);
  text-shadow: 0 0 5px rgba(147, 235, 13, 0.85), 0 0 14px rgba(147, 235, 13, 0.5);
  transform: translateY(-1px);
}

.hero-header.is-scrolled .hero-nav-link,
.hero-header.is-scrolled .hero-nav-username {
  color: #f4f6f3;
}

.hero-header.is-scrolled .hero-nav-link:hover,
.hero-header.is-scrolled .hero-nav-link:focus-visible,
.hero-header.is-scrolled .hero-nav-item.is-open > .hero-nav-trigger {
  color: #111411;
}

.hero-nav-link:focus-visible,
.hero-dropdown-link:focus-visible,
.hero-nav-toggle:focus-visible {
  outline: 2px solid #93eb0d;
  outline-offset: 3px;
}

.hero-nav-chevron {
  width: 0.7rem;
  height: 0.45rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  transition: transform 180ms ease;
}

.hero-nav-item.is-open .hero-nav-chevron,
.hero-nav-item:focus-within .hero-nav-chevron {
  transform: rotate(180deg);
}

.hero-dropdown-panel {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  width: min(22rem, calc(100vw - 2rem));
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-7px) scale(0.98);
  transform-origin: top left;
  transition: opacity 160ms ease, transform 200ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 200ms;
}

[data-dropdown-align="end"] .hero-dropdown-panel {
  right: 0;
  left: auto;
  transform-origin: top right;
}

.hero-nav-item.is-open > .hero-dropdown-panel,
.hero-header:not(.is-enhanced) .hero-nav-item:hover > .hero-dropdown-panel,
.hero-header:not(.is-enhanced) .hero-nav-item:focus-within > .hero-dropdown-panel {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.hero-dropdown-inner {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  background: rgba(15, 18, 17, 0.98);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
}

.hero-dropdown-link {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.72rem;
  color: #f5f7f4;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.hero-dropdown-link strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.hero-dropdown-link span {
  color: #aeb5ae;
  font-size: 0.76rem;
  line-height: 1.4;
}

.hero-dropdown-link:hover,
.hero-dropdown-link:focus-visible {
  color: #93eb0d;
  background: rgba(147, 235, 13, 0.08);
  transform: translateX(2px);
}

.hero-nav-account {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding-left: clamp(0.35rem, 0.8vw, 0.75rem);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-header.is-scrolled .hero-nav-account {
  border-left-color: rgba(255, 255, 255, 0.16);
}

/* Compact scrolled state — hide username; keep cart/login icon controls coherent */
.hero-header.is-scrolled .hero-nav-username {
  display: none;
}

.hero-header.is-scrolled .hero-nav-cart,
.hero-header.is-scrolled .hero-nav-login {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  flex-shrink: 0;
  border-radius: 50%;
  border-color: rgba(147, 235, 13, 0.34);
  background: rgba(10, 14, 12, 0.52);
  color: #edf6e4;
}

.hero-header.is-scrolled .hero-nav-cart-icon,
.hero-header.is-scrolled .hero-nav-login-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.hero-header.is-scrolled .hero-nav-badge {
  top: -3px;
  right: -4px;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.22rem;
  font-size: 0.58rem;
}

.hero-nav-username {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f4f6f3;
  text-shadow: 0 0 7px rgba(147, 235, 13, 0.16);
}

.hero-nav-account-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  padding: 0.15rem 0.3rem;
  outline-offset: 2px;
}

.hero-nav-account-link:focus-visible {
  outline: 2px solid #93eb0d;
  outline-offset: 2px;
}

/* Authenticated account link keeps avatar/username treatment (not guest login icon). */
.hero-header.is-scrolled .hero-nav-account-link {
  color: inherit;
}

.hero-nav-toggle {
  display: none;
  width: 3rem;
  height: 3rem;
  padding: 0.72rem;
  color: #f4f6f3;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.hero-nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 0.25rem 0;
  border-radius: 2px;
  background: currentColor;
  transition: transform 200ms ease, opacity 160ms ease;
}

.hero-header.is-scrolled .hero-nav-toggle {
  color: #f4f6f3;
  border-color: rgba(255, 255, 255, 0.16);
}

.hero-header.is-menu-open .hero-nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hero-header.is-menu-open .hero-nav-toggle span:nth-child(2) {
  opacity: 0;
}

.hero-header.is-menu-open .hero-nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Large desktop only: pull search into unused logo-track gutter (opaque artwork stays left). */
@media (min-width: 1321px) {
  .hero-search--desktop {
    margin-inline-start: clamp(-3.5rem, -3.25vw, -2rem);
  }

  .hero-nav-list {
    gap: clamp(0.2rem, 0.55vw, 0.55rem);
  }

  .hero-nav-link {
    padding-inline: 0.58rem;
  }
}

@media (min-width: 1041px) and (max-width: 1320px) {
  .hero-header {
    grid-template-columns: minmax(190px, 220px) minmax(155px, 190px) minmax(0, 1fr);
    gap: 0.45rem;
    padding-inline: 0.7rem;
  }

  .hero-nav {
    gap: 0.4rem;
  }

  .hero-nav-list {
    gap: 0.12rem;
  }

  .hero-nav-link {
    padding-inline: 0.45rem;
    font-size: 0.92rem;
  }

  .hero-nav-account {
    gap: 0.2rem;
    padding-left: 0.25rem;
  }

  .hero-search__input {
    padding-left: 0.7rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 1040px) {
  .hero-header {
    grid-template-columns: minmax(190px, 1fr) auto;
    gap: 1rem;
    min-height: 5.5rem;
    padding: 0.45rem 0.65rem;
  }

  .hero-logo {
    width: min(290px, 60vw);
    height: 4.5rem;
  }

  .hero-header.is-scrolled {
    height: auto;
    min-height: var(--hero-header-compact-height, 52px);
  }

  .hero-header.is-scrolled .hero-logo {
    width: min(270px, 58vw);
    height: 2.25rem;
  }

  .hero-nav-toggle {
    display: block;
    justify-self: end;
  }

  .hero-search--desktop {
    display: none;
  }

  .hero-nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    display: grid;
    align-items: stretch;
    gap: 0.65rem;
    max-height: min(76vh, 42rem);
    padding: 0.7rem;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    background: rgba(15, 18, 17, 0.98);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.34);
    /* Closed by default — JavaScript toggles is-menu-open */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.985);
    transform-origin: top center;
    transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 220ms;
  }

  .hero-header.is-menu-open .hero-nav {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
  }

  .hero-search--mobile {
    display: grid;
    width: 100%;
    min-height: 3rem;
    margin-bottom: 0.15rem;
  }

  .hero-search--mobile .hero-search__input {
    min-height: 3rem;
    font-size: 1rem;
  }

  .hero-search--mobile .hero-search__submit {
    width: 3rem;
    min-width: 3rem;
    min-height: 3rem;
  }

  .hero-nav-list {
    display: grid;
    gap: 0.2rem;
  }

  .hero-nav-link {
    width: 100%;
    min-height: 3rem;
    justify-content: space-between;
    padding-inline: 0.9rem;
    color: #f4f6f3;
    font-size: 1rem;
  }

  .hero-nav-item:hover > .hero-dropdown-panel,
  .hero-nav-item:focus-within > .hero-dropdown-panel {
    visibility: inherit;
    opacity: inherit;
    pointer-events: inherit;
    transform: none;
  }

  .hero-dropdown-panel,
  [data-dropdown-align="end"] .hero-dropdown-panel {
    position: static;
    display: grid;
    grid-template-rows: 0fr;
    width: 100%;
    visibility: visible;
    opacity: 0;
    pointer-events: none;
    transform: none;
    transition: grid-template-rows 220ms ease, opacity 180ms ease;
  }

  .hero-nav-item.is-open > .hero-dropdown-panel {
    grid-template-rows: 1fr;
    opacity: 1;
    pointer-events: auto;
  }

  .hero-header:not(.is-enhanced) .hero-dropdown-panel {
    grid-template-rows: 1fr;
    opacity: 1;
    pointer-events: auto;
  }

  .hero-dropdown-inner {
    min-height: 0;
    overflow: hidden;
    padding: 0 0.4rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .hero-nav-item.is-open .hero-dropdown-inner {
    padding-block: 0.25rem 0.5rem;
  }

  .hero-dropdown-link {
    min-height: 3rem;
    padding: 0.65rem 0.9rem;
  }

  .hero-nav-account {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.65rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 0;
  }

  .hero-nav-account .hero-nav-cart,
  .hero-nav-account .hero-nav-login {
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    justify-content: center;
  }

  .hero-nav-account-link {
    width: auto;
  }
}

@media (max-width: 760px) {
  .hero-header {
    top: 0.45rem;
    width: calc(100% - 1rem);
    min-height: 5rem;
  }

  .hero-logo {
    width: min(250px, 68vw);
    height: 4.15rem;
  }

  .hero-header.is-scrolled {
    min-height: 4.5rem;
  }

  .hero-header.is-scrolled .hero-logo {
    width: min(230px, 64vw);
    height: 3.65rem;
  }
}

@media (max-width: 430px) {
  .hero-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hero-logo {
    width: min(220px, 68vw);
  }

  .hero-header.is-scrolled .hero-logo {
    width: min(200px, 62vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-header,
  .hero-logo,
  .hero-logo-img,
  .hero-nav,
  .hero-nav-link,
  .hero-nav-chevron,
  .hero-dropdown-panel,
  .hero-dropdown-link,
  .hero-nav-toggle span {
    transition: none !important;
  }
}
