/* CardVault Showcase — palette matches the iOS app (SPEC.md): */
:root {
  --navy: #1A365D;        /* app Primary */
  --royal: #2B6CB0;       /* app Secondary */
  --gold: #F6AD55;        /* app Accent */
  --bg: #F7FAFC;          /* app Background */
  --card: #FFFFFF;
  --text: #1A202C;        /* app TextPrimary */
  --text-2: #718096;      /* app TextSecondary */
  --success: #48BB78;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(26, 54, 93, 0.10), 0 8px 24px rgba(26, 54, 93, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
a { color: var(--royal); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--royal) 100%);
  color: #fff;
  padding: 40px 0 28px;
}
.hero-brand { display: flex; align-items: center; gap: 16px; }
.hero-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--gold); color: var(--navy);
  font-weight: 800; font-size: 22px; letter-spacing: 0.5px;
  flex-shrink: 0;
}
.hero h1 { font-size: 30px; font-weight: 800; }
.hero-tagline { color: rgba(255,255,255,0.82); font-size: 15px; margin-top: 2px; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.stat-chip {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 6px 16px; font-size: 14px;
}
.stat-chip strong { color: var(--gold); font-weight: 700; }

/* ---------- Controls ---------- */
.controls { margin: 24px 0 8px; display: flex; flex-direction: column; gap: 10px; }
#search {
  width: 100%; padding: 12px 16px;
  border: 1px solid #E2E8F0; border-radius: var(--radius);
  font-size: 16px; background: var(--card);
}
#search:focus { outline: 2px solid var(--royal); border-color: transparent; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select {
  padding: 9px 12px; border: 1px solid #E2E8F0; border-radius: 10px;
  background: var(--card); font-size: 14px; color: var(--text);
}
.result-count { color: var(--text-2); font-size: 14px; margin: 8px 0 16px; }

/* ---------- Grid ---------- */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-bottom: 40px;
}
.item-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.item-card:hover, .item-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 4px 6px rgba(26,54,93,0.10), 0 14px 32px rgba(26,54,93,0.14);
}
.item-image {
  aspect-ratio: 3 / 4.1; width: 100%;
  background: linear-gradient(160deg, #EDF2F7, #E2E8F0);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.item-image img { width: 100%; height: 100%; object-fit: cover; }
.item-image .no-photo { font-size: 34px; opacity: 0.45; }
.item-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.item-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item-sub { font-size: 13px; color: var(--text-2); }
.item-price { font-size: 18px; font-weight: 800; color: var(--navy); margin-top: auto; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.badge-graded { background: var(--navy); color: #fff; }
.badge-rookie { background: var(--gold); color: var(--navy); }
.badge-auto { background: var(--success); color: #fff; }
.badge-type { background: #EDF2F7; color: var(--navy); }
.badge-relic { background: #805AD5; color: #fff; }
.badge-serial { background: #38B2AC; color: #fff; }

/* ---------- Empty / loading ---------- */
.empty, .loading { text-align: center; padding: 60px 0 80px; color: var(--text-2); }
.empty-icon { font-size: 44px; }
.empty h2 { color: var(--text); margin: 10px 0 6px; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 12px;
  border: 3px solid #E2E8F0; border-top-color: var(--royal);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.75); padding: 28px 0; font-size: 14px; }
.footer-contact strong { color: #fff; }
.footer-meta { color: rgba(255,255,255,0.45); font-size: 12px; margin-top: 8px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 20, 35, 0.65); }
.modal-panel {
  position: relative; background: var(--card);
  border-radius: 16px; max-width: 960px; width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  overflow: hidden;
}
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.9); color: var(--text);
  font-size: 15px; cursor: pointer; box-shadow: var(--shadow);
}
.modal-gallery {
  background: #242C3B; display: flex; flex-direction: column; gap: 0; min-height: 420px;
}
.modal-gallery img { width: 100%; height: auto; display: block; }
.modal-gallery .no-photo { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 56px; opacity: 0.3; padding: 80px 0; color: #fff; }
.modal-thumbs { display: flex; gap: 8px; padding: 10px; }
.modal-thumbs button {
  width: 56px; height: 56px; border-radius: 8px; overflow: hidden;
  border: 2px solid transparent; padding: 0; cursor: pointer; background: none;
}
.modal-thumbs button.active { border-color: var(--gold); }
.modal-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.modal-info { padding: 26px 26px 30px; }
.modal-info h2 { font-size: 24px; font-weight: 800; color: var(--navy); margin: 10px 0 4px; }
.modal-price { font-size: 28px; font-weight: 800; margin: 8px 0 18px; }
.modal-info .badge-type { display: inline-block; }
.spec-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin-bottom: 24px; }
.spec-list dt { font-size: 13px; color: var(--text-2); font-weight: 500; }
.spec-list dd { font-size: 14px; color: var(--text); }
.inquire-btn {
  display: inline-block; text-align: center;
  background: var(--gold); color: var(--navy);
  font-weight: 700; text-decoration: none;
  padding: 13px 22px; border-radius: 12px; font-size: 16px;
  transition: filter 0.15s ease;
}
.inquire-btn:hover { filter: brightness(1.06); }

@media (max-width: 760px) {
  .modal-panel { grid-template-columns: 1fr; }
  .modal-gallery { min-height: 0; }
  .hero h1 { font-size: 24px; }
}
