/* ===== PAGE HERO 追加要素（販売・買取ページ固有） ===== */
.page-hero__keywords {
  position: absolute;
  left: min(calc(max(24px, (100vw - 1144px) / 2) + 965px), calc(100vw - 80px));
  top: calc(140px + env(safe-area-inset-top) + 56px + 30px);
  z-index: 1;
  opacity: 0;
  transition: opacity .6s ease .8s;
}
.page-hero.is-loaded .page-hero__keywords {
  opacity: 1;
}
.page-hero__keywords a {
  text-decoration: none;
  display: block;
  font-family: 'M PLUS 1p', sans-serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: .1em;
  color: var(--orange);
  line-height: 1.7;
  text-align: center;
  white-space: nowrap;
}

/* 白枠内見出し */
.page-hero__intro .page-hero__intro-heading {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.6;
  color: #000;
  margin-bottom: 24px;
}

/* セクションタイトルの線幅をコンテンツ幅に合わせる */
.buy-content__inner .section-title { width: 100%; }
.buy-content__inner .section-title__line { width: 100%; }

/* ===== BUY CONTENT ===== */
.buy-content {
  background: var(--bg);
  padding: 80px 0 100px;
}
.buy-content__inner {
  padding: 0 max(40px, calc((100% - 1300px) / 2));
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.buy-section {
  width: 90%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

/* ===== BUY ITEM（写真＋テキスト） ===== */
.buy-item {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .65s ease .1s, transform .65s ease .1s;
}
.buy-item.is-inview {
  opacity: 1;
  transform: translateY(0);
}
.buy-item--reverse {
  flex-direction: row-reverse;
}
.buy-item__deco {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(calc(-50% + 80px));
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
}
.buy-item--reverse .buy-item__deco {
  right: auto;
  left: 0;
}
.buy-item__deco img {
  width: 378px;
  height: auto;
  display: block;
  filter: brightness(0) saturate(100%) invert(83%) sepia(15%) saturate(210%) hue-rotate(340deg);
}
.buy-item__photo {
  flex-shrink: 0;
  width: 470px;
  height: 351px;
  overflow: hidden;
}
.buy-item__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.buy-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.buy-item__heading {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 1.3;
  color: #000;
  margin-top: 10px;
}
.buy-item__text {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 31px;
  color: #000;
}

/* ===== 納車までの流れ ===== */
.flow-section {
  position: relative;
  padding-top: 58px;
}

.flow-service-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 60px 0;
  min-height: unset;
  margin-left: 0 !important;
  margin-bottom: 0 !important;
}

/* ステップ円 */
.flow-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 32px;
  margin-bottom: 36px;
  padding: 0 40px;
}
.flow-steps__line {
  position: absolute;
  top: 50%;
  left: 11%;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  width: 78%;
  height: 3px;
  background: var(--white);
  z-index: 0;
  transition: transform .4s ease 1.1s;
}
.flow-section.is-inview .flow-steps__line {
  transform: translateY(-50%) scaleX(1);
}
.flow-step {
  position: relative;
  z-index: 1;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  border: 3px solid var(--white);
  background: var(--orange);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(.85);
  transition: opacity .5s ease, transform .5s ease, background .15s linear;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.flow-step:hover,
.flow-section.is-inview .flow-step:hover {
  background: color-mix(in srgb, var(--orange) 50%, white);
  transition-delay: 0s;
}

/* flow-steps__line が nth-child(1) のためインデックスが +1 */
.flow-section.is-inview .flow-step:nth-child(2) { opacity: 1; transform: scale(1); transition-delay: .1s; }
.flow-section.is-inview .flow-step:nth-child(3) { opacity: 1; transform: scale(1); transition-delay: .25s; }
.flow-section.is-inview .flow-step:nth-child(4) { opacity: 1; transform: scale(1); transition-delay: .4s; }
.flow-section.is-inview .flow-step:nth-child(5) { opacity: 1; transform: scale(1); transition-delay: .55s; }
.flow-step__num {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 40px;
  line-height: 1;
  color: var(--white);
  flex-shrink: 0;
}
.flow-step__label {
  font-family: 'M PLUS 2', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--white);
  text-align: center;
  line-height: 1.4;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ステップカード */
.flow-cards {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 90%;
  max-width: 1280px;
  margin-bottom: 0;
}
.flow-card {
  background: var(--white);
  border-radius: 32px;
  padding: 28px 40px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease .1s, transform .6s ease .1s;
  scroll-margin-top: calc(70px + env(safe-area-inset-top) + 24px);
}
.flow-card.is-inview {
  opacity: 1;
  transform: translateY(0);
}
.flow-card__title {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: var(--orange);
  width: 300px;
  flex-shrink: 0;
  line-height: 1.4;
  padding-top: 4px;
}
.flow-card__step {
  font-size: 36px;
  margin-right: 4px;
}
.flow-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 31px;
  color: #000;
}
.flow-card__items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.flow-card__items li {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--orange);
  line-height: 1.6;
}
.flow-card__items li::before {
  content: '・';
}
.flow-card__btns {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 8px;
  justify-content: flex-end;
}
.flow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 56px;
  padding: 0 28px;
  border-radius: 16px;
  background: var(--orange);
  color: var(--white);
  border: 2px solid transparent;
  font-family: 'M PLUS 1p', sans-serif;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: .08em;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.flow-btn:hover { opacity: .8; }
.flow-card__btns .flow-btn:first-child:hover {
  opacity: 1;
  background: #ffede1;
  color: var(--orange);
  border-color: var(--orange);
}
.flow-btn__arrow {
  display: inline-block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-top: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
  transform: rotate(45deg);
}

/* ===== BUY CTA ===== */
.buy-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 30px max(40px, calc((100% - 1300px) / 2)) 0;
  width: 100%;
}
.buy-cta__text {
  font-family: 'M PLUS 2', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--white);
  text-align: center;
  letter-spacing: .05em;
}
.buy-cta__btns {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  width: 100%;
}

/* rep-btn スタイル（buy-ctaで使用） */
.rep-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  border: 2px solid var(--orange);
  font-family: 'M PLUS 1p', sans-serif;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: .1em;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .25s ease;
  min-width: 0;
  position: relative;
}
.rep-btn:hover { opacity: .8; }
.rep-btn--white {
  background: var(--white);
  color: var(--orange);
}
.rep-btn--light {
  background: var(--orange);
  color: var(--white);
  border-color: var(--white);
}
.rep-btn__arrow {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-top: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
  transform: rotate(45deg);
  flex-shrink: 0;
  position: absolute;
  right: 30px;
  top: 50%;
  margin-top: -6px;
}

/* ===== 1100px以下 ===== */
@media (max-width: 1100px) {
  .buy-content { padding-top: 30px; }
  .page-hero__keywords { display: none; }
  .buy-item__photo { width: 42%; height: auto; aspect-ratio: 4/3; }
  .buy-item__heading { font-size: 28px; }
  .flow-card { padding: 20px 28px; gap: 20px; }
  .flow-card__title { font-size: 26px; width: 200px; }
}

/* ===== 901px以上 ===== */
@media (min-width: 901px) {
  .buy-item__heading { margin-top: 0; }
}

/* ===== 701〜900px ===== */
@media (min-width: 701px) and (max-width: 900px) {
  .buy-content { padding-bottom: 50px; }
}

/* ===== 900px以下 ===== */
@media (max-width: 900px) {
  .flow-card { scroll-margin-top: calc(50px + env(safe-area-inset-top) + 24px); }
  .page-hero__keywords { display: none; }

  .buy-content { padding: 30px 0 30px; }
  .buy-content__inner { padding: 0 24px; gap: 40px; }
  .buy-section { width: 100%; gap: 30px; }
  .flow-section { padding-top: 0; }

  .buy-item,
  .buy-item--reverse {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .buy-item__photo { width: 100%; height: 240px; aspect-ratio: unset; }
  .buy-item__heading { font-size: 22px; }
  .buy-item__text { font-size: 15px; line-height: 1.9; }

  .flow-steps { gap: 16px; }
  .flow-step { width: 90px; height: 90px; padding-top: 3px; }
  .flow-section--kaitori .flow-step { padding-top: 3px; }
  .flow-step__num { font-size: 30px; }
  .flow-step__label { font-size: 13px; }

  .flow-cards { width: 100%; padding: 0 24px; box-sizing: border-box; }
  .flow-card {
    flex-direction: column;
    padding: 4px 24px 20px;
    gap: 12px;
    border-radius: 20px;
  }
  .flow-card__title { width: 100%; font-size: 22px; }
  .flow-card__step { vertical-align: -3px; }
  .flow-card__body { font-size: 14px; line-height: 1.9; }
  .flow-card__items li { font-size: 18px; }
  .flow-card__btns { gap: 12px; width: 100%; flex-wrap: nowrap; justify-content: center; }
  .flow-btn { font-size: 15px; height: 48px; padding: 0 16px; flex: 1; }

  .flow-service-box { padding: 40px 0 60px; }
  .buy-cta { padding: 40px 24px 0; gap: 24px; }
  .buy-cta__text { font-size: 16px; }
  .buy-cta__btns { width: 100%; justify-content: center; }
}

/* ===== 901px以上はボタンmax-width・中央揃え ===== */
@media (min-width: 901px) {
  .rep-btn { max-width: 300px; }
  .buy-cta__btns { justify-content: center; }
}

/* ===== 501px以上はsp-br非表示 ===== */
@media (min-width: 501px) {
  .sp-br { display: none; }
}

/* ===== 500px以下 ===== */
@media (max-width: 500px) {
  .flow-cards { gap: 10px; }
  .flow-steps { gap: 10px; padding: 0 13px; }
  .flow-step { width: 72px; height: 72px; }
  .flow-step__num { font-size: 24px; margin-bottom: -5px; }
  .flow-step__label { font-size: 12px; }
  .flow-card__btns {  flex-wrap: wrap; }
  .flow-btn { width: 100%; height: 48px; flex-shrink: 0; justify-content: center; }
  .rep-btn { font-size: 14px; letter-spacing: .05em; width: 100%; flex: none; }
  .buy-cta { padding-top: 20px; padding-left: 20px; padding-right: 20px; }
  .buy-cta__btns { gap: 10px; flex-direction: column; }
}
