/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  line-height: 1.6;
}
a { color: #0071e3; text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Header === */
header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.logo { font-size: .95rem; font-weight: 600; letter-spacing: .02em; opacity: .9; }
.tagline { font-size: .85rem; opacity: .7; }
.lang-switch { margin-left: auto; display: flex; gap: .4rem; }
.lang-btn {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  padding: .3rem .7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .8rem;
  transition: background .2s;
}
.lang-btn.active, .lang-btn:hover { background: rgba(255,255,255,.3); }

/* === Hero === */
.hero {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  background: linear-gradient(180deg, #0f3460 0%, #f5f5f7 100%);
  color: #fff;
}
.hero h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: .5rem; }
.hero p { font-size: 1rem; opacity: .85; }
.hero-intro {
  max-width: 820px;
  margin: 1.2rem auto 0;
  font-size: .85rem;
  line-height: 1.7;
  opacity: .75;
  text-align: left;
  color: #1d1d1f;
  background: rgba(255,255,255,.92);
  padding: .9rem 1.2rem;
  border-radius: 8px;
}

/* === Filters === */
.filters {
  max-width: 1200px;
  margin: -1rem auto 0;
  padding: 1.2rem 1.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
}
.filter-group { display: flex; flex-direction: column; gap: .3rem; flex: 1; min-width: 160px; }
.filter-group label { font-size: .75rem; font-weight: 600; color: #666; text-transform: uppercase; }
.filter-group select, .filter-group input {
  padding: .5rem .7rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: .9rem;
  background: #fafafa;
  transition: border-color .2s;
}
.filter-group select:focus, .filter-group input:focus {
  outline: none;
  border-color: #0071e3;
}

/* === Stats === */
.stats {
  max-width: 1200px;
  margin: 1rem auto .5rem;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  color: #666;
}

/* === Items Grid === */
.items-grid {
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
}

/* === Item Card === */
.item-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.item-card .card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fafafa;
  padding: 8px;
}
.item-card .card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.item-card .card-category {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .3rem;
}
.item-card .card-category.pokemon { color: #E53935; }
.item-card .card-category.jump { color: #4CAF50; }
.item-card .card-category.loft { color: #FF9800; }
.item-card .card-category.calbee { color: #795548; }
.item-card .card-category.tokyo-station { color: #00897B; }
.item-card .card-category.anime-collab { color: #7B1FA2; }
.item-card .card-category.game { color: #1565C0; }
.item-card .card-category.hobby { color: #D84315; }
.item-card .card-category.cosme { color: #EC407A; }
.item-card .card-category.stationery { color: #5C6BC0; }

.item-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; line-height: 1.4; }

.item-card .card-meta {
  font-size: .8rem;
  color: #666;
  margin-bottom: .3rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.item-card .card-meta .icon { font-size: .9rem; }
.item-card .card-desc {
  font-size: .82rem;
  color: #444;
  margin: .5rem 0;
  flex: 1;
}
.item-card .card-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.item-card .card-tags span {
  background: #f0f0f0;
  color: #555;
  padding: .15rem .5rem;
  border-radius: 20px;
  font-size: .7rem;
}
.item-card .card-footer {
  padding: .8rem 1rem;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.item-card .card-footer a {
  font-size: .8rem;
  font-weight: 600;
}
.status-badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
}
.status-badge.on-sale { background: #e8f5e9; color: #2e7d32; }
.status-badge.upcoming { background: #fff3e0; color: #e65100; }
.status-badge.always { background: #e3f2fd; color: #1565c0; }
.status-badge.lottery { background: #fce4ec; color: #c62828; }
.status-badge.limited { background: #f3e5f5; color: #6a1b9a; }
/* 締め切りが近いもの。ほかのバッジより強く見えるように塗りつぶす。
   付くのは販売終了日が登録された商品だけなので、数は多くならない。 */
.status-badge.urgent { background: #d32f2f; color: #fff; }
.status-badge.ended  { background: #eceff1; color: #78909c; }

/* === Store Section === */
.store-section {
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 2rem 1.5rem;
}
.store-section h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.2rem; }
.store-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 1.5rem; }
.store-list {
  background: #fff;
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.store-list h3 { font-size: 1rem; font-weight: 700; margin-bottom: .8rem; color: #333; }
.store-regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .8rem; }
.store-region h4 { font-size: .8rem; font-weight: 600; color: #666; margin-bottom: .3rem; }
.store-region ul { list-style: none; font-size: .8rem; color: #444; }
.store-region ul li { padding: .1rem 0; }
.store-list > ul { list-style: none; font-size: .85rem; }
.store-list > ul li { padding: .2rem 0; }

/* === Footer === */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  background: #1d1d1f;
  color: rgba(255,255,255,.6);
  font-size: .8rem;
}
.footer-sources { margin-top: .5rem; }
.footer-sources a { color: rgba(255,255,255,.7); }
.footer-sources a:hover { color: #fff; }
.footer-links { margin-top: .5rem; }
.footer-links a { color: rgba(255,255,255,.7); }
.footer-links a:hover { color: #fff; }

/* === No Results === */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
  font-size: 1.1rem;
}

/* === Product Detail Modal === */
.modal-overlay {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  justify-content: center; align-items: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: 18px;
  max-width: 860px; width: 100%;
  max-height: 90vh;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: modalIn .25s ease;
  display: flex; flex-direction: row;
  overflow: hidden;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(30px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute; top: .5rem; right: .5rem;
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: #e0e0e0; color: #333;
  font-size: 1.1rem; cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.modal-close:hover { background: #ccc; }
.modal-img-wrap {
  position: relative; background: #fafafa;
  flex: 0 0 40%; display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}
.modal-img {
  width: 100%; height: 100%; max-height: 80vh; object-fit: contain; display: block; padding: 10px;
}
.modal-body {
  flex: 1; padding: 1.2rem 1.5rem;
  display: flex; flex-direction: column;
  overflow-y: auto; position: relative;
}
.modal-cat {
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: .2rem;
}
.modal-cat.pokemon { color: #E53935; }
.modal-cat.jump { color: #4CAF50; }
.modal-cat.loft { color: #FF9800; }
.modal-cat.calbee { color: #795548; }
.modal-cat.tokyo-station { color: #00897B; }
.modal-cat.anime-collab { color: #7B1FA2; }
.modal-cat.game { color: #1565C0; }
.modal-cat.hobby { color: #D84315; }
.modal-cat.cosme { color: #EC407A; }
.modal-cat.stationery { color: #5C6BC0; }
.modal-name { font-size: 1.1rem; font-weight: 800; margin-bottom: .5rem; line-height: 1.35; }
.modal-info-grid {
  display: grid; grid-template-columns: auto 1fr; gap: .2rem .6rem;
  font-size: .8rem; margin-bottom: .5rem;
}
.modal-info-label { color: #888; font-weight: 600; white-space: nowrap; }
.modal-info-value { color: #333; }
.modal-desc {
  font-size: .8rem; color: #444; line-height: 1.6;
  margin-bottom: .5rem; padding: .6rem .8rem;
  background: #f9f9fb; border-radius: 8px;
  flex-shrink: 1; overflow: hidden;
}
.modal-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .6rem; }
.modal-tags span {
  background: #f0f0f0; color: #555;
  padding: .15rem .5rem; border-radius: 20px; font-size: .7rem;
}
.modal-actions { margin-top: auto; }
.modal-btn-request {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  background: linear-gradient(135deg, #e53935, #ff7043);
  color: #fff; padding: .75rem 1.2rem; border-radius: 50px;
  font-size: .95rem; font-weight: 700; text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(229,57,53,.3);
  width: 100%;
}
.modal-btn-request:hover {
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(229,57,53,.4);
  text-decoration: none;
}

/* === Responsive === */
@media (max-width: 768px) {
  header { padding: .7rem 1rem; }
  .header-inner { flex-direction: row; align-items: center; flex-wrap: nowrap; text-align: left; gap: .6rem; }
  .logo-sub { display: none; }
  .tagline { display: none; }
  .logo { white-space: nowrap; flex-shrink: 0; }
  .lang-switch { margin-left: auto; flex-shrink: 0; }
  .lang-btn { white-space: nowrap; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .hero h2 { font-size: 1.3rem; }
  .filters { flex-direction: column; padding: 1rem; }
  .items-grid { grid-template-columns: 1fr; padding: 0 1rem; }
  .modal { flex-direction: column; max-height: 92vh; }
  /* Smaller product image on mobile so the first-view isn't dominated by it. */
  .modal-img-wrap { flex: 0 0 auto; max-height: 28vh; }
  .modal-img { max-height: 28vh; object-fit: contain; }
  /* Modal body: extra top padding so close button doesn't overlap content. */
  .modal-body { padding: 1.2rem 1rem 1rem; overflow-y: auto; }
  /* Product name padding-right so it doesn't run under the close button. */
  .modal-name { font-size: 1rem; padding-right: 48px; }
  .modal-close { width: 44px; height: 44px; font-size: 1.25rem; top: 8px; right: 8px; }
  /* Rarity card: slightly more compact on mobile.
     !important because script.js renders inline styles that would otherwise win. */
  .rarity-section { padding: .45rem .6rem !important; margin: .4rem 0 !important; }
  /* Reorder children with flex order so the purchase CTA appears
     right after the basic info on mobile (instead of at the very bottom). */
  .modal-cat       { order: 1; }
  .modal-name      { order: 2; }
  .modal-info-grid { order: 3; }
  .modal-actions   { order: 4; margin: .6rem 0 .4rem; }
  .rarity-section  { order: 5; }
  .modal-tags      { order: 6; }
  .modal-desc      { order: 7; }
  /* Bigger tap target for the purchase button. */
  .modal-btn-request {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
  }
}
@media (max-width: 380px) {
  .hero h2 { font-size: 1.15rem; }
  .logo { font-size: .85rem; }
  .lang-btn { padding: .2rem .45rem; font-size: .7rem; }
}

/* === Landing Pages === */
.breadcrumb {
  max-width: 1200px;
  margin: 1rem auto 0;
  padding: .5rem 1.5rem;
  font-size: .85rem;
  color: #555;
}
.breadcrumb a { color: #0071e3; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 .4rem; color: #aaa; }

.landing-content {
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}
.landing-content > section { margin-bottom: 2rem; }

.landing-block {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.landing-block h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-left: .6rem;
  border-left: 4px solid #0f3460;
}
.landing-block p {
  font-size: .95rem;
  line-height: 1.8;
  margin-bottom: 1rem;
  color: #333;
}
.landing-block p:last-child { margin-bottom: 0; }
.lang-label {
  display: inline-block;
  background: #1a1a2e;
  color: #fff;
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  margin-right: .5rem;
  vertical-align: middle;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.related-list a {
  display: block;
  padding: .8rem 1rem;
  background: #f5f5f7;
  border-radius: 8px;
  color: #1d1d1f;
  text-decoration: none;
  font-weight: 500;
  font-size: .9rem;
  transition: background .15s, transform .15s;
}
.related-list a:hover {
  background: #e8e8ed;
  text-decoration: none;
  transform: translateY(-1px);
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.landing-card { display: flex; flex-direction: column; }
.landing-card .card-body { display: flex; flex-direction: column; flex: 1; }
.landing-buy {
  display: block;
  margin-top: auto;
  padding: .65rem 1rem;
  text-align: center;
  background: #e53935;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
  transition: background .15s;
}
.landing-buy:hover { background: #c62828; text-decoration: none; color: #fff; }

.landing-cta {
  text-align: center;
  margin-top: 1rem;
}
.landing-cta a {
  display: inline-block;
  padding: .65rem 1.5rem;
  background: #0f3460;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
}
.landing-cta a:hover { background: #1a1a2e; text-decoration: none; }

.faq details {
  border-bottom: 1px solid #eee;
  padding: .8rem 0;
}
.faq details:last-child { border-bottom: none; }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  padding: .3rem 0;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q. "; color: #0071e3; font-weight: 700; }
.faq summary::after { content: " ▼"; opacity: .5; font-size: .75rem; float: right; }
.faq details[open] summary::after { content: " ▲"; }
.faq details > p {
  margin: .6rem 0 .3rem 1.2rem;
  font-size: .9rem;
  color: #444;
  line-height: 1.7;
}
.faq details > p::before { content: "A. "; color: #e53935; font-weight: 700; }

/* Featured topics block (used on index.html and items.html) */
.topic-block {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.topic-block h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  padding-left: .6rem;
  border-left: 4px solid #0f3460;
}
.topic-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.topic-list a {
  display: block;
  padding: 1rem 1.1rem;
  background: #fff;
  border-radius: 10px;
  color: #1d1d1f;
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .15s, box-shadow .15s;
}
.topic-list a:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
}
.topic-list a small { display: block; font-size: .75rem; color: #666; font-weight: 400; margin-top: .25rem; }

@media (max-width: 768px) {
  .landing-content { padding: 0 1rem; }
  .related-list, .topic-list { grid-template-columns: 1fr; }
  .landing-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .topic-block { padding: 0 1rem; }
}

/* ===== エリア選択（東京のみ対応。他は Coming Soon） ===== */
.filter-group-area { flex: 1 1 100%; }

.area-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.area-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.area-chip.is-active {
  background: #1f2937;
  border-color: #1f2937;
  color: #fff;
}

/* 未対応エリア：薄く見せて押せなくする */
.area-chip.is-soon {
  opacity: .45;
  cursor: not-allowed;
  background: #f5f5f5;
  color: #666;
}

.area-chip.is-soon .soon-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e5e5e5;
  color: #777;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .area-chip { padding: 7px 11px; font-size: 13px; }
  .area-chip.is-soon .soon-label { font-size: 9px; padding: 2px 5px; }
}

/* ブランドの絞り込みチップ（作品名で探すための一段目） */
.filter-group-brand { flex-basis: 100%; }
.brand-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.brand-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border, #ddd);
  background: #fff; color: inherit;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.brand-chip:hover { border-color: var(--accent, #c8102e); }
.brand-chip.is-active {
  background: var(--accent, #c8102e); color: #fff;
  border-color: var(--accent, #c8102e);
}
.brand-count { font-size: 12px; font-weight: 400; opacity: .7; }
@media (max-width: 640px) {
  .brand-chip { padding: 7px 11px; font-size: 13px; }
}

/* 公式投稿（X）の埋め込み */
.modal-xpost { margin: 14px 0 4px; }
.modal-xpost .xpost-label { font-size: 12px; font-weight: 700; opacity: .7; margin-bottom: 6px; }
.modal-xpost .twitter-tweet { margin: 0 auto !important; }
.modal-xpost .xpost-link {
  display: inline-block; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border, #ddd); font-size: 14px; font-weight: 700;
  text-decoration: none; color: inherit;
}
.modal-xpost .xpost-link:hover { border-color: var(--accent, #c8102e); }
