* { box-sizing: border-box; }
:root {
  --bg: #0f1216;
  --panel: #161b22;
  --text: #e6eef7;
  --muted: #9fb0c3;
  --brand: #5ad1ff;
  --accent: #40c463;
  --danger: #ff6b6b;
  --link: #8ab4ff;
  --border: #263042;
}
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { opacity: 0.9; }
.container { width: min(1100px, 92%); margin-inline: auto; }

/* Topbar */
.topbar { background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { font-weight: 800; letter-spacing: .2px; color: var(--text); }
.nav { display: flex; gap: 18px; align-items: center; }
.nav a { color: var(--text); opacity: .9; padding: 6px 10px; border-radius: 8px; }
.nav a:hover { background: #1f2430; }
.nav a.active { background: #1f2430; outline: 1px solid var(--border); }
.nav .cart { display: inline-flex; align-items: center; }

/* Hero */
.hero { padding: 18px 0 8px; }
.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  gap: 10px;
}
.hero-item-1 { grid-column: 1 / 2; grid-row: 1 / 3; }
.hero-item-2 { grid-column: 2 / 3; grid-row: 1 / 2; }
.hero-item-3 { grid-column: 2 / 3; grid-row: 2 / 3; }
.hero img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); }

/* Product grid */
.products-block { padding: 26px 0 40px; }
.products-block h2, .products-block h1 { margin: 0 0 16px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: stretch;
}

.product-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;

  /* Make the card a column that stretches full height */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-image { 
  display: block; 
  aspect-ratio: 1 / 1; 
  background: #0d1015; 
  flex: 0 0 auto; 
}
.product-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Content area grows between image and actions */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 0;
  min-height: 0;
  padding: 12px 12px 0;
}
.product-info h3 { margin: 0; font-size: 18px; color: var(--text); }
.product-info .features { margin: 8px 0 0; padding-left: 18px; list-style: disc; }
.product-info > :last-child { margin-bottom: 0; }

/* Button row sits at the very bottom */
.product-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.btn { display: inline-block; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); background: #1a202b; text-align: center; }
.btn.primary { background: var(--brand); color: #00121a; border-color: transparent; font-weight: 700; }
.btn:hover { transform: translateY(-1px); }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; padding: 26px 0 40px; }
.detail-media img { width: 100%; border-radius: 12px; border: 1px solid var(--border); background: #0d1015; }
.detail-info h1 { margin-top: 0; }
.features { margin: 12px 0; padding-left: 18px; }
.note { color: var(--muted); font-size: 14px; }

/* Footer */
.site-footer { background: var(--panel); border-top: 1px solid var(--border); margin-top: 30px; }
.footer-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; padding: 22px 0; }
.footer-col h4 { margin: 0 0 10px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: 6px 0; }
.affiliate { color: var(--muted); font-size: 14px; }
.cards { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cards img { height: 28px; width: auto; filter: grayscale(10%); }
.copyright { border-top: 1px solid var(--border); padding: 10px 0 18px; color: var(--muted); }

/* Responsive */
@media (max-width: 1000px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
}
