/* PeakDrop Design System */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #181824;
  --accent: #f97316;
  --accent-glow: rgba(249, 115, 22, 0.15);
  --accent-hover: #fb923c;
  --text-primary: #f0f0f5;
  --text-secondary: #8a8a9a;
  --text-muted: #5a5a6a;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(249,115,22,0.25);
  --green: #22c55e;
  --blue: #3b82f6;
  --purple: #a855f7;
  --red: #ef4444;
  --amazon: #FF9900;
  --tiktok: #ff0050;
  --shopify: #96BF48;
  --ebay: #E53238;
  --walmart: #0071CE;
}

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ─── Shared Nav ─── */
.app-nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10,10,15,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-left { display: flex; align-items: center; gap: 2rem; }
.nav-right { display: flex; align-items: center; gap: 1.5rem; }

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }

.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}
.cart-link:hover { border-color: var(--border-hover); color: var(--text-primary); }

.cart-count {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -6px;
  right: -6px;
}
.cart-count.hidden { display: none; }

/* ─── Page Container ─── */
.page { padding: 5.5rem 2rem 3rem; max-width: 1280px; margin: 0 auto; }

/* ─── Section Headers ─── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}
.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.page-header h1 .highlight {
  background: linear-gradient(135deg, var(--accent), #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Category Tabs ─── */
.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.cat-tab {
  padding: 0.5rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.cat-tab:hover { border-color: var(--border-hover); color: var(--text-primary); }
.cat-tab.active {
  background: var(--accent-glow);
  border-color: rgba(249,115,22,0.3);
  color: var(--accent);
}

/* ─── Sort & Filter Bar ─── */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.filter-bar .result-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  outline: none;
}
.sort-select:focus { border-color: var(--accent); }
.sort-select option { background: var(--bg-dark); }

/* ─── Search Bar ─── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 1.2rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--accent); }
.search-bar .icon { color: var(--text-muted); font-size: 1.1rem; }
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}
.search-bar input::placeholder { color: var(--text-muted); }

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

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.channel-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  z-index: 2;
}
.channel-badge.amazon { background: rgba(255,153,0,0.2); color: #FF9900; border: 1px solid rgba(255,153,0,0.3); }
.channel-badge.tiktok { background: rgba(255,0,80,0.2); color: #ff4081; border: 1px solid rgba(255,0,80,0.3); }
.channel-badge.shopify { background: rgba(150,191,72,0.2); color: #96BF48; border: 1px solid rgba(150,191,72,0.3); }
.channel-badge.ebay { background: rgba(228,50,56,0.2); color: #E53238; border: 1px solid rgba(228,50,56,0.3); }
.channel-badge.walmart { background: rgba(0,113,206,0.2); color: #5ba8f5; border: 1px solid rgba(0,113,206,0.3); }

.trending-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(249,115,22,0.9);
  color: #fff;
  z-index: 2;
}

.product-info { padding: 1.25rem; }

.product-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.product-meta .rating { color: #fbbf24; }
.product-meta .channels { color: var(--green); font-weight: 500; }

.product-pricing {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.current-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}
.compare-price {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: line-through;
}
.discount-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(34,197,94,0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.add-to-cart-btn {
  width: 100%;
  padding: 0.7rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.add-to-cart-btn:hover { background: var(--accent-hover); transform: scale(1.02); }
.add-to-cart-btn:active { transform: scale(0.98); }
.add-to-cart-btn.added {
  background: var(--green);
  pointer-events: none;
}

/* ─── Product Detail Modal ─── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.modal-overlay.active { display: flex; }

.product-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.modal-image {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  border-radius: 20px 0 0 20px;
  position: relative;
}

.modal-details {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 201;
}
.modal-close:hover { background: rgba(0,0,0,0.8); }

.modal-channel {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  width: fit-content;
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.modal-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.modal-rating .stars { color: #fbbf24; }

.modal-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.modal-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.stat-chip {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
}
.stat-chip .val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}
.stat-chip .lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-pricing {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.modal-pricing .current-price { font-size: 2rem; }

.modal-add-btn {
  padding: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: auto;
}
.modal-add-btn:hover { background: var(--accent-hover); }

/* ─── Cart Page ─── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

.cart-items { display: flex; flex-direction: column; gap: 1rem; }

.cart-item {
  display: flex;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}
.cart-item:hover { border-color: var(--border-hover); }

.cart-item-image {
  width: 100px;
  height: 100px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  flex-shrink: 0;
}

.cart-item-details { flex: 1; }
.cart-item-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.cart-item-channel {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.qty-btn:hover { border-color: var(--accent); background: var(--accent-glow); }
.qty-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}
.cart-item-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
}
.remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.remove-btn:hover { color: var(--red); }

/* Cart Summary */
.cart-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  position: sticky;
  top: 6rem;
}
.cart-summary h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}
.summary-row .label { color: var(--text-secondary); }
.summary-row.total {
  font-weight: 700;
  font-size: 1.15rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.summary-row .savings { color: var(--green); font-weight: 600; }

.checkout-btn {
  width: 100%;
  padding: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 1.5rem;
}
.checkout-btn:hover { background: var(--accent-hover); }
.checkout-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.continue-shopping {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ─── Checkout Page ─── */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  align-items: start;
}

.form-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.form-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group { margin-bottom: 0; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  font-weight: 500;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent);
}
.form-group input::placeholder { color: var(--text-muted); }

/* ─── Empty States ─── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}
.empty-state .icon { font-size: 4rem; margin-bottom: 1.5rem; opacity: 0.4; }
.empty-state h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}
.empty-state .btn {
  display: inline-flex;
  padding: 0.75rem 2rem;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  transition: background 0.2s;
}
.empty-state .btn:hover { background: var(--accent-hover); }

/* ─── Order Confirmation ─── */
.order-success {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 600px;
  margin: 0 auto;
}
.order-success .check {
  width: 80px;
  height: 80px;
  background: rgba(34,197,94,0.1);
  border: 2px solid var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1.5rem;
}
.order-success h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.order-success .order-num {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.order-success p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

/* ─── Toast Notifications ─── */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.3s ease-out;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.toast.success { border-color: rgba(34,197,94,0.3); }
.toast.error { border-color: rgba(239,68,68,0.3); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Loading Skeleton ─── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.05) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Footer ─── */
.app-footer {
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}
.app-footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .cart-layout, .checkout-layout {
    grid-template-columns: 1fr;
  }
  .product-modal {
    grid-template-columns: 1fr;
    max-width: 500px;
  }
  .modal-image { aspect-ratio: auto; min-height: 250px; border-radius: 20px 20px 0 0; }
}

@media (max-width: 768px) {
  .app-nav { padding: 0.85rem 1.25rem; }
  .nav-links { display: none; }
  .page { padding: 5rem 1rem 2rem; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
  .product-image { font-size: 2.5rem; }
  .product-info { padding: 0.85rem; }
  .product-title { font-size: 0.85rem; }
  .current-price { font-size: 1.1rem; }
  .category-tabs { gap: 0.35rem; }
  .cat-tab { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
  .cart-item { flex-direction: column; }
  .cart-item-right { flex-direction: row; align-items: center; width: 100%; }
  .modal-overlay { padding: 0.5rem; }
  .modal-details { padding: 1.5rem; }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; align-items: stretch; }
}
