/* 送信完了メッセージ — sticky ヘッダー下に収まるようスクロール余白 */
.ppf-quote-section,
.ppf-quote-section .gform_confirmation_wrapper,
.ppf-quote-section .gform_confirmation_message {
  scroll-margin-top: calc(var(--ppf-site-header-offset, 56px) + 12px);
}

/* PPF × Gravity Forms — オーバーレイ（sticky CTA モーダル 100050 より前面） */

.ppf-gf-dialog {
  position: fixed;
  inset: 0;
  z-index: 100010;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.ppf-gf-dialog.is-open {
  display: flex;
  z-index: 100100 !important;
}

.ppf-gf-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.ppf-gf-dialog__panel {
  position: relative;
  z-index: 1;
  width: min(26.25rem, 100%);
  padding: 1.5rem 1.35rem 1.25rem;
  background: #fff;
  border: 0.125rem solid #0d0d0d;
  box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.2);
}

.ppf-gf-dialog__message {
  margin: 0 0 1.25rem;
  color: #1a1a1a;
  line-height: 1.65;
  font-size: 0.95rem;
}

.ppf-gf-dialog__ok {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: #0d0d0d;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.ppf-gf-dialog__ok:hover {
  background: #333;
}

/* PC 2カラム — 列間余白・左列（車種・年式・プラン） */
@media (min-width: 992px) {
  .ppf-quote-section .ppf-gravity-form-slot[data-gf-form-id='17'] {
    --ppf-gf-col-gap: clamp(2.5rem, 5vw, 4rem);
  }

  .ppf-quote-section #gform_wrapper_17 .gform_fields,
  .ppf-quote-section .ppf-gravity-form-slot[data-gf-form-id='17'] .gform_fields {
    gap: var(--ppf-gf-col-gap, clamp(2.5rem, 5vw, 4rem)) !important;
  }

  .ppf-quote-section #gform_wrapper_17 .gform_footer,
  .ppf-quote-section .ppf-gravity-form-slot[data-gf-form-id='17'] .gform_footer {
    width: calc(50% - var(--ppf-gf-col-gap, clamp(2.5rem, 5vw, 4rem)) / 2) !important;
    max-width: calc(50% - var(--ppf-gf-col-gap, clamp(2.5rem, 5vw, 4rem)) / 2) !important;
    padding-left: calc(var(--ppf-gf-col-gap, clamp(2.5rem, 5vw, 4rem)) / 2) !important;
  }

  .ppf-quote-section #gform_wrapper_17 .ppf-gf-layout-left .gchoice,
  .ppf-quote-section #gform_wrapper_17 #field_17_4 .gchoice,
  .ppf-quote-section #gform_wrapper_17 #field_17_6 .gchoice,
  .ppf-quote-section .ppf-gravity-form-slot[data-gf-form-id='17'] .ppf-gf-layout-left .gchoice {
    writing-mode: horizontal-tb !important;
    white-space: normal !important;
    word-break: break-word;
  }
}

/* モバイル — ご希望プラン：ボタンで開く選択 UI */
@media (max-width: 991.98px) {
  .ppf-gf-plan-field--mobile .gfield_radio,
  .ppf-gf-plan-field--mobile .gfield_checkbox {
    position: absolute !important;
    width: 0.0625rem !important;
    height: 0.0625rem !important;
    margin: -0.0625rem !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .ppf-gf-plan-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin: 0;
    padding: 1rem 1.1rem;
    border: 0.125rem solid rgba(0, 0, 0, 0.22);
    background: #fff;
    color: #1a1a1a;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  .ppf-gf-plan-trigger::after {
    content: '変更';
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0d0d0d;
    padding: 0.35em 0.65em;
    border: 0.0625rem solid rgba(0, 0, 0, 0.2);
    background: var(--ppf-gold, #ffc107);
  }

  .ppf-gf-plan-trigger:not(.has-value) {
    color: #555;
    font-weight: 500;
  }

  .ppf-gf-plan-trigger:not(.has-value)::after {
    content: '選択';
  }

  .ppf-gf-plan-trigger:focus {
    outline: none;
    border-color: #0d0d0d;
    box-shadow: 0 0 0 0.15rem rgba(0, 0, 0, 0.12);
  }

  .ppf-gf-plan-trigger.has-value {
    border-color: #0d0d0d;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
  }
}

.ppf-gf-plan-sheet {
  position: fixed;
  inset: 0;
  z-index: 100020;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.ppf-gf-plan-sheet.is-open {
  display: flex;
  z-index: 100100 !important;
}

body.ppf-gf-plan-sheet-open {
  overflow: hidden;
}

.ppf-gf-plan-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.ppf-gf-plan-sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 32.5rem;
  max-height: min(78vh, 32.5rem);
  overflow: auto;
  padding: 1.25rem 1rem 1rem;
  background: #fff;
  border-top: 0.1875rem solid var(--ppf-gold, #ffc107);
  box-shadow: 0 -0.5rem 2rem rgba(0, 0, 0, 0.2);
  animation: ppfGfPlanSheetUp 0.28s ease;
}

@keyframes ppfGfPlanSheetUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.ppf-gf-plan-sheet__title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  color: #1a1a1a;
}

.ppf-gf-plan-sheet__options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ppf-gf-plan-sheet__option {
  width: 100%;
  padding: 0.95rem 1rem;
  border: 0.0625rem solid rgba(0, 0, 0, 0.18);
  background: #fafafa;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.ppf-gf-plan-sheet__option:hover,
.ppf-gf-plan-sheet__option:focus {
  outline: none;
  border-color: #0d0d0d;
  background: #fff;
}

.ppf-gf-plan-sheet__option.is-selected {
  border-color: #0d0d0d;
  background: rgba(255, 193, 7, 0.25);
  box-shadow: inset 0 0 0 0.0625rem #0d0d0d;
}

.ppf-gf-plan-sheet__cancel {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.75rem;
  border: none;
  background: #eee;
  color: #333;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.ppf-gf-plan-sheet__cancel:hover {
  background: #e0e0e0;
}

@media (min-width: 992px) {
  .ppf-gf-plan-trigger,
  .ppf-gf-plan-sheet {
    display: none !important;
  }
}
