/* =========================================================
   WinePro 関連ワインセラー カタログ比較テーブル（#wp-rel-cellar 内部完結版）
   ========================================================= */
#wp-rel-cellar {
  display: block;
  width: 100%;
  max-width: 770px;
  margin: 36px auto;
  padding: 0 12px;
  box-sizing: border-box;
  overflow: hidden;
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  color: #222;
}

#wp-rel-cellar .wp-cat-wrap {
  width: 100%;
  max-width: 100%;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 横スクロールコンテナ */
#wp-rel-cellar .wp-cat-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

#wp-rel-cellar .wp-cat-scroll::-webkit-scrollbar {
  height: 7px;
}
#wp-rel-cellar .wp-cat-scroll::-webkit-scrollbar-track {
  background: #f2f2f2;
}
#wp-rel-cellar .wp-cat-scroll::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 4px;
}
#wp-rel-cellar .wp-cat-scroll::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* テーブル本体 */
#wp-rel-cellar .wp-cat-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: max-content;
  margin: 0;
  background: #fff;
}

/* 1列あたりの幅 */
#wp-rel-cellar .wp-cat-th,
#wp-rel-cellar .wp-cat-td {
  width: 165px;
  min-width: 165px;
  max-width: 165px;
  box-sizing: border-box;
  border-right: 1px solid #e2e2e2;
  border-bottom: 1px solid #e2e2e2;
  vertical-align: top;
  padding: 0;
}

#wp-rel-cellar .wp-cat-th:last-child,
#wp-rel-cellar .wp-cat-td:last-child {
  border-right: none;
}

#wp-rel-cellar .wp-cat-row:last-child .wp-cat-td {
  border-bottom: none;
}

/* グループ境界線（同ブランド比較 と 同等サイズ比較 の境目） */
#wp-rel-cellar .wp-cat-group-border {
  border-left: 2px solid #c5c5c5;
}

/* =========================================================
   左端「本商品」列の固定（Sticky）
   ========================================================= */
#wp-rel-cellar .wp-cat-sticky {
  position: sticky;
  left: 0;
  z-index: 5;
  border-right: 2px solid #999 !important;
  box-shadow: 3px 0 8px rgba(0, 0, 0, 0.08);
}

#wp-rel-cellar .wp-cat-th.wp-cat-sticky {
  z-index: 6;
  background: #2b2b2b;
  color: #fff;
}

#wp-rel-cellar .wp-cat-td.wp-cat-sticky {
  background: #fdfbf7;
}

/* =========================================================
   1行目：グループヘッダー（本商品 | 同ブランドで比較する | 同等サイズで比較する）
   ========================================================= */
#wp-rel-cellar .wp-cat-th {
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  letter-spacing: 0.03em;
}

#wp-rel-cellar .wp-cat-th--brand {
  background: #722f37;
  color: #fff;
}

#wp-rel-cellar .wp-cat-th--similar {
  background: #1e3a5f;
  color: #fff;
  border-left: 2px solid #c5c5c5;
}

/* =========================================================
   2行目：画像行
   ========================================================= */
#wp-rel-cellar .wp-cat-img-box {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

#wp-rel-cellar .wp-cat-subtag {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 4px;
  background: #f4f4f4;
  color: #444;
  border-bottom: 1px solid #ececec;
}

/* 「現在表示中」は2px拡大 */
#wp-rel-cellar .wp-cat-subtag--current {
  background: #f3eee5;
  color: #555;
  font-size: 13px;
}

#wp-rel-cellar .wp-cat-subtag--up {
  background: #fdf2f3;
  color: #722f37;
}

#wp-rel-cellar .wp-cat-subtag--down {
  background: #f2f6fa;
  color: #2c5282;
}

#wp-rel-cellar .wp-cat-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}

#wp-rel-cellar .wp-cat-td.wp-cat-sticky .wp-cat-thumb {
  background: #fdfbf7;
}

#wp-rel-cellar .wp-cat-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

#wp-rel-cellar a.wp-cat-img-box:hover .wp-cat-thumb img {
  transform: scale(1.04);
}

/* =========================================================
   3行目・4行目共通：行ラベル（収納本数 / 価格：1px拡大）
   ========================================================= */
#wp-rel-cellar .wp-cat-row-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #666;
  background: #f5f5f5;
  padding: 3px 6px;
  text-align: center;
  border-bottom: 1px solid #eaeaea;
}

#wp-rel-cellar .wp-cat-td.wp-cat-sticky .wp-cat-row-label {
  background: #f3eee5;
  color: #555;
}

/* =========================================================
   3行目：収納本数（サイズ）行（1px拡大）
   ========================================================= */
#wp-rel-cellar .wp-cat-cap-val {
  padding: 8px 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  color: #222;
  text-align: center;
  min-height: 44px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  box-sizing: border-box;
}

#wp-rel-cellar .wp-cat-cap-val strong {
  font-size: 21px;
  font-weight: 800;
  color: #111;
  margin-right: 2px;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

/* =========================================================
   4行目：価格行（ログイン時：1px拡大 / 未ログイン時：「現在表示中」2px拡大）
   ========================================================= */
#wp-rel-cellar .wp-cat-price-box {
  padding: 8px 6px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
}

#wp-rel-cellar .wp-cat-price-link {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  text-decoration: none;
  line-height: 1.2;
}

#wp-rel-cellar .wp-cat-price-val {
  font-size: 16px;
  font-weight: 800;
  color: #b91c1c;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

#wp-rel-cellar .wp-cat-price-tax {
  font-size: 11px;
  color: #555;
  margin-left: 2px;
}

#wp-rel-cellar .wp-cat-current-note {
  font-size: 13px;
  font-weight: 700;
  color: #666;
}

#wp-rel-cellar .wp-cat-price-empty {
  font-size: 13px;
  color: #888;
}

/* 未ログイン時：「ログインして／価格を表示」ボタン */
#wp-rel-cellar .wp-cat-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  padding: 5px 4px;
  background: #722f37;
  color: #fff !important;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none !important;
  border-radius: 4px;
  box-sizing: border-box;
  transition: background-color 0.2s ease;
}

#wp-rel-cellar .wp-cat-login-btn:hover {
  background: #582229;
  opacity: 1 !important;
}

/* =========================================================
   スマホ表示調整（左端「本商品」＋右側1列の計2列が画面幅に収まるサイズ）
   ========================================================= */
@media (max-width: 600px) {
  #wp-rel-cellar {
    margin: 28px auto;
    padding: 0 8px;
  }

  #wp-rel-cellar .wp-cat-th,
  #wp-rel-cellar .wp-cat-td {
    width: calc((100vw - 36px) / 2);
    min-width: calc((100vw - 36px) / 2);
    max-width: calc((100vw - 36px) / 2);
  }

  #wp-rel-cellar .wp-cat-th {
    font-size: 12px;
    padding: 8px 4px;
  }

  #wp-rel-cellar .wp-cat-cap-val strong {
    font-size: 19px;
  }

  #wp-rel-cellar .wp-cat-price-val {
    font-size: 15px;
  }
}

/* ワインセラー商品ページ固有の支払い方法ポップアップ位置調整（右はみ出し防止・1行維持） */
@media (max-width: 600px) {
  .body-product-detail .p-product-set .__payment-name {
    left: auto !important;
    right: 0 !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
  }
}