:root {
  --bg: #f5f5f5;
  --ink: #111111;
  --muted: #8a8a8a;
  --line: #d9d9d9;
  --btn-border: #e23b3b;
  --btn-text: #e23b3b;
  --qty-bg: #ece8e8;
  --font: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

.cart {
  width: min(980px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.75rem 0 4rem;
}

.cart-title {
  margin: 0 0 2rem;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.cart-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 120px;
  gap: 1rem;
  padding: 0 0 0.85rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.col-qty { text-align: center; }
.col-total { text-align: right; }

.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 120px;
  gap: 1rem;
  align-items: center;
  padding: 1.35rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
}

.product {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  min-width: 0;
}

.thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 2px;
  background: #d9cfe8;
  flex: 0 0 auto;
}

.meta .name {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.meta .price {
  font-size: 0.98rem;
  margin-bottom: 0.2rem;
}

.meta .variant {
  font-size: 0.95rem;
  color: #333;
}

.qty {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  background: var(--qty-bg);
  border-radius: 4px;
  overflow: hidden;
  min-width: 108px;
}

.qty button {
  appearance: none;
  border: 0;
  background: transparent;
  width: 36px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  color: #333;
}

.qty span {
  min-width: 28px;
  text-align: center;
  font-size: 0.98rem;
}

.line-total {
  text-align: right;
  font-size: 1rem;
}

.cart-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 2rem;
  padding-top: 1.5rem;
  align-items: start;
}

.instructions {
  display: grid;
  gap: 0.55rem;
  max-width: 420px;
  font-size: 0.95rem;
}

.instructions textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;
  padding: 0.75rem 0.85rem;
  font: inherit;
  color: inherit;
}

.instructions textarea:focus {
  outline: 2px solid rgba(0, 0, 0, 0.18);
  outline-offset: 1px;
}

.summary {
  justify-self: end;
  width: 100%;
  max-width: 280px;
  text-align: right;
}

.subtotal {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.subtotal strong {
  font-weight: 700;
}

.checkout-btn {
  appearance: none;
  width: 100%;
  height: 48px;
  border: 1px solid var(--btn-border);
  border-radius: 2px;
  background: #fff;
  color: var(--btn-text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.checkout-btn:hover:not(:disabled) {
  background: #fff5f5;
}

.checkout-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  min-height: 1.25rem;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
}

.status.err { color: #c62828; }
.status.ok { color: #1b7a45; }

/* return page reuse */
.return-wrap {
  width: min(640px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0;
}

.return-wrap h1 {
  margin: 0 0 1rem;
  font-size: 2rem;
}

.return-wrap .button {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--btn-border);
  color: var(--btn-text);
  text-decoration: none;
  background: #fff;
}

@media (max-width: 760px) {
  .cart-head { display: none; }

  .cart-line {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .qty { justify-self: start; }
  .line-total { text-align: left; font-weight: 600; }

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

  .summary {
    justify-self: stretch;
    max-width: none;
    text-align: left;
  }

  .subtotal { justify-content: space-between; }
  .status { text-align: left; }
}
