/* =====================================================
   Product Common Styles
   ===================================================== */

/* =====================================================
   Product Archive Grid
   ===================================================== */

.product-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.75rem;
  margin: 2rem 0;
}

/* =====================================================
   Product Card
   ===================================================== */

.product-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  transition:
    transform 0.3s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.3s cubic-bezier(0.2, 0, 0, 1),
    border-color 0.25s ease;
  will-change: transform;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  border-color: transparent;
}

/* 販売終了 */
.product-card.is-discontinued {
  opacity: 0.6;
  pointer-events: none;
}

/* 入荷待ち */
.product-card.is-backordered {
  opacity: 0.8;
}

/* おすすめ */
.product-card.is-featured {
  border-color: var(--zeal-prairie-green);
  box-shadow: 0 0 0 1px var(--zeal-prairie-green);
}

.product-card.is-featured:hover {
  box-shadow:
    0 0 0 1px var(--zeal-prairie-green),
    0 12px 40px rgba(136, 168, 80, 0.2);
}

/* リンク全体 */
.product-card__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.product-card__link:focus-visible {
  outline: 2px solid var(--zeal-forest-green);
  outline-offset: 3px;
}

/* ── 画像エリア ──────────────────────────────────── */
.product-card__image {
  aspect-ratio: 4 / 3;
  background: var(--color-bg-soft);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.55s cubic-bezier(0.2, 0, 0, 1);
}

.product-card:hover .product-card__image img {
  transform: scale(1.06);
}

/* ステータスオーバーレイ */
.product-card__status-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.product-card__status-overlay span {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 12px;
  border-radius: 2px;
}

.product-card__status-overlay--backordered {
  background: rgba(0, 68, 56, 0.32);
}

/* ラベル（NEW / SALE 等） */
.product-card__label {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  pointer-events: none;
  line-height: 1.5;
}

.product-card__label--new        { background: var(--zeal-forest-green);   }
.product-card__label--bestseller { background: var(--zeal-vital-orange);    }
.product-card__label--limited    { background: var(--zeal-berry,  #B83D4E); }
.product-card__label--sale       { background: var(--zeal-red,    #D73D30); }
.product-card__label--restock    { background: var(--zeal-teal,   #007582); }

/* カテゴリバッジ */
.product-card__badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--zeal-forest-green);
  color: #fff;
  pointer-events: none;
  line-height: 1.5;
}

/* ── コンテンツエリア ─────────────────────────────── */
.product-card__content {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 0.75rem;
}

/* body（タイトル・キャッチ・原材料） */
.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-grow: 1;
}

/* タイトル */
.product-card__title {
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.product-card:hover .product-card__title {
  color: var(--zeal-forest-green);
}

/* キャッチコピー */
.product-card__catch {
  font-size: 0.73rem;
  color: var(--zeal-forest-green);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 原材料（一覧用） */
.product-card__ingredients {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
  margin-top: auto;
  padding-top: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 用途アイコン（アイコン＋ラベルセット） ──────── */
.product-card__icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.product-card__icon-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 8px 3px 5px;
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.product-card__icon-item:hover {
  background: color-mix(in srgb, var(--zeal-prairie-green) 10%, #fff);
  border-color: var(--zeal-prairie-green);
}

.product-card__icon-img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.product-card__icon-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1;
  transition: color 0.2s ease;
}

.product-card__icon-item:hover .product-card__icon-label {
  color: var(--zeal-forest-green);
}

/* ── フッター（価格・内容量） ─────────────────────── */
.product-card__footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 0.65rem;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

/* 価格 */
.product-card__price {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0;
}

.product-card__price-before {
  font-size: 0.73rem;
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.product-card__price-current {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.product-card__price-current.is-sale {
  color: var(--zeal-vital-orange);
}

/* 内容量 */
.product-card__weight {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 768px) {
  .product-archive-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
  }
}

@media (max-width: 480px) {
  .product-card__content {
    padding: 0.85rem 0.9rem 0.9rem;
    gap: 0.6rem;
  }

  .product-card__title {
    font-size: 0.85rem;
  }

  .product-card__price-current {
    font-size: 0.92rem;
  }

  /* SP はアイコンのみ（ラベルは非表示） */
  .product-card__icon-label {
    display: none;
  }

  .product-card__icon-item {
    padding: 4px;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    justify-content: center;
  }

  .product-card__icon-img {
    width: 13px;
    height: 13px;
  }

  .product-card__footer {
    padding-top: 0.5rem;
  }
}