/**
 * 在庫ステータス連動ラベル（臙脂 #7F2629 / 黄金 #B88B46）
 * 和モダン・シール風
 */

/* ── 共通：シール風ベース ───────────────────────────────────── */
.tcf-stock-label {
  display: inline-block;
  position: absolute;
  z-index: 5;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  pointer-events: none;
}

/* ループ：商品画像の左上に重ねる */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
  position: relative;
}

.tcf-stock-label--loop {
  top: 10px;
  left: 10px;
}

/* 単一商品：ギャラリー上（.product が relative でラベルが重なる） */
.woocommerce div.product,
.single-product .product {
  position: relative;
}

.tcf-stock-label--single {
  top: 12px;
  left: 12px;
}

/* ── 完売（SOLD OUT）：臙脂 ───────────────────────────────────── */
.tcf-stock-label--sold_out {
  background: #7F2629;
  color: #FAF9F7;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ── 残りわずか：黄金 ───────────────────────────────────────── */
.tcf-stock-label--few {
  background: #B88B46;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* ── 在庫あり：臙脂の淡いトーン ─────────────────────────────── */
.tcf-stock-label--in_stock {
  background: rgba(127, 38, 41, 0.92);
  color: #FAF9F7;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ── 完売時のカート追加ボタン非活性・グレーアウト ───────────── */
.tcf-product-sold-out .single_add_to_cart_button,
.tcf-product-sold-out .ajax_add_to_cart {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.woocommerce ul.products li.product.tcf-product-sold-out .button,
.woocommerce-page ul.products li.product.tcf-product-sold-out .button {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ループ内：ボタンが a タグの場合 */
.woocommerce ul.products li.product.tcf-product-sold-out a.button,
.woocommerce-page ul.products li.product.tcf-product-sold-out a.button {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 768px) {
  .tcf-stock-label {
    padding: 5px 10px;
    font-size: 11px;
  }
  .tcf-stock-label--loop {
    top: 8px;
    left: 8px;
  }
  .tcf-stock-label--single {
    top: 10px;
    left: 10px;
  }
}

/* ── 一覧カード（在庫ありバッチ削除＋銘柄/用途バッチ＋目方表示） ─────────────────────────── */

/* 一覧では「在庫あり」ラベルは PHP 側で非出力。旧キャッシュ向けに残す */
body.tbt-context-shop .tcf-stock-label--loop.tcf-stock-label--in_stock {
  display: none !important;
}

/* 完売・在庫切れカード：グレーアウト＋カート操作のみ無効（商品ページへのリンクは維持） */
body.tbt-context-shop ul.products li.product.tcf-product-sold-out,
body.tbt-context-shop ul.products li.product.outofstock {
  opacity: 0.58;
  filter: grayscale(0.2);
}
body.tbt-context-shop ul.products li.product.tcf-product-sold-out .button,
body.tbt-context-shop ul.products li.product.tcf-product-sold-out .add_to_cart_button,
body.tbt-context-shop ul.products li.product.tcf-product-sold-out a.add_to_cart_button,
body.tbt-context-shop ul.products li.product.outofstock .button,
body.tbt-context-shop ul.products li.product.outofstock .add_to_cart_button,
body.tbt-context-shop ul.products li.product.outofstock a.add_to_cart_button {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.5;
}

/* 通販一覧のカード感（写真〜品名/価格周りを枠＆背景で見やすく） */
body.tbt-context-shop ul.products li.product {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(127, 38, 41, 0.18);
  border-radius: 14px;
  padding: 12px 12px 10px;
  box-shadow: 0 10px 24px rgba(42, 22, 16, 0.06);
}

/* サムネイルの枠線 */
body.tbt-context-shop ul.products li.product img.attachment-woocommerce_thumbnail,
body.tbt-context-shop ul.products li.product img.wp-post-image {
  border-radius: 12px;
  border: 1px solid rgba(127, 38, 41, 0.18);
  display: block;
}

/* 銘柄/用途バッチ（チップ） */
.tcf-loop-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tcf-loop-meta-chips--brand-title {
  margin: 0 0 0.3rem;
}

.tcf-loop-meta-chips--usage-price {
  margin: 0.08rem 0 0.28rem;
}

.tcf-loop-meta-chips--usage-overlay {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 4;
  margin: 0;
  pointer-events: none;
}

.tcf-loop-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.15;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.tcf-loop-chip--brand {
  background: #fce7f3;
  color: #9d174d;
  border-color: rgba(157, 23, 77, 0.18);
}

.tcf-loop-chip--usage {
  background: #dbeafe;
  color: #1e40af;
  border-color: rgba(30, 64, 175, 0.18);
}

/* モバイルのみチップを小さくし、カード表示の邪魔を抑える */
@media (max-width: 781px) {
  .tcf-loop-meta-chips {
    gap: 3px;
  }
  .tcf-loop-meta-chips--brand-title {
    margin: 0 0 0.24rem;
  }
  .tcf-loop-meta-chips--usage-price {
    margin: 0.08rem 0 0.22rem;
  }
  .tcf-loop-meta-chips--usage-overlay {
    top: 14px;
    left: 14px;
  }

  .tcf-loop-chip {
    padding: 3px 8px;
    font-size: 0.66rem;
    line-height: 1.08;
  }

  body.tbt-context-shop ul.products li.product .woocommerce-loop-product__title {
    font-size: 0.9rem;
    line-height: 1.3;
  }

  body.tbt-context-shop ul.products li.product .tcf-loop-weight-inline {
    margin-left: 6px;
    padding: 1px 7px;
    font-size: 0.7rem;
  }
}

/* 品名：一覧カードでは価格・バッジ類とのバランスを取るため少し抑える */
body.tbt-context-shop ul.products li.product .woocommerce-loop-product__title {
  font-size: 0.98rem;
  line-height: 1.34;
  margin: 0.1rem 0 0.18rem;
}

/* 目方（価格の横）：バッジ風の枠＋背景で視認性を上げる（ブランドカラー：臙脂 #7F2629 / 黄金 #B88B46） */
body.tbt-context-shop ul.products li.product .tcf-loop-weight-inline {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(184, 139, 70, 0.14);
  border: 1px solid rgba(184, 139, 70, 0.45);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  color: #7F2629;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 1.4;
}

/* 価格をブロック表示しない（目方と同一行に並べる） */
body.tbt-context-shop ul.products li.product .price {
  display: inline-block !important;
  margin: 0 !important;
  vertical-align: baseline;
  font-size: 1.02rem;
}

/* バリエーション商品の「～」付き価格：ベースラインを揃えて単品と位置がずれにくくする */
body.tbt-context-shop ul.products li.product.product-type-variable .price {
  display: inline-flex !important;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.08em 0.28em;
  max-width: 100%;
}
body.tbt-context-shop ul.products li.product.product-type-variable .price .woocommerce-Price-amount,
body.tbt-context-shop ul.products li.product.product-type-variable .price ins .amount,
body.tbt-context-shop ul.products li.product.product-type-variable .price del {
  vertical-align: baseline;
}

/* ── 在庫管理：入荷予定メッセージ（単一商品ページ） ───────────── */
.tcf-inventory-restock-notice {
  margin: 10px 0;
  padding: 10px 14px;
  background: #FBF3E7;
  border: 1px solid rgba(184, 139, 70, 0.35);
  border-radius: 6px;
  color: #7F2629;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}
.tcf-inventory-restock-notice br:last-child {
  display: none;
}

