.checkout {
  --checkout-line: var(--line, #d9d5cd);
  --checkout-ink: var(--ink, #171c22);
  padding-block: clamp(2rem, 5vw, 4rem) 4.5rem;
  color: var(--checkout-ink);
}

.checkout h1 {
  margin-bottom: .65rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -.035em;
  line-height: 1.1;
}

.checkout h2 {
  margin-bottom: .65rem;
  font-size: 1.35rem;
  line-height: 1.25;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1rem, 4vw, 3rem);
  margin-top: 1.5rem;
}

.checkout-fields,
.checkout-summary {
  min-width: 0;
}

.checkout-fields > label,
.checkout fieldset {
  margin: 0 0 1rem;
}

.checkout fieldset {
  padding: clamp(.85rem, 2vw, 1.25rem);
  min-width: 0;
  border: 1px solid var(--checkout-line);
  border-radius: .625rem;
  background: #faf8f3;
}

.checkout fieldset fieldset {
  margin-block: 1rem 0;
  background: #fff;
}

.checkout legend {
  padding-inline: .35rem;
  font-weight: 650;
}

.checkout label {
  display: block;
  font-weight: 600;
}

.checkout label > small,
.checkout-optional {
  color: #605d56;
  font-size: .875rem;
  font-weight: 400;
}

.checkout-optional {
  margin-inline-start: .3rem;
}

.checkout select,
.checkout input:is([name=owner_name], [name=owner_email], [name=code], [name=promo_code]) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  margin-block: .35rem 1rem;
  padding: .65rem .8rem;
  border: 1px solid #b9b4aa;
  border-radius: .375rem;
  background: #fff;
  color: var(--checkout-ink);
  font: inherit;
}

.checkout input:is([name=owner_email], [name=promo_code]):disabled {
  background: #ececea;
  border-color: #c9c9c5;
  color: #4f4f4c;
  opacity: 1;
}

.checkout input[name="promo_code"] { margin-bottom: .15rem; }

.checkout label:has(input:is([type=checkbox], [type=radio])) {
  padding: .7rem .6rem;
  border-bottom: 1px solid var(--checkout-line);
  font-weight: 500;
  cursor: pointer;
}

.checkout input:is([type=checkbox], [type=radio]) {
  margin-inline: 0 .35rem;
  accent-color: var(--orange-dark, #8a4926);
}

.checkout-consent {
  margin-block-end: .75rem;
}

.checkout-consent > label:has(input[type=checkbox]) {
  padding-block: .25rem;
  border-bottom: 0;
}

.checkout-consent > small {
  display: block;
  margin-inline-start: 1.9rem;
  font-size: .875rem;
}

.checkout-consent > small > a {
  color: var(--orange-dark, #8a4926);
  text-decoration: underline;
}

.checkout :is(input, select, button, a):focus-visible {
  outline: 2px solid var(--orange-dark, #8a4926);
  outline-offset: 3px;
}

.checkout-summary,
.checkout-step {
  --checkout-panel-padding: clamp(1rem, 3vw, 1.6rem);
  padding: var(--checkout-panel-padding);
  border: 1px solid var(--checkout-line);
  border-radius: .625rem;
  background: #faf8f3;
}

.checkout-summary {
  position: sticky;
  top: 1rem;
}

.checkout-summary ul {
  padding: 0;
  list-style: none;
}

.checkout-summary li,
.checkout-summary dl div {
  display: flex;
  justify-content: space-between;
  gap: .65rem;
  padding-block: .6rem;
  border-bottom: 1px solid var(--checkout-line);
}

.checkout-summary li > span:first-child,
.checkout-summary dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.checkout-summary li > span:last-child,
.checkout-summary output {
  flex-shrink: 0;
  white-space: nowrap;
}

.checkout-summary dd {
  margin: 0;
  text-align: end;
}

.checkout-summary dl div[hidden] {
  display: none;
}

.checkout-summary output {
  font-size: 1.2rem;
  font-weight: 700;
}

.checkout-recommendation {
  margin-block: .75rem;
  padding: .85rem;
  border: 1px solid var(--checkout-line);
  border-radius: .375rem;
  background: #f2eee5;
}

.checkout-recommendation button {
  margin-top: .5rem;
}

.checkout-step {
  max-width: 40rem;
  margin-block: 1.25rem;
}

.checkout-step form {
  margin-block: .9rem;
}

.checkout-confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkout-step .checkout-email-confirmed {
  margin-block-end: 0;
}

.checkout-email-confirmed + .checkout-confirm-actions {
  margin-block-start: var(--checkout-panel-padding);
}

.checkout-confirm-buttons,
.checkout-confirm-edit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding-inline: .5rem;
  text-align: center;
  overflow-wrap: anywhere;
}

.checkout-confirm-buttons {
  align-items: flex-start;
  padding-inline-start: 0;
}

.checkout-confirm-buttons form {
  max-width: 100%;
  margin: 0;
}

.checkout-confirm-edit {
  border-inline-start: 1px solid var(--checkout-line);
}

.checkout .button {
  max-width: 100%;
  min-height: 44px;
  white-space: normal;
}

.checkout [data-purchase-submit] {
  width: 100%;
}

@media (max-width: 760px) {
  .checkout-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .checkout-summary {
    position: static;
  }
}

.checkout-edition-hint {
  display: block;
  margin: .35rem 0;
  color: #605d56;
  font-size: .9rem;
  font-weight: 400;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.checkout-edition-hint:empty {
  display: none;
}

.checkout-edition-table-wrap {
  max-width: 42rem;
  margin-block: 1rem;
  overflow-x: auto;
}

.checkout-edition-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  line-height: 1.35;
}

.checkout-edition-table :is(th, td) {
  padding: .4rem .55rem;
  border: 1px solid var(--checkout-line);
  text-align: center;
}

.checkout-edition-table th:first-child:is([scope="row"], [rowspan]) {
  text-align: start;
}

.checkout-edition-table thead {
  background: #faf8f3;
}
