/* ===== リセット・ベース ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body { font-family: 'Hiragino Sans', 'Meiryo', sans-serif; background: #f5f5f0; color: #333; min-height: 100vh; }
a { text-decoration: none; color: inherit; }

/* ===== ヘッダー ===== */
.hd {
  background: #FF0033;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.hd-logo {
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.hd-search {
  flex: 1;
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  max-width: 700px;
}
.hd-search input {
  flex: 1;
  border: none;
  padding: 9px 14px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.hd-search button {
  background: #FF6600;
  border: none;
  color: #fff;
  padding: 9px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  transition: background 0.2s;
}
.hd-search button:hover { background: #e55a00; }
.hd-right { margin-left: auto; }
.cart-icon { color: #fff; font-size: 13px; cursor: pointer; }

/* ===== サブナビ ===== */
.subnav {
  background: #CC0000;
  padding: 7px 16px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 2px;
  opacity: 0.9;
  transition: background 0.15s;
}
.subnav a:hover { background: rgba(255,255,255,0.15); opacity: 1; }

/* ===== バナー ===== */
.banner {
  background: linear-gradient(135deg, #fff5e0 0%, #ffe8cc 100%);
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #FF6600;
}
.banner-text h2 { font-size: 18px; font-weight: 900; color: #333; margin-bottom: 6px; line-height: 1.5; }
.banner-text p { font-size: 13px; color: #666; margin-bottom: 14px; }
.banner-btn {
  background: #FF0033;
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.banner-btn:hover { background: #cc0029; }
.banner-icon { font-size: 60px; opacity: 0.35; }

/* ===== セクション ===== */
.body-wrap { max-width: 1100px; margin: 0 auto; }
.section { padding: 14px 16px; }
.sec-title {
  font-size: 15px;
  font-weight: 900;
  color: #333;
  padding-bottom: 8px;
  border-bottom: 2px solid #FF0033;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sec-more { font-size: 12px; color: #0066cc; font-weight: 400; }
.sec-more:hover { text-decoration: underline; }

/* ===== カテゴリ ===== */
.cat-wrap {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.cat-item {
  background: #fff;
  border: 1px solid #e0e0d8;
  border-radius: 4px;
  padding: 12px 6px 10px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-size: 22px;
}
.cat-item:hover { border-color: #FF6600; box-shadow: 0 2px 6px rgba(255,102,0,0.15); }
.cat-item span { font-size: 11px; color: #555; }

/* ===== ランキング ===== */
.ranking-list { display: flex; flex-direction: column; }
.rank-item {
  background: #fff;
  border: 1px solid #e0e0d8;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}
.rank-item:last-child { border-bottom: 1px solid #e0e0d8; }
.rank-item:hover { background: #fffaf5; }
.rank-no { font-size: 18px; font-weight: 900; color: #bbb; min-width: 28px; text-align: center; }
.rank-no.r1 { color: #FF0033; }
.rank-no.r2 { color: #FF6600; }
.rank-no.r3 { color: #FF9900; }
.rank-thumb {
  width: 60px; height: 60px;
  background: #f5f5f0;
  border: 1px solid #e0e0d8;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-thumb .no-img { font-size: 28px; }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-size: 13px; color: #333; line-height: 1.4; margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rank-price { font-size: 15px; font-weight: 700; color: #FF0033; }
.rank-price small { font-size: 11px; color: #666; font-weight: 400; }
.rank-badge {
  display: inline-block;
  font-size: 10px;
  background: #fff0e0;
  color: #FF6600;
  border: 1px solid #FF9900;
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 6px;
}
.rank-point { font-size: 10px; color: #FF6600; margin-top: 2px; }
.rank-loading { padding: 20px; text-align: center; color: #888; background: #fff; border: 1px solid #e0e0d8; }

/* ===== 商品グリッド ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.p-card {
  background: #fff;
  border: 1px solid #e0e0d8;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.p-card:hover { border-color: #aaa; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.p-img {
  width: 100%; height: 120px;
  background: #f9f9f5;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.p-img img { width: 100%; height: 100%; object-fit: cover; }
.p-img .no-img { font-size: 40px; }
.p-info { padding: 8px 10px 10px; }
.p-name { font-size: 12px; color: #333; line-height: 1.4; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-price { font-size: 15px; font-weight: 700; color: #FF0033; }
.p-price-tax { font-size: 10px; color: #888; font-weight: 400; margin-left: 2px; }
.p-ship { font-size: 10px; color: #0066cc; margin-top: 2px; }
.p-point { font-size: 10px; color: #FF6600; margin-top: 1px; }
.p-review { font-size: 10px; color: #888; margin-top: 2px; }

/* ===== ピックアップ ===== */
.pickup-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pickup-card {
  background: #fff5e6;
  border: 1px solid #ffe0b0;
  border-radius: 4px;
  padding: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.pickup-card:hover { background: #ffe9cc; }
.pickup-card h4 { font-size: 13px; font-weight: 700; color: #333; margin-bottom: 5px; }
.pickup-card p { font-size: 12px; color: #666; }

/* ===== ローディング ===== */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: #888;
}
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid #f0f0f0;
  border-top: 3px solid #FF0033;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== エラー ===== */
.error-msg {
  margin: 16px;
  padding: 14px 16px;
  background: #fff0f0;
  border: 1px solid #ffcccc;
  border-radius: 4px;
  color: #cc0000;
  font-size: 13px;
}

/* ===== もっと見る ===== */
.load-more-wrap { text-align: center; margin-top: 16px; }
.load-more-btn {
  background: #fff;
  border: 1px solid #FF0033;
  color: #FF0033;
  padding: 10px 32px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}
.load-more-btn:hover { background: #fff0f0; }

/* ===== フッター ===== */
.ft {
  background: #CC0000;
  color: #fff;
  text-align: center;
  padding: 14px;
  font-size: 12px;
  margin-top: 20px;
}

/* ===== レスポンシブ ===== */
@media (max-width: 600px) {
  .hd-logo { font-size: 16px; }
  .cat-wrap { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .cat-item { font-size: 18px; padding: 8px 4px; }
  .cat-item span { font-size: 10px; }
  .pickup-wrap { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .banner { padding: 16px; }
  .banner-icon { display: none; }
}
