.checkout-page {
  background: var(--paper);
}

.checkout-intro {
  padding-top: clamp(4.75rem, 9vw, 9rem);
  padding-bottom: clamp(3.5rem, 7vw, 6.5rem);
}

.checkout-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(20rem, 0.92fr);
  gap: clamp(3rem, 9vw, 10rem);
  max-width: var(--max);
  margin: 0 auto;
}

.checkout-intro h1 {
  max-width: 52rem;
  margin: 2.25rem 0 0;
  font-size: clamp(4rem, 9vw, 9rem);
  font-weight: 400;
  letter-spacing: -0.08em;
  line-height: 0.83;
}

.checkout-intro-grid > p {
  align-self: end;
  max-width: 31rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.45rem);
}

.checkout-section {
  padding: 0 var(--page-x) var(--section-y);
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(20rem, 0.76fr) minmax(32rem, 1.24fr);
  min-width: 0;
  max-width: var(--max);
  margin: 0 auto;
  border-top: 0.0625rem solid var(--line);
  border-right: 0.0625rem solid var(--line);
  border-bottom: 0.0625rem solid var(--line);
  border-left: 0.0625rem solid var(--line);
}

.order-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--charcoal);
  color: var(--paper-soft);
}

.summary-image {
  overflow: hidden;
  aspect-ratio: 1.35 / 1;
  border-bottom: 0.0625rem solid var(--line-light);
}

.summary-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.summary-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(2rem, 4vw, 4rem);
}

.summary-content h2 {
  margin: 1.8rem 0 0.5rem;
  font-size: clamp(2.6rem, 4.5vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 0.88;
}

.summary-description {
  margin: 0;
  color: rgba(248, 245, 237, 0.58);
}

.summary-lines {
  display: grid;
  gap: 0.8rem;
  margin-top: clamp(4rem, 10vw, 9rem);
  padding-top: 1.25rem;
  border-top: 0.0625rem solid var(--line-light);
}

.summary-lines div,
.summary-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.summary-lines span,
.summary-lines strong,
.summary-total span,
.summary-total strong {
  font-size: 0.82rem;
  font-weight: 400;
}

.summary-lines span {
  color: rgba(248, 245, 237, 0.6);
}

.summary-total {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 0.0625rem solid var(--line-light);
}

.summary-total strong {
  color: var(--bronze-light);
  font-size: clamp(2.5rem, 5vw, 5rem);
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.summary-note {
  margin: 1.5rem 0 0;
  color: rgba(248, 245, 237, 0.45);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.checkout-form {
  min-width: 0;
  background: var(--paper-soft);
}

.form-section {
  min-width: 0;
  padding: clamp(2rem, 4vw, 4.5rem);
  border-bottom: 0.0625rem solid var(--line);
}

.form-heading {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.form-heading .card-index {
  width: 2rem;
  margin-top: 0;
  line-height: 1.25;
}

.form-heading h2 {
  margin: 0.75rem 0 0;
  font-size: clamp(2.3rem, 4vw, 4.7rem);
  font-weight: 400;
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

.checkout-form label {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.15rem;
}

.checkout-form label > span,
.invoice-choice legend {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.checkout-form label em {
  color: var(--bronze-deep);
  font-size: 0.66rem;
  font-style: normal;
  letter-spacing: 0.08em;
}

.checkout-form input,
.checkout-form select {
  width: 100%;
  min-height: 3.2rem;
  padding: 0.85rem 0;
  border: 0;
  border-bottom: 0.0625rem solid var(--line);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
}

.checkout-form input:focus,
.checkout-form select:focus {
  border-color: var(--ink);
  box-shadow: none;
}

.checkout-form input[readonly] {
  color: var(--muted);
}

.form-note {
  margin: -1rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.invoice-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
}

.invoice-choice legend {
  width: 100%;
  margin-bottom: 0.75rem;
}

.invoice-choice .choice {
  display: inline-flex;
  grid-template-columns: auto auto;
  gap: 0.55rem;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

.invoice-choice .choice span {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.invoice-choice input {
  width: 1rem;
  min-height: 1rem;
  accent-color: var(--ink);
}

.invoice-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 0.0625rem solid var(--line);
}

.invoice-fields label:nth-child(3),
.invoice-fields label:nth-child(4),
.invoice-fields label:nth-child(6) {
  grid-column: 1 / -1;
}

.payment-panel {
  padding: clamp(2rem, 4vw, 4.5rem);
  background: var(--bronze-light);
}

.payment-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}

.payment-secure {
  max-width: 100%;
  color: rgba(17, 18, 15, 0.66);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.payment-panel > p {
  max-width: 28rem;
  margin: 2.5rem 0;
  color: rgba(17, 18, 15, 0.68);
}

.payment-panel .button {
  justify-content: space-between;
  width: 100%;
}

.stripe-payment {
  margin: 0 0 2rem;
  padding-top: 2rem;
  border-top: 0.0625rem solid rgba(17, 18, 15, 0.24);
}

.express-checkout {
  margin-bottom: 1.75rem;
}

.payment-divider {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 1.5rem 0;
  color: rgba(17, 18, 15, 0.58);
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.payment-divider::before,
.payment-divider::after {
  flex: 1;
  height: 0.0625rem;
  background: rgba(17, 18, 15, 0.24);
  content: "";
}

.payment-edit {
  margin-top: 1.5rem;
  padding: 0;
  border: 0;
  border-bottom: 0.0625rem solid currentColor;
  background: transparent;
  color: rgba(17, 18, 15, 0.66);
  cursor: pointer;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.checkout-form .form-section :disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.74;
}

.payment-panel .button:disabled,
.payment-edit:disabled {
  cursor: wait;
  opacity: 0.55;
}

.checkout-status {
  min-height: 1.4rem;
  margin: 1rem 0 0;
  color: rgba(17, 18, 15, 0.7);
  font-size: 0.82rem;
}

.checkout-independence {
  margin-top: 0;
}

.success-section {
  min-height: calc(100vh - 5.5rem);
  padding: clamp(6rem, 12vw, 12rem) var(--page-x);
}

.success-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
  gap: clamp(3rem, 10vw, 10rem);
  max-width: var(--max);
  margin: 0 auto;
}

.success-inner h1 {
  max-width: 58rem;
  margin: 2rem 0 0;
  font-size: clamp(4rem, 9vw, 9rem);
  font-weight: 400;
  letter-spacing: -0.08em;
  line-height: 0.84;
}

.success-copy {
  align-self: end;
  max-width: 31rem;
}

.success-copy p {
  color: var(--muted);
  font-size: 1.1rem;
}

.success-copy .button {
  margin-top: 2rem;
}

@media (max-width: 62rem) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .order-summary {
    display: grid;
    grid-template-columns: minmax(14rem, 0.9fr) minmax(0, 1.1fr);
  }

  .summary-image {
    height: 100%;
    border-right: 0.0625rem solid var(--line-light);
    border-bottom: 0;
  }

  .summary-lines {
    margin-top: 3rem;
  }
}

@media (max-width: 48rem) {
  .checkout-intro-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .checkout-intro h1 {
    margin-top: 1.5rem;
    font-size: clamp(4rem, 15vw, 7rem);
  }

  .order-summary {
    display: block;
  }

  .summary-image {
    aspect-ratio: 1.35 / 1;
    height: auto;
    border-right: 0;
    border-bottom: 0.0625rem solid var(--line-light);
  }

  .form-grid.two-col,
  .invoice-fields {
    grid-template-columns: 1fr;
  }

  .invoice-fields label:nth-child(3),
  .invoice-fields label:nth-child(4),
  .invoice-fields label:nth-child(6) {
    grid-column: auto;
  }

  .payment-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .payment-secure {
    text-align: left;
  }

  .success-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

@media (max-width: 39rem) {
  .checkout-intro {
    padding-top: 3.5rem;
  }

  .checkout-form label > span,
  .invoice-choice legend {
    font-size: 0.68rem;
  }

  .checkout-intro h1 {
    font-size: clamp(3.25rem, 16vw, 4rem);
  }

  .summary-content,
  .form-section,
  .payment-panel {
    padding: 2rem 1.15rem;
  }

  .payment-panel .button {
    gap: 0.75rem;
    padding-inline: 1rem;
    letter-spacing: 0.09em;
  }
}
