:root {
  --bg-dark: #040009;
  --bg-panel: rgba(14, 2, 24, 0.72);
  --bg-panel-strong: rgba(27, 5, 43, 0.88);
  --border-soft: rgba(255, 255, 255, 0.08);
  --text-primary: #f5f1ff;
  --text-muted: #c4bbf7;
  --accent: #a855f7;
  --accent-strong: #ec4899;
  --accent-blue: #20ffe1;
  --accent-purple: #8b5cf6;
  --card-shadow: 0 24px 60px rgba(5, 0, 14, 0.55);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at 20% -10%, rgba(251, 43, 156, 0.12), transparent 55%),
              radial-gradient(circle at 80% 0%, rgba(32, 255, 225, 0.12), transparent 60%),
              #05000b;
  position: relative;
  overflow-x: hidden;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Modern browsers: WebP (99.3% smaller - 50 KB instead of 8 MB) */
  background: url('/static/images/background.webp') center/cover no-repeat;
  filter: brightness(0.55);
  z-index: -1;
}

/* Fallback for browsers without WebP support (older Safari, IE) */
@supports not (background-image: url('/static/images/background.webp')) {
  .noise-overlay {
    background: url('/static/images/background.jpg') center/cover no-repeat;
  }
}

.top-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.85), rgba(236, 72, 153, 0.85));
  color: white;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(20px, 5vw, 60px);
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 18px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: rgba(168, 85, 247, 0.32);
}

.icon-cart {
  display: block;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23f5f1ff' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* User menu dropdown */
.user-menu {
  position: relative;
}

.account-button {
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  font-family: inherit;
}

.account-button:hover {
  transform: translateY(-1px);
  background: rgba(168, 85, 247, 0.32);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: linear-gradient(180deg, rgba(11, 0, 22, 0.98), rgba(7, 0, 16, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 12px 40px rgba(5, 0, 14, 0.65);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.user-dropdown.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  text-align: left;
  font-family: inherit;
}

.dropdown-item:hover {
  background: rgba(168, 85, 247, 0.2);
}

.dropdown-logout {
  margin: 0;
  padding: 0;
}

.logout-btn {
  width: 100%;
}

.primary-btn {
  padding: 10px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-strong));
  border: none;
  color: white;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.35);
}

.section {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding-bottom: 110px;
}

.discord-cta {
  margin-top: 40px;
  text-align: center;
  padding: 50px clamp(20px, 4vw, 70px);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(19, 5, 35, 0.88), rgba(10, 2, 22, 0.82));
  box-shadow: var(--card-shadow);
}

.discord-cta h2 {
  font-size: clamp(28px, 5vw, 46px);
  margin-bottom: 12px;
}

.discord-cta .secondary {
  color: var(--text-muted);
  margin-bottom: 28px;
}

.discord-cta .cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: white;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 14px 35px rgba(139, 92, 246, 0.45);
  transition: transform 0.15s ease;
}

.discord-cta .cta-button:hover {
  transform: translateY(-2px);
}

.section-title {
  margin-top: 80px;
  text-align: center;
}

.section-title h3 {
  font-size: clamp(26px, 4.2vw, 40px);
  margin-bottom: 10px;
}

.section-title p {
  color: var(--text-muted);
  font-size: 14px;
}

.products-grid {
  margin-top: 30px;
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
  justify-content: center;
}

.product-card {
  position: relative;
  border-radius: var(--button-border-radius, 8px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(11, 0, 22, 0.95), rgba(7, 0, 16, 0.94));
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 360px;
  /* Soft ambient glow - purple aura effect */
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.25);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
}

/* Product image - edge-to-edge in top half */
.product-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-image .product-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
}

/* Product badge (SALE, etc.) */
.product-image {
  position: relative;
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-badge.badge-sale {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* BEST SELLER badge - positioned on right side like SALE on left */
.best-seller-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #FFC107;
  color: #000;
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* Product body - with padding */
.product-body {
  padding: 18px 22px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Buy button - edge-to-edge, pushed to bottom (fallback, overridden by theme_loader.py) */
.product-card .buy-btn {
  margin: auto 0 0 0;
  border-radius: var(--button-border-radius, 8px);
}

.product-card:hover {
  transform: translateY(-4px);
  /* Enhanced glow on hover */
  box-shadow: 0 0 35px rgba(168, 85, 247, 0.5);
}

.product-thumb {
  height: 160px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.04);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stock-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.stock-badge.in {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.55);
  color: #4ade80;
}

.stock-badge.out {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #f87171;
}

.stock-line {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.stock-line.in::before {
  content: "✓ ";
  color: #4ade80;
}

.stock-line.in {
  color: #4ade80;
}

.stock-line.out::before {
  content: "✗ ";
  color: #ef4444;
}

.stock-line.out {
  color: #ef4444;
}

.product-title {
  font-size: 18px;
  font-weight: 700;
}

.prices {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
}

.prices .old {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: line-through;
}

/* .buy-btn styles are now managed by theme_loader.py via Theme Settings */
/* See: Settings → Theme → Buttons for height, border-radius, hover settings */

.category-section {
  margin-top: 90px;
}

.footer {
  margin: 100px auto 60px;
  width: min(1200px, 92vw);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  padding: 26px clamp(18px, 4vw, 40px);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 1, 19, 0.86);
}

.footer .social a {
  margin-right: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

.footer .social a:hover {
  color: var(--text-primary);
}

.footer .brand-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-weight: 700;
  text-decoration: none;
}

.footer .since {
  color: var(--text-muted);
  font-size: 14px;
}

.mobile-nav {
  display: none;
}

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }
  .navbar {
    padding: 18px clamp(16px, 4vw, 32px);
  }
  .discord-cta {
    padding: 40px clamp(16px, 5vw, 48px);
  }
}

@media (max-width: 640px) {
  .section {
    padding-bottom: 80px;
  }
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
}

