/* checkout.css — the purchase page, dressed to match the rest of the site.
 *
 * cc-pay build: v1-20261023
 *
 * WHY THIS FILE EXISTS.
 *
 * buy.blade.php was written on 22 October using mp- classes: mp-order-summary,
 * mp-order-line, mp-field, mp-terms, mp-accept, mp-alert. Those classes were
 * never added to marketplace.css, and buy.blade.php never loaded
 * marketplace.css either — so the page fell back to raw browser defaults.
 * A customer who had decided to spend GBP 6,900 was shown an unstyled form
 * and a grey default button immediately before the card page.
 *
 * WHY A NEW FILE RATHER THAN AN ADDITION TO marketplace.css.
 *
 * marketplace.css is loaded by every Marketplace page — the catalogue, the
 * families, the subcategories, the search, 1,010 listings. Appending to it
 * to fix one page puts all of those at risk for no reason. This file is
 * loaded only by the purchase page.
 *
 * EVERY RULE IS SCOPED UNDER .page-checkout.
 *
 * That is the body class the purchase page already sets, and it appears
 * nowhere else. So this stylesheet is inert on every other page of the site
 * whatever it contains and whatever order it loads in. If it is wrong, it is
 * wrong on one page, and removing one <link> reverts it completely.
 *
 * It uses the --cx-* design tokens from coutts-system.css and the --mp-*
 * aliases from marketplace.css, so the paper, the gold, the ink, the radii
 * and the button height are the site's own values rather than new ones.
 * Every var() carries a literal fallback, because a token that fails to
 * resolve on a payment page should degrade to the right colour, not to
 * nothing.
 */

/* ---- the page itself ------------------------------------------------- */

/* marketplace.css makes .mp-detail a two-column grid with a 300px sidebar.
   The purchase page has no sidebar, so that would leave a 300px hole. One
   centred column, narrower than the catalogue, because a form is easier to
   complete when it is not the width of the screen. */
.page-checkout .mp-detail {
    display: block;
    max-width: var(--cx-container-prose, 820px);
    margin: 0 auto;
    padding: clamp(1.2rem, 3vw, 2.2rem) clamp(1rem, 4vw, 1.6rem) clamp(2.4rem, 5vw, 3.4rem);
}

.page-checkout .mp-detail-main { min-width: 0; }

/* ---- breadcrumbs ----------------------------------------------------- */

/* marketplace.css styles .mp-crumbs as a list. This page uses bare anchors
   and separators, so the layout rules there do not apply to it. */
.page-checkout .mp-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .5rem;
    background: none;
    border: 0;
    padding: 0 0 1rem;
    font-size: .78rem;
    color: var(--mp-muted, #55606E);
}
.page-checkout .mp-crumbs a {
    color: var(--mp-muted, #55606E);
    text-decoration: none;
}
.page-checkout .mp-crumbs a:hover {
    color: var(--mp-gold, #8A6E12);
    text-decoration: underline;
}
.page-checkout .mp-crumbs [aria-current] {
    color: var(--mp-ink, #1B2430);
    font-weight: 600;
}

/* ---- headings -------------------------------------------------------- */

.page-checkout h1 {
    font-size: clamp(1.4rem, 2.6vw, 1.85rem);
    font-weight: 700;
    color: var(--mp-navy, #0B1626);
    margin: 0 0 1.4rem;
    letter-spacing: -.01em;
}

/* ---- what you are buying --------------------------------------------- */

.page-checkout .mp-order-summary {
    background: var(--mp-paper, #F7F5EF);
    border: 1px solid var(--mp-line, #E3E7EE);
    border-radius: var(--cx-radius-lg, 10px);
    padding: clamp(1.1rem, 2.4vw, 1.5rem);
    margin: 0 0 1.6rem;
}
.page-checkout .mp-order-summary h2 {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--mp-ink, #1B2430);
    margin: 0 0 .9rem;
    line-height: 1.35;
}

/* The price. Label left, figure right, the figure given the weight it has
   earned by being the reason the customer is on this page. */
.page-checkout .mp-order-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-top: .85rem;
    border-top: 1px solid var(--mp-line, #E3E7EE);
}
.page-checkout .mp-order-line > span {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--mp-muted, #55606E);
}
.page-checkout .mp-order-line > strong {
    font-size: clamp(1.25rem, 2.6vw, 1.6rem);
    font-weight: 700;
    color: var(--mp-ink, #1B2430);
    white-space: nowrap;
}

.page-checkout .mp-order-note {
    font-size: .78rem;
    line-height: 1.55;
    color: var(--mp-muted, #55606E);
    margin: .8rem 0 0;
}
.page-checkout .mp-order-note--warn {
    color: #6B4E00;
    background: #FDF6E3;
    border-left: 3px solid var(--mp-gold-d, #D9B65A);
    border-radius: var(--cx-radius-xs, 4px);
    padding: .6rem .8rem;
}

/* ---- the form -------------------------------------------------------- */

.page-checkout .mp-order-form {
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
}

.page-checkout .mp-field { display: block; }

.page-checkout .mp-field label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--mp-ink, #1B2430);
    margin: 0 0 .35rem;
}

.page-checkout .mp-field input[type="text"],
.page-checkout .mp-field input[type="email"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: var(--cx-btn-h, 46px);
    padding: .55rem .8rem;
    font-family: inherit;
    font-size: .92rem;
    color: var(--mp-ink, #1B2430);
    background: #FFFFFF;
    border: 1px solid var(--mp-line, #E3E7EE);
    border-radius: var(--cx-btn-radius, 6px);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.page-checkout .mp-field input:focus {
    outline: none;
    border-color: var(--mp-gold-d, #D9B65A);
    box-shadow: 0 0 0 3px rgba(217, 182, 90, .22);
}
.page-checkout .mp-field input::placeholder { color: #9AA6B6; }

/* "if applicable", "optional" — these sit inside the label, so they must not
   inherit the label's weight. */
.page-checkout .mp-field label .mp-field-note {
    font-weight: 400;
    color: var(--mp-muted, #55606E);
}
.page-checkout .mp-field-note {
    display: block;
    font-size: .74rem;
    line-height: 1.5;
    color: var(--mp-muted, #55606E);
    margin: .3rem 0 0;
}

/* ---- the terms ------------------------------------------------------- */

.page-checkout .mp-terms {
    background: var(--mp-paper, #F7F5EF);
    border: 1px solid var(--mp-line, #E3E7EE);
    border-radius: var(--cx-radius-lg, 10px);
    padding: clamp(1rem, 2.2vw, 1.3rem);
    margin: .4rem 0 0;
}
.page-checkout .mp-terms h3 {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--mp-muted, #55606E);
    margin: 0 0 .7rem;
}
.page-checkout .mp-terms p {
    font-size: .82rem;
    line-height: 1.6;
    color: var(--mp-ink, #1B2430);
    margin: 0 0 .6rem;
}
.page-checkout .mp-terms p:last-child { margin-bottom: 0; }

/* ---- accepting them -------------------------------------------------- */

/* A 13px checkbox beside 13px text is a poor target on a phone, and this is
   the control standing between the customer and the card page. */
.page-checkout .mp-accept {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    cursor: pointer;
    font-size: .86rem;
    line-height: 1.5;
    color: var(--mp-ink, #1B2430);
}
.page-checkout .mp-accept input[type="checkbox"] {
    flex: none;
    width: 18px;
    height: 18px;
    margin: .1rem 0 0;
    accent-color: var(--mp-gold-d, #D9B65A);
    cursor: pointer;
}

/* ---- the button ------------------------------------------------------ */

/* marketplace.css already defines .mp-btn and .mp-btn--primary — the gold,
   the radius, the hover lift. Only the things particular to a form submit
   are set here, so the button matches the one on the listing page. */
.page-checkout .mp-order-form .mp-btn--primary {
    align-self: flex-start;
    margin-top: .3rem;
    padding: 0 1.6rem;
    min-height: var(--cx-btn-h, 46px);
}

/* If marketplace.css ever fails to load, the button must still look like a
   button on a payment page rather than a grey browser default. These are the
   same values, applied only where nothing has set a background. */
.page-checkout button.mp-btn:not([style]) {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
}

/* ---- validation ------------------------------------------------------ */

.page-checkout .mp-alert {
    border-radius: var(--cx-radius-lg, 10px);
    padding: .85rem 1rem;
    margin: 0 0 1.3rem;
    font-size: .85rem;
    line-height: 1.55;
}
.page-checkout .mp-alert--warn {
    background: #FDF6E3;
    border: 1px solid var(--mp-gold-d, #D9B65A);
    color: #6B4E00;
}

/* ---- narrow screens -------------------------------------------------- */

@media (max-width: 560px) {
    .page-checkout .mp-order-line {
        flex-direction: column;
        align-items: flex-start;
        gap: .25rem;
    }
    .page-checkout .mp-order-form .mp-btn--primary {
        align-self: stretch;
        justify-content: center;
    }
}
