/* GuestPackSheet uses a 32/38 extrabold headline, 24px gutters and pill buttons.
   CardDetailsSheet uses 20px gutters, a white/5 facts surface and #5fb56b values.
   Icon IDs follow Hermes module 4423's ui.ttf map (U+E900 + glyph index). */
@font-face {
  font-family: Checkout Icons;
  src: url('/fonts/checkout-ui.ttf') format('truetype');
}

#page-dialog:has(.checkout-sheet) {
  width: min(100%, 440px);
  max-width: calc(100% - 24px);
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  overflow: auto;
  background: #18151e;
  border: 1px solid #ffffff25;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
}
@media (min-width: 701px) and (min-height: 601px), (min-width: 701px) and (pointer: fine) {
  #page-dialog:has(.checkout-sheet[data-checkout="preview"]) {
    inset: 0;
    margin: auto;
    border: 1px solid #ffffff25;
    border-radius: 24px;
  }
}
.checkout-sheet {
  font: 400 .9375rem/1.45 Manrope, sans-serif;
  color: #fafafa;
  background: #18151e;
}
.checkout-sheet .close-layer {
  top: 8px; right: 8px; width: 44px; height: 44px;
  border: 0; background: transparent; font-size: 0;
}
.checkout-sheet .close-layer::before {
  content: '\e937';
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; background: #201d28e6;
  color: #fafafad9; font: 16px/1 'Checkout Icons';
}
.checkout-stage {
  height: clamp(140px, 24dvh, 220px);
  display: grid; place-items: center;
  background: #272235 url('/art/card-detail-bg.webp') center top / cover no-repeat;
}
.checkout-photo { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.checkout-stage:has(.merch-photo) { background-color: #e7ded8; }
.checkout-photo.merch-photo { border: 0; border-radius: 0; padding: 0; object-fit: contain; }
.checkout-sheet:is([data-checkout=paid],[data-checkout=limit]) .checkout-stage {
  height: clamp(116px, 17dvh, 162px);
  background: radial-gradient(ellipse at 50% 74%, #7048a666, transparent 59%), #18151e;
}
.checkout-body { padding: 17px 20px max(12px, env(safe-area-inset-bottom)); }
.checkout-caption,.checkout-small,.checkout-metrics dt,.checkout-facts dt { color: #c6bed3; font-size: .75rem; }
.checkout-caption { color: #d6c3ff; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.checkout-title { margin: 4px 0 5px; font-size: clamp(1.55rem, 6vw, 2rem); line-height: 1.18; letter-spacing: -.8px; font-weight: 800; }
.checkout-sheet:is([data-checkout=paid],[data-checkout=limit]) .checkout-title {
  text-align: center; background: linear-gradient(180deg,#fff 38%,#887cee);
  background-clip: text; color: transparent;
}
.checkout-sheet:is([data-checkout=paid],[data-checkout=limit]) :is(.checkout-caption,.checkout-description) { text-align: center; }
.checkout-description { font-size: .875rem; color: #ddd7e5; }
.checkout-metrics,.checkout-catalog,.checkout-receipt {
  margin: 14px 0 0; padding: 11px 14px; border-radius: 16px; background: #ffffff0d;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.checkout-metrics > div { min-width: 0; }
.checkout-metrics dd,.checkout-price { font-weight: 800; font-variant-numeric: tabular-nums; }
.checkout-metrics > div:first-child dd,.checkout-paid { color: #5fb56b; }
.checkout-metrics dd { margin: 2px 0 0; }
.checkout-catalog { border: 1px solid #ffffff22; }
.checkout-catalog h3 { font-size: .98rem; }
.checkout-price { max-width: 52%; text-align: right; font-size: .85rem; }
.checkout-receipt { font-weight: 700; }
.checkout-paid,.checkout-glyph { display: inline-flex; align-items: center; gap: 6px; }
.checkout-glyph { font: 16px/1 'Checkout Icons'; }
.checkout-controls { display: grid; gap: 2px; margin-top: 14px; }
.checkout-controls:has(> .checkout-ship) {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.checkout-controls .model-form,.checkout-footer .related { margin: 0; }
.checkout-controls .actions { display: grid; gap: 3px; }
.checkout-controls .button,.checkout-return {
  display: grid; place-items: center; width: 100%; min-height: 48px;
  padding: 9px 16px; border: 1px solid #e0cbff70; border-radius: 999px;
  background: linear-gradient(110deg,#c2a8ff,#e1c7ff 56%,#d4b0f3);
  color: #20122c; font-size: .9375rem; font-weight: 800; text-align: center;
}
.checkout-controls .secondary,.checkout-sheet[data-checkout=confirm] .checkout-return {
  min-height: 44px; background: transparent; border-color: transparent; color: #e1dce6;
}
.checkout-controls .checkout-ship { border-color: #ffffff3b; }
.checkout-facts { display: grid; gap: 4px; margin: 13px 0 0; }
.checkout-facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.checkout-facts dd { font-size: .75rem; text-align: right; }
.checkout-note { margin-top: 12px; color: #c3bacb; font-size: .76rem; }
.checkout-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 10px; margin-top: 7px; }
.checkout-footer .related { display: flex; flex-wrap: wrap; gap: 0 14px; }
.checkout-footer :is(a.related-link,.checkout-refresh) {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  border: 0; background: transparent; color: #dfd1f2; text-decoration: underline;
  text-underline-offset: .2em; font-size: .78rem;
}
.checkout-sheet :is(button,a):focus-visible { outline: 3px solid #f4dd92; outline-offset: 2px; }
@media (max-width: 540px) {
  #page-dialog:has(.checkout-sheet) { width: 100%; max-width: 100%; }
}
@media (max-height: 600px) {
  .checkout-stage { height: 120px; }
}
@media (forced-colors: active) {
  .checkout-sheet .checkout-title { color: CanvasText !important; }
}

/* Public What's Inside → CardUpClose. Keep the origin's dedicated odds links below
   the first panel when a SKU was reached through the H5 contents/odds pages. */
#page-dialog:has(.checkout-sheet[data-sku-rarity]) {
  --sku-photo-height: 280px;
  inset: auto 0 0; margin: 0 auto;
  width: min(100vw,460px); max-width: 100vw; min-height: 0;
  height: calc(var(--sku-photo-height) + 230px); max-height: 92dvh;
  padding: 0; border: 0; border-radius: 24px 24px 0 0;
  overflow: auto; scrollbar-width: none;
  background: #171732; box-shadow: 0 40px 100px -30px rgb(0 0 0 / 95%);
}
@media (min-width:640px) {
  #page-dialog:has(.checkout-sheet[data-sku-rarity]) {
    --sku-photo-height: clamp(260px, 100svh - 340px, 380px);
    inset: 0; margin: auto; border-radius: 24px;
  }
}
@media (461px <= width < 640px) and (pointer:fine) {
  #page-dialog:has(.checkout-sheet[data-sku-rarity]:not([data-shop-preview])) {
    --sku-photo-height: clamp(260px, 100svh - 340px, 380px);
    inset: 0; margin: auto; border-radius: 24px;
  }
}
#page-dialog:has(.checkout-sheet[data-sku-rarity])::backdrop { background: rgb(8 8 20 / 72%); backdrop-filter: blur(8px); }
#page-dialog:has(.checkout-sheet[data-sku-rarity]) > .native-sheet-grip { display: none; }
.checkout-sheet[data-sku-rarity] {
  position: relative; background: #171732;
  font: 400 16px/1.5 'Proxima Nova',system-ui,sans-serif;
  font-kerning: normal; font-feature-settings: 'salt'; -webkit-font-smoothing: antialiased;
}
[data-sku-rarity=common] { --sku-color: #9ca3af; }
[data-sku-rarity=uncommon] { --sku-color: #2fd07a; }
[data-sku-rarity=rare] { --sku-color: #4f8cff; }
[data-sku-rarity=epic] { --sku-color: #ab6eff; }
[data-sku-rarity=legendary] { --sku-color: #ff5a48; }
[data-sku-rarity=grail] { --sku-color: #ffd23c; }
.checkout-sheet[data-sku-rarity] .close-layer {
  position: sticky; top: 12px; right: auto; z-index: 2;
  display: grid; place-items: center; margin: 0 12px -44px auto; padding: 0;
}
[data-sku-rarity] .close-layer::before { width: 36px; height: 36px; background: rgb(8 8 20 / 30%); color: #abadcc; }
[data-sku-rarity] .checkout-stage {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 24px 24px 0 0;
  height: calc(var(--sku-photo-height) + 56px); padding: 28px 56px; background: #111129;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
:root .checkout-sheet[data-sku-rarity] .sku-rays {
  position: absolute; top: 50%; left: 50%; width: 190%; aspect-ratio: 1; translate: -50% -50%; z-index: -1;
  --rays: oklch(from var(--sku-color) l c h / 34%); --ray-spread: 0; --ray-top: .96;
  filter: blur(5px); opacity: 1; pointer-events: none; animation: none;
}
[data-sku-rarity] .checkout-stage::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(52% 46% at 50% 50%, oklch(from var(--sku-color) l c h / 42%), transparent 74%);
}
[data-sku-rarity] .checkout-photo {
  display: block; width: auto; max-width: 100%; height: var(--sku-photo-height); padding: 0; object-fit: contain;
  border: 0; background: transparent;
}
[data-sku-art=product] .checkout-photo { border-radius: 0; filter: drop-shadow(0 24px 30px rgb(0 0 0 / 70%)); }
[data-sku-art=card] .checkout-photo { border-radius: 8px; box-shadow: 0 30px 50px -16px rgb(0 0 0 / 90%); }
.sku-arrow {
  position: absolute; z-index: 1; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px; min-height: 0; padding: 0;
  border: 0; border-radius: 50%; color: #abadcc; background: rgb(8 8 20 / 45%); backdrop-filter: blur(4px);
}
.sku-arrow[data-direction=Previous] { left: 12px; }
.sku-arrow[data-direction=Next] { right: 12px; }
.sku-arrow::before { content: ''; width: 10px; height: 10px; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); }
.sku-arrow[data-direction=Previous]::before { transform: rotate(-135deg); }
.sku-arrow:disabled, .sku-arrow[aria-disabled=true] { opacity: .3; pointer-events: none; }
.sku-more {
  position: absolute; bottom: 6px; right: 12px; min-height: 28px; padding: 4px 8px; border: 0; border-radius: 8px;
  color: #c6c6dc; background: rgb(17 17 41 / 76%); font-size: 12px;
}
[data-sku-rarity] .checkout-body { padding: 0; }
.sku-summary { display: block; padding: 24px; text-align: center; color: white; }
.sku-summary .checkout-caption {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0;
  color: #abadcc; font-size: 13px; line-height: 19.5px; font-weight: 700; text-transform: none; letter-spacing: 0;
}
.sku-summary .checkout-caption::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--sku-color); }
.sku-summary .checkout-title {
  margin: 6px 0 0; font-family: inherit; font-size: 22px; font-weight: 800; line-height: 27.5px; letter-spacing: normal;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sku-grade { min-height: 21px; margin: 4px 0 0; color: #abadcc; font-size: 14px; line-height: 21px; font-weight: 600; }
.sku-value { margin: 12px 0 0; color: #abadcc; font-size: 36px; line-height: 36px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sku-options { padding: 18px 24px; border-top: 1px solid #ffffff18; }
@media (prefers-reduced-motion:no-preference) {
  :root:not(.reduced-motion) [data-sku-rarity] .checkout-stage:not([data-sku-step]) .checkout-photo {
    animation: sku-photo-in .28s cubic-bezier(.22,1,.36,1) 67ms backwards;
  }
  :root:not(.reduced-motion) [data-sku-rarity]:not(:has([data-sku-step])) .sku-summary > * {
    animation: sku-copy-in .28s cubic-bezier(.22,1,.36,1) var(--sku-delay,83ms) backwards;
  }
  .sku-summary h1 { --sku-delay: 116ms; }
  .sku-summary .sku-grade { --sku-delay: 150ms; }
  .sku-summary .sku-value { --sku-delay: 183ms; }
}
@keyframes sku-photo-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes sku-copy-in { from { opacity: 0; transform: translateY(10px); } }

/* A multi-box quote adds the unit price beside the order total. Keep the balance
   and order in two columns, with the amount still needed across the full row. */
#page-dialog .standard-page[data-route="9439"] .stats:has(> div:nth-child(4):last-child) {
  grid-template-columns: repeat(2,minmax(0,1fr));
  grid-template-areas: "balance total" "balance price" "shortfall shortfall";
  & > div:first-child { grid-area: balance; align-content: center; }
  & > div:nth-child(2) {
    grid-area: price; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px;
    margin-top: -1px; padding-top: 0;
    & dd { margin: 0; font-size: .8rem; }
  }
  & > div:nth-child(3) { grid-area: total; padding-bottom: 3px; }
  & > div:last-child {
    grid-area: shortfall; display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
    background: #302839;
    & dd { margin: 0; }
  }
}
