:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2230;
  --border: #2a3140;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #e8442a;
  --accent-2: #ff6b4a;
  --ok: #3fb950;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Hiragino Sans", "Noto Sans JP", sans-serif;
  line-height: 1.5;
}

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

.site-header {
  background: linear-gradient(180deg, #161b22, #0d1117);
  border-bottom: 1px solid var(--border);
  padding: 36px 0 28px;
}
.site-header h1 { margin: 0; font-size: 28px; letter-spacing: -0.02em; }
.site-header h1 span { color: var(--accent-2); font-weight: 500; }
.tagline { margin: 6px 0 0; color: var(--muted); }

.vehicle-picker { margin: 26px 0 0; }
.vehicle-bar-label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 8px; }

.make-logos { display: flex; flex-wrap: wrap; gap: 8px; }
.make-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.make-chip:hover { border-color: var(--accent); }
.make-chip.active { border-color: var(--accent); background: rgba(232, 68, 42, 0.12); }
.make-chip img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  padding: 1px;
}

.model-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.model-row select {
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  min-width: 150px;
}
.model-row select:focus { border-color: var(--accent); }
.model-row select:disabled { opacity: 0.5; cursor: default; }

.search-bar {
  display: flex;
  gap: 10px;
  margin: 12px 0 8px;
}
#query {
  flex: 1;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
#query:focus { border-color: var(--accent); }
#submit-btn {
  padding: 0 22px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
#submit-btn:hover { background: var(--accent-2); }
#submit-btn:disabled { opacity: 0.5; cursor: default; }

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 2px 0;
  flex-wrap: wrap;
}
.filters-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.filter-btn {
  font-size: 13px;
  padding: 6px 14px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.meta {
  font-size: 13px;
  color: var(--muted);
  margin: 12px 2px 0;
}
.meta code {
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 5px;
  color: #cdd9e5;
}
.status { margin: 18px 2px; color: var(--muted); min-height: 20px; }

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 8px 0 60px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card a { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }

.thumb {
  aspect-ratio: 1 / 1;
  background: #0a0e14 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: #3a4252; font-size: 13px;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* English placeholder card (replaces the store's generic JP text image) */
.ph-card {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: #f4f5f7; color: #1a1f29;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  text-align: center;
}
.ph-top, .ph-bottom { flex: 1; display: flex; align-items: center; justify-content: center; padding: 6px; }
.ph-top { font-weight: 700; color: #444; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.ph-mid {
  flex: 1.3; display: flex; align-items: center; justify-content: center;
  background: #fbe7a6; padding: 8px 10px;
}
.ph-mid span { font-weight: 700; font-size: 13px; line-height: 1.3; color: #1a1f29; }
.ph-bottom { color: #6a7180; font-size: 11px; }
.ph-big .ph-top { font-size: 18px; }
.ph-big .ph-mid span { font-size: 20px; }
.ph-big .ph-bottom { font-size: 14px; }

.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.source-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 20px;
  white-space: nowrap;
}

.vehicle-slot:empty { display: none; }
.vehicle {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent-2);
  background: rgba(255, 107, 74, 0.1);
  border: 1px solid rgba(255, 107, 74, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
}

.title-en { font-weight: 600; font-size: 14.5px; }

/* Skeleton shimmer shown while a title is still being translated */
.skeleton-lines { display: flex; flex-direction: column; gap: 6px; padding: 2px 0; }
.sk {
  height: 13px;
  border-radius: 5px;
  background: linear-gradient(90deg, #1c2230 25%, #2a3344 37%, #1c2230 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.sk.short { width: 60%; }
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.title-ja { font-size: 12px; color: var(--muted); }
.row { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.prices { display: flex; flex-direction: column; line-height: 1.25; }
.price { font-weight: 700; color: var(--accent-2); }
.price-jpy { font-size: 12px; color: var(--muted); }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.badge.in { background: rgba(63,185,80,0.15); color: var(--ok); }
.badge.out { background: rgba(139,148,158,0.15); color: var(--muted); }

/* ---- Product detail page ---- */
.back-link { color: var(--muted); text-decoration: none; font-size: 13px; }
.back-link:hover { color: var(--accent-2); }
.detail { margin: 24px 0 60px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; }
@media (max-width: 760px) { .detail-grid { grid-template-columns: 1fr; } }

.gallery-main {
  aspect-ratio: 1 / 1; background: #0a0e14; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-main.no-img { color: #3a4252; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb-pick {
  width: 60px; height: 60px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); cursor: pointer; opacity: 0.6;
}
.thumb-pick.active, .thumb-pick:hover { opacity: 1; border-color: var(--accent); }

.detail-title { font-size: 22px; margin: 8px 0 4px; line-height: 1.3; }
.detail-title-ja { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.detail-price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.detail-price .price { font-size: 24px; font-weight: 800; color: var(--accent-2); }

.buy-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qty { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.qty button { width: 38px; height: 40px; background: var(--panel-2); color: var(--text); border: none; font-size: 18px; cursor: pointer; }
.qty button:hover { background: var(--accent); }
.qty input { width: 52px; height: 40px; text-align: center; background: var(--panel); color: var(--text); border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 15px; }
.buy-btn { background: var(--accent); color: #fff; padding: 0 18px; height: 40px; display: inline-flex; align-items: center; border-radius: 10px; text-decoration: none; font-weight: 600; }
.buy-btn:hover { background: var(--accent-2); }
.share-btn { height: 40px; padding: 0 14px; background: var(--panel-2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 600; }
.share-btn:hover { border-color: var(--accent); color: var(--accent-2); }
.share-msg { color: var(--ok); font-size: 13px; height: 18px; margin-top: 6px; }

.specs, .variants, .desc { margin-top: 24px; }
.specs h3, .variants h3, .desc h3, .recommended h3 { font-size: 15px; margin: 0 0 10px; color: var(--text); }
.specs table { width: 100%; border-collapse: collapse; font-size: 14px; }
.specs th, .specs td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.specs th { color: var(--muted); font-weight: 600; width: 38%; }
.variants ul { list-style: none; padding: 0; margin: 0; }
.variants li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.prices-inline { display: flex; align-items: baseline; gap: 8px; }
.desc-body { font-size: 14px; color: #cdd9e5; line-height: 1.7; }
.muted { color: var(--muted); }

.recommended { margin-top: 40px; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.rec-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: border-color 0.15s; }
.rec-card:hover { border-color: var(--accent); }
.rec-thumb { aspect-ratio: 1/1; background: #0a0e14 center/cover; display: flex; align-items: center; justify-content: center; color: #3a4252; font-size: 12px; }
.rec-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rec-title { font-size: 12.5px; padding: 8px 10px 4px; font-weight: 600; }
.rec-price { font-size: 12.5px; padding: 0 10px 10px; color: var(--accent-2); font-weight: 700; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 40px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer a { color: var(--accent-2); }
