/* Base Layout & Scroll Wrapper */
.compare-table-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  background-color: #fff;
  /* スクロールバーのスタイリング */
  scrollbar-width: thin;
  scrollbar-color: #bbbbbb #f1f1f1;
}

.compare-table-wrapper::-webkit-scrollbar {
  height: 8px;
}
.compare-table-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 0 0 8px 8px;
}
.compare-table-wrapper::-webkit-scrollbar-thumb {
  background: #bbbbbb;
  border-radius: 4px;
}

/* Table Design */
.compare-table {
  width: 100%;
  min-width: 1200px; /* 7商品が窮屈にならないように広めに調整 */
  border-collapse: separate;
  border-spacing: 0;
  text-align: center;
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
}

/* Sticky Positioning */
.sticky-top {
  position: sticky;
  top: 0;
  background-color: #fff;
  z-index: 2;
  vertical-align: top;
  border-bottom: 2px solid #e0e0e0;
  border-right: 1px solid #f0f0f0;
  padding: 16px;
  min-width: 160px;
}

.sticky-left {
  position: sticky;
  left: 0;
  background-color: #f8f9fa;
  z-index: 1;
  font-weight: bold;
  text-align: left;
  padding: 16px;
  border-right: 2px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  width: 140px;
  min-width: 140px;
}

.sticky-corner {
  position: sticky;
  top: 0;
  left: 0;
  background-color: #f8f9fa;
  z-index: 3;
  border-right: 2px solid #e0e0e0;
  border-bottom: 2px solid #e0e0e0;
  padding: 16px;
  vertical-align: bottom;
  text-align: left;
}

.corner-text {
  font-size: 12px;
  color: #666;
  font-weight: bold;
}

/* Table Cells */
.compare-table td {
  padding: 16px;
  border-right: 1px solid #f0f0f0;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;
  background-color: #fff;
}

.compare-table tr:hover td,
.compare-table tr:hover .sticky-left {
  background-color: #fcfcfc;
}

/* Product Header Info */
.product-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.product-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #eee;
}

.product-name {
  font-size: 15px;
  font-weight: bold;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em; /* 2行分を確保 */
}

/* ▼▼▼ 今回の修正箇所 ▼▼▼ */
.product-price {
  font-size: 18px;
  font-weight: bold;
  color: #d32f2f;
  margin: 0;
  white-space: nowrap; /* ←追加：強制的に1行で表示（改行させない） */
}

/* Button */
.btn-detail {
  display: inline-block;
  padding: 8px 0; /* 左右の固定余白をなくして幅に余裕を持たせる */
  background-color: #0056b3;
  color: #fff;
  text-decoration: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  transition: background-color 0.2s ease;
  width: 90%;
  max-width: 140px; /* 広がりすぎないように最大幅を指定 */
  box-sizing: border-box;
  text-align: center; /* 文字を中央揃え */
  white-space: nowrap; /* 強制的に1行で表示（改行させない） */
}

.btn-detail:hover {
  background-color: #004494;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .sticky-top {
    min-width: 140px;
    padding: 12px 8px;
  }
  
  .sticky-left {
    width: 100px;
    min-width: 100px;
    padding: 12px 8px;
    font-size: 12px;
  }

  .product-img {
    width: 100px;
    height: 100px;
  }

  .product-name {
    font-size: 13px;
  }

  .product-price {
    font-size: 16px;
  }

  .btn-detail {
    padding: 8px 0;
    font-size: 12px; /* スマホでは少し文字を小さく */
    width: 95%;
  }

  .compare-table td {
    padding: 12px 8px;
    font-size: 13px;
  }
}