:root {
  --bg: #0b0d12;
  --surface: #141821;
  --surface-2: #1b2130;
  --border: #262e40;
  --text: #f3f5f9;
  --muted: #9aa4b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 13, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.125rem;
}

.brand-mark {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.powered-pill {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 999px;
}

.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}

.cart-btn:hover {
  border-color: var(--accent);
}

.cart-count {
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero {
  padding: 56px 0 32px;
  max-width: 720px;
}

.eyebrow {
  color: #818cf8;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 0 0 14px;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.catalog-controls {
  margin-bottom: 24px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 0.88rem;
  cursor: pointer;
}

.pill.active,
.pill:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.14);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding-bottom: 72px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: #3a4560;
}

.product-cover {
  height: 140px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cover-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.format-badge,
.promo-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(11, 13, 18, 0.55);
  color: #fff;
  backdrop-filter: blur(6px);
}

.promo-badge {
  background: rgba(255, 255, 255, 0.2);
}

.cover-category {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.product-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  margin: 0 0 4px;
  font-size: 1.08rem;
}

.product-tagline {
  margin: 0 0 10px;
  color: #c7d2fe;
  font-size: 0.86rem;
}

.product-desc {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.86rem;
  flex: 1;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.price {
  font-size: 1.2rem;
  font-weight: 700;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 13px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent);
}

.btn-full {
  width: 100%;
  padding: 12px;
  font-size: 0.95rem;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.cart-drawer.open {
  display: block;
}

.cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.cart-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(400px, 100%);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.cart-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.cart-item-title {
  font-weight: 600;
  font-size: 0.92rem;
}

.cart-item-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.remove-btn {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 0.8rem;
  cursor: pointer;
}

.cart-footer {
  padding: 18px 20px;
  border-top: 1px solid var(--border);
}

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

.cart-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.status-page {
  max-width: 680px;
  margin: 56px auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.download-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0;
}

.download-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--accent);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 60;
}

.toast.show {
  opacity: 1;
}

.loading-state,
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

@media (max-width: 640px) {
  .powered-pill {
    display: none;
  }
  .download-card {
    flex-direction: column;
    align-items: flex-start;
  }
}
