#checkoutDialog {
  --checkout-ink: #243227;
  --checkout-muted: #566257;
  --checkout-line: #dce2d9;
  --checkout-tint: #f3f5f0;
  width: min(960px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  scroll-padding-block: 74px 16px;
  border: 1px solid var(--checkout-line);
  border-radius: 16px;
  color: var(--checkout-ink);
  background: #fff;
}

body.campaign-store #checkoutDialog { padding-bottom: 0; }
#checkoutDialog [hidden] { display: none !important; }

.checkout-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--checkout-line);
  background: #fff;
}

.checkout-header p {
  margin: 0 0 2px;
  color: var(--checkout-muted);
  font-size: 10px;
  letter-spacing: .16em;
}

#checkoutDialog .checkout-header h2 {
  margin: 0;
  padding: 0;
  font-size: 24px;
  line-height: 1.15;
}

#checkoutDialog .checkout-header .closeDialog {
  flex: 0 0 auto;
  border: 1px solid var(--checkout-line);
  background: var(--checkout-tint);
  color: var(--checkout-ink);
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

#checkoutDialog #orderForm, .checkout-summary {
  min-width: 0;
  margin: 0;
  padding: 18px 24px;
}

#orderForm > section + section, .checkout-payment { margin-top: 14px; }
.checkout-layout h3, .checkout-payment legend {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.checkout-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.checkout-section-heading span { font-size: 12px; color: var(--checkout-muted); }

.checkout-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#checkoutDialog #orderForm label {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.35;
}

#checkoutDialog #orderForm input:not([type="radio"]),
#checkoutDialog #orderForm textarea {
  min-height: 44px;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  scroll-margin-block: 0;
}

#checkoutDialog #orderForm textarea { min-height: 56px; }

.checkout-shipping {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  border: 1px solid var(--checkout-line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.checkout-payment { min-width: 0; border: 0; padding: 0; margin-inline: 0; }
.checkout-payment legend { padding: 0; }

.checkout-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}

#checkoutDialog #orderForm .checkout-method {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--checkout-line);
  border-radius: 8px;
  cursor: pointer;
}

#checkoutDialog #orderForm .checkout-method:has(input:checked) {
  border-color: #758872;
  background: #eef3eb;
}

#checkoutDialog #orderForm .checkout-method input {
  appearance: auto;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--checkout-ink);
}

#checkoutDialog #orderForm > [type="submit"] { min-height: 46px; margin-top: 12px; }
#checkoutDialog #orderStatus:empty { display: none; }
#checkoutDialog #orderForm .care-checkout-links { margin: 8px 0 0; }

.checkout-summary {
  background: var(--checkout-tint);
  border-left: 1px solid var(--checkout-line);
}

.checkout-summary-card {
  padding: 16px;
  border: 1px solid var(--checkout-line);
  border-radius: 12px;
  background: #fff;
}

.checkout-summary ul { list-style: none; margin: 12px 0; padding: 0; }
.checkout-summary li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding-block: 8px;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.checkout-summary li + li { border-top: 1px solid var(--checkout-line); }
.checkout-summary li span { display: block; margin-top: 3px; color: var(--checkout-muted); }
.checkout-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: #e6e9e1;
}
.checkout-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.checkout-summary dl, .checkout-confirmation dl { margin: 0; font-size: 14px; }
.checkout-summary dl div, .checkout-confirmation dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.checkout-summary dd, .checkout-confirmation dd { margin: 0; text-align: right; }
.checkout-summary .checkout-grand-total {
  border-top: 1px solid var(--checkout-line);
  padding-top: 12px;
  font-size: 16px;
  font-weight: 700;
}

.checkout-confirmation {
  max-width: 500px;
  margin: 0 auto;
  padding: 26px 24px;
}

.checkout-confirmation h3 { margin: 0; font-size: 23px; }
.checkout-confirmation > p { color: var(--checkout-muted); line-height: 1.5; }
.checkout-confirmation-details {
  padding: 8px 14px 14px;
  border: 1px solid var(--checkout-line);
  border-radius: 10px;
  background: var(--checkout-tint);
  overflow-wrap: anywhere;
}
.checkout-confirmation dd { font-weight: 650; }
.checkout-confirmation .payment-instructions,
.checkout-confirmation .payment-receipt { font-size: 14px; }
.checkout-continue {
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  border: 0;
  border-radius: 8px;
  background: var(--checkout-ink);
  color: #fff;
}

@media (max-width: 700px) {
  #checkoutDialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .checkout-layout { grid-template-columns: minmax(0, 1fr); }
  .checkout-header, #checkoutDialog #orderForm, .checkout-summary { padding-inline: 16px; }
  .checkout-summary { grid-row: 1; border-left: 0; border-bottom: 1px solid var(--checkout-line); }
  #checkoutDialog #orderForm { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  #checkoutContact + .checkout-field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .checkout-summary li { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 6px; }
}

#checkoutDialog .checkout-thumb,
.checkout-summary .checkout-product-name,
.checkout-item-actions button,
.checkout-undo button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
#checkoutDialog .checkout-thumb { width: 100%; padding: 0; }
.checkout-summary .checkout-product-name {
  padding: 0;
  background: transparent;
  font-weight: 650;
  text-align: left;
}
.checkout-summary .checkout-product-name:hover { text-decoration: underline; }
.checkout-item-price { white-space: nowrap; }
.checkout-item-actions { display: flex; flex-wrap: wrap; gap: 0 12px; }
.checkout-item-actions button,
.checkout-undo button {
  min-height: 32px;
  padding: 3px 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.checkout-undo { display: flex; align-items: center; gap: 10px; font-size: 13px; }
#checkoutEmpty { font-size: 13px; line-height: 1.5; }

.product-dialog[data-checkout-review] .purchase-actions,
.product-dialog[data-checkout-review] .customer-variants,
.product-dialog[data-checkout-review] .size-options,
.product-dialog[data-checkout-review] :is(#detailSize, #detailQty, #detailAdd),
.product-dialog[data-checkout-review] label:is([for="detailSize"], [for="detailQty"]) { display: none; }
.campaign-store .product-dialog[data-checkout-review] > .detail-close {
  position: sticky;
  inset: 0 auto auto 0;
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  height: auto;
  min-height: 44px;
  margin: 0 0 14px;
  padding: 10px 16px;
  border: 1px solid var(--store-ink, #243227);
  border-radius: 10px;
  background: var(--store-ink, #243227);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}
.campaign-store .product-dialog[data-checkout-review] > .detail-close::before {
  content: "←" / "";
  font-size: 18px;
  line-height: 1;
}
.campaign-store .product-dialog[data-checkout-review] > .detail-close:hover {
  background: #354638;
}
.campaign-store .product-dialog[data-checkout-review] > .detail-close:focus-visible {
  outline: 2px solid #3d5844;
  outline-offset: 3px;
}
.checkout-reviewed-selection { font-size: 14px; font-weight: 600; }

@media (max-width: 700px) {
  .checkout-item-actions button, .checkout-undo button { min-height: 44px; }
}
