/* ========================================
   比較表テーブル
   ======================================== */

.compare-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 24px 0;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
  border-radius: 10px;
}

.compare-table {
  min-width: 700px;
  width: 100%;
  border-collapse: collapse;
}

/* ヘッダー */
.compare-table-header {
  display: grid;
  grid-template-columns: 120px 80px 1fr 160px 200px;
  background-color: #fef1f1;
  color: #f1707a;
  font-weight: bold;
  font-size: 13px;
  border-bottom: 2px solid #f16b6f;
  border-radius: 10px 10px 0 0;
}

.compare-th {
  padding: 12px 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #f2f2f2;
}

.compare-th:last-child {
  border-right: none;
}

/* 行 */
.compare-table-row {
  display: grid;
  grid-template-columns: 120px 80px 1fr 160px 200px;
  /* border-bottom: 1px solid #f2f2f2; */
  align-items: stretch;
}

.compare-table-row:nth-child(odd) {
  background-color: #fff;
}

.compare-table-row:nth-child(even) {
  /* background-color: #fdf5f4; */
}

.compare-table-row:nth-child(n+1) {
  border-top: 1px solid #f2f2f2;
}

/* セル */
.compare-td {
  padding: 12px 8px;
  font-size: 13px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  border-right: 1px solid #f2f2f2;
}

.compare-td:last-child {
  border-right: none;
}

/* 業者名 */
.compare-td-name {
  font-weight: bold;
  justify-content: flex-start;
  text-align: left;
}

.compare-bp-name {
  font-weight: bold;
  font-size: 14px;
}

/* HP画像 */
.compare-td-image {
  padding: 8px;
}

.compare-td-image .img-wrap {
  width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-td-image .img-wrap img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* 買取方法 */
.compare-td-method {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
}

.compare-method-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #333;
  white-space: nowrap;
  line-height: 1.8;
}

.compare-method-item::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #f16e72;
  flex-shrink: 0;
}

/* 手数料 */
.compare-td-commission {
  text-align: center;
}

.compare-commission {
  font-size: 12px;
  line-height: 1.6;
}

/* CTAボタン */
.compare-td-cta {
  flex-direction: column;
  gap: 6px;
}

.compare-cta-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.compare-cta-btn {
  display: block;
  text-align: center;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
  line-height: 1.4;
}

.compare-cta-btn:hover {
  opacity: 0.8;
}

.compare-cta-btn.campaign {
  background-color: #fff4e6;
  color: #c46329;
  border: 1px solid #f8be95;
  text-decoration: none;
}

.compare-cta-btn.official {
  background-color: #f16b6f;
  color: #ffffff;
  border: 1px solid #f16b6f;
  text-decoration: none;
}

.compare-cta-arrow::before {
  content: '\2197';
  font-family: 'Arial', 'Helvetica', sans-serif;
  font-style: normal;
  margin-right: 2px;
}
.compare-table .compare-table-body {
  border-radius: 0 0 10px 10px;
  overflow: hidden;
  border-left: 1px solid #f2f2f2;
  border-right: 1px solid #f2f2f2;
  border-bottom: none;
  border-top: none;
  display: flex;
  flex-direction: column;
}


/* ========================================
   エディター用スタイル
   ======================================== */
.editor-styles-wrapper .wp-block-kaitori-compare-table .compare-table-row {
  margin-bottom: 2px;
}

.editor-styles-wrapper .wp-block-kaitori-compare-table .compare-cta-btn {
  pointer-events: none;
}

/* appender（+ボタン）をテーブル幅いっぱいに配置 */
.wp-block-kaitori-compare-table .block-list-appender {
  display: flex;
  justify-content: center;
  padding: 8px 0;
}

.wp-block-kaitori-compare-table .block-list-appender .block-editor-button-block-appender {
  margin: 0 auto;
}

/* ========================================
   レスポンシブ
   ======================================== */
@media screen and (max-width: 768px) {
  .compare-table {
    min-width: 600px;
  }

  .compare-table-header {
    grid-template-columns: 90px 70px 1fr 120px 170px;
    font-size: 11px;
  }

  .compare-table-row {
    grid-template-columns: 90px 70px 1fr 120px 170px;
  }

  .compare-th,
  .compare-td {
    padding: 8px 4px;
    font-size: 11px;
  }

  .compare-cta-btn {
    padding: 6px 8px;
    font-size: 11px;
  }
}
