/*
 * 料金ページ専用スタイル。
 * レイアウト・表・カードの見た目だけを管理し、文字サイズは共通の typography.css と tokens.css に委譲する。
 */

.p-price-hero .p-page-hero__inner {
  max-width: 920px;
}

.p-price-detail-block__lead {
  max-width: 760px;
  margin: 0 0 40px;
  color: var(--color-text);
  font-weight: 400;
  line-height: 1.9;
}

.p-price-size-grid header span,
.p-price-size-grid__fit > span {
  color: var(--color-primary);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.p-price-size-grid > article > p strong {
  font-weight: 500;
}

/* ----------------------------------------
 * サイト規模
 * ------------------------------------- */
.p-price-size-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.p-price-size-grid > article {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.p-price-size-grid header {
  padding: 26px 26px 22px;
  background: #f7f9fa;
  border-bottom: 1px solid var(--color-border);
}

.p-price-size-grid header span {
  display: block;
  margin-bottom: 6px;
}

.p-price-size-grid h3 {
  margin: 0;
}

.p-price-size-grid header strong {
  display: block;
  margin-top: 14px;
  color: var(--color-primary-dark);
  font-size: var(--font-size-item-title);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.02em;
}

.p-price-size-grid header small {
  display: block;
  margin-top: 6px;
  color: var(--color-text);
  font-size: var(--font-size-body);
  font-weight: 400;
  line-height: 1.7;
}

.p-price-size-grid__fit {
  min-height: 220px;
  margin: 20px 26px 0;
  padding: 18px 18px 20px;
  background: #f7f9fc;
}

.p-price-size-grid__fit > span {
  display: block;
  margin-bottom: 6px;
  line-height: 1.5;
}

.p-price-size-grid__fit h4 {
  margin: 0;
  color: var(--color-heading);
  font-weight: 500;
}

.p-price-size-grid__fit p {
  margin: 8px 0 0;
  color: var(--color-text);
  font-weight: 400;
  line-height: 1.8;
}

.p-price-size-grid > article > p {
  margin: 0;
  padding: 20px 26px 0;
  color: var(--color-text);
}

.p-price-size-grid ul {
  padding: 14px 26px 22px;
  margin: 0;
  list-style: none;
}

.p-price-size-grid li {
  position: relative;
  padding: 7px 0 7px 18px;
  color: #33434d;
  border-bottom: 1px solid #edf1f3;
}

.p-price-size-grid li:last-child {
  border-bottom: 0;
}

.p-price-size-grid li::before {
  position: absolute;
  top: 17px;
  left: 2px;
  width: 6px;
  height: 6px;
  content: "";
  background: var(--color-primary);
  border-radius: 50%;
}

/* ----------------------------------------
 * 料金表 共通
 * ------------------------------------- */
.p-price-detail-block {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--color-border);
}

.p-price-table-wrap {
  width: 100%;
  margin-top: 36px;
  overflow-x: auto;
  background: #fff;
  border: 1px solid #dce3e8;
  border-radius: var(--radius-lg);
  -webkit-overflow-scrolling: touch;
}

.p-price-table-wrap:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 4px;
}

.p-price-table {
  width: 100%;
  min-width: 880px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--color-text);
  font-weight: 400;
  line-height: 1.7;
}

.p-price-table th,
.p-price-table td {
  padding: 19px 20px;
  vertical-align: middle;
  text-align: left;
  border-right: 1px solid #e3e8ec;
  border-bottom: 1px solid #e3e8ec;
}

.p-price-table th:last-child,
.p-price-table td:last-child {
  border-right: 0;
}

.p-price-table tbody tr:last-child th,
.p-price-table tbody tr:last-child td {
  border-bottom: 0;
}

.p-price-table thead th {
  color: var(--color-primary-dark);
  background: #f3f6f8;
  border-bottom-color: #d6dfe5;
  font-weight: 500;
  line-height: 1.55;
}

.p-price-table thead th small {
  display: block;
  margin-top: 3px;
  color: #667681;
  font-size: var(--font-size-body);
  font-weight: 400;
  line-height: 1.5;
}

.p-price-table tbody th {
  color: var(--color-text);
  background: #f8fafb;
  font-weight: 500;
  line-height: 1.65;
}

.p-price-table tbody td {
  color: #3f4d56;
  background: #fff;
  font-weight: 400;
}

.p-price-table td strong {
  color: var(--color-text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.p-price-table td small {
  display: block;
  margin-top: 4px;
  color: var(--color-text);
  font-size: var(--font-size-body);
  font-weight: 400;
  line-height: 1.6;
}

.p-price-mobile-cards {
  display: none;
}

/* 制作料金表は料金列を揃え、補足列を広く取る。 */
.p-price-detail-block .p-price-table thead th:first-child,
.p-price-detail-block .p-price-table tbody th {
  width: 21%;
}

.p-price-detail-block .p-price-table thead th:nth-child(2),
.p-price-detail-block .p-price-table thead th:nth-child(3),
.p-price-detail-block .p-price-table thead th:nth-child(4),
.p-price-detail-block .p-price-table tbody td:nth-child(2),
.p-price-detail-block .p-price-table tbody td:nth-child(3),
.p-price-detail-block .p-price-table tbody td:nth-child(4) {
  width: 15%;
  text-align: center;
}

.p-price-detail-block .p-price-table thead th:nth-child(5),
.p-price-detail-block .p-price-table tbody td:nth-child(5) {
  width: 34%;
}

.p-price-detail-block .p-price-table tbody td:nth-child(5) {
  color: #53636d;
}

.p-price-detail-block .p-price-table tbody td:nth-child(2) strong,
.p-price-detail-block .p-price-table tbody td:nth-child(3) strong,
.p-price-detail-block .p-price-table tbody td:nth-child(4) strong {
  display: inline-block;
  line-height: 1.5;
}

.p-price-table__total th,
.p-price-table__total td {
  background: #f3f6f8;
  border-top: 1px solid #cfd8df;
}

.p-price-table__total th,
.p-price-table__total td strong,
.p-price-table__required th,
.p-price-table__required td strong {
  color: var(--color-text);
  font-weight: 500;
}

.p-price-table__required th,
.p-price-table__required td {
  background: #f4f7ff;
}

/* ----------------------------------------
 * 保守料金表
 * ------------------------------------- */
.p-price-table--maintenance {
  min-width: 960px;
}

.p-price-table--maintenance thead th:first-child,
.p-price-table--maintenance tbody th {
  width: 31%;
}

.p-price-table--maintenance thead th:not(:first-child),
.p-price-table--maintenance tbody td:not(:first-child) {
  width: 23%;
  text-align: center;
}

.p-price-table--maintenance tbody tr:first-child td {
  vertical-align: top;
  text-align: left;
}

.p-price-table--maintenance thead th:not(:first-child) {
  background: #f1f5f8;
}

.p-price-table--maintenance thead th span,
.p-price-table--maintenance thead th strong {
  display: block;
}

.p-price-table--maintenance thead th span {
  margin-bottom: 6px;
  font-weight: 500;
}

.p-price-table--maintenance thead th strong {
  color: var(--color-text);
  font-size: var(--font-size-item-title);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.p-price-table--maintenance tbody td,
.p-price-table--maintenance tbody td strong {
  font-weight: 400;
}

/* ----------------------------------------
 * オプション
 * ------------------------------------- */
.p-price-option-groups {
  display: grid;
  gap: 48px;
  margin-top: 40px;
}

.p-price-option-groups > section > header {
  margin-bottom: 18px;
}

.p-price-option-groups h3 {
  margin: 0;
}

.p-price-option-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.p-price-option-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
  padding: 22px 24px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.p-price-option-list article:nth-child(even) {
  border-right: 0;
}

.p-price-option-list article:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.p-price-option-list h4 {
  margin: 0;
}

.p-price-option-list p {
  margin: 5px 0 0;
  color: var(--color-text);
}

.p-price-option-list strong {
  flex: 0 0 auto;
  color: var(--color-primary-dark);
  font-size: var(--font-size-body);
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

/* ----------------------------------------
 * 注記・シミュレーター導線
 * ------------------------------------- */
.p-price-note {
  max-width: 980px;
  margin: 18px 0 0;
  color: var(--color-text);
  font-weight: 400;
  line-height: 1.8;
}

.p-price-note + .c-button-group {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 32px;
}

@media (max-width: 1024px) {
  .p-price-size-grid {
    grid-template-columns: 1fr;
  }

  .p-price-size-grid > article {
    max-width: 760px;
  }

  .p-price-size-grid__fit {
    min-height: 0;
  }
}

@media (max-width: 800px) {
  .p-price-table thead th:first-child,
  .p-price-table tbody th {
    position: sticky;
    left: 0;
    z-index: 2;
  }

  .p-price-table thead th:first-child {
    z-index: 3;
    box-shadow: 1px 0 0 #d6dfe5;
  }

  .p-price-table tbody th {
    box-shadow: 1px 0 0 #e3e8ec;
  }

  .p-price-table__total th {
    background: #f3f6f8;
  }

  .p-price-table__required th {
    background: #f4f7ff;
  }

  .p-price-option-list {
    grid-template-columns: 1fr;
  }

  .p-price-option-list article,
  .p-price-option-list article:nth-child(even),
  .p-price-option-list article:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
  }

  .p-price-option-list article:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 720px) {
  .p-price-table-wrap {
    display: none;
  }

  .p-price-mobile-cards {
    display: grid;
    gap: 16px;
    margin-top: 28px;
  }

  .p-price-mobile-card {
    padding: 20px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }

  .p-price-mobile-card > h3,
  .p-price-mobile-card--plan header h3 {
    margin: 0;
    color: var(--color-heading);
    font-weight: 500;
  }

  .p-price-mobile-card > p,
  .p-price-mobile-card--plan header p {
    margin: 8px 0 0;
    color: var(--color-text);
    line-height: 1.8;
  }

  .p-price-mobile-card dl {
    margin: 18px -20px -20px;
  }

  .p-price-mobile-card dl > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(104px, auto);
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-top: 1px solid var(--color-border);
  }

  .p-price-mobile-card dt,
  .p-price-mobile-card dd {
    margin: 0;
    line-height: 1.65;
  }

  .p-price-mobile-card dt {
    color: var(--color-text);
  }

  .p-price-mobile-card dt small {
    display: block;
    margin-top: 2px;
    color: var(--color-text-secondary);
    font-size: var(--font-size-body);
  }

  .p-price-mobile-card dd {
    color: var(--color-heading);
    font-weight: 500;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .p-price-mobile-card--total {
    background: #f8fafb;
  }

  .p-price-mobile-card--required {
    background: #f4f7ff;
    border-color: var(--color-primary-light);
  }

  .p-price-mobile-card--plan header {
    padding: 20px;
    margin: -20px -20px 0;
    background: #f3f6f8;
    border-bottom: 1px solid var(--color-border);
  }

  .p-price-mobile-card--plan header strong {
    display: block;
    margin-top: 6px;
    color: var(--color-primary-dark);
    font-size: var(--font-size-item-title);
    font-weight: 500;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
  }

  .p-price-mobile-card--plan dl {
    margin-top: 0;
  }

  .p-price-mobile-card--plan dl > div:first-child {
    border-top: 0;
  }
}

@media (max-width: 640px) {
  .p-price-size-grid {
    gap: 14px;
    margin-top: 28px;
  }

  .p-price-size-grid header,
  .p-price-size-grid > article > p,
  .p-price-size-grid ul {
    padding-right: 20px;
    padding-left: 20px;
  }

  .p-price-size-grid__fit {
    margin-right: 20px;
    margin-left: 20px;
    padding: 16px 16px 18px;
  }

  .p-price-detail-block {
    margin-top: 48px;
    padding-top: 36px;
  }

  .p-price-option-groups {
    gap: 36px;
    margin-top: 32px;
  }

  .p-price-option-list article {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
  }

  .p-price-option-list strong {
    text-align: left;
  }

  .p-price-note + .c-button-group {
    margin-top: 24px;
  }
}
