body.cart-open { overflow: hidden; }

.cart {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1002;
  width: min(430px, 94vw);
  height: 100dvh;
  padding: 24px;
  background: #fff;
  color: #111;
  box-shadow: -18px 0 45px rgba(0, 0, 0, 0.2);
  transform: translateX(105%);
  transition: transform 220ms ease;
  overflow-y: auto;
}

.cart.open { transform: translateX(0); }

.cart > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid #ddd;
}

.cart > header h2 { margin: 0; }
.cart > header button {
  border: 0;
  background: transparent;
  font-size: 2rem;
  cursor: pointer;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.56);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.scrim.show {
  opacity: 1;
  pointer-events: auto;
}

.cart-count[hidden] { display: none; }

.cart-empty {
  padding: 64px 12px;
  text-align: center;
}

.cart-empty a,
.cart-line-title { color: inherit; }

.cart-line {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid #e5e5e5;
}

.cart-line-image {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f3f3f3;
}

.cart-line-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-line-title {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 5px;
}

.cart-line-details p {
  margin: 0 0 6px;
  color: #666;
  font-size: 0.9rem;
}

.cart-line-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
}

.cart-line-quantity {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bbb;
}

.cart-line-quantity button {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.cart-line-quantity span {
  min-width: 28px;
  text-align: center;
}

.cart-remove {
  border: 0;
  padding: 0;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
}

.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #ddd;
  font-size: 1.05rem;
}

.cart-checkout {
  width: 100%;
  margin-top: 16px;
  padding: 15px 18px;
  border: 0;
  background: #111;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cart-checkout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


.checkout-result {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  padding: 48px 20px;
}

.checkout-result-card {
  width: min(680px, 100%);
  padding: 48px;
  border: 1px solid rgba(17, 17, 17, 0.18);
  background: #fff;
  text-align: center;
}

.checkout-result-card h1 {
  margin: 12px 0 16px;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  line-height: 0.95;
}

.checkout-result-card p {
  max-width: 560px;
  margin: 0 auto 24px;
}

.checkout-status {
  display: grid;
  gap: 8px;
  margin: 24px 0;
  padding: 18px;
  background: rgba(17, 17, 17, 0.06);
}

.checkout-result-card .btn {
  display: inline-flex;
}
