.p-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

.p-table.p-table {
  --p-table-actions-width: 156px;
  --p-table-photo-width: 132px;
  --p-table-product-width: 210px;
  --p-table-price-width: 170px;
  --p-table-stock-width: 104px;
  --p-table-short-width: 112px;
  --p-table-long-width: 220px;
  --p-table-heading-height: 52px;
  --p-table-row-min-height: 108px;
  --p-table-action-width: 132px;
  --p-table-action-height: 37px;
  --p-table-photo-frame-width: 112px;
  --p-table-photo-frame-height: 88px;
  width: max-content;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  line-height: 1.45;
}

.p-table.p-table--fill {
  width: 100%;
  min-width: calc(
    var(--p-table-actions-width) +
    var(--p-table-photo-width) +
    var(--p-table-product-width) +
    var(--p-table-price-width) +
    var(--p-table-stock-width)
  );
}

.p-table.p-table--fill .p-col-product {
  width: auto;
  max-width: none;
}

.p-table th,
.p-table td {
  padding: 10px 12px;
  border-right: 1px solid var(--line, #e7e7ea);
  border-bottom: 1px solid var(--line, #e7e7ea);
  vertical-align: middle;
}

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

.p-table thead th {
  height: var(--p-table-heading-height);
  padding-block: 8px;
  white-space: nowrap;
  background: #161619;
  color: #fff;
  vertical-align: middle;
}

.p-table tbody tr {
  height: var(--p-table-row-min-height);
}

.p-table .p-col-actions {
  width: var(--p-table-actions-width);
  min-width: var(--p-table-actions-width);
  max-width: var(--p-table-actions-width);
  text-align: center;
}

.p-table .p-col-photo {
  width: var(--p-table-photo-width);
  min-width: var(--p-table-photo-width);
  max-width: var(--p-table-photo-width);
  padding-inline: 10px;
  text-align: center;
}

.p-table .p-col-product {
  width: var(--p-table-product-width);
  min-width: var(--p-table-product-width);
  max-width: var(--p-table-product-width);
}

.p-table .p-col-price {
  width: var(--p-table-price-width);
  min-width: var(--p-table-price-width);
  max-width: var(--p-table-price-width);
  white-space: nowrap;
}

.p-table .p-col-stock {
  width: var(--p-table-stock-width);
  min-width: var(--p-table-stock-width);
  max-width: var(--p-table-stock-width);
  white-space: nowrap;
}

.p-table .p-col-short {
  width: var(--p-table-short-width);
  min-width: var(--p-table-short-width);
  max-width: 160px;
  white-space: nowrap;
}

.p-table .p-col-long {
  width: var(--p-table-long-width);
  min-width: 180px;
  max-width: 240px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-break: strict;
}

.p-actions {
  display: flex;
  min-width: var(--p-table-action-width);
  align-items: center;
  flex-direction: column;
  gap: 6px;
}

.p-table td .p-action {
  margin: 0;
  width: var(--p-table-action-width);
  min-width: var(--p-table-action-width);
  max-width: var(--p-table-action-width);
  height: var(--p-table-action-height);
  min-height: var(--p-table-action-height);
  max-height: var(--p-table-action-height);
  box-sizing: border-box;
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.2;
}

.p-table .p-action--compare,
.p-table .p-action--rental,
.p-table .p-action--request {
  display: inline-flex;
  flex: 0 0 auto;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid #b0000d;
  border-radius: 8px;
  background: #fff;
  color: #b0000d;
  font-size: 11.5px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.p-table .p-action--compare[aria-pressed="true"] {
  border-color: #202126;
  background: #202126;
  color: #fff;
}

.p-table .p-action--rental {
  background: #b0000d;
  color: #fff;
}

.p-table .p-action--request {
  border-color: #c8102e;
  background: #fff;
  color: #c8102e;
}

.p-table .p-photo {
  display: flex;
  width: var(--p-table-photo-frame-width);
  height: var(--p-table-photo-frame-height);
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  margin: auto;
  padding: 5px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e3e3e8;
  border-radius: 8px;
}

.p-table .p-photo__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  object-fit: contain;
  background: transparent;
  border: 0;
  border-radius: 0;
}

/* 機種の欄：商品名を1行目、メーカーや商品IDを2行目に置く */
.p-table .p-col-product {
  text-align: left;
}

.p-product {
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: left;
}

.p-table .p-product > a,
.p-table .p-product > b {
  font-weight: 700;
  line-height: 1.5;
}

.p-table .p-product small {
  color: #5f646d;
  font-size: 11.5px;
  line-height: 1.5;
}

.p-table .p-product > * {
  min-width: 0;
}

tr[data-rental-state="unavailable"],
tr.norent[data-norent="1"] {
  background: #fafafa;
  color: #8a8f95;
}

[data-rental-state="unavailable"] :is(td, th, p, span, small, b, strong, em, div, a):not(.p-action),
.norent[data-norent="1"] :is(td, th, p, span, small, b, strong, em, div, a):not(.p-action) {
  color: #8a8f95;
}

/* 画面幅ではなく親の幅に合わせる（親が本文幅を決める） */

/* ポータル側の「見出しセルは折り返さない」指定に負けないようにする */
.p-table tbody th.p-col-product,
.p-table .p-product,
.p-table .p-product > * {
  white-space: normal;
  word-break: break-word;
}

/* 機種×仕様の比較表 */
.p-spec-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.p-spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.55;
}

.p-spec-scroll .p-spec-table th,
.p-spec-scroll .p-spec-table td {
  padding: 12px 14px;
  border-right: 1px solid #e7e7ea;
  border-bottom: 1px solid #e7e7ea;
  text-align: left;
  vertical-align: top;
}

.p-spec-scroll .p-spec-table thead th {
  padding-block: 16px;
  background: #161619;
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.p-spec-scroll .p-spec-table .p-spec-key {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  border-right-color: #c9c9cf;
  font-weight: 700;
  white-space: normal;
}

.p-spec-scroll .p-spec-table thead .p-spec-key {
  z-index: 2;
  background: #161619;
}

.p-spec-scroll .p-spec-table tbody tr:last-child > * {
  border-bottom: 1px solid #e7e7ea;
}

.p-spec-scroll .p-spec-model {
  min-width: 0;
}

.p-spec-scroll .p-spec-model img {
  max-width: 80px;
  height: auto;
}

@media (max-width: 390px) {
  .p-spec-scroll .p-spec-table .p-spec-key {
    width: 112px;
    min-width: 112px;
  }

  .p-spec-scroll .p-spec-table :is(th, td):not(.p-spec-key) {
    min-width: 150px;
  }
}

/* 比較・レンタルのボタン：表の外（商品カードなど）でも同じ見た目にする */
.p-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #b0000d;
  border-radius: 8px;
  background: #fff;
  color: #b0000d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.p-action.p-action--rental,
.p-action.p-btn--primary {
  background: #b0000d;
  border-color: #b0000d;
  color: #fff;
}

.p-action.p-action--compare[aria-pressed="true"],
.p-action.p-btn--secondary[aria-pressed="true"] {
  background: #202126;
  border-color: #202126;
  color: #fff;
}

/* 表の中：ポータルごとの色指定より優先して、比較＝白地に赤枠、レンタル＝赤地に白字にそろえる */
.p-table .p-actions .p-action.p-btn--secondary,
.p-table .p-actions .p-action.p-action--compare {
  background: #fff;
  border: 1px solid #b0000d;
  border-radius: 8px;
  color: #b0000d;
}

.p-table .p-actions .p-action.p-btn--primary,
.p-table .p-actions .p-action.p-action--rental {
  background: #b0000d;
  border: 1px solid #b0000d;
  border-radius: 8px;
  color: #fff;
}

.p-table .p-actions .p-action[aria-pressed="true"] {
  background: #202126;
  border-color: #202126;
  color: #fff;
}
