/* Marketplace under 1024px: the summary stacks below the items, so the checkout
   action is pinned to the bottom of the screen and the coupon folds below it. */
.mp-summary-card { position: static; }
@media (min-width: 1024px) {
  .mp-summary-card { position: sticky; top: 1rem; }
}

@media (max-width: 1023.98px) {
  .mp-cart-paybar,
  .mp-checkout-paybar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: hsl(var(--background));
    border-top: 1px solid hsl(var(--border));
    box-shadow: 0 -4px 16px rgb(0 0 0 / 0.08);
  }
  .mp-cart-paybar .mp-cart-paybar-total {
    flex: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    border: 0;
  }
  .mp-cart-paybar .mp-cart-paybar-total > span:first-child { font-size: 11px; }
  .mp-cart-paybar .mp-cart-paybar-total > span:last-child { font-size: 19px; }
  .mp-cart-paybar > a,
  .mp-checkout-paybar > button { flex: 1; width: auto; }
  main:has(.mp-cart-paybar),
  main:has(.mp-checkout-paybar) { padding-bottom: 96px; }
}

.mp-cart-box { container-type: inline-size; }
.mp-cart-grid.mp-cart-head { display: none; }
.mp-cart-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}
.mp-cart-grid > :first-child { grid-column: 1 / -1; }
.mp-cart-grid > :nth-child(3) { text-align: right; }
@container (min-width: 560px) {
  .mp-cart-grid.mp-cart-head { display: grid; }
  .mp-cart-grid { grid-template-columns: minmax(0, 1fr) 130px 130px 40px; gap: 1rem; }
  .mp-cart-grid > :first-child { grid-column: auto; }
  .mp-cart-grid > :nth-child(3) { text-align: center; }
}

@media (max-width: 639.98px) {
  .mp-checkout-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
  }
  .mp-checkout-row .mp-cell-course { grid-column: 1 / -1; }
  .mp-checkout-row .mp-cell-price { grid-row: 2; grid-column: 1; }
  .mp-checkout-row .mp-cell-trash { grid-row: 2; grid-column: 2; justify-self: end; }
  .mp-checkout-row .mp-cell-qty   { grid-row: 3; grid-column: 1; }
  .mp-checkout-row .mp-cell-total { grid-row: 3; grid-column: 2; }
}
