.pill-nav-container {
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  background: #000;
  z-index: 99;
}

.pill-nav-flex-container {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 2.5em;
}

.pill-nav-logo-brand {
  display: flex;
  align-items: center;
  gap: 0.7em;
  flex-shrink: 0;
}

.pill-nav-brand {
  font-weight: 700;
  font-size: 1.25em;
  color: #fff;
  margin-left: 0.5em;
  text-decoration: none;
}

.pill-nav {
  --nav-h: 64px;
  --logo: 56px;
  --pill-pad-x: 32px;
  --pill-gap: 12px;
  width: max-content;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  font-size: 1.25rem;
}

.pill-nav-items {
  display: flex;
  align-items: center;
  gap: 2em;
  margin-left: auto;
  height: var(--nav-h);
  background: var(--base, #000);
  border-radius: 9999px;
}

.pill-logo {
  width: var(--nav-h);
  height: var(--nav-h);
  border-radius: 50%;
  background: var(--base, #000);
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pill-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pill-list {
  list-style: none;
  display: flex;
  align-items: stretch;
  gap: var(--pill-gap);
  margin: 0;
  padding: 3px;
  height: 100%;
}

.pill-list>li {
  display: flex;
  height: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 var(--pill-pad-x);
  background: var(--pill-bg, #fff);
  color: var(--pill-text, var(--base, #000));
  text-decoration: none;
  border-radius: 9999px;
  box-sizing: border-box;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.pill .hover-circle {
  position: absolute;
  left: 50%;
  bottom: 0;
  border-radius: 50%;
  background: var(--base, #000);
  z-index: 1;
  display: block;
  pointer-events: none;
  will-change: transform;
}

.pill .label-stack {
  position: relative;
  display: inline-block;
  line-height: 1;
  z-index: 2;
}

.pill .pill-label {
  position: relative;
  z-index: 2;
  display: inline-block;
  line-height: 1;
  will-change: transform;
}

.pill .pill-label-hover {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--hover-text, #fff);
  z-index: 3;
  display: inline-block;
  will-change: transform, opacity;
}

.pill.is-active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: var(--base, #000);
  border-radius: 50px;
  z-index: 4;
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .pill-nav-container {
    width: 100%;
    left: 0;
  }
  .pill-nav-flex-container {
    gap: 1em;
  }
  .desktop-only {
    display: none;
  }
  .mobile-only {
    display: block;
  }
}

.mobile-menu-button {
  width: var(--nav-h);
  height: var(--nav-h);
  border-radius: 50%;
  background: var(--base, #000);
  border: none;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  position: relative;
}

@media (max-width: 768px) {
  .mobile-menu-button {
    display: flex;
  }
}

.hamburger-line {
  width: 16px;
  height: 2px;
  background: var(--pill-bg, #fff);
  border-radius: 1px;
  transition: all 0.01s ease;
  transform-origin: center;
}

/* --- MOBILE MENU POPUP FIXES --- */
.mobile-menu-popover {
  position: absolute;
  top: 3em;
  left: 1rem;
  right: 1rem;
  background: #222; /* Make bg dark but not black for contrast */
  border-radius: 27px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 998;
  opacity: 0;
  transform-origin: top center;
  visibility: hidden;
  padding: 0.5em 0.5em;
}

.mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 3px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.mobile-menu-popover .mobile-menu-link,
.mobile-menu-popover button.mobile-menu-link {
  display: block;
  width: 100%;
  padding: 14px 18px;
  color: #fff !important; /* Always white text for visibility */
  background-color: transparent !important; /* Use transparent for contrast */
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  border-radius: 50px;
  transition: all 0.2s ease;
  border: none;
  outline: none;
  text-align: center; /* Center the link text */
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
  line-height: 1.4;
}

.mobile-menu-popover .mobile-menu-link:hover,
.mobile-menu-popover button.mobile-menu-link:hover {
  cursor: pointer;
  background-color: #444 !important; /* Slightly lighter bg for hover */
  color: #37FF8B !important; /* Accent color on hover */
}

.mobile-menu-popover .mobile-menu-link.is-active,
.mobile-menu-popover button.mobile-menu-link.is-active {
  background-color: #37FF8B !important; /* Active link gets accent color */
  color: #222 !important; /* Dark text for contrast */
}

@media (max-width: 480px) {
  .mobile-menu-popover {
    left: 0.5rem;
    right: 0.5rem;
  }
  .mobile-menu-popover .mobile-menu-link,
  .mobile-menu-popover button.mobile-menu-link {
    padding: 12px 10px;
    font-size: 16px;
  }
}
