/* ============================================================
   psm-price.css — 料金シミュレーター＋料金表の見た目
   クラスは psm- 接頭辞のみ。テーマの共通クラス（c-*/l-*）には依存しない。
   色・書体はテーマのCSS変数をフォールバック付きで参照する
   （例：var(--c-blue, #265ea8)）ので、テーマ側の変数名が変わっても
   フォールバック値でそのまま動く。
   将来 WordPress プラグイン化するときは、このファイルをそのまま
   プラグインの assets/ に移設する想定。
   ============================================================ */

/* ---------- 共通 ---------- */
.psm-sim,
.psm-price-table {
  box-sizing: border-box;
}
.psm-sim *,
.psm-sim *::before,
.psm-sim *::after,
.psm-price-table *,
.psm-price-table *::before,
.psm-price-table *::after {
  box-sizing: border-box;
}
.psm-sim select,
.psm-sim input,
.psm-sim button {
  font-family: var(--font-sans, "Noto Sans JP", sans-serif);
}
.psm-sim__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;
}

/* ---------- シミュレーター：面（グレー） ---------- */
.psm-sim__panel {
  box-sizing: border-box;
  background: var(--c-bg, #f9f9f9);
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 490px;
  gap: 40px;
}
.psm-sim__col {
  min-width: 0;
}

.psm-sim__block {
  margin-bottom: 40px; /* Figma実測：どのブロックも「入力欄の下端→次の見出し」が40pxで揃う */
}
.psm-sim__block:last-child {
  margin-bottom: 0;
}
.psm-sim__label {
  margin: 0;
  font: 700 18px/25px var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-blue, #265ea8);
}
.psm-sim__hint {
  margin: 4px 0 16px; /* Figma実測：見出し→補足=30px、補足→入力欄=40pxに合わせた値 */
  font: 400 14px/25px var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-gray-3, #707070);
}

/* ---------- 入力欄の共通見た目（配布エリア／配布部数／オプション） ---------- */
.psm-sim__select-wrap {
  position: relative;
  max-width: 450px;
}
.psm-sim__select,
.psm-sim__opt select {
  display: block;
  width: 100%;
  height: 45px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--c-line, #c8c8c8);
  border-radius: 5px;
  background: #fff;
  font: 400 14px/1 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 15 15'><path d='M3 5.5l4.5 4.5 4.5-4.5' fill='none' stroke='%23707070' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.psm-sim__select:focus-visible,
.psm-sim__opt select:focus-visible,
.psm-sim__qty:focus-visible {
  outline: 3px solid var(--c-blue, #265ea8);
  outline-offset: 2px;
}

/* ---------- 配布方法：3つのボタン ---------- */
.psm-sim__methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  max-width: 600px;
}
.psm-sim__method {
  position: relative;
}
.psm-sim__method input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.psm-sim__method input:disabled {
  cursor: not-allowed;
}
.psm-sim__method input:focus-visible + label {
  outline: 3px solid var(--c-blue, #265ea8);
  outline-offset: 2px;
}
.psm-sim__method label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 72px;
  border: 1px solid var(--c-line, #c8c8c8);
  border-radius: 5px;
  background: #fff;
  text-align: center;
  cursor: pointer;
}
.psm-sim__method-name {
  font: 700 16px/25px var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
}
.psm-sim__method-note {
  font: 400 14px/25px var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
}
.psm-sim__method input:checked + label {
  border: 2px solid var(--c-blue, #265ea8);
  background: var(--c-blue-pale, #eef4ff);
}
.psm-sim__method input:checked + label .psm-sim__method-name {
  color: var(--c-blue, #265ea8);
}
.psm-sim__method input:disabled + label {
  border-style: dashed;
  background: var(--c-gray-2, #ededed);
  cursor: not-allowed;
}
.psm-sim__method input:disabled + label .psm-sim__method-name,
.psm-sim__method input:disabled + label .psm-sim__method-note {
  color: var(--c-gray-3, #707070);
}

/* ---------- 配布部数：プリセット＋直接入力 ---------- */
.psm-sim__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-bottom: 14px;
}
.psm-sim__preset {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  font: 400 16px/25px var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
  cursor: pointer;
}
.psm-sim__preset input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--c-blue, #265ea8);
  cursor: pointer;
}
.psm-sim__preset input:focus-visible {
  outline: 3px solid var(--c-blue, #265ea8);
  outline-offset: 2px;
}
.psm-sim__qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.psm-sim__qty {
  width: 100%;
  max-width: 260px;
  height: 45px;
  padding: 0 14px;
  border: 1px solid var(--c-line, #c8c8c8);
  border-radius: 5px;
  background: #fff;
  font: 400 16px/1 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
}
.psm-sim__unit {
  font: 400 14px/1 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
}

/* ---------- オプション作業 ---------- */
.psm-sim__opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  max-width: 600px;
}
.psm-sim__opt-label {
  display: block;
  margin: 4px 0 10px; /* Figma実測：補足文からラベルまで20px・ラベルから入力欄まで10px */
  font: 700 16px/25px var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
}
.psm-sim__sub-note {
  margin-top: 8px;
  font: 400 12px/1.7 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-gray-3, #707070);
}

/* ---------- 結果カード ---------- */
.psm-sim__card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 0 14px 1px rgba(0, 0, 0, 0.25);
  padding: 30px 40px;
}
.psm-sim__card-title {
  margin: 0;
  font: 700 18px/25px var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-blue, #265ea8);
}
.psm-sim__amount {
  margin: 10px 0 0;
  font: 700 32px/1.3 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
  font-variant-numeric: tabular-nums;
}
.psm-sim__amount-unit {
  font-size: 22px;
  margin-left: 2px;
}
.psm-sim__amount-wave {
  display: inline-block;
  margin: 0 10px;
}
.psm-sim__amount-in {
  margin: 4px 0 0;
  font: 700 20px/1.3 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-gray-3, #707070);
  font-variant-numeric: tabular-nums;
}
.psm-sim__amount-in-label {
  font-size: 13px;
  font-weight: 500;
  margin-right: 4px;
}
.psm-sim__tax-note {
  margin: 8px 0 0;
  font: 700 13px/1.7 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-red, #a94040);
}
.psm-sim__per {
  margin: 12px 0 0;
  font: 400 14px/1.7 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
}
.psm-sim__per b {
  color: var(--c-blue, #265ea8);
}
.psm-sim__per-warning {
  display: inline-block;
  margin-top: 4px;
  font-weight: 700;
  color: var(--c-red, #a94040);
}

.psm-sim__breakdown {
  border-top: 1px solid var(--c-line, #c8c8c8);
  margin-top: 20px;
  padding-top: 14px;
}
.psm-sim__bd-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 14px;
  font: 400 14px/25px var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
}
.psm-sim__bd-row span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.psm-sim__bd-total {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 14px;
  border-top: 1px solid var(--c-line, #c8c8c8);
  margin-top: 10px;
  padding-top: 10px;
  font: 700 14px/25px var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
}
.psm-sim__bd-total span:last-child {
  color: var(--c-blue, #265ea8);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.psm-sim__bd-row--tax {
  margin-top: 6px;
  color: var(--c-gray-3, #707070);
}

.psm-sim__cta {
  display: block;
  width: 100%;
  max-width: 330px;
  margin: 24px auto 0;
  height: 60px;
  padding: 0 20px;
  border: 0;
  border-radius: 30px;
  background: var(--c-blue, #265ea8);
  color: #fff;
  font: 500 16px/23px var(--font-sans, "Noto Sans JP", sans-serif);
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.psm-sim__cta:hover {
  opacity: 0.8;
}
.psm-sim__cta:disabled {
  background: var(--c-gray-3, #707070);
  cursor: not-allowed;
  opacity: 1;
}
.psm-sim__cta:focus-visible {
  outline: 3px solid var(--c-blue, #265ea8);
  outline-offset: 2px;
}
.psm-sim__cta-note {
  margin: 11px 0 0;
  font: 400 12px/1.7 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-gray-3, #707070);
  text-align: center;
}

.psm-sim__notice {
  margin-top: 22px;
  background: var(--c-blue-pale, #eef4ff);
  border-radius: 3px;
  padding: 20px;
}
.psm-sim__notice-title {
  margin: 0 0 12px;
  padding: 4px 0;
  background: #fff;
  border-radius: 2px;
  text-align: center;
  font: 700 16px/1.4 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-blue, #265ea8);
}
.psm-sim__notice ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.psm-sim__notice li {
  position: relative;
  margin-bottom: 12px;
  padding-left: 1em;
  font: 400 16px/21px var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
}
.psm-sim__notice li::before {
  content: "\30fb";
  position: absolute;
  left: 0;
}
.psm-sim__notice li:last-child {
  margin-bottom: 0;
}
.psm-sim__notice u {
  text-decoration: underline;
  text-decoration-color: var(--c-red, #a94040);
  text-underline-offset: 3px;
  color: var(--c-red, #a94040);
  font-weight: 500;
}

/* ---------- 封入・折り加工のみのご相談 ---------- */
.psm-sim__workonly {
  margin-top: 30px;
  background: #fff;
  border: 1px solid var(--c-line, #c8c8c8);
  border-radius: 10px;
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.psm-sim__workonly-body h3 {
  margin: 0 0 6px;
  font: 700 16px/1.5 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-blue, #265ea8);
}
.psm-sim__workonly-body p {
  margin: 0;
  font: 400 14px/1.85 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
}
.psm-sim__workonly-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 26px;
  border: 1.5px solid var(--c-blue, #265ea8);
  border-radius: 25px;
  background: #fff;
  color: var(--c-blue, #265ea8);
  font: 700 14px/1 var(--font-sans, "Noto Sans JP", sans-serif);
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s ease;
}
.psm-sim__workonly-btn:hover {
  background: var(--c-blue-pale, #eef4ff);
}
.psm-sim__workonly-btn:focus-visible {
  outline: 3px solid var(--c-blue, #265ea8);
  outline-offset: 2px;
}

/* ---------- レイアウト切り替え：1115px以下は縦積み ---------- */
@media (max-width: 1115px) {
  .psm-sim__panel {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

/* ---------- スマホ（767px以下） ---------- */
@media (max-width: 767px) {
  .psm-sim__panel {
    padding: 24px 20px;
  }
  .psm-sim__card {
    padding: 24px 20px;
  }
  .psm-sim__methods,
  .psm-sim__opts {
    max-width: none;
  }
  .psm-sim__amount {
    font-size: 28px;
  }
  .psm-sim__amount-unit {
    font-size: 18px;
  }
  .psm-sim__workonly {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    padding: 22px 20px;
  }
  .psm-sim__workonly-btn {
    width: 100%;
  }
}

/* ============================================================
   料金表（PC＝一覧表 ／ スマホ＝市町村名ごとの開閉式）
   2026-09-29：単金一覧（39地区・17市町村）に合わせて作り替え。
   Figmaの見た目（青い見出し行・淡い青の地区名・60pxの行・スマホの青い帯）を引き継ぐ。
   PCの表とスマホの開閉式を両方出力し、幅で片方だけ表示する。
   ============================================================ */
.psm-price-table__pc {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--c-line, #c8c8c8);
  font: 400 16px/1.4 var(--font-sans, "Noto Sans JP", sans-serif);
  color: var(--c-text, #333);
}
.psm-price-table__pc thead th {
  height: 60px;
  padding: 0 8px;
  background: var(--c-blue, #265ea8);
  font-weight: 700;
  color: #fff;
  text-align: center;
}
.psm-price-table__pc thead th:nth-child(1) {
  width: 190px;
}
.psm-price-table__pc thead th:nth-child(2) {
  width: 210px;
}
.psm-price-table__pc tbody th,
.psm-price-table__pc tbody td {
  height: 50px; /* Figmaは60px（12行）。39行に増えたため縦長を抑えて50pxに */
  padding: 8px 12px;
  border: 1px solid var(--c-line, #c8c8c8);
  text-align: center;
  vertical-align: middle;
}
.psm-price-table__pc .psm-price-table__group {
  background: var(--c-blue-pale, #eef4ff);
  font-weight: 700;
}
.psm-price-table__pc .psm-price-table__district {
  background: #f8faff;
  font-weight: 700;
}

.psm-price-table__sp {
  display: none;
}
.psm-price-table__summary::-webkit-details-marker {
  display: none;
}
.psm-price-table__summary::marker {
  content: "";
}

/* ---------- スマホ：開閉式に切り替え ---------- */
@media (max-width: 767px) {
  .psm-price-table__pc {
    display: none;
  }
  .psm-price-table__sp {
    display: block;
  }
  .psm-price-table__row {
    margin-bottom: 20px; /* スマホ版Figma：帯66px＋間隔20px */
  }
  .psm-price-table__row:last-child {
    margin-bottom: 0;
  }
  .psm-price-table__summary {
    display: flex;
    align-items: center;
    height: 66px;
    padding: 0 20px;
    background: var(--c-blue, #265ea8);
    list-style: none;
    cursor: pointer;
  }
  .psm-price-table__summary:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
  }
  .psm-price-table__area-name {
    font: 700 18px/1.4 var(--font-sans, "Noto Sans JP", sans-serif); /* スマホ版Figma：18px Bold */
    color: #fff;
  }
  .psm-price-table__chevron {
    flex: none;
    margin-left: auto;
    width: 14px;
    height: 14px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    margin-top: -4px;
  }
  .psm-price-table__row[open] .psm-price-table__chevron {
    transform: rotate(-135deg);
    margin-top: 4px;
  }
  .psm-price-table__body {
    background: #fff;
  }
  .psm-price-table__mini {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font: 400 14px/1.4 var(--font-sans, "Noto Sans JP", sans-serif);
    color: var(--c-text, #333);
  }
  .psm-price-table__mini th,
  .psm-price-table__mini td {
    padding: 10px 4px;
    border: 1px solid var(--c-line, #c8c8c8);
    text-align: center;
    vertical-align: middle;
    overflow-wrap: anywhere;
  }
  .psm-price-table__mini thead th {
    background: var(--c-blue-pale, #eef4ff);
    font-weight: 700;
  }
  .psm-price-table__mini thead th:first-child {
    width: 31%;
  }
  .psm-price-table__mini tbody th {
    background: #f8faff;
    font-weight: 700;
  }
  .psm-price-table__mini td {
    white-space: nowrap; /* 「25〜30円」の「円」だけが次の行に落ちないように */
  }
}
@media (max-width: 374px) {
  .psm-price-table__mini {
    font-size: 13px;
  }
  .psm-price-table__mini thead th:first-child {
    width: 28%;
  }
}
