.masthead .cart-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  color: inherit;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.masthead .cart-link:hover .cart-link-label { text-decoration: underline; }
.cart-icon { flex: none; }
.cart-count {
  min-width: 1.5em;
  padding-inline: .35em;
  border-radius: 4px;
  background: #e2edf0;
  color: #172e39;
  font-size: 12px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.order-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
  margin: 14px 0 0;
  padding-block: 12px 3px;
  border-top: 1px solid var(--line);
}
.cart-quantity { display: grid; justify-items: start; gap: 5px; }
.cart-quantity > label {
  font-size: 12px;
  line-height: 1.25;
  color: var(--body, var(--text));
}
.cart-stepper {
  display: inline-grid;
  grid-template-columns: 2rem minmax(0, 1fr) 2rem;
  align-items: stretch;
  width: 8.5rem;
  height: 44px;
  border: 1px solid #a9bcbd;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.cart-stepper button,
.cart-stepper input {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: center;
}
.cart-stepper button {
  border-radius: 5px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.cart-stepper button:hover:enabled { background: var(--mist, var(--surface)); }
.cart-stepper input {
  width: 100%;
  border-inline: 1px solid var(--line);
  border-radius: 0;
  appearance: textfield;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
}
.cart-stepper input::-webkit-inner-spin-button,
.cart-stepper input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.cart-stepper :focus-visible { outline: 2px solid #046e88; outline-offset: -2px; }
.cart-stepper :disabled, .cart-remove:disabled { opacity: .55; cursor: default; }
.order-controls [data-add-message] {
  flex-basis: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--quiet, var(--muted));
}
.order-controls [data-add-message]:empty { position: absolute; }
.order-controls [data-add-message] a { font-weight: 650; color: var(--ink); }

.cart-view { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.cart-page { flex: 1; width: 100%; padding-bottom: clamp(36px, 5vw, 72px); }
.cart-page h1 { margin: 0 0 24px; font-weight: 710; }
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(245px, 320px);
  align-items: start;
  gap: clamp(24px, 4vw, 64px);
}
.cart-items { list-style: none; padding: 0; margin: 0; border-top: 2px solid #526873; }
.cart-items li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto auto;
  gap: 10px 16px;
  align-items: center;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}
.cart-items img {
  width: 72px;
  height: 64px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.cart-item-name { grid-column: 2; overflow-wrap: anywhere; color: var(--body); font-size: 14px; }
.cart-items li:not(:has(img)) .cart-item-name { grid-column: 1 / 3; }
.cart-item-name a { display: block; color: var(--ink); font-size: 16px; font-weight: 700; text-decoration: none; }
.cart-item-name a:hover { text-decoration: underline; }
.cart-remove, .cart-dialog-actions .text-action {
  padding: 0;
  min-height: 44px;
  border: none;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}
.cart-summary { padding: 20px; }
.cart-summary dl { margin: 0 0 16px; }
.cart-summary dl > div { display: flex; justify-content: space-between; gap: 8px; padding-block: 4px; font-size: 14px; }
.cart-summary dl > div:last-child { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.cart-summary dt { color: var(--body); }
.cart-summary dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.cart-summary .primary { width: 100%; }
.cart-page [data-empty], .cart-page [data-order-success] {
  border-top: 2px solid #526873;
  margin: 0;
  padding-block: 22px;
  color: var(--body);
}
.cart-page [data-contact-dialog] {
  width: min(440px, calc(100% - 32px));
  max-height: 90dvh;
  overflow: auto;
  padding: clamp(18px, 4vw, 28px);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.cart-page dialog::backdrop { background: rgb(15 31 39 / 65%); }
.cart-page [data-contacts] { display: grid; gap: 14px; }
.cart-page [data-contacts] h2 { margin: 0 0 4px; font-size: 22px; line-height: 1.2; letter-spacing: -.025em; }
.cart-page [data-contacts] label { display: grid; gap: 5px; color: var(--body); font-size: 13px; font-weight: 650; }
.cart-page [data-contacts] input {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #a9bcbd;
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}
.cart-page [data-contacts] input:focus-visible { outline: 2px solid #046e88; outline-offset: 1px; }
.cart-dialog-actions { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.cart-page [data-send-error], .cart-page [data-cart-error], .cart-page [data-error-for] { margin: 0; font-size: 13px; color: #983115; }
.cart-page [data-send-error]:empty, .cart-page [data-cart-error]:empty, .cart-page [data-error-for]:empty { display: none; }
.cart-page [data-cart-error]:not(:empty) { margin-bottom: 12px; }
@media (max-width: 850px) {
  .cart-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .masthead .site-header-row { display: grid; }
  .masthead .cart-link { grid-column: 3; grid-row: 1; justify-self: end; }
  .cart-stepper { width: 7.5rem; }
  .cart-page h1 { margin-bottom: 18px; }
}
@media (max-width: 520px) {
  .masthead .cart-link-label {
    position: absolute; width: 1px; height: 1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .masthead .cart-link { justify-content: center; min-width: 44px; gap: 4px; }
  .cart-items li { grid-template-columns: 58px minmax(0, 1fr) auto; gap: 8px 12px; }
  .cart-items img { width: 58px; height: 52px; }
  .cart-items .cart-quantity { grid-row: 2; grid-column: 2; }
  .cart-items .cart-remove { grid-row: 1; grid-column: 3; justify-self: end; }
}
