/* DevGear - one stylesheet for the whole shop. */

:root {
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --good: #15803d;
  --good-bg: #dcfce7;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

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

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

/* ---------- header ---------- */

.site-header {
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 62px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}
.logo:hover { text-decoration: none; }
.logo span { color: #60a5fa; }

.site-header nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-header nav a,
.site-header nav button {
  color: #cbd5e1;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.site-header nav a:hover,
.site-header nav button:hover { color: #fff; text-decoration: none; }

.cart-count {
  display: inline-block;
  min-width: 19px;
  padding: 0 5px;
  margin-left: 5px;
  background: var(--accent);
  color: #fff;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.cart-count[hidden] { display: none; }

.owner-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: #fbbf24;
  color: #451a03;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
}

/* ---------- page furniture ---------- */

main { padding: 28px 0 64px; }

h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.4px; }
h2 { font-size: 19px; margin: 0 0 12px; }
.subtitle { color: var(--ink-soft); margin: 0 0 24px; }

.notice {
  padding: 11px 14px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  font-size: 14px;
}
.notice.error { background: var(--bad-bg); color: var(--bad); }
.notice.success { background: var(--good-bg); color: var(--good); }
.notice.info { background: #e0f2fe; color: #075985; }
.notice[hidden] { display: none; }

/* ---------- filters ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 22px;
}

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

.chip {
  padding: 7px 15px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 99px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  color: var(--ink-soft);
}
.chip:hover { border-color: var(--ink-faint); }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}

.toolbar .spacer { margin-left: auto; }

input[type="search"], select, input[type="text"], input[type="email"],
input[type="password"], input[type="tel"], input[type="number"], textarea {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--card);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

/* ---------- product grid ---------- */

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.09);
}

/* Stand-in for the product photo until real images are added. */
.thumb {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  position: relative;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  border-bottom: 1px solid var(--line);
}
.thumb img { width: 100%; height: 100%; display: block; }

/* Generated illustrations: shown whole, with space around them. */
.thumb img.art { object-fit: contain; padding: 12px; }

/* Photographs: fill the card. A photo letterboxed inside a card looks like a
   mistake, and these are all landscape so the crop is safe. */
.thumb img.photo { object-fit: cover; padding: 0; }
.thumb .initials {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--thumb-color, #64748b);
  letter-spacing: -1px;
}
.thumb[data-category="Keyboards"] { --thumb-color: #4f46e5; }
.thumb[data-category="Mouse"]     { --thumb-color: #0d9488; }
.thumb[data-category="Headsets"]  { --thumb-color: #c026d3; }
.thumb[data-category="Monitors"]  { --thumb-color: #ea580c; }

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 5px;
}
.badge.out { background: var(--bad-bg); color: var(--bad); }
.badge.low { background: var(--warn-bg); color: var(--warn); }

.card-body { padding: 14px; display: flex; flex-direction: column; flex: 1; gap: 4px; }
.card-brand {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--ink-faint);
  font-weight: 700;
}
.card-name { font-weight: 600; line-height: 1.35; }
.card-name a { color: var(--ink); }
.card-price { font-size: 18px; font-weight: 700; margin-top: 6px; }
.card .btn { margin-top: 12px; width: 100%; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn:disabled { background: var(--ink-faint); cursor: not-allowed; }
.btn.secondary {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
.btn.secondary:hover { background: #f1f5f9; }
.btn.danger { background: none; color: var(--bad); border-color: transparent; padding: 4px 8px; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { padding: 5px 11px; font-size: 13px; }

/* ---------- product detail ---------- */

.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
.detail .thumb { border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.detail h1 { margin-top: 6px; }
.price-big { font-size: 30px; font-weight: 700; margin: 14px 0 6px; }
.stock-line { margin-bottom: 18px; font-weight: 600; }
.stock-line.ok { color: var(--good); }
.stock-line.low { color: var(--warn); }
.stock-line.out { color: var(--bad); }
.buy-row { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.spec { border-top: 1px solid var(--line); padding-top: 16px; color: var(--ink-soft); }

.photo-credit {
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.5;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* ---------- tables ---------- */

table { width: 100%; border-collapse: collapse; background: var(--card); }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-soft); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }

/* ---------- cart & checkout ---------- */

.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; align-items: start; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.totals { display: flex; justify-content: space-between; padding: 7px 0; }
.totals.grand {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 14px;
  font-size: 19px;
  font-weight: 700;
}

.qty { display: flex; align-items: center; gap: 6px; }
.qty input { width: 58px; text-align: center; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 14px; }
.field input, .field select, .field textarea { width: 100%; }
.field .err { color: var(--bad); font-size: 13px; margin-top: 4px; display: block; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

/* ---------- paying ---------- */

.pay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pay-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 10px;
  line-height: 1.5;
}
.pay-note code {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}

/* ---------- the simulated gateway window ---------- */

/* Deliberately not styled to look like a real payment page. The amber banner
   is the point: nobody should be able to mistake this for a real checkout. */

.sandbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}

.sandbox-window {
  background: var(--card);
  border-radius: 14px;
  width: 100%;
  max-width: 380px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
}

.sandbox-banner {
  background: #fef3c7;
  color: #92400e;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid #fde68a;
}

.sandbox-body { padding: 22px; }

.sandbox-amount {
  font-size: 30px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.5px;
}

.sandbox-for {
  text-align: center;
  color: var(--ink-soft);
  margin: 4px 0 22px;
  font-size: 14px;
}

.sandbox-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-faint);
  margin-bottom: 5px;
}

.sandbox-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink-faint);
  font: inherit;
  margin-bottom: 14px;
}

.sandbox-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.sandbox-explain {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  background: #f1f5f9;
  padding: 11px 13px;
  border-radius: 8px;
  margin: 4px 0 18px;
}

.sandbox-tabs {
  display: flex;
  gap: 4px;
  background: #eef2f7;
  padding: 4px;
  border-radius: 9px;
  margin-bottom: 18px;
}
.sandbox-tabs button {
  flex: 1;
  padding: 8px;
  border: 0;
  background: none;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.sandbox-tabs button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.sandbox-panel[hidden] { display: none; }

.sandbox-qr {
  display: grid;
  place-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
}
.sandbox-qr svg { width: 190px; height: 190px; display: block; }

.sandbox-payee {
  text-align: center;
  font-size: 13px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: var(--ink-soft);
  margin: 0 0 12px;
  word-break: break-all;
}

/* ---------- status pills ---------- */

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pill.pending { background: var(--warn-bg); color: var(--warn); }
.pill.paid { background: var(--good-bg); color: var(--good); }
.pill.cancelled { background: var(--bad-bg); color: var(--bad); }

/* ---------- owner dashboard ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--ink-soft); font-weight: 700; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; }

.stat .stat-note {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 3px;
}

.admin-order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  font-size: 14px;
  line-height: 1.6;
}
.admin-order-grid .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink-faint);
  font-weight: 700;
  margin-bottom: 4px;
}
.admin-order-grid code {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  color: var(--ink-soft);
  font-size: 13px;
  background: var(--card);
}
.site-footer strong { color: var(--ink); }

/* ---------- auth page ---------- */

.auth-split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}

/* left: the brand panel */

.auth-brand {
  position: relative;
  overflow: hidden;
  padding: 54px 56px;
  color: #fff;
  background: linear-gradient(150deg, #0b1120 0%, #14275c 52%, #1d4ed8 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-brand .art {
  position: absolute;
  inset: 0;
  opacity: 0.13;
  pointer-events: none;
}

.auth-brand > * { position: relative; }

.auth-brand .logo { font-size: 24px; }

.auth-brand h2 {
  font-size: 38px;
  line-height: 1.15;
  letter-spacing: -1px;
  margin: 0 0 14px;
  max-width: 14ch;
}

.auth-brand p.tag {
  color: #bfdbfe;
  font-size: 16px;
  margin: 0 0 34px;
  max-width: 40ch;
}

.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-points li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #dbeafe;
  font-size: 15px;
}
.auth-points .tick {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.22);
  color: #93c5fd;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}

.auth-brand .small {
  color: #93a9cc;
  font-size: 13px;
  margin: 0;
}

/* right: the form */

.auth-form-side {
  display: grid;
  place-items: center;
  padding: 44px 26px;
  background: var(--bg);
}

.auth-card { width: 100%; max-width: 430px; }

.auth-card h1 { font-size: 28px; margin: 0 0 4px; }
.auth-card .subtitle { margin-bottom: 26px; }

.form-switcher {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: #eef2f7;
  padding: 4px;
  border-radius: 10px;
}
.form-switcher button {
  flex: 1;
  padding: 9px;
  border: 0;
  background: none;
  border-radius: 7px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.form-switcher button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.auth-card .field input,
.auth-card .field select {
  padding: 11px 13px;
  border-radius: 9px;
}

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 62px !important; }
.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 6px;
}
.pw-toggle:hover { background: #eff6ff; }

.checkbox-row { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 16px; }
.checkbox-row input { margin-top: 3px; }
.checkbox-row label { font-size: 14px; color: var(--ink-soft); font-weight: 400; }

.auth-card .btn { padding: 12px; font-size: 15px; }

/* "or" with a rule running through it, either side of the word */
.or-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
  color: var(--ink-faint);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.or-line::before,
.or-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.demo-hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 10px 0 0;
  text-align: center;
  line-height: 1.5;
}

.auth-foot {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
}
.auth-foot button {
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}

@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; min-height: 0; }
  .auth-brand { padding: 32px 26px; }
  .auth-brand h2 { font-size: 27px; max-width: none; }
  .auth-brand p.tag { margin-bottom: 22px; }
  .auth-points { display: none; }
  .auth-form-side { padding: 32px 22px 56px; }
}

@media (max-width: 800px) {
  .detail, .two-col { grid-template-columns: 1fr; }
  .site-header .wrap { gap: 12px; }
  .site-header nav { gap: 13px; font-size: 14px; }
}
