.cart-page {
  --blue: #183fe5;
  --cart-line: #dcded8;
  max-width: 1600px;
  margin: auto;
  padding: 48px 4% 64px;
  color: #1d2420;
}
.cart-page > h1 {
  font-size: clamp(32px, 4vw, 48px);
  margin: 0 0 28px;
  font-weight: 500;
}
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: start;
}
.cart-items {
  min-width: 0;
  display: grid;
  gap: 24px;
}
.cart-page .cart-design-card {
  display: block;
  padding: 24px;
  border: 1px solid var(--cart-line);
  margin: 0;
  background: white;
}
.cart-design-card > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.cart-design-card h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.cart-page a,
.cart-options a {
  color: var(--blue);
}
.cart-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
}
.cart-delete {
  margin-left: auto;
}
.cart-item-content {
  display: grid;
  grid-template-columns: minmax(150px, 240px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.cart-preview {
  position: relative;
  min-width: 0;
  padding-bottom: 28px;
}
.cart-page .cart-preview > img {
  width: 100%;
  max-height: 320px;
  height: auto;
  object-fit: contain;
}
.cart-page .design-preview,
.cart-options .design-preview,
.checkout-item-preview .design-preview {
  position: relative;
  container-type: inline-size;
  background: white;
  overflow: hidden;
}
.cart-page .preview-garment,
.cart-options .preview-garment,
.checkout-item-preview .preview-garment {
  display: block;
  width: 100%;
  height: auto;
}
.cart-page .preview-artwork,
.cart-options .preview-artwork,
.checkout-item-preview .preview-artwork {
  position: absolute;
  inset: 0;
}
.cart-page .design-element,
.cart-options .design-element,
.checkout-item-preview .design-element {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--rotation));
  text-align: center;
}
.cart-page .design-element > img,
.cart-options .design-element > img,
.checkout-item-preview .design-element > img {
  width: 100%;
  height: auto;
  display: block;
  transform: scale(var(--flip), var(--flip-y));
}
.cart-page .art-text,
.cart-options .art-text,
.checkout-item-preview .art-text {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: var(--text-size);
  line-height: 1.15;
  transform: scale(var(--flip), var(--flip-y));
}
.cart-page .cart-side-toggle {
  position: absolute;
  right: 6px;
  bottom: 48px;
  width: 64px;
  padding: 3px;
  border: 1px solid var(--cart-line);
  background: white;
  cursor: pointer;
}
.cart-side-toggle > span {
  font-size: 11px;
}
.cart-side-label {
  display: block;
  text-align: center;
  font-size: 13px;
  margin-top: 8px;
}
.cart-item-details h3 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.4;
}
.cart-item-details p {
  margin: 0 0 10px;
  line-height: 1.5;
}
.cart-size-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.cart-size-chips span {
  padding: 4px 8px;
  background: #f3f4f0;
  font-size: 14px;
}
.cart-decoration {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 14px;
  margin-bottom: 12px;
}
.cart-saved-note {
  color: #606761;
  font-size: 13px;
}
.cart-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.cart-item-actions button {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--blue);
  cursor: pointer;
}
.cart-item-actions button + button {
  border-left: 1px solid var(--cart-line);
  padding-left: 12px;
}
.cart-line-price {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  font-size: 14px;
}
.cart-line-price span {
  color: #606761;
}
.cart-line-price p {
  margin: 0;
}
.cart-delivery {
  margin-top: 24px;
  border-top: 1px solid var(--cart-line);
  padding-top: 20px;
}
.cart-delivery h3 {
  font-size: 18px;
  margin: 0 0 12px;
}
.cart-delivery > div {
  border: 1px solid var(--blue);
  display: inline-flex;
  gap: 12px;
  padding: 14px 18px;
  align-items: center;
}
.cart-delivery svg {
  color: var(--blue);
}
.cart-delivery small {
  display: block;
  margin-top: 6px;
  color: #606761;
  font-size: 13px;
}
.cart-add-products {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--blue);
  padding: 16px;
  text-decoration: none;
}
.cart-order-summary {
  position: sticky;
  top: 24px;
  border: 1px solid var(--cart-line);
  padding: 28px;
}
.cart-order-summary h2 {
  font-size: 26px;
  margin: 0 0 24px;
  font-weight: 500;
}
.cart-order-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.cart-grand-total {
  border-top: 1px solid var(--cart-line);
  padding-top: 24px;
  font-size: 18px;
}
.cart-primary {
  background: #183fe5;
  color: white;
  border: 1px solid #183fe5;
  padding: 14px 20px;
  border-radius: 0;
  cursor: pointer;
}
.cart-order-summary .cart-primary {
  width: 100%;
}
.cart-order-summary > p {
  color: #606761;
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0 0;
}
.cart-page button:disabled,
.cart-options button:disabled {
  opacity: 0.45;
  cursor: default;
}
.cart-page :is(button, a, input):focus-visible,
.cart-options :is(button, a, input):focus-visible {
  outline: 2px solid #183fe5;
  outline-offset: 3px;
}
.cart-options {
  --blue: #183fe5;
  --cart-line: #dcded8;
  width: min(1000px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid #dcded8;
  border-radius: 0;
  color: #1d2420;
}
.cart-options[open] {
  display: flex;
  flex-direction: column;
}
.cart-options::backdrop {
  background: #0008;
}
.cart-options > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--cart-line);
  gap: 12px;
  flex-shrink: 0;
}
.cart-options h2 {
  font-size: 28px;
  margin: 0;
  font-weight: 500;
}
.cart-options h3 {
  font-size: 20px;
  margin: 0 0 8px;
}
.cart-options p {
  margin: 8px 0 16px;
}
.cart-options-body {
  overflow: auto;
  min-height: 0;
  padding: 24px;
}
.cart-options-previews {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 230px));
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}
.cart-options-previews > div > span {
  display: block;
  text-align: center;
  font-size: 13px;
  margin-top: 6px;
}
.cart-colors {
  border: 0;
  padding: 0;
  margin: 24px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cart-colors legend {
  margin-bottom: 12px;
}
.cart-colors button {
  width: 36px;
  height: 36px;
  border: 1px solid #bbb;
  padding: 0;
  cursor: pointer;
}
.cart-colors button[aria-pressed="true"] {
  outline: 2px solid #183fe5;
  outline-offset: 2px;
}
.cart-colors button span {
  color: white;
  text-shadow:
    0 1px 3px black,
    0 -1px 3px black;
}
.cart-size-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 12px;
}
.cart-size-fields label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  min-width: 0;
}
.cart-size-fields input {
  width: 100%;
  height: 46px;
  border: 1px solid #bbb;
  border-radius: 0;
  text-align: center;
  padding: 6px;
  font: inherit;
  appearance: textfield;
}
.cart-size-fields input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}
.cart-size-fields small {
  font-size: 11px;
  color: #606761;
}
.cart-notice {
  background: #eef3ff;
  border-left: 3px solid #183fe5;
  padding: 12px;
}
.cart-options > footer {
  display: flex;
  flex-shrink: 0;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  padding: 20px 24px;
  border-top: 1px solid var(--cart-line);
}
.cart-options > footer > span {
  margin-right: auto;
}
.cart-options > footer > button:not(.cart-primary) {
  padding: 14px 20px;
  border: 1px solid var(--cart-line);
  background: white;
}
@media (max-width: 1100px) {
  .cart-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 20px;
  }
  .cart-item-content {
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
    gap: 16px;
  }
  .cart-design-card {
    padding: 20px;
  }
}
@media (max-width: 800px) {
  .cart-page {
    padding: 28px 24px 48px;
  }
  .cart-layout {
    grid-template-columns: 1fr;
  }
  .cart-order-summary {
    position: static;
  }
  .cart-item-content {
    grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1fr);
  }
  .cart-page .cart-design-card {
    padding: 18px;
  }
  .cart-design-card > header {
    gap: 10px;
  }
  .cart-design-card h2 {
    font-size: 23px;
  }
  .cart-item-details h3 {
    font-size: 16px;
  }
  .cart-line-price {
    grid-column: 1/-1;
  }
  .cart-options {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
  }
  .cart-options > header,
  .cart-options-body {
    padding: 18px;
  }
  .cart-options h2 {
    font-size: 24px;
  }
  .cart-options > footer {
    padding: 16px;
    flex-wrap: wrap;
  }
  .cart-options > footer > span {
    flex-basis: 100%;
  }
}
@media (max-width: 380px) {
  .cart-item-content {
    grid-template-columns: 1fr;
  }
  .cart-preview {
    max-width: 220px;
    margin: auto;
  }
  .cart-line-price {
    grid-column: 1;
  }
  .cart-page {
    padding-inline: 16px;
  }
}

.cart-page.cart-page--empty {
  max-width: 1440px;
  padding: 32px 4% 64px;
}
.cart-page.cart-page--empty > h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 26px;
}
.cart-page .saved-empty .button {
  color: white;
}

.cart-page .cart-row {
  display: block;
  padding: 0;
  margin: 0;
  border: 0;
}
.cart-page .cart-row + .cart-row {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--cart-line);
}

/* Product photos and artwork must retain the same coordinate system as the canvas. */
.cart-page .cart-row .design-preview img,
.cart-options .design-preview img {
  max-height: none;
}
.cart-design-card > header {
  padding: 0 0 20px;
  margin-bottom: 24px;
  gap: 16px;
}
.cart-design-card > header h2 {
  font-size: 24px;
  letter-spacing: -0.4px;
}
.cart-page .cart-preview {
  padding-bottom: 0;
}
.cart-preview > .design-preview {
  border: 1px solid var(--cart-line);
  border-radius: 8px;
}
.cart-page .cart-side-toggle {
  bottom: 36px;
  right: 8px;
  width: 56px;
  border-radius: 6px;
  overflow: hidden;
}
.cart-line-price {
  align-self: start;
}
@media (min-width: 1300px) {
  .cart-item-content {
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) 120px;
    gap: 22px;
  }
  .cart-line-price {
    grid-column: 3;
    grid-row: 1;
    grid-template-columns: 1fr;
    text-align: right;
    gap: 6px;
  }
  .cart-line-price p {
    margin-bottom: 14px;
  }
}
@media (max-width: 480px) {
  .cart-item-content {
    grid-template-columns: 1fr;
  }
  .cart-preview {
    width: min(100%, 240px);
    margin: 0 auto;
  }
  .cart-line-price {
    grid-column: 1;
  }
  .cart-item-actions button + button {
    border-left: 0;
    padding-left: 0;
  }
  .cart-item-actions {
    gap: 8px 16px;
  }
}

/* The populated cart and its editing dialogs use the designer's visual language. */
.cart-page:not(.cart-page--empty),
.cart-options {
  --cart-line: #e2e8f0;
  --blue: #183fe5;
  color: #1e293b;
  font-family: Arial, sans-serif;
  font-weight: 400;
}
.cart-page:not(.cart-page--empty) :is(h1, h2, h3, strong, button),
.cart-options :is(h2, h3, strong, button) {
  font-weight: 400;
}
.cart-page .cart-design-card,
.cart-order-summary {
  border-radius: 14px;
}
.cart-page .cart-primary,
.cart-page .cart-add-products,
.cart-options > footer button {
  border-radius: 28px;
  min-height: 44px;
}
.cart-page .cart-icon-button {
  border-radius: 50%;
}
.cart-page .cart-icon-button:hover {
  background: #eef3ff;
}
.cart-page .cart-size-chips span {
  border-radius: 6px;
  background: #f1f5f9;
}
.cart-page .cart-delivery > div {
  border-radius: 12px;
  background: #f8faff;
}
.cart-options {
  border-radius: 16px;
}
.cart-options input {
  border-radius: 8px;
}
.cart-options .cart-color-swatches button {
  border-radius: 8px;
}

/* Reserve the final preview area while product and local artwork load. */
.cart-preview-stage {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--cart-line);
  border-radius: 8px;
  overflow: hidden;
}
.cart-preview-stage > .design-preview {
  width: min(100%, calc(100% * var(--preview-ratio)));
  flex-shrink: 0;
  aspect-ratio: var(--preview-ratio);
}
.cart-preview-stage > .design-preview[data-loaded="false"] {
  visibility: hidden;
}
.cart-preview-loading {
  color: #64748b;
  font-size: 14px;
}

.cart-product-name-line {
  display: block;
}
.cart-product-name-line + .cart-product-name-line {
  margin-top: 5px;
}
.cart-page .cart-side-toggle {
  bottom: 8px;
  background: white;
}
.cart-page .cart-item-actions {
  gap: 0;
}
.cart-page .cart-item-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 8px 12px;
  min-height: 44px;
  font-size: 14px;
}
.cart-page .cart-item-actions button:first-child {
  padding-left: 0;
}
.cart-page .cart-item-actions button + button {
  border-left: 1px solid var(--cart-line);
}
.cart-page .cart-item-actions button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.cart-page .cart-item-actions button:hover:not(:disabled) {
  background: transparent;
}
@media (max-width: 600px) {
  .cart-page .cart-item-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    width: 100%;
  }
  .cart-page .cart-item-actions button,
  .cart-page .cart-item-actions button:first-child {
    flex-direction: column;
    padding: 8px 4px;
    font-size: 12px;
    line-height: 1.4;
    gap: 6px;
  }
}

/* Compact designer controls for both cart editing dialogs. */
.cart-options {
  width: min(1040px, calc(100% - 24px));
  border-color: #e2e8f0;
}
.cart-options > header,
.cart-options > footer {
  padding: 14px 20px;
  background: white;
}
.cart-options > header .cart-icon-button {
  color: #000;
}
.cart-options h2 {
  font:
    400 24px/1.25 Arial,
    sans-serif;
  letter-spacing: normal;
}
.cart-options h3 {
  font:
    400 18px/1.3 Arial,
    sans-serif;
  letter-spacing: normal;
}
.cart-options-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px 24px;
  padding: 16px 20px;
}
.cart-options-product {
  grid-column: 1/-1;
}
.cart-options p {
  margin: 0 0 10px;
  font-size: 14px;
}
.cart-options-previews {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: start;
  gap: 8px;
  margin: 0;
}
.cart-options-previews > div {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: white;
}
.cart-options-previews .design-preview {
  width: min(100%, calc(100% * var(--preview-ratio)));
  margin: auto;
}
.cart-options-controls {
  min-width: 0;
}
.cart-options .cart-colors {
  gap: 6px;
  margin: 0 0 12px;
}
.cart-options .cart-colors legend {
  font-size: 15px;
  margin-bottom: 8px;
}
.cart-options .cart-colors button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  flex-shrink: 0;
}
.cart-options .cart-size-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.cart-size-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3px 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
}
.cart-size-row:nth-child(odd) {
  border-right: 1px solid #e2e8f0;
}
.cart-size-row > small {
  grid-column: 1/-1;
}
.cart-quantity-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cart-options .cart-quantity-stepper button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #183fe5;
  border-radius: 50%;
  background: #eef3ff;
  color: #183fe5;
}
.cart-quantity-stepper button svg {
  width: 16px;
  height: 16px;
}
.cart-options .cart-quantity-stepper input {
  width: 42px;
  height: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
}
.cart-options > footer button {
  padding: 10px 22px;
}
@media (max-width: 700px) {
  .cart-options-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .cart-options-product {
    grid-column: 1;
  }
  .cart-options-previews {
    width: 160px;
    justify-self: center;
  }
  .cart-options h2 {
    font-size: 20px;
  }
  .cart-options > header,
  .cart-options > footer {
    padding: 12px;
  }
  .cart-options .cart-colors {
    display: grid;
    grid-template-rows: repeat(2, 28px);
    grid-auto-flow: column;
    grid-auto-columns: 28px;
    overflow-x: auto;
    padding: 3px;
  }
  .cart-options .cart-colors legend {
    float: left;
    width: 100%;
  }
  .cart-options .cart-size-row {
    padding: 6px;
    gap: 3px;
  }
  .cart-options .cart-quantity-stepper {
    gap: 3px;
  }
  .cart-options .cart-quantity-stepper input {
    width: 32px;
  }
  .cart-options .cart-quantity-stepper button {
    width: 26px;
    height: 28px;
  }
  .cart-options > footer {
    flex-wrap: wrap;
    gap: 8px;
  }
  .cart-options > footer > span {
    font-size: 13px;
  }
}

.cart-item-details {
  container-type: inline-size;
}
.cart-page .cart-item-details h3 {
  font-size: 17px;
  line-height: 1.3;
  margin: 0 0 10px;
}
.cart-page .cart-item-details p {
  font-size: 14px;
  margin: 0 0 10px;
}
.cart-page .cart-item-actions {
  display: grid;
  grid-template-columns: 1fr 1.55fr 0.9fr;
  margin-top: 10px;
  width: 100%;
}
.cart-page .cart-item-actions button {
  min-width: 0;
  padding: 6px;
  font-size: 13px;
  line-height: 1.3;
}
@container (max-width: 440px) {
  .cart-page .cart-item-actions button,
  .cart-page .cart-item-actions button:first-child {
    flex-direction: column;
    padding: 6px 3px;
    gap: 4px;
    font-size: 12px;
  }
}
.cart-page .cart-line-price {
  display: block;
  grid-column: 3;
  grid-row: 1;
  text-align: right;
  font-size: 14px;
}
.cart-page .cart-line-price p {
  margin: 0;
}
@media (min-width: 801px) {
  .cart-page .cart-item-content {
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) 100px;
    gap: 16px;
  }
}
@media (min-width: 801px) and (max-width: 1200px) {
  .cart-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .cart-order-summary {
    position: static;
  }
}
@media (max-width: 800px) {
  .cart-page .cart-line-price {
    grid-column: 2;
    grid-row: auto;
  }
}
@media (max-width: 480px) {
  .cart-page .cart-line-price {
    grid-column: 1;
  }
}

@container (min-width: 441px) {
  .cart-page .cart-item-actions {
    grid-template-columns: max-content max-content max-content;
    justify-content: start;
  }
  .cart-page .cart-item-actions button {
    justify-content: flex-start;
    padding-inline: 16px;
  }
  .cart-page .cart-item-actions button:first-child {
    padding-left: 0;
  }
}

.cart-options .cart-options-previews {
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, 200px);
  justify-self: center;
}
@media (max-width: 700px) {
  .cart-options .cart-options-previews {
    width: min(100%, 110px);
  }
}

.cart-page .cart-item-actions button svg {
  transition:
    fill 180ms ease,
    transform 800ms ease-in-out;
}
.cart-page
  .cart-item-actions
  button:not(:last-child):is(:hover, :focus-visible):not(:disabled)
  svg {
  fill: currentColor;
}
.cart-page
  .cart-item-actions
  button:last-child:is(:hover, :focus-visible):not(:disabled)
  svg {
  transform: rotate(360deg);
}
@media (prefers-reduced-motion: reduce) {
  .cart-page .cart-item-actions button svg {
    transition: none;
  }
  .cart-page
    .cart-item-actions
    button:last-child:is(:hover, :focus-visible):not(:disabled)
    svg {
    transform: none;
  }
}

.cart-options .cart-colors legend,
.cart-options-size-heading h3 {
  font:
    400 18px/1.3 Arial,
    sans-serif;
  letter-spacing: normal;
}
.cart-options-size-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 10px;
}
.cart-options .cart-options-size-heading h3,
.cart-options .cart-options-size-heading p {
  margin: 0;
}
.cart-options .cart-options-size-heading p {
  color: #64748b;
  font-size: 12px;
  text-align: right;
}

.cart-options .cart-options-product .cart-product-name-line:first-child {
  font:
    400 18px/1.3 Arial,
    sans-serif;
}

.cart-options .cart-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
@media (max-width: 700px) {
  .cart-options .cart-options-previews {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 240px);
  }
  .cart-options .cart-size-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .cart-options .cart-size-row:nth-child(odd) {
    border-right: 0;
  }
  .cart-options .cart-size-row {
    grid-template-columns: 1fr auto;
    padding: 8px 10px;
  }
  .cart-options .cart-colors {
    display: block;
    overflow: visible;
    min-width: 0;
    padding: 0;
  }
  .cart-options .cart-colors legend {
    float: none;
    width: auto;
    margin-bottom: 8px;
  }
  .cart-options .cart-color-swatches {
    display: grid;
    grid-template-rows: repeat(2, 28px);
    grid-auto-flow: column;
    grid-auto-columns: 28px;
    overflow-x: auto;
    padding: 3px;
    gap: 6px;
  }
}

.cart-options-product-card {
  display: contents;
}
@media (max-width: 700px) {
  .cart-options-body {
    background: #f7f8fa;
    gap: 20px;
    padding: 16px;
  }
  .cart-options-product-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
  }
  .cart-options .cart-options-previews {
    order: -1;
    width: 100%;
    gap: 10px;
  }
  .cart-options .cart-options-product p {
    margin: 0;
  }
  .cart-options .cart-size-fields {
    background: white;
    border-radius: 12px;
  }
  .cart-options .cart-size-row {
    padding: 12px;
    gap: 4px 10px;
  }
  .cart-options .cart-size-row > span {
    font-size: 20px;
  }
  .cart-options .cart-size-row > small {
    grid-column: 1;
    font-size: 12px;
    color: #64748b;
  }
  .cart-options .cart-quantity-stepper {
    grid-column: 2;
    grid-row: 1 / span 2;
    gap: 8px;
  }
  .cart-options .cart-quantity-stepper button {
    width: 36px;
    height: 36px;
  }
  .cart-options .cart-quantity-stepper input {
    width: 44px;
    height: 38px;
    font-size: 20px;
  }
  .cart-options .cart-quantity-stepper button svg {
    width: 20px;
    height: 20px;
  }
  .cart-options-size-heading {
    flex-wrap: wrap;
  }
}

.cart-options,
.cart-options .cart-options-body {
  background: white;
}
.cart-options > header {
  border-bottom: 0;
}
.cart-options .cart-color-swatches {
  padding: 5px;
}

.cart-mobile-price {
  display: none;
}
.cart-quantity-summary {
  display: contents;
}
@media (max-width: 700px) {
  .cart-page .cart-item-details h3 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    align-items: baseline;
  }
  .cart-page .cart-mobile-price {
    display: block;
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    font-size: 14px;
  }
  .cart-page .cart-item-details h3 .cart-product-name-line:not(:first-child) {
    grid-column: 1 / -1;
  }
  .cart-page .cart-line-price {
    display: none;
  }
  .cart-page .cart-quantity-summary {
    display: block;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 12px;
    margin-bottom: 10px;
  }
  .cart-page .cart-quantity-summary p {
    margin: 0 0 10px;
  }
  .cart-page .cart-quantity-summary .cart-size-chips {
    justify-content: flex-start;
    margin: 0;
  }
}

/* Mobile cart rows mirror the compact image/details layout. */
@media (max-width: 700px) {
  .cart-page .cart-item-content {
    display: grid;
    grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: start;
  }
  .cart-page .cart-preview {
    grid-column: 1;
    grid-row: 1 / span 4;
    width: 100%;
    max-width: none;
    margin: 0;
  }
  .cart-page .cart-item-details,
  .cart-page .cart-quantity-summary {
    display: contents;
  }
  .cart-page .cart-item-details h3 {
    display: block;
    grid-column: 2;
    grid-row: 1;
    font-size: 14px;
    line-height: 1.3;
    margin: 0;
  }
  .cart-page .cart-mobile-price {
    display: none;
  }
  .cart-page .cart-line-price {
    display: block;
    grid-column: 3;
    grid-row: 1;
    font-size: 14px;
  }
  .cart-page .cart-item-details > p {
    grid-column: 2 / -1;
    grid-row: 2;
    margin: 0;
    font-size: 13px;
  }
  .cart-page .cart-quantity-summary > p {
    grid-column: 2 / -1;
    grid-row: 3;
    margin: 0;
    font-size: 13px;
  }
  .cart-page .cart-quantity-summary .cart-size-chips {
    grid-column: 2 / -1;
    grid-row: 4;
    margin: 0;
    justify-content: flex-start;
  }
  .cart-page .cart-item-actions {
    grid-column: 1 / -1;
    grid-row: 5;
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    margin-top: 0;
  }
  .cart-page .cart-item-actions button,
  .cart-page .cart-item-actions button:first-child {
    flex-direction: row;
    padding: 6px;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
    flex: 1 1 auto;
  }
  .cart-page .cart-item-actions button:first-child {
    padding-left: 0;
    justify-content: flex-start;
  }
  .cart-page .cart-item-actions button svg {
    width: 14px;
    height: 14px;
  }
  .cart-page .cart-side-toggle {
    width: 32px;
    bottom: 4px;
    right: 4px;
    padding: 2px;
  }
  .cart-page .cart-item-details > p[role="status"] {
    grid-row: 6;
    grid-column: 1 / -1;
  }
}
@media (max-width: 360px) {
  .cart-page .cart-item-content {
    gap: 8px;
  }
  .cart-page .cart-item-actions button,
  .cart-page .cart-item-actions button:first-child {
    font-size: 11px;
    padding-inline: 4px;
    gap: 3px;
  }
  .cart-page .cart-item-actions button svg {
    width: 12px;
    height: 12px;
  }
}

@media (max-width: 700px) {
  .cart-page .cart-item-details h3 {
    font-weight: 600;
  }
  .cart-page .cart-item-details h3 .cart-product-name-line:not(:first-child) {
    display: none;
  }
}

.cart-page .cart-size-chips {
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.cart-page .cart-size-chips > span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.cart-page {
  max-width: 1440px;
  padding: 32px 4% 64px;
}
.cart-page > h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 26px;
  letter-spacing: -0.025em;
}

/* Keep the site's wide-screen header/footer centering out of dialogs. */
.cart-options > header,
.cart-options > footer {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
}

a.cart-primary {
  display: block;
  text-align: center;
  text-decoration: none;
}
.cart-page a.cart-primary,
.cart-page a.cart-primary:visited {
  color: #fff;
}
.checkout-back {
  display: inline-block;
  margin-bottom: 24px;
}
.checkout-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 28px 0;
}
.checkout-fields label {
  display: grid;
  gap: 10px;
  font-weight: 600;
  min-width: 0;
}
.checkout-fields input,
.checkout-fields select {
  border: 1px solid #7c8175;
  background: white;
  color: inherit;
  min-width: 0;
  width: 100%;
  padding: 12px;
  font: inherit;
  min-height: 48px;
  border-radius: 0;
}
.checkout-fields :focus-visible,
.checkout-page a:focus-visible {
  outline: 2px solid #2637ef;
  outline-offset: 3px;
}
.checkout-note {
  color: #626958;
  font-size: 14px;
}
@media (max-width: 600px) {
  .checkout-fields {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.checkout-consent {
  margin: 1.5rem 0;
  font-size: 0.94rem;
  line-height: 1.5;
}
.checkout-consent h3,
.checkout-consent h4 {
  margin: 1rem 0 0.5rem;
}
.checkout-consent p {
  margin: 0.65rem 0;
}
.checkout-agreement {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.checkout-agreement input {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  accent-color: #233cf5;
}
.checkout-refresh {
  padding: 0.5rem 0;
  margin-top: 0.75rem;
  border: 0;
  background: transparent;
  color: #233cf5;
  text-decoration: underline;
  cursor: pointer;
}
.checkout-payment {
  border: 1px solid #d5d8cc;
  margin-top: 1.5rem;
  padding: clamp(1rem, 3vw, 2rem);
}
.checkout-payment .cart-primary {
  margin-top: 1.5rem;
  width: 100%;
}
.checkout-confirmed {
  padding: 2rem 0;
}
.checkout-fields input:read-only {
  background: #f5f5f1;
}
.checkout-fields :disabled {
  opacity: 0.75;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
  grid-template-areas: "steps summary";
  gap: 28px;
  align-items: start;
}
.checkout-steps {
  grid-area: steps;
  min-width: 0;
  display: grid;
  gap: 18px;
}
.checkout-step {
  border: 1px solid #dcded8;
  border-radius: 12px;
  padding: clamp(20px, 2.4vw, 32px);
  background: #fff;
  min-width: 0;
}
.checkout-step > header {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.checkout-step h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  margin: 0;
  line-height: 1.3;
}
.checkout-step h2 > span {
  color: #233cf5;
  font-size: 0.62em;
  margin-right: 10px;
}
.checkout-step h2:focus {
  outline: none;
}
.checkout-step > p {
  line-height: 1.55;
  margin: 16px 0;
}
.checkout-step .checkout-step-summary {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}
.checkout-step-pending {
  color: #646d60;
  font-size: 15px;
}
.checkout-step fieldset {
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}
.checkout-step > .cart-primary {
  margin-top: 20px;
}
.checkout-edit,
.checkout-preview-toggle {
  color: #233cf5;
  background: transparent;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
  padding: 10px 0;
  min-height: 44px;
}
.checkout-step .checkout-payment {
  padding: 0;
  border: 0;
  margin-top: 20px;
  min-width: 0;
}
.checkout-payment > div {
  min-width: 0;
  width: 100%;
}
.checkout-summary {
  grid-area: summary;
  min-width: 0;
  position: sticky;
  top: 24px;
  border: 1px solid #dcded8;
  border-radius: 12px;
  background: #fff;
}
.checkout-summary-content {
  padding: clamp(20px, 2.4vw, 32px);
}
.checkout-summary-content > h2 {
  font-size: 23px;
  margin: 0 0 24px;
}
.checkout-summary-content > h2 > span {
  font-size: 15px;
  font-weight: 400;
}
.checkout-summary-toggle {
  display: none;
}
.checkout-summary-items {
  display: grid;
  gap: 24px;
}
.checkout-item {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 16px;
}
.checkout-item-preview {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100px;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  overflow: hidden;
  font-size: 13px;
  text-align: center;
}
.checkout-item-preview .design-preview {
  width: min(100%, calc(125% * var(--preview-ratio)));
  height: auto;
  aspect-ratio: var(--preview-ratio);
}
.checkout-preview-toggle {
  font-size: 13px;
  width: 100%;
}
.checkout-item-details {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.checkout-item-details h3 {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.35;
}
.checkout-item-details p {
  margin: 4px 0;
  line-height: 1.45;
}
.checkout-totals {
  margin: 28px 0 0;
}
.checkout-totals > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  align-items: baseline;
}
.checkout-totals dd {
  text-align: right;
  margin: 0;
}
.checkout-totals .cart-grand-total {
  border-color: #dcded8;
  font-size: 20px;
  font-weight: 600;
}
.checkout-summary-content > p {
  font-size: 14px;
  line-height: 1.5;
}
@media (max-width: 900px) {
  .checkout-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "summary" "steps";
    gap: 20px;
  }
  .checkout-summary {
    position: static;
  }
  .checkout-summary-toggle {
    display: flex;
    width: 100%;
    padding: 18px 20px;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: 0;
    text-align: left;
    color: inherit;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
  }
  .checkout-summary-toggle > span:nth-child(2) {
    margin-left: auto;
    text-align: right;
    color: #233cf5;
  }
  .checkout-summary-toggle small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #646d60;
    margin-top: 4px;
  }
  .checkout-summary-toggle svg {
    flex: 0 0 18px;
  }
  .checkout-summary[data-open="true"] .checkout-summary-toggle svg {
    transform: rotate(180deg);
  }
  .checkout-summary[data-open="false"] .checkout-summary-content {
    display: none;
  }
  .checkout-summary-content > h2 {
    display: none;
  }
  .checkout-summary-content {
    border-top: 1px solid #dcded8;
  }
}
@media (max-width: 480px) {
  .checkout-step > .cart-primary {
    width: 100%;
  }
  .checkout-summary-toggle {
    padding: 16px;
  }
  .checkout-item {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
  }
}
