/* ---- cart ---- */

.cart {
  padding: 0 var(--gutter) clamp(64px, 8vw, 120px);
}

.cart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(40px, 6vw, 88px) 0 clamp(24px, 3vw, 40px);
  border-bottom: 1px solid var(--rule);
}

.cart-head h1 {
  font-size: clamp(64px, 11vw, 168px);
}

.cart-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.cart-body[hidden],
.cart-empty[hidden] {
  display: none;
}

.cart-line {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto 96px auto;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}

.cart-line .media {
  aspect-ratio: 4 / 5;
}

.cart-info {
  display: grid;
  gap: 4px;
}

.cart-info a:hover {
  color: var(--muted);
}

.stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--rule);
}

.stepper button {
  width: 40px;
  height: 40px;
  font-family: var(--font-mono);
}

.stepper button:hover {
  background: var(--surface);
}

.stepper span {
  min-width: 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
}

.cart-line-total {
  text-align: right;
  font-weight: 500;
}

.remove:hover {
  color: var(--ink);
}

.cart-summary {
  position: sticky;
  top: var(--gutter);
  display: grid;
  gap: 20px;
  margin-top: 24px;
  padding: 28px;
  background: var(--surface);
}

.cart-summary dl {
  display: grid;
  gap: 12px;
}

.cart-summary dl div {
  display: flex;
  justify-content: space-between;
}

.cart-summary dd {
  margin: 0;
}

.cart-summary .total {
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 18px;
  font-weight: 500;
}

.cart-summary .button {
  width: 100%;
}

.cart-summary .button:disabled {
  background: var(--muted);
  cursor: not-allowed;
}

.continue {
  justify-self: start;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.cart-empty {
  display: grid;
  justify-items: start;
  gap: 24px;
  padding: 64px 0;
}

@media (max-width: 900px) {
  .cart-body {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 600px) {
  .cart-line {
    grid-template-columns: 96px minmax(0, 1fr) auto;
    grid-template-areas:
      'img info total'
      'img step remove';
    gap: 12px 16px;
  }

  .cart-line .media {
    grid-area: img;
  }

  .cart-info {
    grid-area: info;
  }

  .stepper {
    grid-area: step;
    justify-self: start;
  }

  .cart-line-total {
    grid-area: total;
    align-self: start;
  }

  .remove {
    grid-area: remove;
    justify-self: end;
  }
}
