.pill-nav {
  position: sticky;
  top: 24px;
  margin: 0 auto 48px auto;
  width: fit-content;
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  z-index: 100;
  height: 56px; /* Lock the exact height */
  max-height: 56px;
  overflow: visible !important;
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.25), 
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -1px 8px rgba(0, 0, 0, 0.1);
}

.pill-nav a, .pill-nav button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-nav a:hover, .pill-nav button:hover, .pill-nav .active {
  background: var(--glass-fill-strong);
  color: var(--text-primary);
}
/* --- Mega-Menu Dropdown Logic --- */
/* --- Simple Category Jump Menu --- */
/* --- Floating Category Dropdown Menu --- */
.dropdown {
  position: relative; /* Anchors the dropdown to this specific menu item */
  display: inline-flex;
  align-items: center;
}

.dropdown-content {
  display: none; /* Hidden by default */
  position: absolute !important; /* CRITICAL: Forces it to float outside the nav bar so it NEVER stretches the parent */
  top: 100%; /* Positions it directly below the nav text */
  left: 50%;
  transform: translateX(-50%);
  margin-top: 16px; /* Gap between the nav bar and the dropdown */
  width: 220px;
  padding: 12px;
  z-index: 9999; /* Guarantees it floats over everything else on the page */
  border-radius: 12px;
}

.dropdown-content.glass-card {
  background: rgba(20, 22, 28, 0.6); /* Slightly darker glass for contrast */
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25), 
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -1px 8px rgba(0, 0, 0, 0.15);
}

.dropdown:hover .dropdown-content,
.dropdown.active .dropdown-content {
  display: flex !important;
  flex-direction: column;
  gap: 4px;
}

.dropdown-content a {
  display: block;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap; /* Prevents text from wrapping and breaking the design */
}

.dropdown-content a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Mobile Fallback: If the screen is too narrow, we let it stretch natively so it doesn't bleed off-screen */
@media (max-width: 950px) {
  .dropdown-content {
    position: static !important;
    width: 100%;
    transform: none;
    margin-top: 8px;
    box-shadow: none;
    border: none;
    background: transparent;
    backdrop-filter: none;
  }
}

/* V2 Segmented Control */
.segmented {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 40px;
}

.segmented button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s ease;
}

.segmented button.active {
  background: var(--glass-fill-strong);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border: 1px solid var(--glass-border);
}

/* Strictly Mobile-Responsive Overrides */
@media (max-width: 768px) {
  .pill-nav {
    flex-wrap: wrap;
    height: auto;
    max-height: none;
    border-radius: 24px;
    justify-content: center;
    margin-bottom: 32px;
    gap: 4px;
    padding: 6px;
    width: calc(100% - 32px);
    max-width: 480px;
  }
  .pill-nav a, .pill-nav button {
    padding: 8px 12px;
    font-size: 13px;
  }
  .dropdown-content {
    position: static !important;
    width: 100%;
    transform: none;
    margin-top: 8px;
    box-shadow: none;
    border: none;
    background: transparent;
    backdrop-filter: none;
    display: none;
  }
}

/* Nav active-state persistent glow */
.pill-nav a.active, 
.pill-nav button.active {
  box-shadow: 
    0 0 12px rgba(124, 156, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(124, 156, 255, 0.3) !important;
}

/* --- Sleek Premium Glass Footer Component --- */
.glass-footer {
  margin-top: 80px;
  padding: 40px 20px;
  border-top: 1px solid var(--glass-border);
  text-align: center;
}

.glass-footer .footer-nav {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  margin-bottom: 20px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-footer .footer-nav a {
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.glass-footer .footer-nav a:hover {
  background: var(--glass-fill-strong);
  color: var(--text-primary);
}

.glass-footer .footer-copyright {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
}

@media (max-width: 600px) {
  .glass-footer .footer-nav {
    flex-direction: column;
    border-radius: 16px;
    width: 100%;
    max-width: 320px;
  }
  .glass-footer .footer-nav a {
    padding: 10px 14px;
    text-align: center;
  }
}
