/* The checkout pop-up (templates/new-design/partials/checkout.html, static/js/checkout.js): C2 on the design canvas.
   Desktop: a 1000px dialog, the review or the card form on the left and what you pay on the right.
   Phone (below 992px, as the Make an offer pop-up): a bottom sheet, one column, the total and the button pinned.
   Self-contained on purpose: its own colors and buttons, so a page without vehicle-page.css can use it. Bootstrap's
   modal shows it; checkout.js sets data-co-step on .co and hides panels with the hidden attribute. */

.co {
    --co-navy: #19284A;
    --co-body: #4A5468;
    --co-muted: #5B6478;
    --co-line: #E3E6EC;
    --co-divider: #EEF0F4;
    --co-soft: #F3F3F3;
    --co-ground: #F7F8FA;
    --co-purple: #5B2FC9;
    --co-purple-soft: #F4F1FC;
    --co-good: #0F6B3E;
    --co-good-bg: #E7F6EE;
    --co-caution: #7A4D00;
    --co-caution-bg: #FFF1D1;
    --co-problem: #A3122A;
    --co-problem-bg: #FDE7EA;
    display: flex; flex-direction: column; overflow: hidden;
    border: 0; border-radius: 24px; padding: 0; background: #FFFFFF;
    box-shadow: 0 24px 64px rgba(16, 24, 40, 0.35);
    color: var(--co-navy);
    font-family: var(--ff-primary, 'Poppins', sans-serif);
    font-size: 15px; line-height: 1.5; text-align: left;
}
.co *, .co *::before, .co *::after { box-sizing: border-box; }
/* custom.css pads every <section> 80px top and bottom. */
.co section { padding: 0; margin: 0; }
.co h3, .co p, .co ul, .co dl, .co dd, .co ol { margin: 0; padding: 0; }
.co ul, .co ol { list-style: none; }
.co h3 { font-family: inherit; text-transform: none; letter-spacing: normal; }
.co button { font-family: inherit; }
.co a { color: var(--co-purple); }
.co [hidden] { display: none !important; }
.co .vp-icon { flex-shrink: 0; display: block; }

.co-modal .co__dialog { width: calc(100% - 32px); max-width: 1000px; margin: 32px auto; }
.co-modal .co__dialog.co__dialog--narrow { max-width: 520px; }

/* ------------------------------------------------------------------ head: title, the two steps, close */

.co__head { display: flex; align-items: center; gap: 16px; padding: 20px 28px; border-bottom: 1px solid var(--co-divider); }
.co__h { flex: 1 1 auto; min-width: 0; font-size: 20px; line-height: 28px; font-weight: 700; color: var(--co-navy); }
.co__steps { display: flex; align-items: center; gap: 10px; }
.co__stepper { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; color: var(--co-muted); }
.co__step-n {
    width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: #E8EAEF; color: var(--co-navy); font-size: 12px; font-weight: 700;
}
.co__step-line { width: 28px; height: 1.5px; background: var(--co-line); }
.co[data-co-step="review"] [data-co-stepper="review"],
.co[data-co-step="pay"] [data-co-stepper="pay"] { color: var(--co-navy); font-weight: 600; }
.co[data-co-step="review"] [data-co-stepper="review"] .co__step-n,
.co[data-co-step="pay"] [data-co-stepper="pay"] .co__step-n { background: var(--co-purple); color: #FFFFFF; }
.co[data-co-step="message"] .co__steps { display: none; }
.co__close {
    flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px;
    background: var(--co-soft); color: var(--co-navy); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.co__close:hover { background: #E8E9EC; }

/* ------------------------------------------------------------------ body: main + what you pay */

.co__body { display: grid; grid-template-columns: minmax(0, 1fr) 400px; min-height: 0; }
.co[data-co-step="message"] .co__body { grid-template-columns: minmax(0, 1fr); }
.co[data-co-step="message"] .co__summary { display: none; }
.co__main { min-width: 0; padding: 28px; }
.co__panel { display: flex; flex-direction: column; gap: 24px; }
.co__summary {
    display: flex; flex-direction: column; gap: 16px; padding: 28px;
    background: var(--co-ground); border-left: 1px solid var(--co-divider);
}
.co__h3 { font-size: 15px; line-height: 21px; font-weight: 600; color: var(--co-navy); }
.co__phone-only { display: none !important; }

/* The car */
.co__car { display: flex; gap: 18px; align-items: flex-start; }
.co .co__car-photo { width: 200px; height: 150px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--co-soft); }
.co__car-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 4px; }
.co__chip {
    align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: var(--co-purple-soft); color: var(--co-purple);
    font-size: 12px; line-height: 18px; font-weight: 600;
}
.co__car-title { font-size: 20px; line-height: 27px; font-weight: 700; color: var(--co-navy); }
.co__car-stock { font-size: 13px; line-height: 18px; color: var(--co-body); }
.co__car-price { font-size: 24px; line-height: 32px; font-weight: 700; color: var(--co-navy); }

/* How you'll get it */
.co__group { display: flex; flex-direction: column; gap: 12px; }
.co__options { display: flex; flex-direction: column; gap: 12px; }
.co__option {
    display: flex; flex-direction: column; gap: 12px; padding: 16px;
    border: 1.5px solid var(--co-line); border-radius: 16px; background: #FFFFFF;
}
.co__options[role="radiogroup"] .co__option { cursor: pointer; }
.co__option.is-chosen { border: 2px solid var(--co-purple); padding: 15.5px; }
.co__option-head { display: flex; align-items: center; gap: 12px; margin: 0; font-weight: inherit; cursor: inherit; }
.co__radio-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.co__radio {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #9AA3B5;
    display: flex; align-items: center; justify-content: center;
}
.co__radio-input:checked + .co__radio { border-color: var(--co-purple); }
.co__radio-input:checked + .co__radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--co-purple); }
.co__radio-input:focus-visible + .co__radio { box-shadow: 0 0 0 3px rgba(91, 47, 201, 0.25); }
.co__tile {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; background: #EEF1F6; color: var(--co-navy);
    display: flex; align-items: center; justify-content: center;
}
.co__option-name { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; line-height: 21px; font-weight: 600; }
.co__tag { padding: 2px 8px; border-radius: 999px; background: var(--co-good-bg); color: var(--co-good); font-size: 11px; line-height: 16px; font-weight: 700; }
.co__option-price { font-size: 17px; line-height: 24px; font-weight: 700; white-space: nowrap; }
.co__option-body { display: flex; flex-direction: column; gap: 12px; }
.co__option-note { font-size: 13px; line-height: 19px; color: var(--co-body); }
.co__option-rules { display: none; flex-direction: column; gap: 4px; font-size: 13px; line-height: 19px; color: var(--co-navy); }
.co__option.is-chosen .co__option-rules { display: flex; }
.co__option-rules li { position: relative; padding-left: 16px; }
.co__option-rules li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
/* Delivery's details only while delivery is chosen (a buyer allowed lot pickup can switch to pickup). */
.co__options[role="radiogroup"] .co__option:not(.is-chosen) .co__option-body { display: none; }

.co__address { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--co-soft); }
.co__address-pin { padding-top: 2px; color: var(--co-navy); }
.co__address-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.co__address-line { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--co-navy); overflow-wrap: anywhere; }
.co__address-sub { font-size: 12px; line-height: 17px; color: var(--co-body); }
.co__new { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--co-purple-soft); color: var(--co-purple); font-size: 11px; line-height: 16px; font-weight: 700; white-space: nowrap; }
.co__link {
    flex-shrink: 0; padding: 0; min-height: 32px; border: 0; background: none; cursor: pointer;
    font-size: 15px; line-height: 20px; font-weight: 600; color: var(--co-purple);
}
.co__link:hover { text-decoration: underline; }
.co__link--inline { min-height: 0; font-size: inherit; line-height: inherit; text-decoration: underline; }
.co__link--center { align-self: center; color: var(--co-navy); text-decoration: underline; }
.co__perks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; }
.co__perks li { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; line-height: 18px; color: var(--co-body); }
.co__perks .vp-icon, .co__all-in .vp-icon { margin-top: 2px; color: var(--co-good); }

/* Change, in place */
.co__change { display: flex; flex-direction: column; gap: 10px; }
.co__label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--co-navy); }
/* Google's field draws its own box (static/js/google_autocomplete.js); it only needs the full width. */
.co__field { border: 0 !important; border-radius: 12px; background: none; padding: 0 !important; height: auto; overflow: visible; }
.co__field.is-invalid { outline: 2px solid var(--co-problem); outline-offset: 1px; }
.co__field gmp-place-autocomplete { display: block; width: 100%; }
.co__field-error { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--co-problem); }
.co__field-error:empty { display: none; }
.co__quote { height: 48px; }

/* Banners: info, problem, caution, held, good */
.co__banner {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
    font-size: 13px; line-height: 19px; color: var(--co-navy); background: var(--co-purple-soft);
}
.co__banner .vp-icon { margin-top: 1px; }
.co__banner b { display: block; font-size: 14px; line-height: 20px; font-weight: 600; }
.co__banner--info { background: var(--co-purple-soft); }
.co__banner--info > .vp-icon, .co__banner--held > .vp-icon { color: var(--co-purple); }
.co__banner--problem { background: var(--co-problem-bg); }
.co__banner--problem > .vp-icon, .co__banner--problem b { color: var(--co-problem); }
.co__banner--caution { background: var(--co-caution-bg); }
.co__banner--caution > .vp-icon, .co__banner--caution b { color: var(--co-caution); }
.co__banner--good { background: var(--co-good-bg); }
.co__banner--good > .vp-icon, .co__banner--good b { color: var(--co-good); }
.co__banner--held { padding: 14px 18px; }

/* ------------------------------------------------------------------ what you pay */

.co__headline { display: flex; flex-direction: column; gap: 2px; padding-bottom: 4px; }
.co__eyebrow { font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--co-muted); }
.co__total { font-size: 40px; line-height: 48px; font-weight: 700; color: var(--co-navy); }
.co__all-in { display: flex; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--co-good); }
.co__busy { display: none; align-items: center; gap: 10px; font-size: 14px; color: var(--co-body); }
.co[data-co-busy="loading"] .co__busy { display: flex; }
.co[data-co-busy="loading"] .co__rows,
.co[data-co-busy="loading"] .co__headline .co__total,
.co[data-co-busy="loading"] .co__all-in { visibility: hidden; }
.co[data-co-busy="loading"] .co__rows { display: none; }
.co__rows { display: flex; flex-direction: column; }
.co__row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 12px 0; border-top: 1px solid var(--co-line); }
.co__row dt { display: flex; align-items: center; gap: 6px; font-size: 15px; line-height: 22px; font-weight: 400; color: var(--co-navy); }
.co__row dt [data-co-row-label] { display: inline-flex; align-items: center; gap: 6px; }
.co__row[data-co-delivery-row] { align-items: center; }
.co__row dd { font-size: 15px; line-height: 22px; color: var(--co-navy); white-space: nowrap; }
.co__row-note { flex: 1 0 100%; font-size: 13px; line-height: 19px; color: var(--co-body); }
.co__row-note:empty { display: none; }
.co__toggle {
    display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; cursor: pointer;
    font-size: 13px; line-height: 18px; font-weight: 600; color: var(--co-purple);
}
.co__toggle[aria-expanded="true"] .vp-icon { transform: rotate(180deg); }
.co__fee-list { flex: 1 0 100%; display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--co-line); }
.co__fee { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; padding: 4px 0; font-size: 14px; line-height: 20px; }
.co__fee > span:last-of-type { white-space: nowrap; }
.co__fee-sub { flex: 1 0 100%; display: flex; flex-direction: column; margin: 4px 0 0; padding-left: 12px; border-left: 2px solid var(--co-line); }
.co__fee-sub .co__fee { font-size: 13px; color: var(--co-body); padding: 2px 0; }
.co__row--total { border-top: 1.5px solid var(--co-navy); }
.co__row--total dt { font-weight: 700; }
.co__row--total dd { font-size: 22px; line-height: 28px; font-weight: 700; }

.co__act { display: flex; flex-direction: column; gap: 14px; }
.co__error { font-size: 13px; line-height: 19px; font-weight: 600; color: var(--co-problem); }
.co__fine { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; line-height: 17px; color: var(--co-body); }
.co__fine .vp-icon { margin-top: 1px; }

/* Buttons */
.co__btn {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 56px; padding: 0 20px;
    border: 0; border-radius: 12px; background: var(--co-purple); color: #FFFFFF;
    font-size: 17px; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer;
}
.co__btn:hover { filter: brightness(1.08); }
.co__btn:disabled { opacity: 0.6; cursor: default; filter: none; }
.co__btn--secondary { background: #FFFFFF; color: var(--co-navy); border: 1.5px solid var(--co-navy); }
.co__btn--secondary:hover { background: var(--co-ground); filter: none; }
.co__btn.is-busy::before {
    content: ""; width: 16px; height: 16px; border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.4); border-top-color: #FFFFFF; animation: co-spin 0.8s linear infinite;
}
.co__spinner {
    flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid rgba(91, 47, 201, 0.25); border-top-color: var(--co-purple); animation: co-spin 0.8s linear infinite;
}
@keyframes co-spin { to { transform: rotate(360deg); } }

/* Cards we take */
.co__cards { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.co__card {
    flex-shrink: 0; width: 52px; height: 34px; border-radius: 6px; border: 1px solid var(--co-line); background: #FFFFFF;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.co .co__card img { display: block; width: auto; max-width: none; }
.co__card--visa img { height: 13px; }
.co__card--mastercard img { height: 22px; }
.co__card--amex { background: #006FCF; border-color: #006FCF; }
.co__card--amex img { height: 32px; }
.co .co__card--discover img { width: 44px; height: auto; }

/* ------------------------------------------------------------------ step 2: the card form */

/* Authorize.Net's form has two layouts that work: its wide one from about 640px, and its phone one up to about 420px.
   In between it hides its own total (measured on dev, 2026-10-13). So the pay step widens the dialog and slims the
   summary (about 700px for the form on a desktop), and a narrower frame gets the phone layout, centred. */
.co-modal .co__dialog.co__dialog--pay { max-width: 1080px; }
.co[data-co-step="pay"] .co__body { grid-template-columns: minmax(0, 1fr) 320px; }
.co__frame { position: relative; min-height: 600px; border-radius: 12px; overflow: hidden; container-type: inline-size; }
.co__frame iframe { display: block; width: 100%; height: 600px; margin: 0 auto; border: 0; }
@container (max-width: 639px) {
    .co__frame iframe { max-width: 420px; }
}
.co__frame-busy {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 14px; color: var(--co-body); background: var(--co-ground); border: 1px dashed var(--co-line); border-radius: 12px;
}
.co__frame form { display: none; }
.co__pay .co__link { align-self: flex-start; color: var(--co-navy); }
.co__you-pay { align-items: baseline; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--co-body); }
.co__you-pay b { font-size: 24px; line-height: 30px; font-weight: 700; color: var(--co-navy); }
.co[data-co-step="pay"] .co__headline .co__all-in { display: flex; }
.co[data-co-step="pay"] .co__act { display: none; }

/* ------------------------------------------------------------------ one message */

.co__message { gap: 16px; }
.co__message-actions { display: flex; flex-direction: column; gap: 10px; }
.co__message-actions:not(:has(> :not([hidden]))) { display: none; }
.co__paid { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.co__paid-mark {
    align-self: center; width: 56px; height: 56px; border-radius: 50%; background: var(--co-good-bg); color: var(--co-good);
    display: flex; align-items: center; justify-content: center;
}
.co__paid-title { text-align: center; font-size: 22px; line-height: 30px; font-weight: 700; }
.co__paid-amount { text-align: center; font-size: 30px; line-height: 38px; font-weight: 700; }
.co__paid-facts { display: flex; flex-direction: column; }
.co__paid-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--co-divider); font-size: 14px; line-height: 20px; }
.co__paid-facts dt { font-weight: 400; color: var(--co-body); }
.co__paid-facts dd { text-align: right; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ phone: a bottom sheet */

.co__foot { display: none; }

@media (max-width: 991.98px) {
    .co-modal > .modal-dialog.co__dialog {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto;
        width: 100%; max-width: none; height: auto; min-height: 0; margin: 0; display: block; transform: none;
    }
    .co-modal > .modal-dialog .modal-content.co {
        height: auto; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); margin: 0; border-radius: 20px 20px 0 0;
    }
    .co__phone-only { display: flex !important; }
    .co__desktop-only { display: none !important; }
    .co__head { padding: 14px 16px 12px; gap: 10px; }
    .co__h { font-size: 18px; }
    .co__stepper { font-size: 13px; gap: 6px; }
    .co__step-line { width: 18px; }
    .co__body { display: flex; flex-direction: column; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; }
    .co__main { padding: 16px; }
    .co__panel { gap: 18px; }
    .co__summary { padding: 0 16px 16px; gap: 10px; background: #FFFFFF; border-left: 0; }
    .co__headline { display: none; }
    .co[data-co-step="pay"] .co__summary { display: none; }
    .co .co__car-photo { width: 112px; height: 84px; border-radius: 10px; }
    .co__car { gap: 14px; }
    .co__car-text { padding-top: 0; gap: 2px; }
    .co__car-title { font-size: 16px; line-height: 22px; }
    .co__car-price { font-size: 20px; line-height: 26px; }
    .co__held-note { gap: 6px; font-size: 12px; line-height: 17px; color: var(--co-body); }
    .co__held-note .vp-icon { margin-top: 1px; }
    .co__row--total { align-items: center; }
    .co__foot {
        display: flex; flex-direction: column; gap: 10px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--co-divider); background: #FFFFFF;
    }
    .co__foot-review { display: flex; flex-direction: column; gap: 10px; }
    .co__foot-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--co-body); }
    .co__foot-total b { font-size: 24px; line-height: 30px; font-weight: 700; color: var(--co-navy); }
    .co__foot-secure { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
    .co__foot-secure .co__fine { align-items: center; }
    .co__foot .co__card { width: 36px; height: 24px; border-radius: 4px; }
    .co__foot .co__card--visa img { height: 9px; }
    .co__foot .co__card--mastercard img { height: 15px; }
    .co__foot .co__card--amex img { height: 22px; }
    .co .co__foot .co__card--discover img { width: 31px; }
    .co__foot .co__cards { gap: 4px; flex-wrap: nowrap; }
    .co__foot-pay { display: none; }
    .co[data-co-step="pay"] .co__foot-review { display: none; }
    .co[data-co-step="pay"] .co__foot-pay { display: block; }
    .co[data-co-step="message"] .co__foot { display: none !important; }
    .co__frame iframe { height: 600px; }
}
