@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --primary-light: #c084fc;
  --secondary: #fbbf24;
  --bg-dark: #0a0614;
  --bg-card: #140d22;
  --bg-surface: #1e1230;
  --text-primary: #f3e8ff;
  --text-secondary: #a78bfa;
  --text-muted: #6b5b7e;
  --border: #2a1a3e;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(124, 58, 237, 0.25);
  --glow: 0 0 40px rgba(124, 58, 237, 0.3);
  --sparkle-size: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ─── Stars canvas ─────────────────────────────────────────────────────────── */
#stars-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* ─── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
  background: rgba(20, 13, 34, 0.85);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-light);
  text-decoration: none;
  transition: opacity 0.2s;
}

.navbar-brand:hover { opacity: 0.85; }

.navbar-brand .icon {
  font-size: 1.4rem;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(192,132,252,0.5)); }
  50% { filter: drop-shadow(0 0 12px rgba(192,132,252,0.9)); }
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  list-style: none;
}

.navbar-nav a, .navbar-nav button {
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  transition: all 0.25s;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
}

.navbar-nav a:hover, .navbar-nav button:hover {
  background: var(--bg-surface);
  color: var(--primary-light);
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity 0.2s;
}
.btn:active::after { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

.btn-gold {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #1a0a00;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(251, 191, 36, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(251, 191, 36, 0.5);
}

.btn-danger { background: var(--error); color: white; }

.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.8rem; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ─── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
  z-index: 1;
}

.card:hover {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: var(--shadow);
}

/* ─── Product Grid ─────────────────────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem 2rem 2rem;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s, border-color 0.3s;
  position: relative;
  z-index: 1;
}

.product-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.3);
  border-color: rgba(192, 132, 252, 0.5);
}

.product-img-wrap {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-img-wrap img { transform: scale(1.06); }

.product-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(20, 13, 34, 0.8) 100%);
  pointer-events: none;
}

.product-info { padding: 1rem 1rem 1.1rem; }

.product-name { font-weight: 600; margin-bottom: 0.3rem; color: var(--text-primary); }

.product-category { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.5rem; }

.product-price { font-size: 1.25rem; font-weight: 700; color: var(--secondary); }

.product-seller { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.4rem; }

.btn-add-cart { transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important; }
.btn-add-cart:hover { transform: translateY(-1px) scale(1.03) !important; }

/* Filter in animation */
@keyframes card-in {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.card-filter-in { animation: card-in 0.25s ease both; }

/* ─── Categories filter ────────────────────────────────────────────────────── */
.categories-filter {
  display: flex;
  gap: 0.7rem;
  padding: 1rem 2rem 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.categories-filter::-webkit-scrollbar { display: none; }

.category-chip {
  padding: 0.45rem 1.1rem;
  border-radius: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.82rem;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.category-chip:hover, .category-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

/* ─── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(192,132,252,0.08);
  position: relative;
  z-index: 1;
}

.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal h2 { color: var(--primary-light); margin-bottom: 1.5rem; font-size: 1.3rem; }

/* Upgrade vendor modal */
.modal-upgrade {
  max-width: 500px;
  background: linear-gradient(145deg, #180c2e, #1a0f2e);
  border-color: rgba(192,132,252,0.2);
}

.modal-upgrade-header {
  text-align: center;
  margin-bottom: 1.8rem;
}

.modal-upgrade-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  display: block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.modal-upgrade-header h2 { font-size: 1.4rem; margin-bottom: 0.4rem; }
.modal-upgrade-sub { color: var(--text-muted); font-size: 0.85rem; }

.required-star { color: var(--primary-light); margin-left: 2px; }

.btn-upgrade-submit { width: 100%; justify-content: center; font-size: 1rem; padding: 0.85rem; }

/* ─── Forms ────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }

.product-form { padding: 1.75rem; }

/* ─── Cart ─────────────────────────────────────────────────────────────────── */
.cart-sidebar {
  position: fixed;
  right: -420px;
  top: 0;
  width: 400px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 200;
  transition: right 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.4);
}
.cart-sidebar.open { right: 0; }

.cart-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-items { flex: 1; overflow-y: auto; padding: 1rem; }

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.cart-item:hover { background: var(--bg-surface); border-radius: 8px; }

.cart-item img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }

.cart-footer { padding: 1.5rem; border-top: 1px solid var(--border); }

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ─── Dashboard ────────────────────────────────────────────────────────────── */
.dashboard { padding: 2rem; position: relative; z-index: 1; }

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.dashboard-sub { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.2rem; }

.section-title { color: var(--text-secondary); font-size: 1rem; font-weight: 600; margin-bottom: 1rem; letter-spacing: 0.02em; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(124,58,237,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.stat-card:hover {
  border-color: rgba(124,58,237,0.5);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.stat-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--primary-light); margin-bottom: 0.25rem; }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.82rem; }

/* ─── Tables ───────────────────────────────────────────────────────────────── */
.table-container { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(124, 58, 237, 0.04); }

th { color: var(--text-secondary); font-weight: 500; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ─── Status badges ────────────────────────────────────────────────────────── */
.badge { padding: 0.22rem 0.7rem; border-radius: 20px; font-size: 0.73rem; font-weight: 500; }

.badge-pending   { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.badge-confirmed { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge-paid      { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge-cancelled { background: rgba(239, 68, 68, 0.12);  color: var(--error); }

/* ─── Mode switcher ────────────────────────────────────────────────────────── */
.mode-switcher {
  display: flex;
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 0.2rem;
  border: 1px solid var(--border);
}

.mode-switcher button {
  padding: 0.35rem 0.9rem;
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  transition: all 0.25s;
}

.mode-switcher button.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 8px rgba(124,58,237,0.4);
}

/* ─── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 5rem 2rem 4rem;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(124,58,237,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  padding: 0.3rem 1rem;
  border-radius: 20px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(192,132,252,0.3);
  color: var(--primary-light);
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  animation: fade-up 0.6s ease both;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1rem;
  animation: fade-up 0.6s 0.1s ease both;
}

.hero-highlight {
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  animation: shimmer-text 4s linear infinite;
  background-size: 200% auto;
}

@keyframes shimmer-text {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 550px;
  margin: 0 auto 1.5rem;
  animation: fade-up 0.6s 0.2s ease both;
}

.hero-search {
  display: flex;
  gap: 0.5rem;
  max-width: 520px;
  margin: 0 auto 2rem;
  animation: fade-up 0.6s 0.3s ease both;
}

.search-input {
  flex: 1;
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(30, 18, 48, 0.8);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
}
.search-input::placeholder { color: var(--text-muted); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  animation: fade-up 0.6s 0.4s ease both;
}

.hero-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Features section ─────────────────────────────────────────────────────── */
.features-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 2rem 2rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: fade-up 0.5s var(--delay, 0s) ease both;
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(124,58,237,0.1), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.feature-card:hover::after { opacity: 1; }

.feature-card:hover {
  border-color: rgba(192,132,252,0.4);
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.feature-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
  transition: transform 0.3s;
}
.feature-card:hover .feature-icon { transform: scale(1.15) rotate(-5deg); }

.feature-card h3 { color: var(--primary-light); margin-bottom: 0.5rem; font-size: 1rem; }
.feature-card p { color: var(--text-muted); font-size: 0.83rem; }

/* ─── Section header ───────────────────────────────────────────────────────── */
.section-header { padding: 2rem 2rem 0; position: relative; z-index: 1; }
.section-header h2 { color: var(--primary-light); font-size: 1.4rem; }

/* ─── Empty state ──────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 5rem 2rem; position: relative; z-index: 1; }

.empty-state-icon {
  font-size: 4rem;
  color: var(--primary-light);
  margin-bottom: 1.5rem;
  opacity: 0.5;
  animation: pulse-glow 3s ease-in-out infinite;
}

.empty-state h3 { color: var(--text-primary); margin-bottom: 0.8rem; font-size: 1.3rem; }
.empty-state p { color: var(--text-muted); max-width: 500px; margin: 0 auto 1.5rem; }

/* ─── CTA section ──────────────────────────────────────────────────────────── */
.cta-section {
  text-align: center;
  padding: 5rem 2rem;
  background: linear-gradient(135deg, rgba(30,18,48,0.9), var(--bg-dark));
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.cta-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(124,58,237,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.cta-icon { font-size: 3rem; margin-bottom: 1rem; animation: float 4s ease-in-out infinite; }

.cta-section h2 { color: var(--primary-light); margin-bottom: 0.75rem; font-size: 1.7rem; }
.cta-section p { color: var(--text-muted); max-width: 500px; margin: 0 auto 2rem; }

.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ─── Upgrade banner (profile) ─────────────────────────────────────────────── */
.upgrade-banner {
  position: relative;
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(251,191,36,0.08));
  border: 1px solid rgba(192,132,252,0.25);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
  animation: fade-up 0.5s ease both;
}

.upgrade-banner-glow {
  position: absolute;
  top: -50%;
  right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(251,191,36,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.upgrade-banner-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  position: relative;
}

.upgrade-banner-icon { font-size: 2.5rem; flex-shrink: 0; animation: float 4s ease-in-out infinite; }

.upgrade-banner-text { flex: 1; min-width: 200px; }
.upgrade-banner-text h3 { color: var(--primary-light); font-size: 1rem; margin-bottom: 0.3rem; }
.upgrade-banner-text p { color: var(--text-muted); font-size: 0.83rem; line-height: 1.5; }

/* ─── Profile card ─────────────────────────────────────────────────────────── */
.profile-card { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}

.profile-fields { flex: 1; min-width: 200px; }

.profile-field {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.profile-field:last-child { border-bottom: none; }

.profile-field-label { color: var(--text-muted); font-size: 0.82rem; }
.profile-field-value { color: var(--text-primary); font-size: 0.9rem; font-weight: 500; text-align: right; }

/* ─── Toast notifications ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  min-width: 280px;
  max-width: 360px;
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-left-width: 3px;
}

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--error); }
.toast.info    { border-left-color: var(--primary); }

.toast-msg { flex: 1; font-size: 0.88rem; }

.toast-hide { animation: toast-out 0.35s ease both; }

@keyframes toast-in {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toast-out {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(110%); opacity: 0; }
}

/* ─── View transition ──────────────────────────────────────────────────────── */
#app {
  min-height: calc(100vh - 60px);
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#app.view-entered {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Sparkle particles ────────────────────────────────────────────────────── */
.sparkle-particle {
  position: fixed;
  width: var(--sparkle-size);
  height: var(--sparkle-size);
  border-radius: 50%;
  background: radial-gradient(circle, #fbbf24, #c084fc);
  pointer-events: none;
  z-index: 99999;
  animation: sparkle-fly 0.8s ease-out both;
  transform-origin: center;
}

@keyframes sparkle-fly {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* ─── Spinner ──────────────────────────────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ─── Stock badges ─────────────────────────────────────────────────────────── */
.stock-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  margin-top: 0.4rem;
}
.stock-ok  { background: rgba(16,185,129,0.12); color: var(--success); }
.stock-low { background: rgba(245,158,11,0.12);  color: var(--warning); }
.stock-out { background: rgba(239,68,68,0.12);   color: var(--error); }

/* ─── Seller product grid ──────────────────────────────────────────────────── */
.seller-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.seller-product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.seller-product-card:hover {
  border-color: rgba(192,132,252,0.4);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.seller-product-img {
  position: relative;
  height: 150px;
  overflow: hidden;
}
.seller-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.seller-product-card:hover .seller-product-img img { transform: scale(1.05); }

.seller-status-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.55rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.seller-product-info { padding: 0.85rem; }

.seller-product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.4rem 0;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.seller-product-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.7rem;
}
.seller-product-actions .btn { flex: 1; justify-content: center; }

/* ─── Catalog page ─────────────────────────────────────────────────────────── */
.catalog-page { padding: 2rem; position: relative; z-index: 1; }

.catalog-header { margin-bottom: 1.5rem; }
.catalog-header h2 { color: var(--primary-light); font-size: 1.5rem; }

.catalog-search-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.catalog-search-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.catalog-search-main {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}
.catalog-search-main .search-input { flex: 1; }

.catalog-filters-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr auto;
  gap: 0.75rem;
  align-items: end;
}

.catalog-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.catalog-filter-group label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.catalog-select, .catalog-input {
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  transition: border-color 0.25s;
  width: 100%;
}
.catalog-select:focus, .catalog-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

.catalog-results { position: relative; z-index: 1; }

.catalog-result-count {
  color: var(--text-muted);
  font-size: 0.83rem;
  padding: 0 0 0.75rem 0.25rem;
}

.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 0;
}

/* ─── Cart count badge bounce animation ────────────────────────────────────── */
@keyframes cart-count-bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.cart-count-bump {
  animation: cart-count-bump 0.35s ease;
}

/* ─── Checkout review ──────────────────────────────────────────────────────── */
.checkout-items { display: flex; flex-direction: column; gap: 0.6rem; }

.checkout-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.checkout-item:last-child { border-bottom: none; }

.checkout-item img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

/* ─── Order card hover ─────────────────────────────────────────────────────── */
.order-card { transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s; }
.order-card:hover {
  border-color: rgba(192,132,252,0.45);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* ─── Order status update buttons ─────────────────────────────────────────── */
.order-status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ─── Order status filter ──────────────────────────────────────────────────── */
.order-status-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

/* ─── Chat ─────────────────────────────────────────────────────────────────── */
.chat-messages {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.25rem 0 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.chat-msg { display: flex; flex-direction: column; max-width: 75%; }
.chat-msg-mine  { align-self: flex-end;  align-items: flex-end; }
.chat-msg-theirs { align-self: flex-start; align-items: flex-start; }

.chat-bubble {
  padding: 0.55rem 0.9rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-msg-mine .chat-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-bottom-right-radius: 4px;
}
.chat-msg-theirs .chat-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  padding: 0 0.2rem;
}

.chat-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chat-input-field {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.chat-input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
}
.chat-input-field::placeholder { color: var(--text-muted); }

/* ─── Chat notifier button ──────────────────────────────────────────────────── */
.chat-notifier-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
  transition: background 0.2s;
  line-height: 1;
  display: flex;
  align-items: center;
}
.chat-notifier-btn:hover { background: rgba(124,58,237,0.15); }

.chat-unread-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  background: var(--error);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
  animation: badge-pop 0.3s ease;
  font-family: inherit;
  line-height: 1;
}
@keyframes badge-pop {
  0%  { transform: scale(0); }
  70% { transform: scale(1.25); }
  100%{ transform: scale(1); }
}

/* ─── Chat center panel ─────────────────────────────────────────────────────── */
.chat-center-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 149;
  background: transparent;
}
.chat-center-overlay.active { display: block; }

.chat-center-panel {
  position: fixed;
  top: 60px;
  right: 1rem;
  width: 340px;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 80px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 48px rgba(0,0,0,0.5), var(--glow);
  display: flex;
  flex-direction: column;
  z-index: 150;
  transform: translateY(-8px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.chat-center-panel.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.chat-center-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-center-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-light);
}

.chat-center-body {
  overflow-y: auto;
  flex: 1;
  padding: 0.5rem;
}

.chat-center-item {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s;
  position: relative;
}
.chat-center-item:hover { background: var(--bg-surface); }
.chat-center-item.unread { background: rgba(124,58,237,0.08); }
.chat-center-item.unread:hover { background: rgba(124,58,237,0.15); }

.chat-center-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.chat-center-info { flex: 1; min-width: 0; }

.chat-center-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-center-order {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.chat-center-preview {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-center-item.unread .chat-center-preview {
  color: var(--text-primary);
  font-weight: 500;
}

.chat-center-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary-light);
  flex-shrink: 0;
  margin-top: 5px;
}

.chat-center-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.chat-center-empty-icon { font-size: 2rem; margin-bottom: 0.5rem; }

/* ─── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .chat-center-panel { right: 0.5rem; left: 0.5rem; width: auto; }
  .navbar { padding: 0.75rem 1rem; }
  .navbar-nav { gap: 0.4rem; }
  .hero { padding: 3.5rem 1rem 3rem; }
  .hero h1 { font-size: 2.1rem; }
  .hero-search { flex-direction: column; }
  .hero-stats { gap: 1rem; }
  .features-section { grid-template-columns: repeat(2, 1fr); padding: 1.5rem 1rem 2rem; gap: 1rem; }
  .feature-card { padding: 1.5rem 1rem; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); padding: 1rem; }
  .categories-filter { padding: 0.75rem 1rem; }
  .cart-sidebar { width: 100%; }
  .dashboard { padding: 1rem; }
  .empty-state { padding: 3rem 1rem; }
  .cta-section { padding: 3rem 1rem; }
  .profile-card { flex-direction: column; }
  .upgrade-banner-content { flex-direction: column; text-align: center; }
  .form-row { grid-template-columns: 1fr; }
  .modal { padding: 1.5rem; }
  .catalog-filters-row { grid-template-columns: 1fr 1fr; }
  .catalog-search-main { flex-direction: column; }
  .seller-products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .catalog-page { padding: 1rem; }
  .order-status-filter { gap: 0.3rem; }
  .chat-msg { max-width: 90%; }
  .chat-messages { max-height: 280px; }
}

