/* Public storefront — Steam-inspired dark theme. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body.store {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  background: #1b2838;
  color: #c7d5e0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #66c0f4; text-decoration: none; }
a:hover { color: #a5d6f5; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */

.store-topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #171a21;
  padding: 0 32px;
  height: 60px;
}

.store-brand {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.store-nav { display: flex; gap: 18px; }
.store-nav a { color: #b8c4cf; font-weight: 500; }
.store-nav a:hover { color: #fff; }

.cart-badge {
  display: inline-block;
  background: #5c7e10;
  color: #fff;
  border-radius: 9px;
  padding: 0 7px;
  font-size: 12px;
}

.store-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.store-user { color: #b8c4cf; font-size: 13px; }

/* Operator group — only rendered for logged-in staff, visually fenced off
   from the customer account controls so the two sessions read distinctly. */
.store-staff {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-right: 14px;
  margin-right: 4px;
  border-right: 1px solid #2a3f54;
}
.store-staff-id { color: #8f98a0; font-size: 12px; white-space: nowrap; }

/* Internal cross-link — only rendered for logged-in operators. */
.store-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #2a3f54;
  color: #cfe0ee;
  border: 1px solid #3d5773;
  border-radius: 3px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
}
.store-admin-link:hover { background: #34506b; color: #fff; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn-primary {
  display: inline-block;
  background: linear-gradient(90deg, #06bfff 0%, #2d73ff 100%);
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 8px 16px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary:hover { color: #fff; filter: brightness(1.1); }
.btn-primary.lg { padding: 12px 28px; font-size: 16px; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.link-btn {
  background: none;
  border: none;
  color: #66c0f4;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.link-btn:hover { color: #a5d6f5; }

/* ── Main ────────────────────────────────────────────────────────────────── */

.store-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 32px;
}

.hero { margin-bottom: 28px; }
.hero h1 { color: #fff; font-size: 26px; margin-bottom: 6px; }
.hero p { color: #8f98a0; }

.back-link { display: inline-block; margin-bottom: 18px; }

/* ── Catalog grid ────────────────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.module-card {
  background: #16202d;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
  transition: transform 0.12s, box-shadow 0.12s;
}
.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  color: inherit;
}

.module-thumb {
  height: 130px;
  background: #0e1620;
  display: flex;
  align-items: center;
  justify-content: center;
}
.module-thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb-placeholder {
  font-size: 48px;
  font-weight: 700;
  color: #2a475e;
}
.thumb-placeholder.lg { font-size: 96px; width: 100%; height: 280px; display: flex; align-items: center; justify-content: center; background: #0e1620; border-radius: 6px; }

.module-body { padding: 14px 16px; }
.module-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #66c0f4;
}
.module-body h3 { color: #fff; font-size: 16px; margin: 4px 0 6px; }
.module-body p { color: #8f98a0; font-size: 13px; min-height: 34px; }
.module-price { display: inline-block; margin-top: 10px; color: #beee11; font-weight: 600; }
.module-price.lg { font-size: 22px; }

/* ── Module detail ───────────────────────────────────────────────────────── */

.module-detail {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}
.module-detail-media img { width: 100%; border-radius: 6px; }
.module-detail-info h1 { color: #fff; font-size: 26px; margin: 6px 0; }
.module-summary { color: #c7d5e0; margin-bottom: 14px; }
.module-description { color: #8f98a0; margin-bottom: 20px; }

.config-placeholder, .payment-placeholder {
  background: #16202d;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 20px;
}
.config-placeholder h3, .payment-placeholder h3 { color: #fff; font-size: 15px; margin-bottom: 6px; }

.purchase-row {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #16202d;
  padding: 16px;
  border-radius: 6px;
}

/* ── Cart & checkout ─────────────────────────────────────────────────────── */

.store-main h1 { color: #fff; margin-bottom: 18px; }

.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: #16202d;
  border-radius: 6px;
  overflow: hidden;
}
.cart-table th, .cart-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #0e1620;
}
.cart-table th { color: #8f98a0; font-size: 12px; text-transform: uppercase; }
.cart-table tfoot td { border-bottom: none; }

.cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}

.checkout-summary, .checkout-summary ul { margin-bottom: 20px; }
.checkout-summary { background: #16202d; padding: 16px; border-radius: 6px; }
.checkout-summary h3 { color: #fff; margin-bottom: 10px; }
.checkout-summary li { list-style: none; padding: 4px 0; }
.checkout-total { margin-top: 10px; color: #beee11; }

/* ── Auth cards ──────────────────────────────────────────────────────────── */

.auth-card {
  max-width: 380px;
  margin: 20px auto;
  background: #16202d;
  border-radius: 8px;
  padding: 32px;
}
.auth-card h1 { color: #fff; margin-bottom: 18px; }
.auth-card label {
  display: block;
  margin-bottom: 14px;
  color: #b8c4cf;
  font-size: 13px;
}
.auth-card input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 9px 12px;
  background: #0e1620;
  border: 1px solid #2a475e;
  border-radius: 4px;
  color: #fff;
  font: inherit;
}
.auth-card input:focus { outline: none; border-color: #66c0f4; }
.auth-card .btn-primary { width: 100%; margin-top: 6px; }
.auth-alt { margin-top: 16px; font-size: 13px; color: #8f98a0; }

/* ── Misc ────────────────────────────────────────────────────────────────── */

.empty-state {
  background: #16202d;
  border-radius: 6px;
  padding: 50px;
  text-align: center;
  color: #8f98a0;
}
.empty-state h1 { color: #fff; }

.msg-error {
  background: #5a1d1d;
  border: 1px solid #8a2a2a;
  color: #ffb4b4;
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 13px;
}

.store-footer {
  background: #171a21;
  color: #61707d;
  padding: 18px 32px;
  font-size: 12px;
}
