/* =============================================================================
   CHECKOUT
   -----------------------------------------------------------------------------
   Two columns on desktop - form left, sticky order right. One column from
   991px down, with the cards collapsible and a sticky total bar on phones.

   Built on the design tokens in fs-theme.css, so it follows light and dark
   with the rest of the site and needs no colours of its own.
   ============================================================================= */

/* translucent, so the site backdrop reads through the checkout too */
.co-page { background: rgba(255, 255, 255, .5); }
:root[data-theme="dark"] .co-page { background: var(--surface-page); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .co-page { background: var(--surface-page); }
}

/* Everything on this page sizes inside its box and inside the viewport.
   Stated rather than assumed - bootstrap sets border-box for most elements
   but resets a few back to content-box. */
.co-shell, .co-shell *, .co-sticky, .co-sticky * { box-sizing: border-box; }
.co-shell, .co-shell .container, .co-grid, .co-main, .co-side, .co-card { max-width: 100%; min-width: 0; }
.co-shell { padding: 34px 0 96px; }
.co-shell .container { max-width: 1180px; padding-left: 24px; padding-right: 24px; }

/* ---- top strip: back, progress, secure --------------------------------- */
.co-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; flex-wrap: wrap;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}
.co-back {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 500; color: var(--ink-body);
    transition: color var(--t);
}
.co-back:hover { color: var(--ink); }
.co-back i { font-size: 12px; }

.co-steps { display: flex; align-items: center; gap: 10px; }
.co-step {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13.5px; font-weight: 500; color: var(--ink-faint);
    white-space: nowrap;
    transition: color var(--t);
}
.co-step__n {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--surface-muted); color: var(--ink-muted);
    font-size: 12px; font-weight: 600;
    transition: background-color var(--t), color var(--t);
}
.co-step.is-active { color: var(--ink); font-weight: 600; }
.co-step.is-active .co-step__n { background: var(--brand-500); color: #fff; }
.co-step.is-done { color: var(--ink-body); }
.co-step.is-done i { color: var(--brand-500); font-size: 12px; }
.co-step__bar { width: 34px; height: 1px; background: var(--line-strong); }

.co-secure {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 500; color: var(--ink-muted);
}
.co-secure i { font-size: 11px; }

/* ---- page heading ------------------------------------------------------- */
.co-head { padding: 30px 0 26px; }
.co-head h1 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.4vw, 3rem);
    line-height: 1.02; font-weight: 700;
    letter-spacing: -.02em; text-transform: uppercase;
    color: var(--ink);
}
.co-head p { margin: 0; font-size: 15px; color: var(--ink-muted); }

/* ---- errors ------------------------------------------------------------- */
.co-alert {
    display: flex; gap: 14px;
    margin: 0 0 26px; padding: 16px 18px;
    border: 1px solid var(--brand-200);
    border-left: 3px solid var(--brand-500);
    border-radius: var(--r-md);
    background: var(--surface-tint);
}
.co-alert > i { color: var(--brand-ink); font-size: 17px; margin-top: 2px; }
.co-alert h2 {
    margin: 0 0 6px; font-family: var(--font-ui);
    font-size: 15px; font-weight: 600; text-transform: none; color: var(--ink);
}
.co-alert ul { margin: 0; padding-left: 17px; list-style: disc; }
.co-alert li { font-size: 14px; line-height: 1.6; color: var(--ink-body); }

/* ---- layout ------------------------------------------------------------- */
.co-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: 28px; align-items: start; }
.co-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.co-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 22px; min-width: 0; }

/* ---- card --------------------------------------------------------------- */
.co-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-xs);
    overflow: hidden;
    transition: box-shadow var(--t), border-color var(--t);
}
.co-card:hover { box-shadow: var(--sh-sm); }

.co-card__head {
    display: flex; align-items: center; gap: 14px;
    width: 100%; padding: 20px 22px;
    background: none; border: 0; text-align: left;
    cursor: default;                 /* only a button on mobile */
}
.co-card__icon {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: var(--r-md);
    background: var(--surface-sunken); border: 1px solid var(--line);
    color: var(--ink); font-size: 15px;
}
.co-card__text { flex: 1 1 auto; min-width: 0; display: block; }
.co-card__title {
    display: block;
    font-family: var(--font-ui);
    font-size: 16px; font-weight: 600; letter-spacing: -.005em;
    color: var(--ink);
}
.co-card__sub { display: block; margin-top: 3px; font-size: 13px; color: var(--ink-muted); }
.co-card__flag {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--ink-muted);
}
.co-card__chev { display: none; color: var(--ink-muted); font-size: 13px; transition: transform var(--t); }

.co-card__body { padding: 0 22px 22px; }

/* ---- fields ------------------------------------------------------------- */
.co-field { margin-bottom: 16px; }
.co-field:last-child { margin-bottom: 0; }
.co-field label {
    display: block; margin-bottom: 7px;
    font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.co-req { color: var(--ink-brand); }
.co-opt { font-weight: 400; color: var(--ink-faint); }
.co-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.co-card input[type="text"],
.co-card input[type="tel"],
.co-card input[type="email"],
.co-card textarea {
    min-height: 48px;
    font-size: 15px;
    border-radius: var(--r-md);
}
.co-card textarea { min-height: 68px; padding-top: 12px; }

/* signed in: the verified account email (read-only), "Save these details", and the guest's "Sign in" hint */
.co-card input.co-readonly { background: var(--surface-muted); color: var(--ink-body); cursor: default; }
.co-verified { display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.45; color: var(--ink-muted); }
.co-verified i { color: #1f8a4c; }
.co-verified a, .co-acct-hint a { color: var(--ink-brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.co-save {
    display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: start;
    margin-top: 16px; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-muted);
}
.co-save input[type="checkbox"] { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand-500); cursor: pointer; }
.co-save input[type="checkbox"]:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }
.co-save label { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink); cursor: pointer; }
.co-save label span { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-muted); }
.co-acct-hint {
    display: flex; gap: 10px; align-items: flex-start;
    margin: 16px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-body);
}
.co-acct-hint i { margin-top: 2px; color: var(--ink-muted); font-size: 16px; }
:root[data-theme="dark"] .co-verified i { color: #7ee2a8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .co-verified i { color: #7ee2a8; } }

/* inline validation */
.co-err { display: none; margin-top: 6px; font-size: 13px; color: var(--ink-brand); }
.co-field.has-error input,
.co-field.has-error textarea { border-color: var(--brand-500); }
.co-field.has-error .co-err { display: block; }

/* phone with a fixed UK prefix */
.co-phone { display: flex; align-items: stretch; }
.co-phone__cc {
    display: inline-flex; align-items: center; gap: 6px;
    flex: 0 0 auto; padding: 0 12px;
    border: 1px solid var(--line); border-right: 0;
    border-radius: var(--r-md) 0 0 var(--r-md);
    background: var(--surface-sunken);
    font-size: 14px; font-weight: 500; color: var(--ink-body);
    white-space: nowrap;
}
.co-phone__flag {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 2px 6px; border-radius: 3px;
    background: var(--ink); color: var(--surface);
    font-size: 10px; font-weight: 700; letter-spacing: .04em;
}
.co-phone input { border-radius: 0 var(--r-md) var(--r-md) 0 !important; }

/* ---- selectable options ------------------------------------------------- */
.co-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.co-pick__opt {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    margin: 0; padding: 15px 16px;
    border: 1px solid var(--line); border-radius: var(--r-md);
    background: var(--surface); cursor: pointer;
    transition: border-color var(--t), background-color var(--t), box-shadow var(--t);
}
.co-pick__opt:hover { border-color: var(--line-strong); }
.co-pick__opt input {
    position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0;
}
.co-pick__dot {
    flex: 0 0 auto;
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--line-strong);
    transition: border-color var(--t), box-shadow var(--t);
}
.co-pick__icon {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: var(--r-sm);
    background: var(--surface-sunken);
    color: var(--ink); font-size: 14px;
    transition: background-color var(--t), color var(--t);
}
.co-pick__text { min-width: 0; }
.co-pick__text strong { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.co-pick__text em { display: block; margin-top: 2px; font-size: 12.5px; font-style: normal; color: var(--ink-muted); }

.co-pick__opt.is-on {
    border-color: var(--brand-500);
    background: var(--surface-tint);
    box-shadow: inset 0 0 0 1px var(--brand-500);
}
.co-pick__opt.is-on .co-pick__dot {
    border-color: var(--brand-500);
    box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 9px var(--brand-500);
}
.co-pick__opt.is-on .co-pick__icon { background: var(--brand-500); color: #fff; }
.co-pick__opt:focus-within { box-shadow: var(--ring); }

/* ---- revealed blocks ---------------------------------------------------- */
.co-reveal { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.co-reveal[hidden] { display: none; }

.co-info, .co-notice {
    display: flex; gap: 10px; align-items: flex-start;
    margin: 16px 0 0; padding: 12px 14px;
    border-radius: var(--r-md);
    background: var(--surface-sunken);
    font-size: 13px; line-height: 1.55; color: var(--ink-body);
}
.co-info i { color: var(--ink-muted); margin-top: 2px; }
.co-info[hidden] { display: none; }
.co-notice {
    margin: 0 0 18px;
    background: var(--surface-tint);
    border: 1px solid var(--brand-200);
}
.co-notice i { color: var(--brand-ink); margin-top: 2px; }
.co-notice strong { color: var(--ink); }

/* ---- card fields -------------------------------------------------------- */
.co-cc { position: relative; }
.co-cc__brands {
    position: absolute; top: 50%; inset-inline-end: 12px; transform: translateY(-50%);
    display: flex; gap: 6px; font-size: 20px; color: var(--ink-faint);
    pointer-events: none;
}
.co-cc input { padding-inline-end: 92px; }
.co-card input:disabled, .co-card textarea:disabled {
    background: var(--surface-sunken);
    color: var(--ink-faint);
    cursor: not-allowed;
}

/* ---- order summary ------------------------------------------------------ */
.co-count { font-weight: 400; color: var(--ink-muted); }
.co-edit {
    flex: 0 0 auto;
    font-size: 13.5px; font-weight: 600; color: var(--ink-brand);
    transition: color var(--t);
}
.co-edit:hover { color: var(--brand-600); text-decoration: underline; }

.co-lines { margin-bottom: 4px; }
.co-line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.co-line:first-child { padding-top: 0; }
.co-line__thumb {
    flex: 0 0 auto;
    width: 56px; height: 56px; border-radius: var(--r-md);
    overflow: hidden; background: var(--surface-sunken);
    border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
}
.co-line__thumb img { width: 100%; height: 100%; object-fit: cover; }
.co-line__thumb i { color: var(--brand-200); font-size: 18px; }
.co-line__main { flex: 1 1 auto; min-width: 0; }
.co-line__name { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.co-line__meta { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-muted); }
.co-line__meta .co-out { color: var(--ink-brand); }
.co-line__price { flex: 0 0 auto; font-size: 14.5px; font-weight: 600; color: var(--ink); }

/* The same two words, in the same place, as the basket drawer - a line is
   edited or removed the same way wherever the customer meets it. */
.co-line__acts { display: inline-flex; align-items: center; gap: 14px; margin-left: 14px; }
.co-line__act {
    padding: 0; border: 0; background: none;
    font: inherit; font-size: 12.5px; font-weight: 700;
    letter-spacing: .5px; text-transform: uppercase;
    color: var(--ink);
    border-bottom: 1px solid currentColor;
    text-decoration: none;
    cursor: pointer;
    /* the row is short, so the hit area is grown rather than the text */
    padding-block: 9px;
}
.co-line__act:hover { color: var(--ink-brand); }
.co-line__act--rm { color: var(--ink-muted); }
.co-line__act--rm:hover { color: var(--ink-brand); }
.co-line__act:focus-visible { outline: none; box-shadow: var(--ring); }

@media (max-width: 400px) {
    .co-line__acts { gap: 10px; margin-left: 10px; }
    .co-line__act { font-size: 11.5px; letter-spacing: .3px; }
}

.co-qty { display: inline-flex; align-items: center; margin-top: 9px; border: 1px solid var(--line); border-radius: var(--r-sm); }
/* 34px, up from 28 - the smallest control on the page and the one people
   press most, so it needs to be reachable with a thumb */
.co-qty button {
    width: 34px; height: 34px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: none; border: 0; cursor: pointer;
    color: var(--ink); font-size: 13px;
    transition: background-color var(--t), color var(--t);
}
.co-qty button:hover { background: var(--surface-sunken); }
.co-qty button:disabled { color: var(--ink-faint); cursor: not-allowed; }
.co-qty span { min-width: 26px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--ink); }

.co-note { margin-top: 16px; }

.co-totals { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.co-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.co-totals dt { font-size: 14px; font-weight: 400; color: var(--ink-body); display: inline-flex; align-items: center; gap: 6px; }
.co-totals dt i { font-size: 11px; color: var(--ink-faint); }
.co-totals dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.co-totals__grand { margin: 14px 0 0 !important; padding-top: 14px; border-top: 1px solid var(--line-strong); }
.co-totals__grand dt { font-size: 16px; font-weight: 600; color: var(--ink); }
.co-totals__grand dd { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--ink); }

/* ---- buttons ------------------------------------------------------------ */
.co-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 50px; padding: 0 26px;
    border: 1px solid transparent; border-radius: var(--r-pill);
    font-family: var(--font-ui); font-size: 15px; font-weight: 600;
    cursor: pointer; text-decoration: none;
    transition: background-color var(--t), color var(--t),
                box-shadow var(--t), transform var(--t), border-color var(--t);
}
.co-btn--primary { background: var(--btn-primary); color: #fff; box-shadow: var(--sh-brand); }
.co-btn--primary:hover { background: var(--btn-primary-hover); color: #fff; transform: translateY(-1px); }
.co-btn--primary:active { transform: translateY(0); }
.co-btn--primary:disabled { background: var(--n-300); color: var(--n-0); box-shadow: none; cursor: not-allowed; transform: none; }
.co-btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.co-btn--ghost:hover { background: var(--surface-sunken); color: var(--ink); }
.co-btn:focus-visible { box-shadow: var(--ring); }
.co-btn i { font-size: 13px; }

.co-place { width: 100%; margin-top: 18px; min-height: 54px; }
.co-place.is-busy { pointer-events: none; opacity: .82; }

/* Privacy consent, directly above Place order: the whole sentence is the label, so tapping it ticks the box; the
   Privacy Policy link inside it opens the policy instead. */
.co-consent {
    display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: start;
    margin-top: 18px; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-muted);
    transition: border-color var(--t);
}
.co-consent input[type="checkbox"] {
    width: 20px; height: 20px; margin: 2px 0 0; flex: none;
    accent-color: var(--brand-500); cursor: pointer;
}
.co-consent input[type="checkbox"]:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }
.co-consent label { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink); cursor: pointer; }
.co-consent label a { color: var(--ink-brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.co-consent .co-err { grid-column: 2; }
.co-consent.has-error { border-color: var(--brand-500); }
.co-consent.has-error .co-err { display: block; }
/* the consent message on the dark card: a lighter red, so it reads clearly there too */
:root[data-theme="dark"] .co-consent .co-err { color: #ff9a8b; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .co-consent .co-err { color: #ff9a8b; }
}

.co-empty { text-align: center; padding: 22px 0 6px; }
.co-empty p { color: var(--ink-muted); margin-bottom: 18px; }
.co-empty[hidden] { display: none; }

/* ---- trust -------------------------------------------------------------- */
.co-trust {
    padding: 20px 22px;
    border: 1px solid var(--line); border-radius: var(--r-lg);
    background: var(--surface-sunken);
}
.co-trust h2 {
    margin: 0 0 14px; font-family: var(--font-ui);
    font-size: 14px; font-weight: 600; text-transform: none; color: var(--ink);
}
.co-trust ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.co-trust li {
    display: flex; align-items: center; gap: 11px;
    font-size: 13.5px; color: var(--ink-body);
}
.co-trust li i { color: var(--brand-500); font-size: 13px; width: 16px; text-align: center; }

/* ---- confirmation ------------------------------------------------------- */
.co-steps--done { justify-content: center; padding: 6px 0 30px; }
.co-done { max-width: 620px; margin: 0 auto; text-align: center; padding-bottom: 20px; }
.co-done__mark {
    width: 72px; height: 72px; margin: 0 auto 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--surface-tint);
    border: 1px solid var(--brand-200);
    color: var(--brand-ink); font-size: 28px;
}
.co-done h1 {
    margin: 0 0 14px; font-family: var(--font-display);
    font-size: clamp(1.875rem, 4.4vw, 2.75rem);
    text-transform: uppercase; letter-spacing: -.02em; color: var(--ink);
}
.co-done__lede { font-size: 16px; line-height: 1.7; color: var(--ink-body); }
.co-ref {
    display: inline-block; margin: 22px 0 10px; padding: 13px 24px;
    border: 1px dashed var(--line-strong); border-radius: var(--r-md);
    background: var(--surface);
    font-size: 1.0625rem; font-weight: 600; letter-spacing: .08em; color: var(--ink);
}
.co-done__note { font-size: 14px; line-height: 1.7; color: var(--ink-muted); }
.co-done__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 26px; }

/* ---- sticky total: phones only ------------------------------------------ */
.co-sticky { display: none; }

/* =============================================================================
   TABLET
   ============================================================================= */
@media (max-width: 1199px) {
    .co-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; }
    .co-card__head { padding: 18px; }
    .co-card__body { padding: 0 18px 18px; }
}

@media (max-width: 991px) {
    .co-grid { grid-template-columns: 1fr; gap: 16px; }
    /* the order comes first, so nothing is confirmed unseen */
    .co-side { position: static; order: -1; }
    .co-trust { order: 2; }
    .co-head { padding: 24px 0 20px; }
}

/* =============================================================================
   PHONE
   Cards become accordions and the total follows the thumb in a fixed bar. The
   summary opens first because it is what people check; the rest open as they
   are needed.
   ============================================================================= */
@media (max-width: 767px) {
    /* Clearance comes from the bar's own measured height (set by
       fs-checkout.js) plus a gap, so the last card always scrolls clear of
       it and there is no dead space when it is short. The fallback covers
       the moment before the script runs. */
    .co-shell { padding: 16px 0 calc(var(--co-sticky-h, 76px) + 22px); }
    .co-shell .container { padding-left: 16px; padding-right: 16px; }

    .co-top { gap: 10px; padding-bottom: 14px; }
    .co-back { order: 1; font-size: 13px; }
    .co-secure { order: 2; margin-inline-start: auto; font-size: 12px; }

    /* One line at every width: the connectors absorb the slack and the
       labels never wrap, so nothing is pushed off the edge. */
    .co-steps { order: 3; width: 100%; justify-content: space-between; gap: 6px; min-width: 0; }
    .co-step { font-size: 12px; gap: 6px; flex: 0 0 auto; }
    .co-step__n { width: 19px; height: 19px; font-size: 11px; }
    .co-step__bar { flex: 1 1 auto; width: auto; min-width: 8px; }

    .co-head { padding: 18px 0 16px; }
    .co-head p { font-size: 14px; }

    .co-card__head {
        cursor: pointer;
        min-height: 60px;
        transition: background-color var(--t);
    }
    .co-card__head:active { background: var(--surface-sunken); }
    .co-card__chev { display: block; }
    .co-card__flag { display: none; }
    .co-card__sub { display: none; }

    /* Collapsed by default on phones; JS opens the summary first and drives
       max-height from each panel's own scrollHeight. */
    .co-card__body {
        max-height: 0;
        overflow: hidden;
        padding-top: 0; padding-bottom: 0;
        transition: max-height .3s var(--ease), padding-bottom .3s var(--ease);
    }
    .co-card.is-open .co-card__body { padding-bottom: 18px; }
    .co-card.is-open .co-card__chev { transform: rotate(180deg); }

    .co-row, .co-pick { grid-template-columns: 1fr; gap: 10px; }
    .co-card input[type="text"],
    .co-card input[type="tel"],
    .co-card input[type="email"] { min-height: 50px; font-size: 16px; }  /* 16px stops iOS zooming */
    .co-card textarea { font-size: 16px; }

    .co-qty button { width: 38px; height: 38px; }
    .co-qty span { min-width: 32px; font-size: 14.5px; }

    .co-place { display: none; }             /* the sticky bar carries it */

    /* Compact: it is a persistent bar, so every pixel of it is taken off the
       page for the whole visit. ~62px plus whatever the safe area needs. */
    .co-sticky {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
        display: flex; align-items: center; gap: 12px;
        padding: 9px 14px calc(9px + env(safe-area-inset-bottom, 0px));
        background: var(--surface);
        border-top: 1px solid var(--line);
        box-shadow: 0 -4px 18px rgba(28, 25, 23, .09);
    }
    .co-sticky[hidden] { display: none; }
    .co-sticky__sum { flex: 0 0 auto; line-height: 1.1; }
    .co-sticky__sum span {
        display: block; font-size: 9.5px; font-weight: 600;
        letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted);
    }
    .co-sticky__sum strong { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); }
    .co-sticky .co-btn {
        flex: 1 1 auto; min-height: 46px; padding: 0 16px;
        font-size: 14.5px; white-space: nowrap;
        min-width: 0;                       /* lets the label ellipsis rather than push */
    }
    .co-sticky .co-btn span { overflow: hidden; text-overflow: ellipsis; }
}

/* ---- small phones: 375 and below ---------------------------------------- */
@media (max-width: 380px) {
    .co-shell .container { padding-left: 14px; padding-right: 14px; }
    .co-card__head { padding: 15px 14px; gap: 11px; }
    .co-card__body { padding-left: 14px; padding-right: 14px; }
    .co-card__icon { width: 34px; height: 34px; font-size: 14px; }
    .co-card__title { font-size: 15px; }

    .co-head h1 { font-size: 1.75rem; }
    .co-head p { font-size: 13.5px; }

    .co-step { font-size: 11px; gap: 5px; }
    .co-step__n { width: 18px; height: 18px; font-size: 10px; }

    .co-line__thumb { width: 48px; height: 48px; }
    .co-line__name { font-size: 14px; }
    .co-totals__grand dd { font-size: 1.5rem; }

    .co-sticky { gap: 10px; padding-left: 12px; padding-right: 12px; }
    .co-sticky .co-btn { padding: 0 12px; font-size: 13.5px; }
    .co-sticky__sum strong { font-size: 1.125rem; }
}

/* ---- the narrowest phones still in use: 320 ----------------------------- */
@media (max-width: 340px) {
    .co-shell .container { padding-left: 12px; padding-right: 12px; }

    /* the label alone is enough at this width - the number carries the step */
    .co-step { font-size: 10.5px; gap: 4px; }
    .co-step__bar { min-width: 5px; }
    .co-back span, .co-secure { font-size: 11.5px; }

    .co-card__head { padding: 14px 12px; gap: 10px; }
    .co-card__body { padding-left: 12px; padding-right: 12px; }
    .co-head h1 { font-size: 1.625rem; }

    .co-line { gap: 10px; }
    .co-line__thumb { width: 44px; height: 44px; }

    .co-sticky { gap: 8px; }
    .co-sticky__sum span { font-size: 9px; }
    .co-sticky__sum strong { font-size: 1.0625rem; }
    .co-sticky .co-btn { font-size: 13px; padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .co-card, .co-card__head, .co-card__body, .co-card__chev,
    .co-pick__opt, .co-btn, .co-qty button { transition: none; }
}

/* -----------------------------------------------------------------------------
   A basket line the menu has outgrown
   -----------------------------------------------------------------------------
   Saved before an item changed, so it can no longer be ordered as it stands.
   Said on the line itself, with something to press - the alternative was a
   list of refusals at the end of the form and no way forward.
   -------------------------------------------------------------------------- */
.co-line.is-stale {
    border-radius: 10px;
    box-shadow: 0 0 0 1.5px rgba(240, 78, 62, .35);
    background: rgba(240, 78, 62, .04);
}
.co-line__stale {
    margin: 6px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--brand-ink, #c73523);
}
.co-line__stale i { margin-right: 2px; }
.co-line__fixes { display: inline-flex; gap: 10px; margin-left: 8px; }
.co-line__fix,
.co-line__drop {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 700;
    color: var(--brand-ink, #c73523);
    text-decoration: underline;
    cursor: pointer;
}
.co-line__fix:hover,
.co-line__drop:hover { text-decoration: none; }

/* -----------------------------------------------------------------------------
   Empty the basket
   -----------------------------------------------------------------------------
   Quiet by default and aligned right, so the destructive control is never the
   thing the eye lands on first. The undo that follows is not quiet at all.
   -------------------------------------------------------------------------- */
.co-clearbar { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.co-clear {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 2px;
    border: 0; background: none;
    font: inherit; font-size: 12.5px; font-weight: 700;
    letter-spacing: .5px; text-transform: uppercase;
    color: var(--ink-muted);
    cursor: pointer;
    transition: color .2s ease;
}
.co-clear i { font-size: 12px; }
.co-clear:hover { color: var(--ink-brand); }
.co-clear:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

.co-undo {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 0 0 12px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--ink);
    border-radius: 10px;
    background: var(--surface-sunken);
    font-size: 13.5px;
    color: var(--ink);
}
.co-undo__btn {
    flex: 0 0 auto;
    padding: 6px 2px;
    border: 0; background: none;
    font: inherit; font-size: 13px; font-weight: 700;
    letter-spacing: .4px; text-transform: uppercase;
    color: var(--ink-brand);
    border-bottom: 1px solid currentColor;
    cursor: pointer;
}
.co-undo__btn:hover { color: var(--ink); }

/* Light theme: the page sits on the brand red, so the progress steps and the heading's helper line need light-on-red
   colours (the neutral greys and a red "active" dot were unreadable / invisible there). */
:root[data-theme="light"] .co-head p { color: #fff; }
:root[data-theme="light"] .co-step { color: rgba(255, 255, 255, .88); }
:root[data-theme="light"] .co-step.is-active { color: #fff; }
:root[data-theme="light"] .co-step__n { background: rgba(255, 255, 255, .92); color: #7a1f14; }
:root[data-theme="light"] .co-step.is-active .co-step__n { background: #1f1a17; color: #fff; }
:root[data-theme="light"] .co-step.is-done i { color: #fff; }
:root[data-theme="light"] .co-step__bar { background: rgba(255, 255, 255, .55); }

/* A card with no header (the card-payment page) has nothing to tap open, so it is never collapsed on phones. */
.co-card.co-card--static .co-card__body { max-height: none; overflow: visible; padding: 22px; }
@media (max-width: 767.98px) { .co-card.co-card--static .co-card__body { padding: 18px; } }
.co-card--static .co-totals { margin: 0 0 16px; padding-top: 0; border-top: 0; }
.co-card--static .co-totals__grand { margin: 0 !important; padding-top: 0; border-top: 0; }
@media (max-width: 575.98px) {
    .co-card--static .co-done__actions { flex-direction: column; align-items: stretch; }
    .co-card--static .co-done__actions .co-btn { width: 100%; }
}

/* Light theme confirmation: same brand-red page, so the copy under the heading must be light-on-red. */
:root[data-theme="light"] .co-done__lede,
:root[data-theme="light"] .co-done__note,
:root[data-theme="light"] .co-done__note strong { color: #fff; }
:root[data-theme="light"] .co-done__mark { background: #fff; border-color: #fff; }
:root[data-theme="light"] .co-done .co-btn--primary { background: #fff; border-color: #fff; color: #7a1f14; box-shadow: none; }

/* automatic product price (e.g. SOCIAL PERK) - a label on the line; the price already includes it */
.co-line__promo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 0; font-size: 12.5px; line-height: 1.3; color: var(--ink-muted); }
.co-line__promo b { color: var(--ink, inherit); font-weight: 800; }
.co-perk {
    display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px;
    background: linear-gradient(135deg, #b81e1e 0%, #e0442a 60%, #f0662e 100%); color: #fff;
    font-size: 9px; font-weight: 800; letter-spacing: .09em; line-height: 1.2; text-transform: uppercase; white-space: nowrap;
}
.co-was { position: relative; display: inline-block; }
.co-was::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; height: 2px; border-radius: 2px; background: #e0442a; transform: rotate(-9deg); }

/* ---- voucher / promo code (checked by the server - voucher.php) ---- */
.co-voucher { margin: 4px 0 12px; }
.co-voucher__form { display: flex; gap: 8px; }
.co-voucher__form input {
    flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 14px; border-radius: 10px;
    border: 1px solid var(--border, rgba(127,127,127,.35)); background: transparent; color: inherit;
    font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.co-voucher__form input::placeholder { letter-spacing: 0; text-transform: none; font-weight: 500; opacity: .6; }
.co-voucher__form input:focus { outline: none; border-color: var(--theme2, #d12525); box-shadow: 0 0 0 3px rgba(209,37,37,.15); }
.co-voucher__apply {
    flex: none; height: 44px; padding: 0 18px; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--theme2, #d12525); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.co-voucher__apply:disabled { opacity: .65; cursor: progress; }
.co-voucher__applied {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
    background: rgba(31,138,76,.10); border: 1px solid rgba(31,138,76,.35);
}
.co-voucher__tick { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: #1f8a4c; color: #fff; font-size: 11px; }
.co-voucher__text { flex: 1 1 auto; min-width: 0; font-size: 13.5px; line-height: 1.3; }
.co-voucher__text strong { letter-spacing: .06em; }
.co-voucher__text small { display: block; font-size: 12px; opacity: .8; }
.co-voucher__remove { flex: none; border: 0; background: none; padding: 4px 2px; cursor: pointer; font-size: 12.5px; font-weight: 700; color: inherit; opacity: .8; text-decoration: underline; text-underline-offset: 3px; }
.co-voucher__remove:hover { opacity: 1; }
.co-voucher__msg { margin: 6px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-muted, inherit); }
.co-voucher__msg.is-bad { color: #d12525; font-weight: 600; }
.co-totals__discount dt, .co-totals__discount dd { color: #1f8a4c; font-weight: 700; }

/* voucher entry - closed state as a compact designed row; the reveal animates in (no JS logic involved) */
.co-voucher__toggle {
    display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 10px 12px;
    border: 1px dashed rgba(209,37,37,.45); border-radius: 12px; cursor: pointer; text-align: left;
    background: linear-gradient(120deg, rgba(209,37,37,.07), rgba(209,37,37,.02));
    color: var(--ink, inherit); text-decoration: none; font-weight: 400;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}
.co-voucher__toggle:hover { border-style: solid; border-color: rgba(209,37,37,.65); text-decoration: none; }
.co-voucher__toggle:hover .co-voucher__chev { transform: translateX(2px); }
.co-voucher__toggle:focus-visible { outline: 2px solid var(--theme2, #d12525); outline-offset: 2px; }
.co-voucher__ico { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: rgba(209,37,37,.12); color: var(--theme2, #d12525); font-size: 15px; }
.co-voucher__lbl { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.co-voucher__lbl strong { font-size: 14px; font-weight: 700; color: var(--ink, inherit); }
.co-voucher__lbl small { font-size: 12.5px; color: var(--ink-muted, inherit); }
.co-voucher__chev { flex: none; font-size: 12px; color: var(--theme2, #d12525); transition: transform .18s ease; }
@keyframes coVoucherIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.co-voucher__form:not([hidden]), .co-voucher__applied:not([hidden]) { animation: coVoucherIn .2s ease-out both; }
.co-voucher__applied { padding: 10px 12px; }
@media (prefers-reduced-motion: reduce) { .co-voucher__form, .co-voucher__applied, .co-voucher__toggle, .co-voucher__chev { animation: none !important; transition: none !important; } }
