@font-face {
  font-family: "Checkout Inter";
  src: url("./fonts/checkout-inter.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Checkout JetBrains Mono";
  src: url("./fonts/checkout-jetbrains-mono.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

.checkout-dialog {
  --checkout-mono: "Checkout JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --checkout-surface: #f8fafc;
  --checkout-border: #e2e8f0;
  --checkout-text: #334155;
  --checkout-muted: #64748b;
  --checkout-width: 512px;
  position: fixed;
  inset: calc(var(--checkout-visual-top, 0px) + var(--builder-visual-height, 100dvh) / 2) 0 auto;
  translate: 0 -50%;
  margin: 0 auto;
  width: min(calc(100% - 32px), var(--checkout-width));
  max-width: none;
  max-height: min(90vh, calc(var(--builder-visual-height, 100dvh) - 32px));
  border: 0;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a;
  font: 400 14px/1.43 "Checkout Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--checkout-text);
}
.checkout-dialog::backdrop { background: #02061799; backdrop-filter: none }
.checkout-dialog p, .checkout-dialog h2, .checkout-dialog h3, .checkout-dialog dl, .checkout-dialog dd { margin: 0 }
.checkout-dialog .checkout-header {
  flex: none;
  gap: 16px;
  padding: 0;
  border: 0;
}
.checkout-dialog h2 { color: var(--navy); font-size: 20px; line-height: 28px; font-weight: 700 }
.checkout-dialog .checkout-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #475569;
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
}
.checkout-dialog .checkout-close:hover { color: #1e293b; background: #f1f5f9 }
.checkout-body { min-height: 0; overflow: auto; overscroll-behavior: contain }
.checkout-dialog label { min-width: 0; font-weight: 600 }
.checkout-dialog input:not([type=checkbox]):not([type=radio]), .checkout-dialog textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  color: #0f172a;
}
.checkout-dialog textarea { resize: vertical }
.checkout-dialog input::placeholder, .checkout-dialog textarea::placeholder { color: #64748b }
.checkout-dialog input:focus, .checkout-dialog textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: -1px;
}
.checkout-primary {
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-weight: 600;
}
.checkout-primary:hover:enabled { background: var(--navy-deep) }
.checkout-dialog button:disabled { opacity: .5 }
.checkout-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.checkout-dialog .checkout-intro { color: #475569; margin: 8px 0 20px }
.checkout-dialog [role="status"]:empty { display: none }

.checkout-review, .checkout-delivery-dialog[data-delivery-step="zip"] {
  border: 1px solid var(--checkout-border);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px #00000040;
}
.checkout-review::backdrop, .checkout-delivery-dialog[data-delivery-step="zip"]::backdrop {
  background: #020617b3;
  backdrop-filter: blur(4px);
}
.checkout-review {
  --checkout-width: 576px;
  max-height: min(85vh, calc(var(--builder-visual-height, 100dvh) - 32px));
}
.checkout-review .checkout-header {
  background: var(--checkout-surface);
  border-bottom: 1px solid #f1f5f9;
  padding: 20px;
}
.checkout-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap }
.checkout-review h2 { font-size: 16px; line-height: 24px; font-weight: 900; letter-spacing: -.025em; text-transform: uppercase }
.checkout-reference {
  border-radius: 4px;
  background: var(--navy);
  color: white;
  padding: 2px 8px;
  font: 700 10px/15px var(--checkout-mono);
  white-space: nowrap;
}
.checkout-review .checkout-header p {
  margin-top: 2px;
  color: #64748b;
  font: 400 10px/15px var(--checkout-mono);
}
.checkout-review .checkout-close { width: 32px; height: 32px; border: 1px solid var(--checkout-border); font-weight: 400 }
.checkout-review-body { flex: 1 1 auto; padding: 24px }
.checkout-review-body > * + * { margin-top: 16px }
.checkout-order {
  background: #fafbfc;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 16px;
}
.checkout-items { display: grid; gap: 6px; list-style: none; margin: 0; padding: 0 }
.checkout-items li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px dashed #64748b;
  padding: 6px 0;
  font-size: 12px;
  line-height: 16px;
}
.checkout-items li:first-child { align-items: flex-start; padding-top: 0; padding-bottom: 8px; border-bottom-color: var(--checkout-border) }
.checkout-items li strong { color: #1e293b; font-weight: 600; text-transform: uppercase }
.checkout-items li:first-child strong { font-weight: 700; text-transform: none }
.checkout-base-specs { display: block; color: var(--checkout-muted); font-size: 11px; line-height: 16px; margin: 3px 0 0 }
.checkout-item-price {
  flex: none;
  max-width: 38%;
  color: var(--navy);
  font: 700 12px/16px var(--checkout-mono);
  text-align: right;
}
.checkout-item-price[data-secondary] { color: #475569; font-size: 10px; font-weight: 500 }
.checkout-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 2px solid var(--navy);
  color: var(--navy);
}
.checkout-total strong:first-child { text-transform: uppercase; font-size: 12px; font-weight: 900 }
.checkout-total strong:last-child { font: 800 16px/24px var(--checkout-mono); white-space: nowrap }
.checkout-finishes {
  padding: 14px;
  border: 1px solid var(--checkout-border);
  border-radius: 8px;
  box-shadow: 0 1px 2px #0000000d;
}
.checkout-finishes-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1e293b;
}
.checkout-finishes h3 {
  color: var(--navy);
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.checkout-finishes-heading span {
  flex: none;
  border-radius: 100px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #047857;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 600;
}
.checkout-finishes dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px }
.checkout-finishes dl > div { padding: 8px; border-radius: 4px; border: 1px solid #1e293b; background: var(--checkout-surface) }
.checkout-finishes dt { color: var(--checkout-muted); font-size: 9px; font-weight: 600; text-transform: uppercase }
.checkout-finishes dd { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: #1e293b; font-size: 10px; font-weight: 700 }
.checkout-color { width: 14px; height: 14px; border: 1px solid #0003; border-radius: 50%; flex: none }
.checkout-dialog #review-detail { margin-top: 16px; color: var(--checkout-muted); font-size: 12px }
.checkout-review-footer { flex: none; padding: 18px; border-top: 1px solid #f1f5f9; background: var(--checkout-surface) }
.checkout-review-actions { display: flex; gap: 8px }
.checkout-review-actions button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 12px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.checkout-review-actions .checkout-proceed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: transparent;
  color: white;
  background: #059669;
  background: oklch(59.6% .145 163.225);
  box-shadow: 0 1px 2px #0000000d;
}
.checkout-proceed:hover:enabled { background: #047857; background: oklch(50.8% .118 165.612) }
.checkout-proceed svg { width: 16px; height: 16px; flex: none }
.checkout-customize:hover { border-color: #94a3b8 }
.checkout-review-links { display: flex; justify-content: center; gap: 20px; margin-top: 12px; font-size: 11px }
.checkout-review-links button { color: var(--checkout-muted); font-weight: 500 }
.checkout-review-links:has(> #edit-delivery[hidden]):has(> #review-quote[hidden]),
.checkout-delivery-links:has(> #switch-delivery-method[hidden]):has(> #continue-without-freight[hidden]) { display: none }
.checkout-dialog #cart-status { margin: 0 0 12px; font-size: 12px; text-align: center; color: #92400e }
#cart-picture-status { margin: 0 0 12px; font-size: 12px; text-align: center; color: var(--navy) }
#cart-picture-status:empty { display: none }
#retry-cart-pictures { display: block; margin: -6px auto 12px; font-size: 12px }
#direct-cart svg { width: 12px; height: 12px; display: inline-block; vertical-align: text-bottom; margin-left: 2px }
.checkout-review-links:has(> #direct-cart[hidden]) { display: none }

.checkout-delivery-dialog, .checkout-contact { padding: 24px }
.checkout-address-fields, .checkout-method { margin: 0; padding: 0; border: 0; min-width: 0 }
.checkout-address-fields { display: grid; gap: 12px; margin-bottom: 12px }
.checkout-zip-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: end }
.checkout-address-note { grid-column: 1 / -1; color: var(--checkout-muted); font-size: 12px }
.checkout-zip-row > .checkout-primary { grid-column: 1 / -1; margin-top: 4px }
.checkout-zip-row > [role="status"] { grid-column: 1 / -1; color: var(--navy); font-size: 12px }
.checkout-zip-row > [data-error] { color: #b91c1c }
.checkout-delivery-links { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px }
.checkout-delivery-links button { color: var(--checkout-muted); font-size: 11px }
.checkout-delivery-dialog[data-delivery-step="zip"] { --checkout-width: 448px; overflow-y: auto }
.checkout-delivery-dialog[data-delivery-step="zip"] .checkout-header { min-height: 28px; margin-bottom: 16px }
.checkout-delivery-dialog[data-delivery-step="zip"] h2 { font-size: 18px; font-weight: 900; line-height: 28px; letter-spacing: -.025em; text-transform: uppercase }
.checkout-delivery-dialog[data-delivery-step="zip"] .checkout-close { position: absolute; right: 16px; top: 16px; width: 28px; height: 28px; background: #f1f5f9 }
.checkout-delivery-dialog[data-delivery-step="zip"] .checkout-intro { margin: 0 0 14px; font-size: 12px; line-height: 19.5px }
.checkout-delivery-dialog[data-delivery-step="zip"] .checkout-body { padding-bottom: 20px }
.checkout-delivery-dialog[data-delivery-step="zip"] .checkout-zip-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px }
.checkout-delivery-dialog[data-delivery-step="zip"] .checkout-primary { grid-column: auto; grid-row: 1; grid-column-start: 2; margin: 0; min-height: 38px; padding: 8px 16px; border-radius: 4px }
.checkout-delivery-dialog[data-delivery-step="zip"] #quote-delivery-zip { margin: 0; min-height: 38px; padding: 8px 12px; border-radius: 4px; font-size: 14px; line-height: 20px }
.checkout-delivery-dialog[data-delivery-step="zip"] #quote-delivery-zip:focus { border-color: var(--navy); outline: 1px solid var(--navy) }
.checkout-delivery-dialog[data-delivery-step="zip"] #quote-delivery-zip-field span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
.checkout-delivery-dialog[data-pickup] .checkout-primary { grid-column: 1 / -1 }

.checkout-contact .checkout-intro { margin-bottom: 20px; font-size: 14px; line-height: 20px }
.checkout-delivery-box {
  border: 1px solid #e0f2fe;
  border-radius: 8px;
  background: #f0f9ff;
  color: var(--navy);
  padding: 12px;
  margin-bottom: 16px;
}
.checkout-delivery-box > div { display: flex; align-items: center; justify-content: space-between; gap: 12px }
.checkout-delivery-box p { margin-top: 4px; overflow-wrap: anywhere }
.checkout-delivery-box button { padding: 4px }
.checkout-method { margin-bottom: 16px }
.checkout-method legend { padding: 0; font-weight: 600 }
.checkout-method > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 6px; margin-top: 8px }
.checkout-method label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 6px;
  gap: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-weight: 400;
  text-align: center;
  cursor: pointer;
}
.checkout-method label:has(:checked) { border-color: var(--navy); background: #f0f9ff; color: var(--navy); font-weight: 600 }
.checkout-method input { margin: 0; width: 14px; height: 14px; flex: none; accent-color: var(--navy) }
.checkout-method p, .checkout-dialog .checkout-contact-privacy { margin-top: 8px; color: var(--checkout-muted); font-size: 12px; line-height: 16px }
.checkout-contact-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px }
.checkout-contact-fields label, .checkout-notes { font-size: 14px; line-height: 20px }
.checkout-notes { display: block; margin-top: 16px }
.checkout-contact textarea::placeholder { color: #94a3b8 }
.checkout-dialog .checkout-contact-privacy { margin-top: 12px }
.checkout-contact-footer { flex: none; padding-top: 20px }
.checkout-contact-footer .checkout-primary { font-size: 16px; line-height: 24px; min-height: 48px }
.checkout-toast {
  position: fixed;
  z-index: 12;
  left: auto;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(440px,calc(100vw - 32px));
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--navy);
  border-radius: 10px;
  padding: 13px 38px 13px 15px;
  background: white;
  box-shadow: 0 10px 32px #0f172a33;
  color: var(--navy);
  font: 400 13px/1.45 "Checkout Inter", "Segoe UI", sans-serif;
}
.checkout-toast[data-state="success"] { border-left-color: #059669 }
.checkout-toast[data-state="error"] { border-left-color: #ca8a04 }
.checkout-toast p { color: #475569; margin: 3px 0 0 }
.checkout-toast button { position: absolute; top: 4px; right: 7px; border: 0; background: none; font-size: 22px }
.checkout-dialog #contact-status { margin: 16px 0 0; color: var(--navy) }

@media (max-width: 1023px), (pointer: coarse) {
  .checkout-dialog, .checkout-review {
    width: min(calc(100% - max(8px, env(safe-area-inset-left)) - max(8px, env(safe-area-inset-right))), var(--checkout-width));
    max-height: calc(var(--builder-visual-height, 100dvh) - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom)));
    border-radius: 12px;
  }
  .checkout-review .checkout-header { padding: 10px 12px; gap: 8px }
  .checkout-title-row { row-gap: 4px }
  .checkout-title-row h2 { max-width: calc(100% - 12px) }
  .checkout-dialog h2, .checkout-review h2 { font-size: 15px; line-height: 19px }
  .checkout-dialog .checkout-close { width: 44px; height: 44px }
  .checkout-review-body { padding: 12px; overflow-x: hidden }
  .checkout-review-footer { padding: 10px 12px; max-height: calc(var(--builder-visual-height, 100dvh) * .45); overflow-y: auto }
  .checkout-review-links:has(> #direct-cart) { display: none }
  .checkout-review-actions button { min-height: 46px; padding: 8px; font-size: 11px; line-height: 15px }
  .checkout-contact, .checkout-delivery-dialog { padding: 12px }
  .checkout-delivery-dialog[data-delivery-step="zip"] { padding: 16px }
  .checkout-delivery-dialog[data-delivery-step="zip"] .checkout-close { top: 6px; right: 6px; width: 44px; height: 44px }
  .checkout-delivery-dialog[data-delivery-step="zip"] .checkout-header { min-height: 25px }
  .checkout-delivery-dialog[data-delivery-step="zip"] h2 { padding-right: 40px; font-size: 16px; line-height: 25px }
  .checkout-dialog[data-delivery-step="zip"] #quote-delivery-zip { min-height: 44px; font-size: 16px }
  .checkout-dialog[data-delivery-step="zip"] .checkout-primary { min-height: 44px }
  .checkout-contact .checkout-header, .checkout-delivery-dialog[data-delivery-step="address"] .checkout-header { padding-bottom: 8px }
  .checkout-contact .checkout-body, .checkout-delivery-dialog[data-delivery-step="address"] .checkout-body { padding-right: 3px }
  .checkout-contact .checkout-intro, .checkout-delivery-dialog[data-delivery-step="address"] .checkout-intro { margin: 0 0 12px; font-size: 13px; line-height: 18px }
  .checkout-method label { min-height: 50px; line-height: 16px }
  .checkout-contact-footer { padding-top: 10px }
  .checkout-toast {
    inset-inline: max(8px, env(safe-area-inset-left)) max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    max-width: 440px;
    margin-inline-start: auto;
    padding-right: 52px;
  }
  .checkout-toast button { min-width: 44px; min-height: 44px; top: 0; right: 0 }
}
@media (max-width: 639px) {
  .checkout-finishes dl { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .checkout-contact-fields { grid-template-columns: minmax(0, 1fr) }
  .checkout-method label { font-size: 12px }
}
@media (max-height: 520px) and (max-width: 1023px), (max-height: 520px) and (pointer: coarse) {
  .checkout-review .checkout-header, .checkout-review-footer { padding-block: 6px }
  .checkout-contact-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
}
@media (max-width: 359px) {
  .checkout-contact-fields { grid-template-columns: minmax(0, 1fr) }
  .checkout-delivery-dialog[data-delivery-step="zip"] .checkout-zip-row { grid-template-columns: minmax(0, 1fr) }
  .checkout-delivery-dialog[data-delivery-step="zip"] .checkout-primary { grid-column: 1; grid-row: 2 }
}
