/* ── Shelfbound Comics LK — design tokens ───────────────────────────── */
:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --border: #e5e5e7;
  --border-strong: #d2d2d7;

  --accent: #2c7a7b;       /* muted teal, pulled from the logo */
  --accent-hover: #23615f;
  --accent-tint: #eaf4f4;

  --marvel: #b3232c;
  --dc: #2a5ca8;
  --image: #6b4fa0;
  --idw: #251a3a;
  --other: #6e6e73;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-hover: 0 2px 4px rgba(0,0,0,0.06), 0 16px 32px rgba(0,0,0,0.09);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ──────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 250, 250, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand img {
  height: 34px;
  width: auto;
}

.header-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.header-links .btn-primary {
  color: #fff;
}

.header-links a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
}

.header-links a:hover { color: var(--text); }

.header-links .btn { font-size: 13px; padding: 8px 16px; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 64px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
  background-size: 14px 14px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, black, transparent 75%);
  opacity: 0.6;
  pointer-events: none;
}

.hero-content { position: relative; }

.hero img.hero-logo {
  height: 96px;
  width: auto;
  margin: 0 auto 28px;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}

.hero p.subhead {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface); border-color: var(--text-secondary); }

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ── Disclaimer strip ────────────────────────────────────────────────── */
.disclaimer {
  background: var(--accent-tint);
  color: var(--accent-hover);
  font-size: 13px;
  text-align: center;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
}

/* ── Filters ─────────────────────────────────────────────────────────── */
.filters-bar {
  position: sticky;
  top: 64px;
  z-index: 30;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.filters-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 7px 16px;
  border-radius: 980px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.filter-pill.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.search-input {
  margin-left: auto;
  min-width: 220px;
  flex: 0 1 260px;
  padding: 8px 14px;
  border-radius: 980px;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  background: var(--surface);
}

.search-input:focus { border-color: var(--accent); }

.tags-container {
  margin-top: 10px;
}

.tags-toggle {
  background: transparent;
  border: none;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-hover);
  cursor: pointer;
}

.tags-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.tags-row.collapsed {
  max-height: 42px;
}

.tags-row.expanded {
  max-height: 300px;
}

.tags-row:empty {
  display: none;
}

.tag-pill {
  padding: 5px 13px;
  border-radius: 980px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tag-pill::before {
  content: "#";
  opacity: 0.5;
  margin-right: 2px;
}

.tag-pill.active {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.tag-pill-clear {
  font-size: 12px;
  color: var(--accent-hover);
  background: none;
  border: none;
  text-decoration: underline;
  padding: 5px 4px;
}

/* ── Catalog grid ────────────────────────────────────────────────────── */
.catalog {
  padding: 40px 0 96px;
}

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

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card-image {
  aspect-ratio: 3 / 4;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.card-image img { width: 100%; height: 100%; object-fit: cover; }

.card-image .placeholder {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  padding: 12px;
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 980px;
  color: #fff;
}
.badge.Marvel { background: var(--marvel); }
.badge.DC { background: var(--dc); }
.badge.Image { background: var(--image); }
.badge.Image { background: var(--idw); }
.badge.Other { background: var(--other); }

.status-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 980px;
  background: rgba(29,29,31,0.85);
  color: #fff;
}
.status-tag.Available { background: rgba(52, 120, 90, 0.9); }
.status-tag.Pre-order { background: rgba(180, 130, 20, 0.92); }
.status-tag.Sold { background: rgba(80, 80, 80, 0.85); }

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.format-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 2px;
}

.format-option {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text-secondary);
}

.format-option.selected {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.card-condition {
  font-size: 12px;
  color: var(--text-secondary);
}

.card-price {
  font-size: 16px;
  font-weight: 700;
  margin-top: 4px;
}

.card-price .price-note {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.card-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent-hover);
  background: var(--accent-tint);
  border: none;
  padding: 3px 9px;
  border-radius: 980px;
  cursor: pointer;
}

.card-tag:hover { background: #ddeeee; }

.card-actions {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  gap: 8px;
}

.card-actions .btn { flex: 1; padding: 9px 10px; font-size: 12.5px; }

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(29,29,31,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--surface);
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.24);
}

.modal h2 {
  font-size: 19px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.modal .modal-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.modal-inner { position: relative; }

.channel-choice {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.channel-choice button {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
}

.channel-choice button.selected {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-hover);
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.site-footer a { color: var(--text-secondary); text-decoration: underline; }

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-hover);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 56px 0 40px; }
  .hero img.hero-logo { height: 76px; }
  .header-links a:not(.btn) { display: none; }
  .search-input { flex: 1 1 100%; margin-left: 0; order: 10; }
  .filters-row { row-gap: 10px; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
