/* =========================================
   商品一覧ページ専用 CSS
   （ヘッダー／フッターを壊さない最終版）
========================================= */

/* ---------- 変数 ---------- */
:root {
  --green-deep:   #1a3a1f;
  --green-mid:    #2d6a35;
  --green-light:  #4a9c55;
  --green-mist:   #edf7ee;
  --gold:         #c9a84c;
  --gold-light:   #e8d08a;
  --cream:        #faf7f0;
  --text-dark:    #1c2318;
  --text-mid:     #4a5240;
  --text-light:   #7a8b72;
  --white:        #ffffff;
  --shadow-card:  0 2px 16px rgba(26,58,31,0.08);
  --radius:       12px;
  --radius-lg:    20px;
  --transition:   0.3s cubic-bezier(0.4,0,0.2,1);
}

/* =========================================
   ページヒーロー（test/products.html と同じ）
========================================= */
.page-hero {
  background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
  padding: 4rem 0 3rem;
  text-align: center;
  color: var(--white);
}
.page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 0.5rem;
}
.page-hero p {
  color: rgba(255,255,255,0.75);
}

/* =========================================
   商品一覧セクション
========================================= */
.products-section {
  background: var(--green-mist);
  padding: 4rem 0;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;              /* block → flex */
  flex-direction: column;     /* 縦方向に積む */
  height: 100%;               /* グリッド内で高さを揃えやすくする */
}

/* カード全体をクリック可能にするためのリンク設定 */
.product-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(26,58,31,0.15);
}

/* 画像 */
.product-img {
  height: 200px;
  overflow: hidden;
  position: relative;
  flex: 0 0 200px;   /* 高さ200pxで固定 */
  padding-top: 12px; /* ← ここにインデントを追加（8〜20pxで調整可能） */
}
.product-img img {
    width: 100%;
    height: 200px;
    object-fit: contain; /* ← 全体が見える */
    background: #fff;     /* 余白が出る場合の背景 */
}

/* NO IMAGE */
.sample-img {
  width: 100%;
  height: 100%;
  background: var(--green-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.8);
}
.sample-img-icon {
  font-size: 2.5rem;
  margin-bottom: 0.3rem;
}
.sample-img-label {
  font-size: 0.75rem;
}

/* 情報 */
.product-info {
  padding: 1.2rem;
  display: flex;              /* 縦方向に積む */
  flex-direction: column;
  flex: 1;                    /* 余った高さをここで受ける */
}
.product-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-deep);
  margin-bottom: 0.4rem;
}
.product-desc {
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-bottom: 0.8rem;
  line-height: 1.6;
}
.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-mid);
  margin-top: auto;           /* ここで下寄せにする */}

/* CTA ボタン */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: all var(--transition);
  cursor: pointer;
}
.btn-green {
  background: var(--green-mid);
  color: var(--white);
}
.btn-green:hover {
  background: var(--green-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45,106,53,0.35);
}

/* =========================================
   アニメーション
========================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.7s ease both; }
.delay-1 { animation-delay: 0.1s; }

/* reveal（スクロール表示） */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   レスポンシブ
========================================= */
@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

.product-tags {
    margin: 6px 0 10px;
}

.product-tags {
    margin: 6px 0 10px;
}

.tag-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: #fff;
    margin-right: 4px;
    margin-bottom: 4px;
    transition: opacity .2s;
}

.tag-badge:hover {
    opacity: 0.8;
}

/* 商品編集画面：画像プレビューを画面の高さ20%に制限 */
.preview-box img {
    max-height: 20vh;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

/* ▼ 商品カードの縦レイアウトを安定させる（重要） */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ▼ 情報ブロックを縦方向に積む（価格を下に寄せるため） */
.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ▼ 価格をカードの最下部に固定 */
.product-price {
    margin-top: auto;
}

/* ▼ タグのサイズ調整（test版と同じ雰囲気に） */
.product-tags .tag-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
}

/* ▼ 商品カードの縦レイアウトを安定させる（重要） */
.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ▼ 情報ブロックを縦方向に積む（価格を下に寄せるため） */
.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ▼ 価格をカードの最下部に固定 */
.product-price {
    margin-top: auto;
}

/* ▼ タグのサイズ調整（test版と同じ雰囲気に） */
.product-tags .tag-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
}

/* 画像右上のタグバッジ */
.product-img {
  position: relative;
}

.product-tag-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.product-tag-badge .tag-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  border-radius: 999px;
}

/* 商品説明（タイトルと価格の間） */
.product-desc {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin: 0.4rem 0 0.6rem;
}

.product-info {
    text-align: left;
}
