/* Neutral, readable styling. No animation, no flourish. */
:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --border: #d9d9dd;
  --text: #202124;
  --muted: #5f6368;
  --accent: #1a73e8;
  --accent-hover: #1558b0;
  --danger: #c5221f;
  --code-bg: #1f1f24;
  --code-text: #e6e6e6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 120px;
}

/* header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-header .brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.site-header nav a {
  color: var(--text);
  margin-right: 16px;
  font-size: 14px;
}
.site-header .spacer { flex: 1; }
.cart-link {
  color: var(--text);
  font-weight: 600;
}
.cart-link #cart-badge {
  display: inline-block;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  text-align: center;
  margin-left: 4px;
}

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* hero */
.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 48px 32px;
  margin-bottom: 32px;
}
.hero h1 { margin: 0 0 8px; font-size: 32px; }
.hero p { margin: 0 0 24px; color: var(--muted); }

/* buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--danger); border-color: transparent; padding: 6px 10px; }

/* product grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card-thumb {
  width: 100%;
  aspect-ratio: 1;
  background: #eef1f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--muted);
  border-radius: 6px;
}
.card-title { margin: 4px 0 0; font-size: 16px; }
.card-title a { color: var(--text); }
.card-meta { margin: 0; color: var(--muted); font-size: 13px; }
.card-price { margin: 0; font-weight: 600; }

/* product detail */
.detail {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
}
.detail-thumb {
  aspect-ratio: 1;
  background: #eef1f5;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  color: var(--muted);
}
.qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.qty-row input {
  width: 64px;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* cart */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.cart-table th, .cart-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.cart-table thead th { background: #f0f1f4; font-size: 13px; text-transform: uppercase; color: var(--muted); }
.cart-table tfoot td { border-bottom: none; }
.qty-btn {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 4px;
  cursor: pointer;
  margin: 0 4px;
}
.qty-val { display: inline-block; min-width: 24px; text-align: center; }
.cart-actions { margin-top: 16px; text-align: right; }

/* forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}
.form-grid label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.form-grid input, .form-grid textarea, .form-grid select {
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font: inherit;
  color: var(--text);
  margin-top: 4px;
  background: #fff;
}
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { margin-top: 16px; text-align: right; }

/* util */
.section { margin-bottom: 32px; }
.section h2 { margin: 0 0 12px; font-size: 20px; }
.pill-list { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.pill-list li a {
  display: inline-block; padding: 6px 12px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-size: 13px;
}
.gap-notice {
  background: #fff8e1;
  border: 1px solid #f4c542;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 8px 0 16px;
  font-size: 13px;
  color: #5a4400;
}

/* about page */
.prose { max-width: 720px; }
.prose p { margin-bottom: 1em; }

/* ------------- dataLayer inspector ------------- */
#dl-inspector {
  position: fixed;
  bottom: 12px;
  right: 12px;
  width: 380px;
  max-height: 60vh;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#dl-inspector.collapsed .dl-list { display: none; }
#dl-inspector.collapsed { max-height: none; }
.dl-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #2a2a30;
  border-bottom: 1px solid #3a3a42;
  user-select: none;
}
.dl-header strong { font-weight: 600; }
.dl-count {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
}
.dl-spacer { flex: 1; }
.dl-btn {
  background: transparent;
  color: var(--code-text);
  border: 1px solid #4a4a54;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font: inherit;
}
.dl-btn:hover { background: #3a3a42; }
.dl-list {
  overflow-y: auto;
  padding: 6px 8px;
}
.dl-entry {
  border-bottom: 1px solid #3a3a42;
  padding: 4px 0;
}
.dl-entry summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 2px 0;
}
.dl-entry summary::-webkit-details-marker { display: none; }
.dl-time { color: #9aa0a6; }
.dl-event { color: #8ab4f8; font-weight: 600; }
.dl-entry pre {
  margin: 4px 0 0;
  padding: 6px 8px;
  background: #16161a;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d0d0d4;
  max-height: 240px;
  overflow: auto;
}

/* small screens */
@media (max-width: 640px) {
  .detail { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  #dl-inspector { width: calc(100vw - 24px); }
}
