/* The cart page (S4). Not frozen: there is no prototype for this screen, so it is built in the port from the brief and the
   S1/S2/S3 language (Atelier, tokens only: no colour, font or size that the design system does not already carry). One row per
   piece; a summary beside the rows on a wide screen and below them on a phone. */
.ct { outline: 0; padding-block: var(--ui-space-8) var(--ui-space-16); }
.ct-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ui-space-4); flex-wrap: wrap; padding-bottom: var(--ui-space-5); }
.ct-title { margin: 0; font-family: var(--ui-font-display); font-weight: var(--ui-weight-display); letter-spacing: var(--ui-tracking-display); font-size: var(--ui-text-2xl); color: var(--ui-text); }
.ct-count { margin: 0; font-size: var(--ui-text-sm); color: var(--ui-text-muted); }
.ct-layout { display: grid; gap: var(--ui-space-8); align-items: start; }
@media (min-width: 960px) { .ct-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: var(--ui-space-12); } }
@media (min-width: 960px) { .ct-title { font-size: var(--ui-text-3xl); } }

.ct-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ui-border); }
.ct-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: var(--ui-space-4); align-items: start; padding-block: var(--ui-space-5); border-bottom: 1px solid var(--ui-border); animation: ct-in var(--ui-dur-slow) var(--ui-ease) both; }
@media (min-width: 720px) { .ct-row { grid-template-columns: 112px minmax(0, 1fr) auto; gap: var(--ui-space-6); } }
.ct-row__media { display: block; aspect-ratio: 4 / 5; background: var(--ui-surface-3); overflow: hidden; }
.ct-row__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ct-row__blank { display: block; width: 100%; height: 100%; }
.ct-row__body { display: grid; gap: var(--ui-space-2); justify-items: start; min-width: 0; }
.ct-row__title { color: var(--ui-text); font-weight: var(--ui-weight-strong); font-size: var(--ui-text-md); text-decoration: none; overflow-wrap: anywhere; }
.ct-row__title:hover { text-decoration: underline; text-underline-offset: 3px; }
.ct-row__meta { margin: 0; display: grid; font-size: var(--ui-text-sm); color: var(--ui-text-muted); }
/* On a phone the colour and the code sit on two lines (no separator left hanging at a line's end); from 720px they share one. */
.ct-row__sep { display: none; margin-inline: 0.5em; }
.ct-row__code { display: inline-flex; flex-wrap: wrap; column-gap: 0.5ch; font-family: var(--ui-font-mono); font-size: var(--ui-text-xs); letter-spacing: var(--ui-tracking-label); }
/* A code is one token: it never breaks inside itself, it drops whole to the next line. */
.ct-row__token { white-space: nowrap; }
@media (min-width: 720px) { .ct-row__meta { display: block; } .ct-row__sep { display: inline; } }
.ct-row__gone { margin: 0; display: flex; align-items: center; gap: var(--ui-space-3); flex-wrap: wrap; font-size: var(--ui-text-sm); color: var(--ui-text-muted); }
.ct-row[data-state="sold"] .ct-row__media, .ct-row[data-state="gone"] .ct-row__media, .ct-row[data-state="over"] .ct-row__media { opacity: 0.55; }
.ct-row[data-state="sold"] .ct-row__title, .ct-row[data-state="gone"] .ct-row__title, .ct-row[data-state="over"] .ct-row__title { color: var(--ui-text-muted); }
/* A tap target of 44px, whatever the type size. */
.ct-row__remove { min-height: 44px; min-width: 44px; justify-content: center; }

.ct-summary { display: grid; gap: var(--ui-space-4); padding: var(--ui-space-6); background: var(--ui-surface-2); border: 1px solid var(--ui-border); }
@media (min-width: 960px) { .ct-summary { position: sticky; top: var(--ui-space-8); } }
.ct-sum { display: grid; gap: var(--ui-space-3); margin: 0; }
.ct-sum__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ui-space-4); }
.ct-sum__row dt { font-size: var(--ui-text-sm); color: var(--ui-text-muted); }
.ct-sum__row dd { margin: 0; text-align: end; font-size: var(--ui-text-sm); color: var(--ui-text); }
.ct-sum__n { color: var(--ui-text-subtle); }
.ct-sum__row--total { padding-top: var(--ui-space-4); border-top: 1px solid var(--ui-border); }
.ct-sum__row--total dt { font-size: var(--ui-text-md); color: var(--ui-text); font-weight: var(--ui-weight-strong); }
.ct-held { margin: 0; font-size: var(--ui-text-sm); color: var(--ui-text-muted); }
.ct-checkout { width: 100%; min-height: 48px; justify-content: center; }
.ct-why { margin: 0; font-size: var(--ui-text-sm); color: var(--ui-text-muted); }

@keyframes ct-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ct-row { animation: none; } }

/* The one sentence after a bounce back from checkout, above the rows. */
.ct-notice { margin-bottom: var(--ui-space-5); }
