/* ========================================
   料金シミュレーション結果テーブル
======================================== */

.pricing-summary-table {
  max-width: 900px;
  margin: 40px auto 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* テーブルスタイル */
.summary-table {
  width: auto;
  border-collapse: collapse;
  min-width: 800px;
}

.summary-table thead {
  background: #f8f9fa;
}

.summary-table th {
  padding: 16px 20px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2c3e50;
  border-bottom: 2px solid #e0e0e0;
  white-space: nowrap;
}

.summary-table th:nth-child(1) {
  min-width: 180px;
}

.summary-table th:nth-child(2) {
  min-width: 280px;
}

.summary-table th:nth-child(3),
.summary-table th:nth-child(4),
.summary-table th:nth-child(5) {
  min-width: 100px;
}

.summary-table th:nth-child(6) {
  min-width: 120px;
}

.summary-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s ease;
}

.summary-table tbody tr:last-child {
  border-bottom: none;
}

.summary-table tbody tr:hover {
  background: #f8f9fa;
}

.summary-table td {
  padding: 16px 20px;
  text-align: center;
  font-size: 0.9rem;
  color: #34495e;
  white-space: nowrap;
}

.summary-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: #2c3e50;
  padding-left: 24px;
}

.summary-table td:nth-child(2) {
  text-align: left;
  padding-right: 24px;
}

.summary-table td:nth-child(3),
.summary-table td:nth-child(4),
.summary-table td:nth-child(5) {
  text-align: right;
  font-weight: 600;
}

.summary-table td:last-child {
  font-size: 0.85rem;
  color: #7f8c8d;
  text-align: center;
}

/* カテゴリー別カラー */
.category-email {
  color: #4FA5E6 !important;
  font-weight: 600;
}

.category-line {
  color: #00B900 !important;
  font-weight: 600;
}

.category-sms {
  color: #ff567d !important;
  font-weight: 600;
}

/* 金額列 */
.amount-cell {
  font-weight: 700;
  color: #2c3e50;
  font-size: 1rem;
}

/* 合計セクション */
.summary-totals {
  padding: 0;
  background: white;
}

.summary-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 0 16px 520px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
  gap: 80px;
}

.summary-row:first-child {
  border-top: 2px solid #e0e0e0;
}

.summary-row:last-child {
  border-bottom: none;
  background: white;
}

.summary-row-label {
  font-size: 1rem;
  color: #2c3e50;
  font-weight: 500;
  text-align: right;
  width: auto;
  flex-shrink: 0;
  padding-right: 20px;
}

.summary-row-value {
  font-size: 1.1rem;
  color: #2c3e50;
  font-weight: 600;
  text-align: right;
  width: auto;
  flex-shrink: 0;
  padding-right: 24px;
}

/* 合計行 */
.total-row {
  margin-top: 0;
  padding: 20px 0 20px 520px;
  border-top: 2px solid transparent;
  border-image: linear-gradient(
    to right,
    #4FA5E6 0%,
    #4FA5E6 33.33%,
    #06C755 33.33%,
    #06C755 66.66%,
    #ff567d 66.66%,
    #ff567d 100%
  ) 1;
  border-bottom: none;
  background: white;
}

.total-row .summary-row-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c3e50;
}

.total-row .summary-row-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: #4FA5E6;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .pricing-summary-table {
    margin: 30px 10px 0;
    width: calc(100% - 20px);
    max-width: 100%;
  }

  .summary-table {
    font-size: 0.85rem;
    min-width: auto;
    width: 100%;
  }

  .summary-table th,
  .summary-table td {
    padding: 10px 8px;
    font-size: 0.8rem;
  }

  .summary-table th:first-child,
  .summary-table td:first-child {
    display: none;
  }

  .summary-table th:nth-child(1),
  .summary-table th:nth-child(2),
  .summary-table th:nth-child(3),
  .summary-table th:nth-child(4),
  .summary-table th:nth-child(5),
  .summary-table th:nth-child(6) {
    min-width: auto;
  }

  .summary-totals {
    padding: 0;
  }

  .summary-row {
    padding: 14px 0 14px 300px;
    gap: 60px;
  }

  .summary-row-label {
    font-size: 0.95rem;
    width: auto;
    padding-right: 16px;
  }

  .summary-row-value {
    font-size: 1rem;
    width: auto;
    padding-right: 20px;
  }

  .total-row {
    padding: 18px 0 18px 300px;
  }

  .total-row .summary-row-label {
    font-size: 1rem;
  }

  .total-row .summary-row-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .summary-table th,
  .summary-table td {
    padding: 8px 4px;
    font-size: 0.75rem;
  }

  .summary-table th:nth-child(3),
  .summary-table td:nth-child(3),
  .summary-table th:nth-child(4),
  .summary-table td:nth-child(4) {
    display: none;
  }

  .summary-totals {
    padding: 0;
  }

  .summary-row {
    padding: 12px 0 12px 60px;
    gap: 20px;
  }

  .summary-row-label {
    font-size: 0.9rem;
    width: auto;
    min-width: 120px;
    padding-right: 12px;
  }

  .summary-row-value {
    font-size: 0.95rem;
    width: auto;
    min-width: 100px;
    padding-right: 16px;
  }

  .total-row {
    padding: 16px 0 16px 60px;
  }

  .total-row .summary-row-value {
    font-size: 1.3rem;
  }
}
