#cart-dialog {
  --checkout-border: #3b4c40;
  color: #eef5ea;
  background: #121a15;
  border-color: var(--checkout-border);
}
#cart-dialog > .dialog-head { margin: 0 0 16px; }
#cart-dialog > .dialog-head h2 { margin: 0; font-size: 1.27rem; }
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.63fr);
  align-items: start;
  gap: 18px;
}
.checkout-layout > #cart-items {
  padding: 0 14px;
  border: 1px solid var(--checkout-border);
  border-radius: 12px;
  background: #19251d;
}
.checkout-layout #cart-items .cart-item {
  grid-template-columns: minmax(0, 1fr) minmax(74px, auto) auto auto;
  grid-template-areas: "product total quantity remove";
  align-items: center;
  column-gap: clamp(8px, 1.2vw, 14px);
  row-gap: 6px;
  padding: 11px 0;
}
.checkout-layout .cart-item:last-child { border-bottom: 0; }
.checkout-item-product { grid-area: product; display: flex; align-items: center; gap: 10px; }
.checkout-item-product img {
  width: 42px;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 6px;
  background: #101913;
}
.checkout-item-product > div { min-width: 0; }
.checkout-layout .cart-item .checkout-item-total {
  grid-area: total;
  justify-self: end;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.checkout-layout #cart-items .cart-item > .cart-quantity {
  grid-area: quantity;
  grid-template-columns: 32px minmax(20px, auto) 32px;
  gap: 3px;
  align-items: center;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.checkout-layout #cart-items .cart-quantity small { grid-column: 1 / -1; grid-row: 2; }
.checkout-layout #cart-items .cart-item button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  line-height: 1;
}
.checkout-layout #cart-items .cart-item > button[data-remove] {
  grid-area: remove;
  font-size: 1.08rem;
  color: #d7b4ad;
}
#checkout.checkout-compact { min-width: 0; margin: 0; }
.checkout-compact .checkout-order-summary {
  position: static;
  padding: 16px;
  margin: 0;
  background: #1c291f;
  border-color: var(--checkout-border);
}
.checkout-compact .checkout-grand-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
}
.checkout-compact .checkout-grand-total span { font-size: .9rem; overflow-wrap: anywhere; }
.checkout-compact .checkout-grand-total strong { margin: 0; font-size: 1.38rem; white-space: nowrap; color: #cdff36; }
.checkout-compact .checkout-order-summary dl { margin: 0 0 12px; }
.checkout-compact .checkout-order-summary dl > div { padding: 6px 0; }
.checkout-compact [data-member-discount] { color: #a9e99d; }
.checkout-compact .checkout-method-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  text-align: left;
  border: 1px solid var(--checkout-border);
  border-radius: 8px;
  background: #17221a;
  color: #eef5ea;
}
.checkout-method-trigger small { display: block; color: #b8c7ba; }
.checkout-compact .checkout-use-balance { margin: 8px 0 0; padding: 8px 10px; }
.checkout-compact .checkout-order-summary > p:empty { display: none; }
.checkout-compact .checkout-order-summary > .primary { margin-top: 10px; justify-content: center; }

#cart-dialog .checkout-payment-picker {
  width: min(520px, calc(100vw - 24px));
  max-height: 90dvh;
  color: #eef5ea;
  background: #18231c;
  border: 1px solid #435848;
  border-radius: 14px;
  box-shadow: 0 14px 40px #0007;
  padding: 0;
}
#cart-dialog .checkout-payment-picker[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.checkout-payment-picker .mobile-payment-head,
.checkout-payment-picker .mobile-payment-footer { padding: 10px 14px; border-color: #34483a; background: #1c2b20; }
.checkout-payment-picker .mobile-payment-head h3 { font-size: 1rem; }
.checkout-payment-picker .mobile-payment-head button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  font-size: 1.2rem;
  line-height: 1;
  color: #e4efe3;
}
.checkout-payment-picker .mobile-payment-options {
  display: grid;
  align-content: start;
  gap: 12px;
  max-height: none;
  min-width: 0;
  padding: 10px 14px 14px;
  scrollbar-gutter: stable;
}
#cart-dialog .checkout-payment-picker .checkout-methods {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.checkout-payment-picker .checkout-payment-caption,
.checkout-payment-picker legend { color: #bdcebf; font-size: .78rem; font-weight: 600; padding: 0; }
.checkout-payment-picker .checkout-methods legend { margin-bottom: 6px; }
.checkout-payment-picker .checkout-methods a { font-size: .75rem; margin: 2px 0 0; }
.checkout-payment-picker .checkout-channel-groups { gap: 8px; margin: 4px 0 0; }
.checkout-payment-picker .checkout-channel-groups fieldset {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 137px), 1fr));
  gap: 6px;
  border: 0;
  padding: 0;
  margin: 0;
}
.checkout-payment-picker .checkout-channel-groups legend { margin-bottom: 4px; }
.checkout-payment-picker .checkout-methods label,
#cart-dialog .checkout-payment-picker .checkout-channel-groups label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  padding: 6px 8px;
  margin: 0;
  border: 1px solid #3e5243;
  border-radius: 8px;
  background: #202e24;
  outline: none;
  font-size: .8rem;
  color: #edf3ea;
}
.checkout-payment-picker label input[type="radio"] {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #caff3d;
}
.checkout-payment-picker .checkout-methods label:has(input:checked),
#cart-dialog .checkout-payment-picker .checkout-channel-groups label:has(input:checked) {
  border-color: #b1d963;
  background: #2c3e24;
}
.checkout-payment-picker label:has(input:focus-visible) { outline: 2px solid #caff3d !important; outline-offset: 1px; }
.checkout-payment-picker label span { min-width: 0; overflow-wrap: anywhere; }
.checkout-payment-picker .checkout-methods small,
.checkout-payment-picker .checkout-channel-groups small { display: block; color: #b3c4b6; margin: 2px 0 0; font-size: .7rem; }
.checkout-payment-picker .mobile-payment-footer .primary { justify-content: center; padding: 10px; margin: 0; }

@media (max-width: 760px) {
  #cart-dialog { padding: 12px; }
  .checkout-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .checkout-layout > #cart-items { padding: 0 10px; }
  .checkout-layout #cart-items .cart-item > .checkout-item-product { grid-area: product; }
  .checkout-compact .checkout-order-summary { padding: 12px; }
}
@media (max-width: 520px) {
  .checkout-layout #cart-items .cart-item {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "product product remove" "total quantity quantity";
  }
  .checkout-layout .cart-item .checkout-item-total { justify-self: start; }
  .checkout-layout #cart-items .cart-item > .cart-quantity { justify-self: end; }
}
