:root {
  --ink: #14202b;
  --ink-soft: #4a5866;
  --muted: #6b7885;
  --line: #e2e7ec;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --brand: #0f2a44;
  --accent: #1f9d8f;
  --buy: #ffd814;
  --buy-ink: #0f1111;
  --radius: 12px;
  --max: 1240px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2 { line-height: 1.25; }

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--brand);
  color: #fff;
}
.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.logo span { color: #5fd3c4; }
.search {
  flex: 1;
  display: flex;
  min-width: 0;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 10px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}
.search input:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 3px rgba(95, 211, 196, 0.6); }
.search button {
  border: 0;
  background: var(--accent);
  color: #fff;
  width: 48px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.search svg { width: 20px; height: 20px; fill: currentColor; }
.country-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.country-btn:hover { background: rgba(255, 255, 255, 0.1); }
.cc {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.16);
}

/* ---------- geo banner ---------- */
.geo-banner {
  max-width: var(--max);
  margin: 12px auto 0;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  background: #e8f6f4;
  border: 1px solid #bfe6e0;
  border-radius: var(--radius);
}
.geo-slot { padding: 0 20px; }
.geo-slot:empty { display: none; }

/* ---------- main ---------- */
.main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 20px 48px;
  min-height: 60vh;
}
.status { text-align: center; color: var(--muted); padding: 64px 20px; }
.status.error { color: #b42318; }

.hero {
  background: linear-gradient(135deg, #0f2a44 0%, #17476a 60%, #1f7f86 100%);
  color: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  margin-bottom: 20px;
}
.hero h1 { margin: 0 0 8px; font-size: clamp(22px, 3vw, 32px); max-width: 720px; }
.hero p { margin: 0 0 18px; max-width: 620px; color: rgba(255, 255, 255, 0.85); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

.filters { display: grid; gap: 10px; margin-bottom: 8px; }
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.chip {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chips-secondary .chip { font-size: 13px; padding: 5px 12px; }
.chips-secondary .chip.active { background: var(--accent); border-color: var(--accent); }
.count { color: var(--muted); font-size: 14px; margin: 10px 0 12px; }

/* ---------- grid ---------- */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: 0 6px 20px rgba(15, 42, 68, 0.1); transform: translateY(-2px); }
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; padding-bottom: 14px; }
.card-img { aspect-ratio: 1; background: #fff; padding: 12px; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.card-cat {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 14px;
  margin-top: 4px;
}
.card-title {
  padding: 4px 14px 0;
  font-size: 14px;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.more { display: block; margin: 24px auto 0; }
.empty { text-align: center; padding: 56px 20px; color: var(--ink-soft); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: rgba(15, 42, 68, 0.06); }
.btn-small { padding: 5px 14px; font-size: 14px; }
.btn-buy {
  width: 100%;
  padding: 14px 20px;
  font-size: 17px;
  background: var(--buy);
  border-color: #fcd200;
  color: var(--buy-ink);
}
.btn-buy:hover { background: #f7ca00; }
.linklike {
  border: 0;
  background: none;
  padding: 0;
  text-decoration: underline;
  cursor: pointer;
  color: inherit;
}

/* ---------- product ---------- */
.crumbs { margin-bottom: 16px; font-size: 14px; }
.crumbs a { text-decoration: none; color: var(--ink-soft); }
.crumbs a:hover { color: var(--ink); }
.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}
.gallery { position: sticky; top: 84px; align-self: start; }
.main-img { aspect-ratio: 1; background: #fff; display: grid; place-items: center; }
.main-img img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.thumb {
  flex: none;
  width: 64px;
  height: 64px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.info h1 { font-size: 22px; margin: 6px 0 10px; overflow-wrap: anywhere; }
.info h2 { font-size: 16px; margin: 0 0 8px; }
.variant { color: var(--ink-soft); margin: 0 0 12px; }
.variants ul { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.variant-opt {
  display: block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.variant-opt:hover { border-color: var(--accent); }
.variant-opt.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: #effaf8; font-weight: 600; }
.buy {
  margin: 8px 0 20px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
}
.buy .muted { margin: 10px 0 0; font-size: 13px; }
.bullets ul { margin: 0 0 20px; padding-left: 20px; }
.bullets li { margin-bottom: 8px; overflow-wrap: anywhere; }
.desc p { margin: 0 0 8px; color: var(--ink-soft); overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.asin { font-size: 12px; margin-top: 20px; }

/* ---------- country picker ---------- */
.picker {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}
.picker::backdrop { background: rgba(15, 25, 35, 0.5); }
.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.picker-head h2 { margin: 0; font-size: 18px; }
.icon-btn { border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }
.picker-grid {
  list-style: none;
  margin: 0;
  padding: 16px 20px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.picker-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.picker-item:hover { border-color: var(--accent); }
.picker-item.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.picker-item .cc { background: var(--bg); color: var(--brand); min-width: 34px; height: 24px; font-size: 12px; }
.geo-banner .cc { background: #fff; color: var(--brand); }
.picker-text { display: flex; flex-direction: column; min-width: 0; }
.picker-text small { color: var(--muted); }

/* ---------- footer ---------- */
.footer { background: var(--surface); border-top: 1px solid var(--line); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 24px 20px; font-size: 14px; color: var(--ink-soft); }
.footer-inner p { margin: 0 0 8px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .product { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 20px; }
  .gallery { position: static; }
  .country-name { display: none; }
}
@media (max-width: 600px) {
  .topbar-inner { flex-wrap: wrap; padding: 10px 14px; gap: 10px; }
  .logo { font-size: 22px; flex: 1; }
  .search { order: 3; flex-basis: 100%; }
  .main { padding: 14px 14px 40px; }
  .hero { padding: 24px 20px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-img { padding: 8px; }
  .card-title { font-size: 13px; padding: 4px 10px 0; }
  .card-cat { padding: 0 10px; font-size: 11px; }
  .info h1 { font-size: 19px; }
  .geo-slot { padding: 0 14px; }
}
