/* The voucher form cannot be moved into the cart form (nested forms), and plugins
   can only add markup below the voucher form, so the cart form is flattened and
   the page reordered visually. */
main#content:has(> form .item-category) {
  display: flex;
  flex-direction: column;

  > form:has(.item-category) {
    display: contents;
  }

  > .adapt-checkout-page-notices {
    order: 1;
  }

  > aside:has(#redeem-a-voucher) {
    order: 2;
  }

  > form > .front-page:has(#btn-add-to-cart),
  > :is(aside:has(#redeem-a-voucher), .adapt-checkout-page-notices)
    ~ :not(.adapt-checkout-page-notices) {
    order: 3;
  }
}

/* The divider below the products is drawn by the last product row. */
main#content:has(> .adapt-checkout-page-notices > .adapt-checkout-page-sale-end)
  > form
  .item-category:not(:has(~ .item-category))
  > article:last-child::after {
  display: none;
}

.adapt-checkout-page-notices {
  --notice-spacing: 25px;
  --divider-color: #ddd;
}

.adapt-checkout-page-sale-end {
  margin: 0;
  padding-bottom: var(--notice-spacing);
  border-bottom: 1px solid var(--divider-color);
}

.adapt-checkout-page-contact {
  margin-top: var(--notice-spacing);
}
