/* form-calc-1 : 合計自動計算フォーム（明細行対応） — デモ専用スタイル（.fc1-wrap にスコープ） */

.fc1-wrap {
  width: 100%;
  max-width: 560px;
}

.fc1-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.fc1-table th,
.fc1-table td {
  border: 1px solid #D0D7E0;
  padding: 8px 10px;
  text-align: left;
}

/* 数値列は右寄せ、削除列は中央寄せ */
.fc1-th-num { text-align: right; }
.fc1-th-del { width: 44px; text-align: center; }

.fc1-table thead th {
  background: #F4F6F9;
  font-size: 13px;
  color: #5A6A7A;
  white-space: nowrap;
}

.fc1-name {
  width: 100%;
  min-width: 80px;
  font-size: 16px; /* 16px 未満だと iOS で自動ズームするため */
  padding: 6px 8px;
  border: 1px solid #D0D7E0;
  border-radius: 4px;
}

.fc1-price,
.fc1-qty {
  width: 100%;
  max-width: 96px;
  font-size: 16px;
  padding: 6px 8px;
  border: 1px solid #D0D7E0;
  border-radius: 4px;
  text-align: right;
}

/* 計算結果セル。数字の桁を揃えて表示する */
.fc1-subtotal {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fc1-del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
  color: #E5484D;
  background: #fff;
  border: 1.5px solid #F0C0C2;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.fc1-del-btn:hover:not(:disabled) {
  background: #FDECEC;
  border-color: #E5484D;
}
/* 残り1行のときは削除ボタンを無効化する */
.fc1-del-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.fc1-actions { margin-top: 10px; }

.fc1-add-btn {
  padding: 8px 16px;
  font-size: 13px;
  color: #2B7FE8;
  background: #fff;
  border: 1.5px dashed #A9C7F0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.fc1-add-btn:hover {
  background: #F0F6FF;
  border-color: #2B7FE8;
}

/* 合計エリアは右寄せの2カラム */
.fc1-totals {
  margin-top: 16px;
  margin-left: auto;
  max-width: 280px;
}
.fc1-total-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  font-size: 14px;
  color: #3A4A5A;
}
.fc1-total-value { font-variant-numeric: tabular-nums; }

/* 税込合計だけ強調する */
.fc1-total-grand {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 2px solid #D0D7E0;
  font-size: 18px;
  font-weight: 700;
  color: #1A2A3A;
}

/* スクリーンリーダー用の視覚的非表示 */
.fc1-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* リセットボタン（global.css / example.css には無いのでここで定義） */
.demo-controls {
  margin-top: 12px;
}
.reset-btn {
  padding: 6px 16px;
  font-size: 13px;
  color: #5A6A7A;
  background: #fff;
  border: 1.5px solid #D0D7E0;
  border-radius: 6px;
  cursor: pointer;
  font-family: sans-serif;
  transition: background 0.15s, border-color 0.15s;
}
.reset-btn:hover {
  background: #F4F6F9;
  border-color: #9AA5B4;
}

/* スマホ対応 */
@media (max-width: 480px) {
  .fc1-table th,
  .fc1-table td { padding: 6px; }
  .fc1-price,
  .fc1-qty { max-width: 72px; }
}
