.pb-checkout__layout--long {
  grid-template-rows: auto;
}
.pb-checkout__layout--long .pb-checkout__sections { grid-row: 1; }
.pb-checkout__rail { grid-area: 1 / 2; min-width: 0; }
.pb-checkout__layout--long .pb-checkout__summary,
.pb-checkout__layout--long .pb-checkout__totals-panel { min-width: 0; }
.pb-checkout__layout--long .pb-checkout__summary { gap: 12px; }
.pb-checkout__layout--long .pb-checkout__summary h2 { flex-wrap: wrap; gap: 4px 10px; }
.pb-checkout__layout--long .pb-checkout__totals-panel { gap: 8px; padding-top: 12px; }
.pb-checkout__layout--long .pb-checkout__delivery-progress { margin: 0; }
.pb-checkout__layout--long .pb-checkout__minimum-progress + .pb-checkout__delivery-progress { margin-top: 0; }

.pb-checkout__list-wrap { position: relative; min-height: 0; }
.pb-checkout__layout--long .pb-checkout__totals { gap: 3px 8px; }
.pb-checkout__layout--long .pb-checkout__total { padding-top: 4px; }
.pb-checkout__layout--long .pb-checkout__delivery-progress { gap: 0; }
.pb-checkout__layout--long .pb-checkout__totals-panel .pb-form__check { min-height: 36px; }
.pb-checkout__scroll:focus-visible { outline-offset: -2px; }
.pb-checkout__group-heading {
  z-index: 1; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  gap: 4px 8px; margin: 0; padding: 7px 10px; background: var(--pb-muted);
  border-radius: 8px; font-size: 12px; font-weight: 600;
}
.pb-checkout__group-heading a { color: var(--pb-link); font-weight: 800; }
.pb-checkout__order-group + .pb-checkout__order-group { margin-top: 12px; }
.pb-checkout__compact-line {
  grid-template-columns: 40px minmax(0, 1fr) max-content; min-height: 76px;
  align-items: center; gap: 4px 10px; padding: 8px 0; font-size: 14px;
}
.pb-checkout__compact-line .pb-cart-line__image { grid-row: 1 / span 2; align-self: start; width: 40px; height: 40px; }
.pb-checkout__line-title {
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; grid-column: 2;
  color: var(--pb-ink); font-weight: 700; text-decoration: none;
}
.pb-checkout__line-title:hover { text-decoration: underline; }
.pb-checkout__compact-line .pb-checkout__line-total { grid-area: 1 / 3; justify-self: end; }
.pb-checkout__line-quantity { display: flex; align-items: center; grid-area: 2 / 2; gap: 8px; min-width: 0; }
.pb-checkout__line-quantity .pb-stepper {
  --pb-qty-target: 32px; --pb-stepper-row-height: var(--pb-qty-target);
  grid-template-columns: var(--pb-qty-target) 3ch var(--pb-qty-target); flex: none;
  width: auto; min-height: var(--pb-qty-target);
}
.pb-checkout__line-quantity .pb-stepper :is(button, input) {
  min-width: 0; min-height: var(--pb-qty-target); height: var(--pb-qty-target); padding: 0;
}
.pb-checkout__line-quantity small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pb-checkout__line-remove {
  grid-area: 2 / 3; justify-self: end; display: grid; place-items: center;
  width: 32px; height: 32px; background: transparent; color: var(--pb-ink-muted); border: 0; cursor: pointer;
}
.pb-checkout__line-remove svg { width: 18px; height: 18px; }
.pb-checkout__compact-line :is(.pb-stock-warning, .pb-stock-message) { grid-column: 2 / -1; margin: 0; }
.pb-checkout__removed-line {
  min-height: 52px; margin-block: 6px; padding: 4px 12px; background: var(--pb-muted);
  border-radius: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px;
}
.pb-checkout__removed-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-checkout__pick {
  border: 0; padding: 0; background: none; font: inherit; font-weight: 800;
  text-decoration: underline; cursor: pointer;
}
.pb-checkout__delivery-shortcut {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px;
  padding: 4px 10px; border-radius: 8px; background: var(--pb-yellow-tint);
}
.pb-checkout__pick { min-height: 34px; color: var(--pb-link); white-space: nowrap; }
.pb-checkout__layout--long .pb-checkout__delivery-offer { margin: 12px 0 0; }
.pb-checkout__mobile-bar { display: none; }

@media (min-width: 769px) and (min-height: 701px) {
  .pb-checkout__rail {
    position: sticky; top: 16px; max-height: calc(100vh - var(--pb-checkout-rail-top, 16px) - 16px);
    max-height: calc(100dvh - var(--pb-checkout-rail-top, 16px) - 16px);
    display: flex; flex-direction: column;
  }
  .pb-checkout__layout--long .pb-checkout__summary {
    display: flex; flex-direction: column; flex: 0 1 auto; min-height: 156px; padding-top: 16px;
  }
  .pb-checkout__list-wrap { display: flex; flex: 0 1 auto; }
  .pb-checkout__scroll {
    width: 100%; min-height: 120px; overflow-y: auto; overscroll-behavior: contain;
    scrollbar-gutter: stable; padding-inline-end: 4px; scroll-padding-block: 34px 28px;
  }
  .pb-checkout__list-wrap:has([data-pb-more])::after {
    position: absolute; inset: auto 8px 0 0; height: 28px; pointer-events: none; content: "";
    background: linear-gradient(transparent, var(--pb-card));
  }
  .pb-checkout__group-heading { position: sticky; top: 0; }
}

@media (max-width: 768px) {
  .pb-checkout__rail { display: contents; }
  .pb-checkout__layout--long .pb-checkout__summary { order: 0; padding-block: 0; gap: 0; }
  .pb-checkout__layout--long .pb-checkout__sections { order: 1; }
  .pb-checkout__layout--long .pb-checkout__totals-panel { order: 2; }
  .pb-checkout__layout--long .pb-checkout__items-toggle {
    width: 100%; text-align: start; border: 0; padding: 0; background: none; color: inherit; font: inherit;
  }
  .pb-checkout__layout--long .pb-checkout__items-toggle[aria-expanded="false"] + .pb-checkout__list-wrap {
    display: none;
  }
  .pb-checkout__items-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .pb-checkout__scroll { padding-bottom: 12px; }
  .pb-checkout__group-heading { position: sticky; top: 0; }
  .pb-checkout__compact-line { padding-block: 6px; gap: 2px 8px; }
  .pb-checkout__line-title { line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; }
  .pb-checkout__line-quantity .pb-stepper { --pb-qty-target: 44px; }
  .pb-checkout__line-remove { width: 44px; height: 44px; }
  .pb-checkout__removed-line .pb-checkout__pick { min-height: 44px; }
  .pb-checkout__mobile-bar:not([hidden]) {
    position: fixed; inset: auto 0 0; z-index: 8;
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 12px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--pb-line); background: var(--pb-card);
  }
  .pb-checkout__mobile-bar > span { display: grid; font-size: 12px; color: var(--pb-ink-muted); }
  .pb-checkout__mobile-bar > span b { color: var(--pb-ink); font-size: 16px; white-space: nowrap; }
  .pb-checkout__mobile-bar button[aria-disabled="true"] { color: var(--pb-ink-body); background: var(--pb-disabled); border-color: var(--pb-disabled); }
  .pb-checkout__mobile-bar :is(button, a) { min-height: 48px; }
  .pb-checkout__layout--long :is(input, select, textarea, a, button) { scroll-margin-bottom: 80px; }
  body:has([data-pb-checkout-mobile-bar]:not([hidden])) .pb-cart-toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
