/* DropStream Store — Design System */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-deep: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #181825;
  --accent: #00e5a0;
  --accent-dim: #00e5a020;
  --accent-glow: #00e5a040;
  --accent-dark: #00b880;
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --border: #1e1e2e;
  --border-hover: #2a2a40;
  --danger: #ff4d6a;
  --danger-dim: #ff4d6a20;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--text-primary); }

img { max-width: 100%; display: block; }

/* ─── Grid Background ──────────────────────────────────────────── */
.grid-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

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

/* ─── Navigation ───────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo .logo-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
  position: relative;
}

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

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.cart-link {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--accent);
  color: var(--bg-deep);
  font-size: 11px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-count:empty,
.cart-count[data-count="0"] { display: none; }

/* ─── Container ────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Page Header ──────────────────────────────────────────────── */
.page-header {
  padding: 48px 0 32px;
}

.page-header h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.page-header p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ─── Breadcrumb ───────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 20px 0 0;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-muted); }

/* ─── Shop Layout ──────────────────────────────────────────────── */
.shop-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  padding-bottom: 80px;
}

/* ─── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-section h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.category-list li a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.category-list li a:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.category-list li a.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* ─── Search Bar ───────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.search-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); }

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
  cursor: pointer;
  min-width: 160px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%238888a0'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.sort-select:focus { border-color: var(--accent); }

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

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.product-card-image {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-deep);
  position: relative;
}

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

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

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: var(--bg-deep);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.product-card-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 6px;
}

.product-card-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}

.product-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.product-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.product-compare-price {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 8px;
}

.product-card-btn {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.product-card-btn:hover {
  background: var(--accent);
  color: var(--bg-deep);
}

/* ─── Product Detail ───────────────────────────────────────────── */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 40px 0 80px;
}

.product-detail-image {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
}

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

.product-detail-info {
  display: flex;
  flex-direction: column;
}

.product-detail-category {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
}

.product-detail-name {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  line-height: 1.1;
}

.product-detail-desc {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.product-detail-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.product-detail-price .current {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.product-detail-price .compare {
  font-size: 18px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-detail-savings {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 32px;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
}

.qty-btn {
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-family: inherit;
}

.qty-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.qty-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.qty-btn:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }

.qty-value {
  width: 56px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: none;
  border-right: none;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  outline: none;
  -moz-appearance: textfield;
}
.qty-value::-webkit-inner-spin-button,
.qty-value::-webkit-outer-spin-button { -webkit-appearance: none; }

.add-to-cart-btn {
  width: 100%;
  padding: 16px 32px;
  background: var(--accent);
  color: var(--bg-deep);
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.add-to-cart-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.add-to-cart-btn:active {
  transform: translateY(0);
}

.product-meta {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.product-meta-item .icon {
  color: var(--accent);
  font-size: 16px;
}

/* ─── Related Products ─────────────────────────────────────────── */
.related-section {
  padding: 40px 0 80px;
  border-top: 1px solid var(--border);
}

.related-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 32px;
}

/* ─── Cart ─────────────────────────────────────────────────────── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 40px;
  padding-bottom: 80px;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  gap: 20px;
  align-items: center;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-deep);
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-item-info p {
  font-size: 13px;
  color: var(--text-muted);
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0;
}

.cart-item-qty .qty-btn {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.cart-item-qty .qty-value {
  width: 40px;
  height: 32px;
  font-size: 14px;
}

.cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.cart-item-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.cart-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition);
  font-family: inherit;
}

.cart-remove-btn:hover {
  color: var(--danger);
  background: var(--danger-dim);
}

/* Cart Summary */
.cart-summary {
  position: sticky;
  top: 88px;
  align-self: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.cart-summary h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 14px;
}

.cart-summary-row .label {
  color: var(--text-secondary);
}

.cart-summary-row .value {
  font-weight: 600;
}

.cart-summary-row.total {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 18px;
}

.cart-summary-row.total .value {
  color: var(--accent);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.checkout-btn {
  width: 100%;
  margin-top: 24px;
  padding: 16px;
  background: var(--accent);
  color: var(--bg-deep);
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.checkout-btn:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.continue-shopping {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Empty cart */
.cart-empty {
  text-align: center;
  padding: 80px 0;
}

.cart-empty h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

.cart-empty p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.cart-empty .btn-shop {
  display: inline-block;
  padding: 14px 32px;
  background: var(--accent);
  color: var(--bg-deep);
  border-radius: var(--radius);
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all var(--transition);
}

.cart-empty .btn-shop:hover {
  background: var(--accent-dark);
}

/* ─── Success Page ─────────────────────────────────────────────── */
.success-page {
  text-align: center;
  padding: 80px 0 120px;
  max-width: 600px;
  margin: 0 auto;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 32px;
  color: var(--accent);
}

.success-page h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

.success-page p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 40px;
}

.success-order-number {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 32px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 40px;
}

/* ─── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-deep);
}
.btn-primary:hover {
  background: var(--accent-dark);
  color: var(--bg-deep);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Loading / Empty States ───────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.loading::before {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ─── Footer ───────────────────────────────────────────────────── */
.store-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
}

.footer-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

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

/* ─── Toast Notification ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 24px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 229, 160, 0.15);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast .toast-icon {
  color: var(--accent);
  font-size: 18px;
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    display: flex;
    flex-direction: row;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
  }
  .sidebar-section {
    margin-bottom: 0;
  }
  .category-list {
    flex-direction: row;
  }
  .category-list li a {
    white-space: nowrap;
  }
  .cart-layout {
    grid-template-columns: 1fr;
  }
  .cart-summary {
    position: static;
  }
  .product-detail {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .cart-item {
    grid-template-columns: 60px 1fr;
    gap: 12px;
  }
  .cart-item-qty {
    grid-column: 2;
  }
  .cart-item-right {
    grid-column: 2;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .search-bar {
    flex-direction: column;
  }
  .sort-select {
    width: 100%;
  }
  .nav-links { gap: 16px; }
}
