:root {
  /* Support-style tokens */
  --ink: #0f172a; /* primary text */
  --muted: #64748b; /* secondary text */
  --bg: #ffffff; /* page background */
  --panel: #f6f7fb; /* light section background */
  --card: #ffffff; /* card background */
  --line: #cacaca; /* subtle borders - match support */
  --shadow: 0 8px 22px rgba(2, 8, 23, 0.06);
  --accent: #d20a1b; /* support red accent */

  /* Page-specific (kept for buttons/focus) */
  --brand: #111111;
  --brand-contrast: #ffffff;
  --text: var(--ink);
  --bg-legacy: var(--bg);
  --card-bg: var(--card);
  --border: #e5e7eb; /* input borders */
  --radius: 12px;
  --ring: 0 0 0 3px rgba(210, 10, 27, 0.18); /* accent focus ring */
}

body {
  color: var(--ink);
  background: var(--bg);
  margin: 0;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 136px 20px 64px;
}

/* Page header with support-style accent bar */
.page-header {
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
}
.title {
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.2;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.title::before {
  content: "";
  width: 6px;
  height: 1.1em;
  border-radius: 3px;
  background: var(--accent);
  flex: 0 0 6px;
}
.subtitle {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 1.02rem;
}

.grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 24px;
}
@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .card--sticky {
    position: static;
  }
}

/* Cards minimal – no heavy shadows/borders */
.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: var(--card);
  box-shadow: none;
}
.card--sticky {
  position: sticky;
  top: 84px;
  align-self: start;
}
.card-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.card-title::before {
  content: "";
  width: 6px;
  height: 1em;
  border-radius: 3px;
  background: var(--accent);
  flex: 0 0 6px;
}

.card-title .count-text {
  margin-left: auto;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Labels & inputs – clean underline focus like support */
label {
  display: block;
  font-weight: 600;
  margin: 0.5rem 0 0.35rem;
}
input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: #fff;
  outline: none;
  transition: box-shadow 120ms ease, border-color 120ms ease;
}
input:focus-visible,
textarea:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--ring);
}
textarea {
  min-height: 140px;
  resize: vertical;
}

/* Actions / buttons */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 120ms ease, background 120ms ease,
    color 120ms ease, border-color 120ms ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}
.btn:active {
  transform: translateY(0);
}
.btn.primary {
  background: #111;
  color: #fff;
  border-color: #111;
}
.btn.primary:hover {
  filter: brightness(1.05);
}
.btn.primary:focus-visible {
  box-shadow: var(--ring);
}
.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Cart list – light separators, no heavy borders on images */
.cart-line {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  align-items: center;
}
.cart-line:last-child {
  border-bottom: 0;
}
.cart-line img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(2, 8, 23, 0.06);
}
.line-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.line-title {
  font-weight: 600;
  font-size: 1rem;
}
.line-sub {
  color: var(--muted);
  font-size: 0.93rem;
}
/* Quantity badge + title row */
.line-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.qty-badge {
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

/* Quantity controls (– qty +) */
.qty-controls {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn-qty {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 4px 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}
.btn-qty:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.qty-display {
  min-width: 1.5em;
  text-align: center;
  font-weight: 700;
}
.empty {
  color: var(--muted);
  font-style: italic;
  padding: 6px 0;
}

/* Alert / warning */
.warn {
  display: none;
  margin-top: 10px;
  color: #8a5504;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid #fb923c;
  padding: 10px 12px;
  border-radius: 10px;
}

.line-actions {
  margin-top: 6px;
  display: flex;
  gap: 10px;
}
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
}
.btn-link.danger {
  color: #b91c1c;
}
/* ===== Overrides: flatter, borderless look (support-style) ===== */
.card {
  border: 0;
  border-radius: 0;
  padding: 15px; /* let fields define their own rhythm */
  background: transparent;
  box-shadow: none;
}
.card--sticky {
  border-left: 1px solid var(--line); /* just a soft column divider */
  padding-left: 18px;
}
/* Scroll area for long carts */
.card--sticky #cart-list {
  max-height: 420px;
  overflow: auto;
  padding-right: 6px; /* keep text away from scrollbar */
}
.card--sticky #cart-list::-webkit-scrollbar {
  width: 10px;
}
.card--sticky #cart-list::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 6px;
}
@media (max-width: 980px) {
  .card--sticky {
    border-left: 0;
    padding-left: 0;
  }
}

/* Underline inputs – no boxes/radius */
input,
textarea {
  border: 0;
  border-bottom: 2px solid #e5e7eb;
  border-radius: 0;
  padding: 10px 0;
  background: transparent;
}
input:focus-visible,
textarea:focus-visible {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: none;
}

/* Spacing inside the form */
.card label + input,
.card label + textarea {
  margin-bottom: 14px;
}
.actions {
  margin-top: 18px;
}

/* Buttons – primary is filled, others are link-like */
.btn {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}
.btn:hover {
  transform: none;
  box-shadow: none;
  text-decoration: underline;
}
.btn.primary {
  padding: 12px 16px;
  background: #111;
  color: #fff;
  text-decoration: none;
}
.btn.primary:hover {
  filter: brightness(1.05);
}

/* Cart list – thin separators only */
.cart-line {
  grid-template-columns: 56px 1fr;
  gap: 12px;
  border: 0;
  padding: 12px 0;
}
#cart-list .cart-line + .cart-line {
  border-top: 1px solid var(--line);
}
.cart-line img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

/* Page rhythm tweaks */
.grid {
  gap: 32px;
}
.subtitle {
  margin-bottom: 16px;
}
