/* =========================================================
   KOOTZY — CHECKOUT
   Builds on css/cart.css; tokens only, no new colours.
   ========================================================= */

.checkout-page { padding: 0 0 2.5rem; }

.checkout-grid { display: grid; gap: 1.25rem; }

@media (min-width: 820px) {
    .checkout-grid {
        grid-template-columns: minmax(0, 1fr) 22rem;
        align-items: start;
    }
    .checkout-summary { position: sticky; top: 1rem; }
}

.checkout-main { display: grid; gap: 1rem; min-width: 0; }

/* ── Blocks ── */
.co-block {
    background: var(--bg-panel);
    border: 1.5px solid var(--border-color);
    border-radius: var(--r-md, 14px);
    padding: 1rem 1.1rem 1.15rem;
    margin: 0;
    box-shadow: var(--card-shadow);
}
.co-legend {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-main);
    padding: 0 0.35rem;
    margin-left: -0.35rem;
}

/* ── Fulfilment choice ── */
.co-choice {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.75rem;
    margin-top: 0.6rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--r-sm, 10px);
    cursor: pointer;
}
.co-choice:hover { background: var(--paper-2); }
/* :has lets the whole row react to its radio without extra JS. */
.co-choice:has(input:checked) {
    border-color: var(--lagoon);
    background: var(--paper-2);
}
.co-choice input { margin-top: 0.25rem; width: 20px; height: 20px; accent-color: var(--lagoon-ink); }
.co-choice-body { display: block; }
.co-choice-title {
    display: block;
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
}
.co-choice-note {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

/* ── Fields ── */
.co-field { margin-top: 0.75rem; }
.co-field-hint { display: block; margin-top: .3rem; font-size: .74rem; line-height: 1.35; color: var(--text-muted, #4F6874); }
.co-guest-note { margin: .25rem 0 0; font-size: .84rem; color: var(--text-muted, #4F6874); }
.co-link-btn { padding: 0; border: 0; background: none; font: inherit; font-weight: 800; color: var(--primary, #FF1E36); text-decoration: underline; cursor: pointer; }
.co-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.3rem;
}
.co-optional { font-weight: 400; color: var(--text-muted); }

.co-field input {
    width: 100%;
    min-height: 48px;                    /* comfortable on a phone */
    padding: 0 0.85rem;
    font-family: var(--font-family);
    font-size: 1rem;                     /* 16px+ stops iOS zooming on focus */
    color: var(--text-main);
    background: var(--bg-panel);
    border: 1.5px solid var(--border-color-hover);
    border-radius: var(--r-sm, 10px);
}
.co-field input:focus-visible {
    outline: none;
    border-color: var(--lagoon-ink);
    box-shadow: var(--focus-ring);
}
.co-field input:invalid:not(:placeholder-shown) { border-color: var(--primary); }

.co-row { display: grid; gap: 0.75rem; }
@media (min-width: 480px) {
    .co-row { grid-template-columns: 1fr 1fr; }
}

/* ── Summary lines ── */
.co-lines {
    list-style: none;
    margin: 0 0 0.9rem;
    padding: 0 0 0.9rem;
    border-bottom: 1.5px solid var(--border-color);
    display: grid;
    gap: 0.4rem;
}
.co-line { display: flex; gap: 0.6rem; justify-content: space-between; align-items: center; }
.co-thumb {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    flex: 0 0 auto;
}
.co-line-name { color: var(--text-main); font-size: 0.9rem; overflow-wrap: anywhere; }
.co-line-qty { color: var(--text-muted); font-size: 0.85rem; font-weight: 700; flex: 0 0 auto; }
.co-line-qty.batch-saving-note { color: #087f5b; }

/* ── Unpaid notice ──
   Blush rather than red: this is information, not an error. It must be
   impossible to miss, because no gateway is wired yet. */
.co-unpaid {
    margin: 0.9rem 0 0;
    padding: 0.7rem 0.8rem;
    background: var(--blush);
    border-radius: var(--r-sm, 10px);
    color: var(--text-main);
    font-size: 0.82rem;
    line-height: 1.5;
}

/* Saved delivery addresses (repeat customers) */
.co-ship-note { margin: -0.2rem 0 0.9rem; }

/* The next printing slot: a booking-style strip of the coming days. */
.co-slot { display: grid; gap: .6rem; margin: 0 0 .9rem; padding: .75rem .8rem .8rem; border: 2px solid var(--text-main, #172B35); border-radius: 16px; background: #fff; box-shadow: 3px 3px 0 var(--text-main, #172B35); color: var(--text-main, #172B35); }
.co-slot[hidden] { display: none; }
.co-slot header { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.co-slot header strong { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; }
.co-slot header small { font-weight: 700; font-size: .72rem; color: var(--text-muted, #4F6874); }
.co-slot-batches { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.co-slot-batch { display: grid; place-items: center; gap: .1rem; padding: .5rem .2rem .45rem; border-radius: 12px; border: 1.5px solid var(--border-color, #d5dde5); background: #F7FBFC; color: var(--text-muted, #4F6874); text-align: center; }
.co-slot-batch span { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.co-slot-batch b { font: 700 1.25rem/1.1 var(--font-display); color: var(--text-main, #172B35); white-space: nowrap; }
.co-slot-batch i { margin-top: .15rem; font-style: normal; font-weight: 800; font-size: .58rem; letter-spacing: .08em; text-transform: uppercase; }
.co-slot-batch.full, .co-slot-batch.closed { background: repeating-linear-gradient(135deg, #EEF2F4 0 6px, #E4EAED 6px 12px); color: #6B7F88; }
.co-slot-batch.full b, .co-slot-batch.closed b { color: #6B7F88; text-decoration: line-through; }
.co-slot-batch.yours { background: var(--primary, #FF1E36); border-color: var(--primary, #FF1E36); color: #fff; box-shadow: 0 6px 14px rgba(255, 30, 54, .28); transform: translateY(-3px); }
.co-slot-batch.yours b, .co-slot-batch.yours i { color: #fff; }
.co-slot p { margin: 0; font-size: .8rem; line-height: 1.4; }
@media (prefers-reduced-motion: no-preference) {
    .co-slot-batch.yours { animation: co-slot-pop .45s cubic-bezier(.22, .61, .36, 1) both; }
    @keyframes co-slot-pop { from { transform: translateY(4px) scale(.92); opacity: .4; } to { transform: translateY(-3px) scale(1); opacity: 1; } }
}
.co-saved { display: grid; gap: 0.6rem; margin-bottom: 1rem; }
.co-saved[hidden], #coNewAddress[hidden], #coLabelField[hidden] { display: none; }
.co-saved .co-choice-title { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.co-default-tag { font-size: 0.68rem; font-weight: 800; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--lagoon, #1D7D8D); color: #fff; }
.co-check { display: flex; align-items: center; gap: 0.55rem; margin: 0.4rem 0 0.8rem; font-weight: 600; cursor: pointer; }
.co-check input { width: 18px; height: 18px; accent-color: var(--lagoon, #1D7D8D); }

/* Delivery quote and order total in the summary. */
.cart-totals .co-total-label { font-weight: 800; color: var(--text-main, #172a33); }
.cart-totals .co-total { font-size: 1.1rem; font-weight: 800; }
.co-ship-note { margin: 0.35rem 0 0.6rem; color: var(--text-muted, #4f6670); }

/* Courier choice under Delivery (checkout-page.js renderCouriers) */
.co-couriers { display: grid; gap: .45rem; margin: .5rem 0 .25rem; }
.co-courier { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; padding: .6rem .7rem; border: 1.5px solid var(--border-color, #d5dde5); border-radius: 12px; background: var(--bg-panel, #fff); cursor: pointer; }
.co-courier:has(input:checked) { border-color: var(--primary, #FF1E36); box-shadow: 0 0 0 3px var(--primary-glow, rgba(255, 30, 54, .14)); }
.co-courier strong { display: block; font-size: .92rem; color: var(--text-main, #14202b); }
.co-courier small { display: block; font-size: .78rem; color: var(--text-muted, #667); }
.co-courier b { font-size: .95rem; white-space: nowrap; }
.co-courier input { accent-color: var(--primary, #FF1E36); width: 1.1rem; height: 1.1rem; }

/* Coupon code (checkout-page.js applyCoupon) */
.co-coupon { margin: .6rem 0 .3rem; }
.co-coupon summary { cursor: pointer; font-weight: 700; font-size: .9rem; color: var(--primary-ink, #DB0B21); }
.co-coupon-row { display: flex; gap: .5rem; margin-top: .5rem; }
.co-coupon-row input { flex: 1; min-width: 0; padding: .6rem .7rem; border-radius: 10px; border: 1.5px solid var(--border-color, #d5dde5); font-size: 16px; text-transform: uppercase; letter-spacing: .04em; }
.co-coupon-apply { padding: .6rem 1rem; border-radius: 10px; border: 0; background: var(--text-main, #14202b); color: #fff; font-weight: 800; cursor: pointer; }
.co-coupon-note { margin: .35rem 0 0; font-size: .82rem; color: var(--text-main, #14202b); min-height: 1em; }
.co-coupon-note:empty { display: none; }
.co-discount { color: #15803d; font-weight: 800; }

/* ── fewer boxes, trust, phones (24 Oct) ── */
.co-other { display: block; margin: .2rem 0 .6rem; padding: .35rem 0; border: 0; background: none; font: inherit; font-size: .88rem; font-weight: 700; color: var(--primary-strong, #DB0B21); text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.co-other[hidden] { display: none; }
.co-trust { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; gap: .25rem; font-size: .8rem; color: var(--text-muted, #4F6874); }
.co-inapp { margin: .6rem 0; padding: .6rem .75rem; border-radius: 12px; background: #FFF6E5; border: 1.5px solid #F9A800; font-size: .84rem; line-height: 1.4; color: var(--text-main, #14202b); }
.co-inapp[hidden] { display: none; }
.co-paybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem calc(.6rem + env(safe-area-inset-bottom)); background: #fff; border-top: 2px solid var(--text-main, #14202b); box-shadow: 0 -8px 24px rgba(0, 0, 0, .12); }
.co-paybar[hidden] { display: none; }
.co-paybar-total { display: grid; line-height: 1.1; }
.co-paybar-total small { font-size: .72rem; color: var(--text-muted, #4F6874); }
.co-paybar-total strong { font-size: 1.15rem; }
.co-paybar-go { flex: 1; border: 2px solid var(--text-main, #14202b); background: var(--primary, #FF1E36); color: #fff; border-radius: 14px; padding: .75rem; font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; }
.co-paybar-go:disabled { opacity: .55; cursor: default; }
@media (min-width: 761px) { .co-paybar { display: none !important; } }
/* the order page's "pay from your own browser" (js/in-app.js) */
.inapp-help { margin-top: .8rem; padding: .7rem .8rem; border-radius: 12px; background: #FFF6E5; border: 1.5px solid #F9A800; display: grid; gap: .5rem; font-size: .86rem; }
.inapp-help p { margin: 0; }
.inapp-copy { justify-self: start; border: 2px solid var(--text-main, #14202b); background: #fff; border-radius: 999px; padding: .4rem .9rem; font: inherit; font-weight: 800; cursor: pointer; }
.inapp-copied { font-size: .8rem; color: #15803d; font-weight: 700; }
