/* 展示車両：API 埋め込み + sample.css #section-stock1 をベースにレイアウト */

.carlist-root {
  width: 100%;
  align-self: stretch;
  min-height: 120px;
}

.carlist-loading,
.carlist-empty,
.carlist-error {
  font-size: 12px;
  line-height: 1.6;
  color: var(--black);
  margin: 0;
  padding: 16px 0;
}

.carlist-error {
  color: #b42318;
}

/* ----- 本文ラッパー ----- */
.carlist-wp-content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--black);
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.carlist-wp-content > *:first-child {
  margin-top: 0;
}

.carlist-wp-content > *:last-child {
  margin-bottom: 0;
}

.carlist-wp-content img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.carlist-wp-content figure {
  margin: 1em 0;
  max-width: 100%;
}

.carlist-wp-content iframe {
  max-width: 100%;
}

/* ----- sample #section-stock1 相当（.section-stock1 = PC/SP 共通クラス） ----- */
/* WP 側で id="carlist" のコンテナは JS で .wp-stock-carlist に変換済み */

.section-stock1 .carlist-wp-content div {
  padding: 0;
  color: #777;
  font-size:12px;
  text-align: center;
}

.section-stock1 .carlist-wp-content div.price-div {
  text-align: left;
}

.section-stock1 .smaillogohtml {
  max-width: 280px;
  margin: 120px auto;
}

.section-stock1 .sections {
  text-align: center;
  margin: 80px auto;
  width: 100%;
}

.section-stock1 h3.titleh3 {
  font-size: 48px;
  font-weight: 600;
  color: #777;
  margin: 3px auto 30px;
}

@media screen and (max-width: 1023px) {
  .section-stock1 h3.titleh3 {
    font-size: 28px;
  }
}

/* 在庫グリッドのルート（旧 #carlist） */
.section-stock1 .wp-stock-carlist {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  width: 100%;
  height: auto;
  box-sizing: border-box;
}

/* PC：3台横並び */
.section-stock1 .row1 {
  box-sizing: border-box;
  width: 33.33333333%;
  text-align: left;
}

.section-stock1 .row2 {
  margin: 12px;
}

.section-stock1 .row2 a {
  position: relative;
  text-decoration: none;
  color: #1d1d1d;
  display: block;
  transition: transform 0.2s;
}

.screen .section-stock1 .carlist-wp-content .row2 a {
  display: block;
}

.section-stock1 .row2 a:active {
  transform: scale(0.95);
}

.section-stock1 .mainjson {
  max-width: 1300px;
  margin: 2px auto;
}

.section-stock1 .UsedCarDesc {
  background: #f0f0f0;
  font-weight: 600;
  padding: 20px;
  min-height: 84px;
}

.section-stock1 div.row1 p.CarName {
  border-left: 6px solid #e8080b;
  padding: 6px 13px;
  color: var(--maincolor);
  font-size: 0.8rem;
  font-weight: 600;
}

.section-stock1 p.TotalPriceViewFlag {
  color: var(--maincolor);
  font-size: 24px;
  font-weight: 600;
}

.section-stock1 span.gtitle2 {
  display: block;
  font-size: 12px;
  margin: 7px 0 0;
}

.section-stock1 .wp-block-button {
  margin: 30px auto;
}

.section-stock1 .wp-block-button a.wp-block-button__link {
  font-size: 20px;
  color: #fff;
  background: var(--maincolor);
  padding: 14px 18px 15px;
  border-radius: 8px;
  display: block;
  width: 220px;
  max-width: 100%;
  margin: 10px auto;
  transition: transform 0.2s;
}

.screen .section-stock1 .wp-block-button a.wp-block-button__link {
  display: block;
}

.section-stock1 .wp-block-button a.wp-block-button__link:active {
  transform: scale(0.95);
}

/* スマホ：2台ずつ横並び */
@media screen and (max-width: 1023px) {
  .section-stock1 .wp-stock-carlist {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
    margin-left: -4px;
    margin-right: -4px;
    width: calc(100% + 8px);
  }

  .section-stock1 .row1 {
    box-sizing: border-box;
    width: 50%;
    max-width: 50%;
    flex: 0 0 50%;
    padding-left: 4px;
    padding-right: 4px;
  }

  .section-stock1 .row2 {
    margin: 8px 4px 12px;
  }

  .section-stock1 div.row1 p.CarName {
    font-size: 14px;
  }

  .section-stock1 p.TotalPriceViewFlag {
    font-size: 16px;
  }
}

/* globals より優先（在庫カード内リンク） */
.screen .section-stock1 .carlist-wp-content .row2 a {
  display: block;
  color: #1d1d1d;
  text-decoration: none;
}

.screen .section-stock1 .carlist-wp-content .wp-block-button a.wp-block-button__link {
  display: block;
  color: #fff;
  text-decoration: none;
}

.screen .carlist-wp-content a {
  display: inline;
  color: var(--maincolor);
  text-decoration: underline;
}

.index .stock,
.sp .stock-1 {
  height: auto;
}
