/* Shop checkout.
 *
 * Full-screen editorial sheet, modeled on the "Checkout" design canvas and
 * matching the shop home, ticket sheet and cart: a slim sticky bar, a step
 * eyebrow over a big "Checkout" title, a collapsible order summary with the
 * hairline ledger, underline contact fields, the Stripe payment element
 * under a PAYMENT METHOD rule (Stripe draws its own method tabs and card
 * fields; those are left to Stripe), fine print, and a sticky dock with the
 * total and a square PAY button.
 *
 * The id is `shop-checkout`, not `mobile-…-modal`, so neither the light
 * theme's `[id*="modal"] *` repaint nor mobile-button-safety.css's white
 * button repaint matches it. Colors still carry the id and !important
 * against the `[data-theme="light"] *` rules.
 */
html body #shop-checkout {
    --co-ink: #0d0f0e;
    --co-body: #6f6f69;
    --co-mute: #9a9a93;
    --co-label: #8b8b85;
    --co-hair: #e6e6e2;
    --co-rule: #dcdcd6;
    --co-paper: #ffffff;
    --co-placeholder: #b6b6ae;
    --co-danger: #c4444c;
    --co-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    background: var(--co-paper) !important;
    color: var(--co-ink) !important;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

html body #shop-checkout,
html body #shop-checkout * {
    box-sizing: border-box;
}

html body #shop-checkout .co-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 28px;
}

/* Sticky bar */
html body #shop-checkout .co-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(env(safe-area-inset-top, 0px) + 14px) 20px 12px;
    background: rgba(255, 255, 255, 0.93) !important;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--co-hair);
}

html body #shop-checkout .co-bar span {
    font-family: var(--co-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--co-label) !important;
    -webkit-text-fill-color: var(--co-label) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

html body #shop-checkout .co-bar button {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 15px;
    line-height: 1;
    color: var(--co-label) !important;
    -webkit-text-fill-color: var(--co-label) !important;
    cursor: pointer;
}

/* Intro */
html body #shop-checkout .co-intro {
    padding: 32px 20px 0;
}

html body #shop-checkout .co-eyebrow {
    font-family: var(--co-mono);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    color: var(--co-label) !important;
    -webkit-text-fill-color: var(--co-label) !important;
}

html body #shop-checkout .co-intro h2 {
    margin: 14px 0 0;
    font-size: 32px;
    line-height: 1.05;
    letter-spacing: -0.025em;
    font-weight: 600;
    color: var(--co-ink) !important;
    -webkit-text-fill-color: var(--co-ink) !important;
}

/* Section heads */
html body #shop-checkout .co-section {
    padding: 0 20px;
}

html body #shop-checkout .co-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 12px;
    font-family: var(--co-mono);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    color: var(--co-ink) !important;
    -webkit-text-fill-color: var(--co-ink) !important;
}

html body #shop-checkout .co-head.is-ruled {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--co-ink);
}

html body #shop-checkout .co-head button {
    padding: 16px 0;
    margin: -16px 0;
    min-height: 44px;
    border: 0;
    background: transparent !important;
    box-shadow: none !important;
    font-family: var(--co-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--co-label) !important;
    -webkit-text-fill-color: var(--co-label) !important;
    cursor: pointer;
}

/* Order summary */
html body #shop-checkout .co-lines[hidden] {
    display: none;
}

html body #shop-checkout .co-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    border-top: 1px solid var(--co-hair);
    padding: 13px 0;
}

html body #shop-checkout .co-line-name {
    font-size: 14.5px;
    letter-spacing: -0.01em;
    color: var(--co-ink) !important;
    -webkit-text-fill-color: var(--co-ink) !important;
}

html body #shop-checkout .co-line-meta {
    margin-top: 5px;
    font-family: var(--co-mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    color: var(--co-mute) !important;
    -webkit-text-fill-color: var(--co-mute) !important;
}

html body #shop-checkout .co-line-total {
    font-size: 14.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--co-ink) !important;
    -webkit-text-fill-color: var(--co-ink) !important;
}

html body #shop-checkout .co-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1px solid var(--co-hair);
    padding: 13px 0;
}

html body #shop-checkout .co-row > span:first-child {
    font-size: 14px;
    color: var(--co-body) !important;
    -webkit-text-fill-color: var(--co-body) !important;
}

html body #shop-checkout .co-row > span:last-child {
    font-size: 14.5px;
    font-variant-numeric: tabular-nums;
    color: var(--co-ink) !important;
    -webkit-text-fill-color: var(--co-ink) !important;
}

html body #shop-checkout .co-row small,
html body #shop-checkout .co-row > span.co-note {
    font-family: var(--co-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--co-mute) !important;
    -webkit-text-fill-color: var(--co-mute) !important;
}

html body #shop-checkout .co-row > span.co-note {
    font-size: 11px;
    letter-spacing: 0.12em;
}

html body #shop-checkout .co-row.is-total {
    border-top: 1px solid var(--co-ink);
    padding: 16px 0 0;
}

html body #shop-checkout .co-row.is-total > span:first-child {
    font-size: 15px;
    font-weight: 600;
    color: var(--co-ink) !important;
    -webkit-text-fill-color: var(--co-ink) !important;
}

html body #shop-checkout .co-row.is-total > span:last-child {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Fields: underline inputs with mono labels */
html body #shop-checkout .co-fields {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

html body #shop-checkout .co-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

html body #shop-checkout .co-grid.is-2-1 {
    grid-template-columns: 2fr 1fr;
}

html body #shop-checkout .co-field label {
    display: block;
    font-family: var(--co-mono);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    color: var(--co-mute) !important;
    -webkit-text-fill-color: var(--co-mute) !important;
}

html body #shop-checkout .co-field input {
    display: block;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 13px 0 14px;
    border: 0 !important;
    border-bottom: 1px solid var(--co-rule) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: var(--co-ink) !important;
    -webkit-text-fill-color: var(--co-ink) !important;
    caret-color: var(--co-ink);
    -webkit-appearance: none;
    appearance: none;
}

html body #shop-checkout .co-field input::placeholder {
    color: var(--co-placeholder) !important;
    -webkit-text-fill-color: var(--co-placeholder) !important;
    opacity: 1;
}

html body #shop-checkout .co-field input:focus {
    border-bottom-color: var(--co-ink) !important;
}

/* Stripe mounts: wallet buttons above a mono divider, then the card element */
html body #shop-checkout .co-stripe {
    margin-top: 20px;
}

html body #shop-checkout .co-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    font-family: var(--co-mono);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    color: var(--co-mute) !important;
    -webkit-text-fill-color: var(--co-mute) !important;
}

html body #shop-checkout .co-divider::before,
html body #shop-checkout .co-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--co-hair);
}

html body #shop-checkout .co-unavailable {
    padding: 24px 0;
    font-family: var(--co-mono);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    line-height: 1.7;
    color: var(--co-mute) !important;
    -webkit-text-fill-color: var(--co-mute) !important;
}

/* Fine print */
html body #shop-checkout .co-fine {
    margin-top: 40px;
    padding: 22px 20px 0;
    border-top: 1px solid var(--co-hair);
    font-family: var(--co-mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    line-height: 1.7;
    color: var(--co-mute) !important;
    -webkit-text-fill-color: var(--co-mute) !important;
}

/* Dock */
html body #shop-checkout .co-dock {
    flex: 0 0 auto;
    padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.94) !important;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--co-rule);
}

html body #shop-checkout .co-dock-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

html body #shop-checkout .co-dock-line span {
    font-family: var(--co-mono);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    color: var(--co-label) !important;
    -webkit-text-fill-color: var(--co-label) !important;
}

html body #shop-checkout .co-dock-line strong {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--co-ink) !important;
    -webkit-text-fill-color: var(--co-ink) !important;
}

html body #shop-checkout .co-dock-breakdown {
    margin-top: 6px;
    font-family: var(--co-mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    color: var(--co-mute) !important;
    -webkit-text-fill-color: var(--co-mute) !important;
}

/* The status line the payment script writes into: it sets display, a pink
   background and red text inline; keep it readable and in the system. */
html body #shop-checkout #payment-status {
    margin-top: 12px;
    padding: 0 !important;
    background: transparent !important;
    font-family: var(--co-mono);
    font-size: 10.5px;
    letter-spacing: 0.1em;
    line-height: 1.6;
    color: var(--co-danger) !important;
    -webkit-text-fill-color: var(--co-danger) !important;
}

html body #shop-checkout #pay-button {
    position: static;
    margin-top: 16px;
    width: 100%;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--co-ink) !important;
    box-shadow: none !important;
    font-family: var(--co-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--co-paper) !important;
    -webkit-text-fill-color: var(--co-paper) !important;
    cursor: pointer;
    transition: background 140ms ease;
}

html body #shop-checkout #pay-button:disabled {
    background: var(--co-rule) !important;
    color: var(--co-mute) !important;
    -webkit-text-fill-color: var(--co-mute) !important;
    cursor: default;
}

/* Post-payment confirmation, rendered by the payment script into
   #payment-instructions; give it the sheet's padding. */
html body #shop-checkout #payment-instructions {
    padding: 24px 20px;
}

/* While the ledger's "Total due" row is on screen the dock would repeat the
   same number an inch below it; collapse the dock to just the button until
   the ledger scrolls away (toggled by an IntersectionObserver). */
html body #shop-checkout .co-dock.is-ledger-visible .co-dock-line,
html body #shop-checkout .co-dock.is-ledger-visible .co-dock-breakdown {
    display: none;
}

html body #shop-checkout .co-dock.is-ledger-visible button {
    margin-top: 0;
}
