﻿/* The cart and paying for it. One column, one screen - see CartScreen for why it is not
   three steps like the website's - and two columns on a wide website screen (is-wide).
   Every colour a partner theme token. */

.cart {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--wx-ground, #111);
    color: var(--wx-ink, #fff);
    font-family: var(--wx-font-body, system-ui, -apple-system, "Segoe UI", sans-serif);
}

.cart-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
    color: var(--wx-muted, #9a9a9a);
}

.cart .wx-empty i,
.cart-done i {
    font-size: 2.2rem;
    color: var(--wx-muted-dim, #4a4a4a);
}

.cart-done i { color: var(--wx-good, #4caf50); }

.cart-done h2 {
    margin: 0;
    font-family: var(--wx-font-display, inherit);
    color: var(--wx-ink, #fff);
}

.cart-done-paid {
    margin: 0;
    font-family: var(--wx-font-data, ui-monospace, Consolas, monospace);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--wx-ink, #fff);
}

/* The receipt's top bar: Print Receipt left, My Orders right. The receipt's own icon
   rule (.cart-done i) is undone for the small ones in it. */
.cart-done-nav { width: 100%; max-width: 560px; align-self: stretch; margin: -24px auto 0; }
.cart-done-nav i { font-size: 0.9rem !important; color: inherit !important; }
.cart-done-print { justify-self: start; }

/* Where the order's entries can go, under the receipt - see CartScreen. */
.cart-done-giveaways {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 440px;
    margin-top: 6px;
    text-align: left;
}

.cart-done-giveaways h3 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--wx-muted, #9a9a9a);
}

.cart-done-gcard {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
    cursor: pointer;
}

.cart-done-gcard.is-grand { border-color: var(--wx-signal, #d4af37); }

.cart-done-gcard img {
    width: 56px;
    height: 56px;
    flex: none;
    border-radius: 8px;
    object-fit: cover;
}

.cart-done-gcard-in { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cart-done-gcard-in span { font-size: 0.85rem; color: var(--wx-muted, #9a9a9a); }
.cart-done-gcard-when { color: var(--wx-signal, #d4af37) !important; font-weight: 600; }

.cart-done-earned {
    margin: 0;
    color: var(--wx-signal, #d4af37);
    font-weight: 600;
}

.cart-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px 14px 28px;
}

/* ---------- lines ---------- */

.cart-line {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: 12px;
}

.cart-line-media {
    width: 64px;
    height: 64px;
    border-radius: var(--wx-radius, 12px);
    background: var(--wx-surface, #1b1b1b);
    overflow: hidden;
}

.cart-line-media img { width: 100%; height: 100%; object-fit: cover; }

.cart-line-in {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cart-line-name {
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-line-price {
    font-family: var(--wx-font-data, ui-monospace, Consolas, monospace);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cart-line-each,
.cart-line-points {
    margin-left: 8px;
    font-family: var(--wx-font-body, inherit);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--wx-muted, #9a9a9a);
}

.cart-line-points { margin-left: 0; color: var(--wx-signal, #d4af37); }

/* A membership's "$25 a month, renews automatically" under its name. */
.cart-line-note { font-size: 0.78rem; color: var(--wx-muted, #9a9a9a); }

/* The card box - one place, whichever provider's field is in it. See wxPay.js. */
.cart-pay {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
}

.cart-pay-mount {
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--wx-line, #2c2c2c);
    border-radius: 8px;
    background: var(--wx-ground, #111);
}

/* The pretend processor's form, on a development box. */
.wxpay-dev { display: flex; flex-direction: column; gap: 8px; }
.wxpay-dev-row { display: flex; gap: 8px; }
.wxpay-dev-l { display: flex; flex-direction: column; gap: 3px; flex: 1; font-size: 0.78rem; color: var(--wx-muted, #9a9a9a); }
.wxpay-dev-in {
    padding: 8px 10px;
    border: 1px solid var(--wx-line, #2c2c2c);
    border-radius: 6px;
    background: var(--wx-surface, #1b1b1b);
    color: var(--wx-ink, #fff);
    font: inherit;
    font-family: var(--wx-font-data, ui-monospace, Consolas, monospace);
}
.wxpay-dev-note { margin: 0; font-size: 0.74rem; color: var(--wx-muted, #9a9a9a); }

/* ---------- points ---------- */

.cart-points {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
}

.cart-points-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}



.cart-points-have { font-size: 0.82rem; color: var(--wx-muted, #9a9a9a); }

/* The member's badge beside Member Discount Credit - the same mark a member wears on a
   comment, drawn in line rather than on the corner of a face. */
.cart-points-label { display: inline-flex; align-items: center; gap: 6px; }
.cart-member-badge { display: inline-flex; }
.cart-member-badge .wx-badge-corner { position: static; transform: none; width: 20px; height: 20px; font-size: 10px; box-shadow: none; }

.cart-member-saved { color: var(--wx-good, #4caf50); font-weight: 600; }

.cart-points-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
}

.cart-points-n {
    font-family: var(--wx-font-data, ui-monospace, Consolas, monospace);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.cart-points-off { color: var(--wx-good, #4caf50); font-weight: 600; }

.cart-slider { width: 100%; accent-color: var(--wx-signal, #d4af37); }

.cart-points-ends {
    display: flex;
    justify-content: space-between;
}

/* ---------- totals ---------- */

.cart-totals {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--wx-line, #2c2c2c);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--wx-muted, #cfcfcf);
    font-variant-numeric: tabular-nums;
}

.cart-total.is-due {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--wx-line, #2c2c2c);
    font-family: var(--wx-font-data, ui-monospace, Consolas, monospace);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--wx-ink, #fff);
}

.cart-earns {
    margin: 6px 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wx-signal, #d4af37);
}

.cart-note {
    margin: 0;
    font-size: 0.88rem;
    color: var(--wx-muted, #9a9a9a);
}

/* ---------- where it goes ---------- */

.cart-ship {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
}



/* ---------- how it gets there ---------- */

.cart-delivery {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
}

.cart-delivery-wait {
    margin: 0;
    font-size: 0.88rem;
    color: var(--wx-muted, #9a9a9a);
}

.cart-delivery-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Dimmed rather than hidden while a new quote is on its way: the prices on screen are
   the ones just paid for, and blanking them mid-tap loses the comparison being made. */
.cart-delivery-list.is-busy {
    opacity: 0.55;
}

/* The whole row is the target. A radio button is a 20px hit area on a phone. */
.cart-delivery-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid var(--wx-line, #2c2c2c);
    border-radius: var(--wx-radius, 12px);
    background: var(--wx-ground, #121212);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.cart-delivery-opt:disabled {
    cursor: default;
}

.cart-delivery-opt.is-on {
    border-color: var(--wx-signal, #d4af37);
    background: var(--wx-surface-2, #232323);
}

.cart-delivery-what {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cart-delivery-service {
    font-weight: 600;
}

.cart-delivery-when {
    font-size: 0.8rem;
    color: var(--wx-muted, #9a9a9a);
}

.cart-delivery-price {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Not a red error - nothing has gone wrong. It is a standing condition of the system
   that the customer is entitled to know before they tap. */
.cart-note.is-warn {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--wx-warn, #b8860b);
    border-radius: var(--wx-radius, 12px);
    background: color-mix(in srgb, var(--wx-warn, #b8860b) 12%, transparent);
    color: var(--wx-ink, #ededed);
    text-align: left;
}

/* The two halves of the cart: the lines, and paying for them. Stacked, they read as they
   always did; side by side on a wide website screen, paying stays in view while the lines
   scroll past. */
.cart-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.cart-keep { align-self: center; margin-top: 20px; }

@media (min-width: 900px) {
    .cart.is-wide .cart-scroll {
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
        gap: 28px;
        align-items: start;
        overflow: visible;
    }

    .cart.is-wide .cart-col-side {
        position: sticky;
        top: 16px;
    }

    .cart.is-wide .cart-webbar { display: flex; margin-bottom: 12px; }

    /* Nothing in it: a quiet, roomy middle of the page, not a small box. */
    .cart.is-wide .wx-empty { padding: 88px 20px; gap: 16px; font-size: 1.05rem; }
    .cart.is-wide .wx-empty i { font-size: 3rem; }

    /* The page's own frame is the one frame: the cart does not draw a second, darker
       panel inside it. */
    .cart.is-wide { background: none; }
}

/* The website's header bar shows on a desktop only. */
.cart-webbar { display: none; }
