.lx-cart {
  display: grid;
  gap: var(--lx-s-5);
}

.lx-cart__steps {
  padding: var(--lx-s-5);
  border: var(--lx-hairline);
  border-radius: var(--lx-radius-panel);
  background: var(--lx-fog);
}

.lx-cart__steps .lx-steps__mobile {
  display: none;
}

.lx-cart__steps .lx-steps__position {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.lx-cart__header {
  display: grid;
  gap: var(--lx-s-2);
  margin-block-end: 0;
}

.lx-cart__eyebrow {
  margin: 0 0 var(--lx-s-2);
  color: var(--lx-link);
  font-family: var(--lx-font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lx-cart__count {
  margin: 0;
  color: var(--lx-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

.lx-cart :is(.lx-head__title, .lx-head__lead, h2, h3, p, li, dt, dd, .lx-card__name) {
  word-break: auto-phrase;
  text-wrap-style: pretty;
}

.lx-cart .ec-cartRole {
  width: 100%;
  margin-inline: 0;
}

.lx-cart__alerts:empty,
.lx-cart__alerts:not(:has(.lx-notice)) {
  display: none;
}

.lx-cart__alerts,
.lx-cart__form,
.lx-cart-group__main,
.lx-cart-items,
.lx-cart-item__body,
.lx-cart-item__meta,
.lx-cart-summary,
.lx-cart-summary__facts,
.lx-empty-cart,
.lx-empty-cart__products {
  display: grid;
  gap: var(--lx-s-4);
}

.lx-cart-group {
  display: grid;
  gap: var(--lx-s-5);
}

.lx-cart-group + .lx-cart-group {
  padding-block-start: var(--lx-s-8);
  border-block-start: var(--lx-hairline);
}

.lx-cart-group__head {
  display: grid;
  gap: var(--lx-s-1);
}

.lx-cart-group__head p {
  color: var(--lx-muted);
}

.lx-cart-meter {
  gap: var(--lx-s-3);
}

.lx-cart-meter__text {
  display: grid;
  gap: var(--lx-s-1);
}

.lx-cart-meter__text strong {
  color: var(--lx-ink);
  font-size: var(--lx-text-h4);
  line-height: 1.45;
}

.lx-cart-meter__text span {
  color: var(--lx-muted);
  font-size: var(--lx-text-small);
  line-height: var(--lx-lh-small);
}

.lx-cart-meter__track {
  height: var(--lx-s-2);
  overflow: hidden;
  border-radius: var(--lx-radius-pill);
  background: var(--lx-line);
}

.lx-cart-meter__track span {
  display: block;
  width: var(--lx-cart-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--lx-deep);
  transition: width var(--lx-dur) var(--lx-ease);
}

.lx-cart-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--lx-s-4);
  padding: var(--lx-s-4) 0;
  border-block-start: var(--lx-hairline);
}

.lx-cart-item:last-child {
  border-block-end: var(--lx-hairline);
}

.lx-cart-item__image {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: var(--lx-radius-card);
  background: var(--lx-fog);
}

.lx-cart-item__image img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.lx-cart-item__title-row {
  display: flex;
  gap: var(--lx-s-3);
  align-items: flex-start;
  justify-content: space-between;
}

.lx-cart-item__name {
  font-size: var(--lx-text-h4);
}

.lx-cart-item__name a {
  display: inline-flex;
  align-items: center;
  min-height: var(--lx-touch);
  color: var(--lx-ink);
  text-decoration: none;
}

.lx-cart-item__name a:hover {
  text-decoration: underline;
  text-underline-offset: .18em;
}

.lx-cart-item__remove {
  flex: 0 0 auto;
  min-width: var(--lx-touch);
  justify-content: center;
}

.lx-cart-item__variant {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lx-s-2) var(--lx-s-4);
  color: var(--lx-muted);
  font-size: var(--lx-text-small);
  line-height: var(--lx-lh-small);
}

.lx-cart-item__variant div {
  display: inline-flex;
  gap: var(--lx-s-1);
}

.lx-cart-item__variant dt {
  font-weight: 500;
}

.lx-cart-item__variant dd {
  color: var(--lx-body);
}

.lx-cart-item__meta {
  grid-template-columns: 1fr;
}

.lx-cart-item__label {
  display: block;
  margin-block-end: var(--lx-s-1);
  color: var(--lx-muted);
  font-size: var(--lx-text-small);
  font-weight: 500;
  line-height: var(--lx-lh-small);
}

.lx-cart-item__stepper a,
.lx-cart-item__stepper span {
  display: grid;
  place-items: center;
  min-width: var(--lx-touch);
  min-height: var(--lx-touch);
  color: var(--lx-deep);
  font-size: var(--lx-text-h3);
  font-weight: 700;
  text-decoration: none;
}

.lx-cart-item__stepper a:hover {
  background: var(--lx-mist);
}

.lx-cart-item__stepper span {
  color: var(--lx-muted);
  background: var(--lx-fog);
}

.lx-cart-summary {
  align-self: start;
}

.lx-cart-summary__totals {
  display: grid;
  gap: var(--lx-s-3);
}

.lx-cart-summary__totals div {
  display: flex;
  gap: var(--lx-s-4);
  align-items: baseline;
  justify-content: space-between;
  padding-block-end: var(--lx-s-3);
  border-block-end: var(--lx-hairline);
}

.lx-cart-summary__totals dt {
  flex: 0 0 auto;
  color: var(--lx-muted);
  font-weight: 500;
  white-space: nowrap;
}

.lx-cart-summary__totals dd {
  min-width: 0;
  color: var(--lx-ink);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: end;
}

.lx-cart-summary__shipping dd {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.lx-cart-summary__shipping-fee {
  white-space: nowrap;
}

.lx-cart-summary__shipping-note {
  display: block;
  color: var(--lx-muted);
  font-size: var(--lx-text-small);
  font-weight: 500;
  line-height: var(--lx-lh-small);
}

.lx-cart-summary__total dt,
.lx-cart-summary__total dd {
  color: var(--lx-ink);
  font-size: var(--lx-text-price);
  font-weight: 700;
}

.lx-cart-summary__continue {
  justify-self: center;
}

/* The shared .lx-buybar sets display:grid, which would defeat the hidden attribute. */
.lx-cartbar[hidden] {
  display: none;
}

.lx-cartbar__price {
  display: grid;
  gap: var(--lx-s-1);
  align-content: center;
  white-space: nowrap;
}

.lx-cartbar__label {
  color: var(--lx-muted);
  font-size: var(--lx-text-small);
  line-height: var(--lx-lh-small);
}

.lx-cartbar__amount {
  color: var(--lx-ink);
  font-size: var(--lx-text-price);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.2;
}

/* ShowPointAmount4 injects .ec-cartRole__point rows even when the cart earns 0pt;
   the template JS marks those rows hidden (purchase-path.md: value must be > 0). */
.ec-cartRole__point[hidden] {
  display: none;
}
.lx-cart-summary__totals .ec-cartRole__point {
  color: var(--lx-body);
  font-size: var(--lx-text-small);
  font-weight: 500;
  line-height: var(--lx-lh-small);
  font-variant-numeric: tabular-nums;
}


.lx-cart-summary__facts {
  grid-template-columns: 1fr;
  padding-block-start: var(--lx-s-4);
  border-block-start: var(--lx-hairline);
}

.lx-cart-summary__facts > div {
  display: grid;
  gap: var(--lx-s-1);
  padding-block-end: var(--lx-s-3);
  border-block-end: var(--lx-hairline);
}

.lx-cart-summary__facts a:hover strong {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.lx-cart-summary__facts strong {
  color: var(--lx-ink);
  font-size: var(--lx-text-body);
  font-weight: var(--lx-w-label);
  line-height: 1.5;
}

.lx-cart-summary__facts span {
  color: var(--lx-muted);
  font-size: var(--lx-text-small);
  line-height: var(--lx-lh-small);
}

.lx-cart-summary__contact {
  margin: 0;
  padding-block-start: var(--lx-s-2);
  color: var(--lx-muted);
  font-size: var(--lx-text-small);
  line-height: var(--lx-lh-small);
}

.lx-cart-summary__contact a {
  color: var(--lx-link);
  text-underline-offset: 0.18em;
}

.lx-empty-cart {
  padding: var(--lx-s-6);
  background: var(--lx-fog);
  text-align: start;
}

.lx-empty-cart > p:not(.lx-cart__eyebrow) {
  color: var(--lx-body);
}

.lx-empty-cart__search {
  max-width: 640px;
  background: var(--lx-paper);
}

.lx-empty-cart__categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lx-s-2);
}

.lx-empty-cart__products {
  padding-block-start: var(--lx-s-4);
}

@media (min-width: 768px) {
  .lx-cart__steps .lx-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .lx-cart__header {
    align-items: start;
  }

  .lx-cart-group {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    align-items: start;
  }

  .lx-cart-summary {
    position: sticky;
    top: calc(var(--lx-header-h) + var(--lx-s-6));
  }

  .lx-cart-item {
    grid-template-columns: 96px 1fr;
    gap: var(--lx-s-5);
    padding-block: var(--lx-s-5);
  }

  .lx-cart-item__image {
    width: 96px;
    height: 96px;
  }

  .lx-cart-item__meta {
    grid-template-columns: minmax(120px, 1fr) auto minmax(120px, auto);
    align-items: end;
  }

  .lx-empty-cart {
    padding: var(--lx-s-8);
  }

  .lx-empty-cart .lx-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .lx-cart__steps {
    padding: var(--lx-s-4);
  }

  .lx-cart__steps .lx-steps li[aria-current="step"] {
    grid-template-columns: 1fr;
  }

  .lx-cart__steps .lx-steps li[aria-current="step"]::before,
  .lx-cart__steps .lx-steps li[aria-current="step"] .lx-steps__label {
    display: none;
  }

  .lx-cart__steps .lx-steps li[aria-current="step"] .lx-steps__mobile {
    display: block;
    color: var(--lx-deep);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    white-space: nowrap;
  }


  .lx-cart-item__title-row {
    display: grid;
  }

  .lx-cart-item__remove {
    justify-self: start;
  }

  /* Stacked on the purchase bar, whose padding already holds the safe-area inset: count it once. */
  body:has(.lx-cartbar:not([hidden])) .lx-cookie {
    min-height: 56px;
    padding-bottom: 5px;
  }
}
