@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Variables ── */
:root {
  --bg:         #0b0913;
  --bg2:        #110e1e;
  --surface:    rgba(255,255,255,0.04);
  --surface2:   rgba(255,255,255,0.08);
  --border:     rgba(255,255,255,0.08);
  --border2:    rgba(255,255,255,0.14);
  --primary:    #7c3aed;
  --primary2:   #4f46e5;
  --glow:       rgba(124,58,237,0.35);
  --accent:     #f59e0b;
  --accent2:    #fbbf24;
  --text:       #f0eeff;
  --text2:      #9891b8;
  --text3:      #5e587a;
  --danger:     #ef4444;
  --success:    #22c55e;
  --radius:     18px;
  --radius-sm:  10px;
  --shadow:     0 8px 32px rgba(0,0,0,0.45);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.35);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Sticky Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,9,19,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 18px var(--glow);
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #e0d7ff, var(--text));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Search ── */
.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 10px 42px 10px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search input::placeholder { color: var(--text3); }

.header-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glow);
}

.header-search .search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
  font-size: 14px;
}

.header-nav { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }

.nav-link {
  color: var(--text2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 50px;
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover { color: var(--text); border-color: var(--border2); }

/* ── Wrap ── */
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Hero ── */
.hero {
  padding: 72px 24px 60px;
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(124,58,237,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #c4b5fd;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.08;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #ffffff 30%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 18px;
  color: var(--text2);
  max-width: 460px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-search {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  position: relative;
}

.hero-search input {
  flex: 1;
  padding: 15px 22px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 50px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hero-search input::placeholder { color: var(--text3); }
.hero-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--glow);
}

.hero-search .search-btn {
  padding: 15px 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 20px var(--glow);
}

.hero-search .search-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-num {
  display: block;
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 12px; color: var(--text3); margin-top: 2px; }

/* ── Section ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  margin-top: 48px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* ── Category Chips ── */
.category-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 28px;
}

.category-bar::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  font-family: inherit;
  white-space: nowrap;
}

.chip:hover { border-color: var(--primary); color: var(--text); }

.chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 14px var(--glow);
}

/* ── Product Grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

/* ── Product Card ── */
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  display: block;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 48px rgba(0,0,0,0.5), 0 0 0 1px var(--primary);
  border-color: var(--primary);
}

.product-card:hover .card-cta { opacity: 1; transform: translateY(0); }
.product-card:hover .product-thumb img { transform: scale(1.05); }

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.card-badge.hot   { color: #fbbf24; }
.card-badge.new   { color: #34d399; }
.card-badge.flash { color: #fff; background: linear-gradient(135deg,#ef4444,#f97316); border-radius: 6px; padding: 2px 8px; font-weight: 700; }
.card-badge.off20 { color: #f9a8d4; }
.card-badge.bogo  { color: #fff; background: linear-gradient(135deg,#7c3aed,#4f46e5); border-radius: 6px; padding: 2px 8px; font-weight: 700; }
.card-badge.off5  { color: #6ee7b7; }

.bogo-note { font-size: 13px; font-weight: 600; color: #34d399; margin-bottom: 10px; }

.product-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(145deg, #1a1530, #231e40);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  overflow: hidden;
  position: relative;
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card-cta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, transparent 100%);
  padding: 28px 14px 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.cta-pill {
  background: white;
  color: #0b0913;
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.card-body {
  padding: 14px 16px 16px;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

.price-wrap { display: flex; align-items: baseline; gap: 5px; }
.product-price-orig { font-size: 12px; font-weight: 500; color: var(--text3); text-decoration: line-through; }
.detail-price-wrap { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.detail-price-orig { font-size: 18px; font-weight: 500; color: var(--text3); text-decoration: line-through; }

.card-bought {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 8px;
  font-weight: 500;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent);
}

.price-stars {
  display: flex;
  gap: 1px;
  font-size: 11px;
  color: var(--accent2);
}

/* ── Skeleton ── */
@keyframes shimmer {
  from { background-position: -600px 0; }
  to   { background-position: 600px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 10px;
}

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 1;
}

.skeleton-body { padding: 14px 16px 16px; }
.skeleton-line { height: 13px; margin-bottom: 8px; }
.skeleton-line.short { width: 60%; }

/* ── Result count ── */
.result-count {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 18px;
}

/* ── No results ── */
.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--text2);
}

.no-results-icon { font-size: 48px; margin-bottom: 16px; }
.no-results h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.no-results p { font-size: 14px; color: var(--text3); }

/* ── Product Detail ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text3); text-decoration: none; }
.breadcrumb a:hover { color: var(--text2); }
.breadcrumb span { color: var(--text2); }

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 700px) {
  .product-detail { grid-template-columns: 1fr; gap: 28px; }
}

.detail-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #1a1530, #231e40);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  overflow: hidden;
}

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

.detail-body { display: flex; flex-direction: column; gap: 0; }

.detail-name {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.detail-price {
  font-size: 34px;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: -1px;
}

.detail-price-note {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 24px;
}

.detail-desc {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 28px;
  white-space: pre-wrap;
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}

.trust-badge .trust-icon { font-size: 16px; }

.buy-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary2) 100%);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 8px 32px var(--glow);
  font-family: inherit;
}

.buy-btn:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 14px 40px var(--glow); }
.buy-btn:active { transform: translateY(0); }
.buy-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.15s;
}

.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { border-color: var(--border2); }
.btn.small { width: auto; padding: 7px 13px; font-size: 12px; border-radius: 8px; }
.btn.danger { background: linear-gradient(135deg, #dc2626, #b91c1c); }

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 28px;
  transition: color 0.15s;
}

.back-link:hover { color: var(--text); }

/* ── Messages ── */
.msg {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 14px;
}

.msg.error   { background: rgba(239,68,68,0.1);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.msg.success { background: rgba(34,197,94,0.1);  color: #86efac; border: 1px solid rgba(34,197,94,0.25); }

/* ── Forms ── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glow);
}
.field textarea { resize: vertical; min-height: 80px; }

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}

/* ── Admin table ── */
table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.admin-table th, table.admin-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}

table.admin-table th {
  color: var(--text3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface);
}

table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 50px;
  background: var(--surface2);
  color: var(--text3);
  border: 1px solid var(--border);
}

.badge.active-badge { background: rgba(34,197,94,0.12); color: #86efac; border-color: rgba(34,197,94,0.25); }

/* ── Empty & loading states ── */
.empty-state {
  text-align: center;
  color: var(--text3);
  padding: 60px 20px;
  font-size: 14px;
}

/* ── Success page ── */
.success-wrap {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.success-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 52px 40px;
  text-align: center;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow);
}

.success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 24px;
  box-shadow: 0 0 40px var(--glow);
}

.success-card h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 12px;
}

.success-card p {
  color: var(--text2);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
  margin-top: 80px;
}

.site-footer a { color: var(--text3); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero { padding: 48px 16px 40px; }
  .hero h1 { font-size: 32px; }
  .hero-search { flex-direction: column; }
  .hero-stats { gap: 20px; }
  .header-search { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .wrap { padding: 0 16px 60px; }
}

@media (max-width: 420px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
