:root {
  --border: rgba(157, 78, 221, 0.2);
  --muted: rgba(255, 255, 255, 0.75);
}

body {
  background: var(--background);
  color: var(--text);
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(10, 0, 20, 0.85);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  padding: 0.8rem 0;
  transition: all 0.3s ease;
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--secondary);
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: all 0.25s ease;
}

.logo:hover {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(157, 78, 221, 0.35);
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.4rem;
}

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem 0.1rem;
  transition: color 0.25s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width 0.25s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--secondary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-toggle {
  background: transparent;
  border: 1px solid rgba(157, 78, 221, 0.35);
  color: var(--text);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.theme-toggle:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  box-shadow: 0 6px 18px rgba(157, 78, 221, 0.2);
}

.cart-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.cart-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(10, 0, 20, 0.35);
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff6b6b;
  color: #fff;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.auth-buttons {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.login-btn {
  background: transparent;
  border: 1px solid rgba(157, 78, 221, 0.35);
  color: var(--text);
  padding: 0.65rem 1.2rem;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  transition: all 0.2s ease;
}

.login-btn:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  background: rgba(157, 78, 221, 0.08);
}

.user-dropdown {
  position: relative;
}

.user-button {
  background: rgba(157, 78, 221, 0.15);
  border: 1px solid rgba(157, 78, 221, 0.35);
  color: var(--text);
  padding: 0.65rem 1rem;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  min-height: 44px;
  transition: all 0.2s ease;
}

.user-button:hover {
  background: rgba(157, 78, 221, 0.25);
  border-color: var(--secondary);
}

.dropdown-content {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: rgba(26, 0, 38, 0.96);
  border: 1px solid rgba(157, 78, 221, 0.35);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1200;
}

.user-dropdown.active .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-content a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 1rem;
  color: var(--text);
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.dropdown-content a:hover {
  background: rgba(157, 78, 221, 0.12);
  color: var(--secondary);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.4rem;
}

.hamburger span {
  width: 28px;
  height: 3px;
  background: var(--text);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  width: 100%;
  background: rgba(10, 0, 20, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  padding: 1.25rem 1.4rem 1.6rem;
  z-index: 999;
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.mobile-nav.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.mobile-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 0.65rem 0.2rem;
  display: block;
  border-bottom: 1px solid rgba(157, 78, 221, 0.1);
}

.mobile-auth {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mobile-user-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
}

.legacy-footer {
  margin-top: 5rem;
  background: rgba(10, 0, 20, 0.82);
  border-top: 1px solid var(--border);
  padding: 3.5rem 0 2rem;
  color: var(--text);
}

.legacy-footer .container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.legacy-footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.legacy-footer h4 {
  color: var(--secondary);
  margin-bottom: 0.85rem;
}

.legacy-footer a {
  color: var(--muted);
  text-decoration: none;
  display: block;
  margin: 0.35rem 0;
  transition: color 0.2s ease;
}

.legacy-footer a:hover {
  color: var(--secondary);
}

.legacy-footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(157, 78, 221, 0.2);
  padding-top: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }

  .nav-right .auth-buttons,
  .nav-right .user-dropdown {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-nav {
    display: block;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0.65rem 0;
  }

  .nav-container {
    padding: 0 0.75rem;
    gap: 0.55rem;
  }

  .logo {
    font-size: 1.1rem;
    gap: 0.4rem;
  }

  .nav-right {
    gap: 0.45rem;
  }

  .theme-toggle,
  .cart-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .mobile-nav {
    top: 64px;
    padding: 1rem 1rem 1.2rem;
    max-height: calc(100vh - 64px);
  }

  .dropdown-content {
    right: -8px;
    min-width: min(88vw, 220px);
  }
}

[data-theme='light'] .navbar {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme='light'] .mobile-nav {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme='light'] .legacy-footer {
  background: #f8f9fa;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme='light'] .dropdown-content {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.08);
}
