/* 検索結果・価格履歴 */
.history-main {
  padding-block: 2rem 3rem;
  min-height: 65vh;
}

.history-main h1 {
  font-size: 2rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.history-main h2 {
  font-size: 1.375rem;
  margin-block: 1.75rem 1rem;
}

.result-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.result-card,
.history-panel,
.spec-panel {
  padding: 1.5rem;
  border: 0.0625rem solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.result-card h3 {
  font-size: 1.125rem;
  margin: 0 0 0.75rem;
}

.result-card h3 a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.result-card p {
  margin-block: 0.375rem;
  font-size: 0.875rem;
}

.product-code {
  overflow-wrap: anywhere;
  color: var(--muted);
}

.pagination,
.channel-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-block: 1.5rem;
}

.pagination a,
.channel-tabs a {
  padding: 0.625rem 1rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  background: white;
  color: var(--blue);
}

.channel-tabs a[aria-current] {
  background: var(--navy);
  color: white;
}

.history-notice {
  border-left: 0.25rem solid var(--blue);
  padding: 0.75rem 1rem;
  background: #e7f1fa;
}

.price-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-block: 1.5rem;
}

.price-summary > div {
  padding: 1.25rem;
  background: white;
  border: 0.0625rem solid var(--line);
  border-radius: var(--radius);
}

.price-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
}

.price-summary strong {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.5rem;
}

.price-summary small {
  font-size: 0.875rem;
}

.spec-panel {
  margin-bottom: 1.5rem;
}

.spec-panel h2,
.history-panel h2 {
  margin-top: 0;
}

.spec-list > div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  padding-block: 0.5rem;
  border-bottom: 0.0625rem solid var(--line);
}

.spec-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.history-chart {
  overflow-x: auto;
}

.history-chart svg {
  display: block;
  width: 100%;
  min-width: 32rem;
}

.history-chart text {
  fill: var(--muted);
  font-size: 0.8125rem;
}

.history-grid {
  stroke: var(--line);
}

.history-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 0.1875rem;
  stroke-linejoin: round;
}

.history-dot {
  fill: var(--blue);
}

.history-table {
  min-width: 0;
  font-size: 0.875rem;
  margin-top: 1.5rem;
}

.history-table caption {
  text-align: left;
  padding-block: 0.75rem;
}

.history-table td:first-child {
  text-align: left;
  font-weight: normal;
}

.history-table td:last-child {
  text-align: right;
}

/* スマートフォン */
@media (max-width: 47.9375em) {
  .history-main h1 {
    font-size: 1.5rem;
  }

  .result-list,
  .price-summary {
    grid-template-columns: 1fr;
  }

  .history-panel,
  .spec-panel,
  .result-card {
    padding: 1rem;
  }
}

/* 長い商品名や価格表はカード内で折り返し・スクロールする */
.result-card,
.history-panel,
.spec-panel,
.price-summary > div {
  min-width: 0;
}

.history-main .header-inner,
.history-main .search-form {
  min-width: 0;
}
/* 価格履歴の続きと、構成・購入先との間隔 */
.history-more { margin-top: 1rem; }
.history-more summary {
  width: fit-content;
  padding: 0.75rem 1rem;
  border: 0.0625rem solid var(--line);
  border-radius: 0.5rem;
  color: var(--blue);
  cursor: pointer;
}
.history-more summary:focus-visible {
  outline: 0.1875rem solid var(--blue);
  outline-offset: 0.1875rem;
}
.history-panel + .spec-panel { margin-top: 1.5rem; }

/* 価格を確認した直後と、構成情報を読んだ後の購入ボタン */
.price-summary-action { margin-top: 1rem; }
.history-main .purchase-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 32rem;
  min-height: 3.5rem;
  padding: 1rem 1.25rem;
  text-align: center;
  line-height: 1.6;
  font-size: 1rem;
  color: #fff;
}
.history-main .purchase-link:hover { background: var(--navy); }
.history-main .purchase-link:focus-visible {
  outline: 0.1875rem solid var(--blue);
  outline-offset: 0.1875rem;
}
