/* 全体のリセットっぽいもの */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Helvetica Neue", "Yu Gothic", "YuGothic", "Meiryo", sans-serif;
  color: #222;
  background: #f5f5f7;
}

/* ページ全体（2カラムレイアウト） */
.page {
  display: flex;
  min-height: 100vh;
}

/* 左サイドバー */
.sidebar {
  width: 260px;
  background: #111827;
  color: #e5e7eb;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar__logo {
  display: block;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
}

.logo-main {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.logo-sub {
  display: block;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 4px;
}

/* ナビゲーション */
.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-link {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-decoration: none;
  color: #e5e7eb;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background: #1f2937;
}

.nav-link.is-active {
  background: #f59e0b;
  color: #111827;
  font-weight: 600;
}

/* サイドバーの各セクション */
.sidebar__section {
  margin-top: 8px;
}

.sidebar__title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin: 10px 0 4px;
}

.sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar__list li a {
  display: block;
  padding: 4px 2px;
  font-size: 0.85rem;
  color: #e5e7eb;
  text-decoration: none;
}

.sidebar__list li a:hover {
  text-decoration: underline;
}

/* 右側コンテンツエリア */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 28px;
}

/* ヘッダー */
.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

/* ヘッダー画像（ヒーローエリア） */
.site-hero {
  margin-bottom: 20px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
  background: #111827;
}

.site-hero img {
  display: block;
  width: 100%;
  height: 220px;        /* 好きな高さに調整してOK */
  object-fit: cover;    /* 画像の端をトリミングしてきれいに表示 */
}

/* スマホでは少し高さを低くする */
@media (max-width: 768px) {
  .site-hero img {
    height: 160px;
  }
}


.site-title {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.04em;
}

.site-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.site-header__actions {
  min-width: 220px;
}

.search-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  outline: none;
  background: #ffffff;
}

.search-input:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.3);
}

/* メインコンテンツ */
.main {
  flex: 1;
}

/* 商品セクション */
.product-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 右にカートを寄せる */
  margin-bottom: 12px;
}

.product-section__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.product-section__header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.product-count {
  font-size: 0.85rem;
  color: #6b7280;
}



/* 商品グリッド（3カラム） */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* 商品カード */
.product-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.product-card__image {
  width: 100%;
  padding-top: 68%; /* アスペクト比用（横長） */
  position: relative;
  background: #e5e7eb;
}

.product-card__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-card__title {
  margin: 0;
  font-size: 0.95rem;
}

.product-card__desc {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.6;
}

.product-card__meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.product-card__price {
  font-weight: 600;
  color: #111827;
}

.product-card__tag {
  padding: 2px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
}

/* フッター */
.site-footer {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .page {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }

  .content {
    padding: 16px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 商品グリッド（デフォルトは3カラム） */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* 1024px以下（タブレット横など）では2～3列どちらでもOKだがここはそのままでもよし */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 768px以下（スマホ縦を想定）で2カラムにする */
@media (max-width: 768px) {
  .page {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }

  .content {
    padding: 16px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

/* 個別ページのカートリンクはスマホ時、テキストだけ非表示 */
  .cart-link-detail .cart-label {
    display: none;
  }

  /* アイコン＋バッジはそのまま横並び */
  .cart-link-detail {
    padding: 6px 8px; /* ちょっとコンパクトに */
    gap: 4px;
  }

  /* ← ここがポイント：スマホでも2列 */
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #111827;
  color: #f9fafb;
  font-size: 0.85rem;
  text-decoration: none;
}

.cart-link:hover {
  background: #020617;
}

.cart-count {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #f59e0b;
  color: #111827;
  font-weight: 600;
  text-align: center;
  font-size: 0.8rem;
}


.add-to-cart-btn.added {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

.add-to-cart-btn.added .icon {
  display: none; /* ✔だけでスッキリ見せたいのでアイコン消す */
}

.product-detail-info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card-link article {
  cursor: pointer;
}




/* ★ このブロックはもう使わないので削除
@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    align-items: flex-start;
  }
}
*/

