/* 全体ラッパー */
.estimate-wrapper {
  max-width: 1000px;
  margin: 40px auto;
  padding: 20px;
  box-sizing: border-box;
}

/* カード風の背景 */
.estimate-wrapper .card,
.estimate-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

/* セクション */
.form-section {
  margin-bottom: 24px;
}

.form-section + .form-section {
  border-top: 1px solid #dddddd;
  padding-top: 24px;
}

.form-section h2 {
  font-size: 1.2rem;
  margin: 0 0 12px;
  border-left: 4px solid #2962ff;
  padding-left: 8px;
}

.form-section small {
  color: #777777;
}

/* 基本情報 2カラムレイアウト */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px; /* 左右の間のスペース */
  width: 100%;
  box-sizing: border-box;
}

.form-field {
  width: 100%;
  margin-bottom: 16px;
  box-sizing: border-box;
}

.form-label {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  font-size: 0.95rem;
  font-weight: 600;
}

.badge-required {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e53935;
  color: #ffffff;
  font-size: 0.75rem;
}

/* 入力系 */
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field textarea {
  width: 100%;
  max-width: 100%;  /* 親コンテナをはみ出さない */
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #dddddd;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

/* 見積り項目テーブル */
.price-group {
  margin-bottom: 20px;
}

.price-group-title {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.98rem;
  padding: 4px 0;
  border-bottom: 1px solid #dddddd;
}

.price-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dashed #eeeeee;
}

.price-item:last-child {
  border-bottom: none;
}

.price-item-label {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-size: 0.93rem;
}

.item-unit {
  font-size: 0.8rem;
  color: #777777;
}

.price-item-input {
  text-align: right;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* 数量の＋/−ボタン */
.qty-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  background: #e0e0e0;
  border: none;
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
}

.qty-btn:hover {
  background: #d5d5d5;
}

.qty-btn:active {
  background: #c9c9c9;
}

.qty-wrap input[type="number"],
.estimate-qty {
  width: 70px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #dddddd;
  text-align: center;
  font-size: 0.9rem;
  box-sizing: border-box;
}

/* 各項目の金額表示 */
.line-amount {
  font-size: 0.8rem;
  color: #555555;
  margin-top: 4px;
}

/* 割引オプション */
.discount-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.discount-item {
  font-size: 0.9rem;
  color: #d32f2f;
}

.discount-detail-box {
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  background: #fff5f5;
  border: 1px solid #ffcdd2;
  font-size: 0.85rem;
  white-space: pre-line;
}

/* 見積りサマリー */
.estimate-summary {
  border-radius: 12px;
  background: #f3f5ff;
  padding: 16px 18px;
  margin-top: 8px;
  border: 1px solid #dde3ff;
}

.estimate-summary h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.estimate-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  margin: 2px 0;
}

.estimate-summary-row span.value {
  font-weight: 600;
}

.estimate-summary-row.discount {
  color: #d32f2f;
}

.estimate-summary-row.total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #c2c9ff;
  font-size: 1.05rem;
}

.estimate-summary-row.total span.value {
  font-size: 1.1rem;
}

/* ボタン周り（CF7の submit ボタンとは別デザインにしたい場合） */
.form-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn-reset {
  padding: 10px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  background: #eeeeee;
  color: #444444;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .estimate-wrapper {
    margin: 20px auto;
    padding: 10px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .price-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .price-item-input {
    text-align: left;
  }
}
