/**
 * Shared two-column funnel layout — landing (.plf-wrap) + checkout (.pco-wrap).
 * Keeps the right (checkout) column the same width on offer and checkout pages.
 */

body.pay-landing-body,
body.pay-funnel-body {
  --funnel-split-max: var(--funnel-layout-max, 1080px);
  --funnel-split-pad-x: var(--funnel-layout-pad-x, 20px);
  --funnel-split-pad-top: 32px;
  --funnel-split-pad-bottom: 24px;
  --funnel-split-gap: 32px;
  --funnel-split-main: 1.08fr;
  --funnel-split-side-min: 320px;
  --funnel-split-side-max: 400px;
  --funnel-split-cols: minmax(0, var(--funnel-split-main))
    minmax(var(--funnel-split-side-min), var(--funnel-split-side-max));
}

@media (max-width: 760px) {
  body.pay-landing-body,
  body.pay-funnel-body {
    --funnel-split-gap: 24px;
    --funnel-split-pad-top: 20px;
    --funnel-split-pad-bottom: 16px;
  }
}

@media (max-width: 480px) {
  body.pay-landing-body,
  body.pay-funnel-body {
    --funnel-split-gap: 20px;
    --funnel-split-pad-top: 16px;
    --funnel-split-pad-bottom: 12px;
  }
}

/* One shell gutter — inner grid uses full inner width */
.pay-landing-shell.funnel-page-shell:has(.plf-wrap),
body.pay-funnel-checkout-aligned .pay-landing-shell.funnel-page-shell {
  max-width: var(--funnel-split-max);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: var(--funnel-split-pad-top) var(--funnel-split-pad-x) var(--funnel-split-pad-bottom);
  box-sizing: border-box;
}

.plf-wrap,
body.pay-funnel-checkout-aligned .pay-landing-shell .pco-wrap {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: var(--funnel-split-cols);
  gap: var(--funnel-split-gap);
  align-items: stretch;
  box-sizing: border-box;
  min-width: 0;
}

.plf-content-col,
.pco-context,
.plf-main,
.plf-sticky,
.pco-sticky {
  min-width: 0;
}

.plf-sticky,
.pco-sticky {
  align-self: start;
}

.plf-card,
.pco-card {
  width: 100%;
  box-sizing: border-box;
}

/* ── Mobile: single column, full-width checkout card ── */
@media (max-width: 760px) {
  .pay-landing-shell.funnel-page-shell:has(.plf-wrap) {
    display: flex;
    flex-direction: column;
  }

  .plf-wrap,
  body.pay-funnel-checkout-aligned .pay-landing-shell .pco-wrap {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
    gap: var(--funnel-split-gap);
  }

  .plf-wrap .plf-content-col {
    display: contents;
  }

  .plf-wrap .plf-main {
    order: 1;
  }

  .plf-wrap .plf-sticky {
    order: 2;
    width: 100%;
    max-width: none;
  }

  .plf-wrap .funnel-profile-slot--pre-footer {
    order: 3;
    margin-top: 4px;
    padding: 0;
    flex-shrink: 0;
  }

  body.pay-funnel-checkout-aligned .pco-context {
    order: 1;
  }

  body.pay-funnel-checkout-aligned .pco-sticky {
    order: 2;
    width: 100%;
    max-width: none;
  }

  /* Thank-you: fulfilment card before product context on phone */
  body.pay-funnel-checkout-aligned .pco-thanks-wrap .pco-sticky,
  .pco-thanks-wrap .pco-sticky {
    order: 1;
  }

  body.pay-funnel-checkout-aligned .pco-thanks-wrap .pco-context,
  .pco-thanks-wrap .pco-context {
    order: 2;
  }

  .plf-card,
  .pco-card {
    padding: 20px 16px;
  }

  .plf-cta-btn {
    font-size: 15px;
    padding: 14px 20px;
  }
}

@media (max-width: 480px) {
  .plf-card,
  .pco-card {
    padding: 16px 14px;
  }
}
