/* BJ's on a Budget — Storefront Styles */
/* Uses design tokens from onboarding landing page */

:root {
  --hot-pink: #FF2D7B;
  --deep-purple: #2D0A3E;
  --electric-violet: #8B5CF6;
  --warm-cream: #FFF5F0;
  --gold: #FFB800;
  --dark: #1A0525;
  --dark-soft: #2A1535;
  --card-bg: rgba(45, 15, 70, 0.6);
  --text-muted: #b8a0c8;
  --radius: 16px;
  --radius-sm: 8px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--dark);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 5, 37, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-icon { font-size: 1.6rem; }

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--hot-pink), var(--electric-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.category-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.nav-pill {
  padding: 0.45rem 1.1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-pill:hover {
  color: #fff;
  background: rgba(139, 92, 246, 0.15);
}

.nav-pill.active {
  background: linear-gradient(135deg, var(--hot-pink), var(--electric-violet));
  color: #fff;
  font-weight: 600;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover { background: rgba(255,255,255,0.08); }

.mobile-nav {
  background: var(--deep-purple);
  border-top: 1px solid rgba(139, 92, 246, 0.15);
  padding: 0.5rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav[hidden] { display: none; }

.mobile-nav-link {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.mobile-nav-link.active {
  background: rgba(139, 92, 246, 0.15);
  color: #fff;
}

/* ===== HERO BANNER ===== */
.hero-banner {
  position: relative;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 10%, rgba(139, 92, 246, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 90%, rgba(255, 45, 123, 0.12) 0%, transparent 50%),
    var(--dark);
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238B5CF6' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--hot-pink), var(--electric-violet));
  padding: 0.35rem 1.2rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.hero-highlight {
  background: linear-gradient(135deg, var(--hot-pink), var(--electric-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

.hero-glow {
  position: absolute;
  width: 300px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(255, 45, 123, 0.12), transparent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ===== SECTION LAYOUT ===== */
.featured-section,
.catalog-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
}

.deal-badge {
  background: linear-gradient(135deg, var(--gold), #ff8c00);
  color: var(--dark);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
}

.product-count {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== PRODUCT GRID ===== */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* ===== PRODUCT CARD ===== */
.product-card {
  background: var(--card-bg);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.3);
}

.badge-featured {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: linear-gradient(135deg, var(--gold), #ff8c00);
  color: var(--dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 50px;
  z-index: 2;
}

.badge-featured-sm {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: var(--gold);
  color: var(--dark);
  font-size: 0.65rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: rgba(0,0,0,0.3);
  position: relative;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.product-card:hover .product-image { transform: scale(1.04); }

.product-info { padding: 1.1rem; }

.product-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--hot-pink);
  margin-bottom: 0.4rem;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.product-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--warm-cream);
}

.product-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--hot-pink), var(--electric-violet));
  color: #fff;
  text-decoration: none;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover { opacity: 0.85; }

.btn-add-cart {
  background: linear-gradient(135deg, var(--hot-pink), var(--electric-violet));
  color: #fff;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
  font-family: 'Outfit', sans-serif;
}

.btn-add-cart:hover { opacity: 0.8; }

.btn-buy {
  display: inline-block;
  background: linear-gradient(135deg, var(--hot-pink), var(--electric-violet));
  color: #fff;
  text-decoration: none;
  padding: 0.45rem 1rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
  border: none;
}
.btn-buy:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn-coming-soon {
  display: inline-block;
  background: rgba(168, 158, 194, 0.2);
  color: #a89ec2;
  padding: 0.45rem 0.9rem;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--deep-purple);
  border-top: 1px solid rgba(139, 92, 246, 0.1);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.footer-inner { max-width: 600px; margin: 0 auto; }

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: #fff; }

.footer-legal {
  font-size: 0.72rem;
  color: rgba(184, 160, 200, 0.5);
}

/* ===== SPIN WHEEL POPUP ===== */
.wheel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 5, 37, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.wheel-overlay[hidden] { display: none; }

.wheel-card {
  background: var(--deep-purple);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

.wheel-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.wheel-close:hover { color: #fff; }

.wheel-header { margin-bottom: 1.5rem; }

.wheel-emoji { font-size: 2.5rem; margin-bottom: 0.75rem; }

.wheel-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.wheel-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.wheel-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 1.5rem;
}

#wheelCanvas {
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(139, 92, 246, 0.2), 0 0 0 10px rgba(139, 92, 246, 0.08);
  transition: transform 0s;
}

.wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 22px solid var(--gold);
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hot-pink), var(--electric-violet));
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 4px 20px rgba(255, 45, 123, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 3;
}

.spin-btn:not(:disabled):hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 6px 28px rgba(255, 45, 123, 0.65);
}

.spin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wheel-result { padding: 0.5rem 0; }

.result-code {
  background: rgba(139, 92, 246, 0.15);
  border: 1px dashed var(--electric-violet);
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--electric-violet);
  margin-bottom: 0.75rem;
  display: inline-block;
}

.result-text {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.btn-copy-code {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, var(--hot-pink), var(--electric-violet));
  color: #fff;
  border: none;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 0.75rem;
  transition: opacity 0.2s;
}

.btn-copy-code:hover { opacity: 0.8; }

.btn-close-result {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  text-decoration: underline;
  transition: color 0.2s;
}

.btn-close-result:hover { color: #fff; }

.wheel-fine {
  font-size: 0.65rem;
  color: rgba(184, 160, 200, 0.45);
  margin-top: 1.25rem;
  line-height: 1.4;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .header-inner { gap: 1rem; }
  .logo-text { display: none; }
  .category-nav { display: none; }
  .mobile-menu-btn { display: flex; }

  .hero-title { font-size: 2rem; }
  .hero-sub { font-size: 0.9rem; }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }

  .product-info { padding: 0.75rem; }
  .product-name { font-size: 0.875rem; }
  .product-price { font-size: 1.1rem; }
  .product-desc { font-size: 0.72rem; -webkit-line-clamp: 2; }

  .featured-section, .catalog-section { padding: 2rem 1rem; }

  .wheel-card { padding: 2rem 1.5rem; }
}

@media (max-width: 380px) {
  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
}

/* ===== UTILITY ===== */
a { color: inherit; }
button { font-family: 'Outfit', sans-serif; }