:root {
  --bg: #0f0f0f;
  --surface: #1a1a2e;
  --surface-2: #16213e;
  --accent: #e94560;
  --accent-2: #0f3460;
  --text: #eee;
  --text-dim: #999;
  --radius: 8px;
  --max-width: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

/* Nav */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
}
nav .logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
nav .logo:hover { color: var(--accent); text-decoration: none; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--text-dim); font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Main */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 0;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.hero p { color: var(--text-dim); font-size: 1.1rem; }

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}
.stat-label { color: var(--text-dim); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }
a.stat-card { border: 1px solid transparent; transition: border-color 0.2s; }
a.stat-card:hover { border-color: var(--accent); text-decoration: none; }

/* Category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.category-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.category-card:hover { border-color: var(--accent); text-decoration: none; }
.category-name { font-weight: 700; color: var(--text); font-size: 1.1rem; }
.category-count { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.25rem; }

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}
.product-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.product-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 1rem;
}
.product-info { padding: 1rem; }
.product-info h3 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.product-info h3 a { color: var(--text); }
.product-info h3 a:hover { color: var(--accent); text-decoration: none; }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}
.badge-category { background: var(--accent-2); color: var(--text); }
.badge-connection { background: #1a4a1a; color: #8f8; }
.badge-firmware { background: #4a3a1a; color: #fa3; }
.badge-xbox { background: #107c10; color: white; }
.badge-system { background: #2a1a4a; color: #c8b4ff; }
.badge-family { background: #1a3a3a; color: #8fd; }
.badge-collection { background: #3a1a2a; color: #f8c; }
a.badge:hover { text-decoration: none; opacity: 0.8; }

.product-meta { margin-bottom: 0.5rem; }
.product-links { display: flex; gap: 0.75rem; font-size: 0.85rem; }
.product-links a { color: var(--text-dim); }
.product-links a:hover { color: var(--accent); }

/* Filters */
.filters { margin-bottom: 1rem; }
.filters strong { color: var(--text-dim); margin-right: 0.5rem; font-size: 0.85rem; }

/* Product detail */
.product-detail { max-width: 900px; }
.product-header {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.product-hero-image {
  background: var(--surface);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.product-hero-image img { max-width: 100%; max-height: 300px; object-fit: contain; }
.product-hero-info h1 { font-size: 1.8rem; margin-bottom: 0.75rem; }
.detail-row { margin: 0.75rem 0; color: var(--text-dim); }
.detail-row strong { color: var(--text); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: 1rem;
  margin-right: 0.5rem;
}
.btn:hover { text-decoration: none; opacity: 0.9; }
.btn-primary { background: var(--accent-2); color: var(--text); }
.btn-secondary { background: var(--accent); color: white; }

/* Product sections */
.product-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--surface);
}
.product-section h2 { margin-bottom: 1rem; }
.product-section ul { list-style: none; }
.product-section li { padding: 0.35rem 0; }
.product-section li a { word-break: break-all; font-size: 0.9rem; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 0.5rem; }
.faq-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
.faq-item summary::before { content: "+ "; color: var(--accent); }
.faq-item[open] summary::before { content: "- "; }
.faq-answer { margin-top: 0.75rem; color: var(--text-dim); line-height: 1.7; }
.faq-answer p { margin-bottom: 0.5rem; }

/* Updater cards */
.updater-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.updater-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.updater-card:hover { border-color: var(--accent); }
.updater-card h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.updater-card h2 a { color: var(--text); }
.updater-card h2 a:hover { color: var(--accent); text-decoration: none; }
.updater-card p { color: var(--text-dim); font-size: 0.9rem; margin: 0.75rem 0; }

/* Updater list on product page */
.updater-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.updater-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
}
.updater-item a:first-child { font-weight: 600; }
.updater-open { color: var(--text-dim); font-size: 0.85rem; margin-left: auto; }
.updater-open:hover { color: var(--accent); }

/* Platform cards */
.platform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.platform-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.platform-card strong { font-size: 1.1rem; }
.platform-req { color: var(--text-dim); font-size: 0.85rem; }
.platform-actions { margin-top: 0.5rem; }
.platform-actions .btn { margin-top: 0; font-size: 0.85rem; padding: 0.4rem 1rem; }

/* Download cards */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.download-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  border: 1px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
  color: var(--text);
}
.download-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.download-icon {
  width: 40px;
  height: 40px;
  color: var(--accent);
}
.download-label {
  font-weight: 700;
  font-size: 1rem;
}
.download-filename {
  font-size: 0.75rem;
  color: var(--text-dim);
  word-break: break-all;
  line-height: 1.3;
}

/* System hero */
.system-hero {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}
.system-hero h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.system-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.system-description { color: var(--text-dim); font-size: 1.05rem; line-height: 1.7; }
.system-description p { margin: 0; }

/* See all */
.see-all { text-align: center; margin-top: 1.5rem; }

.section-intro { margin-bottom: 2rem; color: var(--text-dim); }
section { margin-bottom: 3rem; }
section > h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
section > h3 { font-size: 1.1rem; color: var(--text-dim); margin-top: 1.25rem; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* Footer */
footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem;
  border-top: 1px solid var(--surface);
  color: var(--text-dim);
  font-size: 0.85rem;
  text-align: center;
}
footer p { margin-bottom: 0.5rem; }
footer a { color: var(--text-dim); }
footer a:hover { color: var(--accent); }

/* Product description & pricing */
.product-description { color: var(--text-dim); margin-bottom: 0.75rem; font-size: 1rem; }
.product-pricing { margin: 0.75rem 0; }
.price { font-size: 1.5rem; font-weight: 800; color: #4caf50; }
.price-compare { font-size: 1rem; color: var(--text-dim); text-decoration: line-through; margin-left: 0.5rem; }

/* Two-column layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.two-col h2 { font-size: 1.2rem; margin-bottom: 0.75rem; margin-top: 1.5rem; }
.two-col h2:first-child { margin-top: 0; }
.two-col ul { padding-left: 1.25rem; margin-bottom: 0; }
.two-col li { list-style: disc; padding: 0.25rem 0; }

/* Specs table */
.specs-table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; }
.specs-table th,
.specs-table td { padding: 0.6rem 1rem; text-align: left; border-bottom: 1px solid var(--surface-2); }
.specs-table th { color: var(--text-dim); font-weight: 600; width: 160px; white-space: nowrap; }
.specs-table td { color: var(--text); }

.product-section h3 { font-size: 1.1rem; margin-top: 1.25rem; margin-bottom: 0.5rem; }
.product-section ul { padding-left: 1.25rem; }
.product-section li { list-style: disc; }

/* Responsive */
@media (max-width: 768px) {
  nav { flex-direction: column; gap: 0.75rem; }
  .product-header { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  main { padding: 1rem; }
}
