/* The Cookie Club: the cart (/shop/cart/).
     .ct-top      the heading, and beside it when it could all be here if it were ordered now
     .ct-main     what's in the cart, how far off free postage is, and "When can I get it?"
     .ct-sum      the summary: the total and the one way on, Checkout. It follows the page down.
     .ct-bar      on a phone: the total and the button, in reach while the summary is off the screen
     .ct-empty    nothing in it yet
   Loaded by this page only (src/shop/checkout.mjs), after fresh-shop.css (the breadcrumbs are its).
   What it does is in static/assets/js/cart-page.js. */

/* One way on from here: the footer's invitation to enquire is left off this page (and the room the
   footer keeps for it goes too). */
.ct-body .f-cta { display: none; }
.ct-body .f-foot { padding-top: clamp(2.75rem, 6vw, 4.5rem); }

.ct-page { padding: clamp(0.75rem, 2vw, 1.5rem) 0 clamp(3.5rem, 8vw, 6.5rem); }
.ct-page .f-crumbs ol { margin-bottom: 0; }
.ct-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 40px; margin: clamp(0.6rem, 1.6vw, 1rem) 0 clamp(1.5rem, 3.5vw, 2.25rem); }
.chrome-new .ct-top h1 { margin: 0; font-size: clamp(2.75rem, 2rem + 4vw, 4.5rem); line-height: 0.92; }
.ct-promise { flex: 1 1 22rem; max-width: 34rem; margin: 0 0 6px; font-weight: 700; font-size: clamp(1.05rem, 0.98rem + 0.4vw, 1.22rem); line-height: 1.4; color: var(--text); text-wrap: balance; }
.ct-promise[hidden] { display: none; }
.ct-promise strong { font-weight: 900; color: var(--heading); white-space: nowrap; }
@media (min-width: 901px) { .ct-promise { text-align: right; } }

.ct-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, 0.92fr); align-items: start; gap: clamp(1.5rem, 3.5vw, 3rem); }
.ct-main { min-width: 0; display: grid; gap: 18px; }

/* ---------- small things used throughout ---------- */
.ct-link { padding: 0; border: 0; background: none; font: inherit; font-weight: 800; color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ct-link:hover { text-decoration-color: var(--mark); }
.ct-link:focus-visible { outline: 3px solid var(--mark); outline-offset: 3px; border-radius: 4px; }
.ct-tick { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--on-accent); -webkit-mask: radial-gradient(circle at 88% 12%, transparent 21%, #000 22%); mask: radial-gradient(circle at 88% 12%, transparent 21%, #000 22%); }
.ct-tick svg { width: 62%; height: 62%; }
.ct-msg { max-width: 46ch; padding: clamp(1.25rem, 3vw, 2rem); border-radius: var(--r-lg); background: var(--soft); font-weight: 700; line-height: 1.5; }
.ct-nojs { font-weight: 700; }

/* Put it back: straight after something is removed. */
.ct-undo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; margin: 0; padding: 13px 20px; border-radius: var(--r-md); background: var(--text); color: var(--on-dark, #fff); font-weight: 700; line-height: 1.35; animation: ct-in 0.2s var(--ease-out); }
.ct-undo strong { font-weight: 900; }
.ct-undo .ct-link { min-height: 32px; color: inherit; text-decoration-color: rgba(255, 255, 255, 0.5); }
.ct-undo .ct-link:hover { text-decoration-color: #fff; }
.ct-undo .ct-link:focus-visible { outline-color: #fff; }

/* ---------- free Parcel Post ---------- */
.ct-free { padding: 15px 20px 17px; border-radius: var(--r-md); background: var(--soft); }
.ct-free p { margin: 0 0 11px; font-weight: 700; line-height: 1.35; color: var(--text); }
.ct-free strong { font-weight: 900; }
.ct-free a { margin-left: 4px; font-weight: 800; color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 2px; text-underline-offset: 3px; white-space: nowrap; }
.ct-free a:hover { text-decoration-color: var(--mark); }
.ct-free-track { position: relative; height: 12px; border-radius: 999px; background: #fff; }
.ct-free-track span { position: relative; display: block; height: 100%; min-width: 12px; border-radius: 999px; background: var(--accent); transition: width 0.5s var(--ease-out); }
/* (The end of the bar is a biscuit, on its way.) */
.ct-free-track span::after { content: ''; position: absolute; right: -9px; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--soft); -webkit-mask: radial-gradient(circle at 84% 16%, transparent 22%, #000 23%); mask: radial-gradient(circle at 84% 16%, transparent 22%, #000 23%); }
.ct-free.is-won { background: var(--accent); }
.ct-free.is-won p { margin: 0; color: var(--on-accent); }
.ct-free.is-won .ct-free-track { display: none; }

/* ---------- what's in the cart ---------- */
.ct-items { padding: 4px clamp(1rem, 2.5vw, 1.6rem); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); }
.ct-lines { list-style: none; margin: 0; padding: 0; }
.ct-line { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: start; gap: 4px clamp(0.9rem, 2vw, 1.25rem); padding: 20px 0; }
.ct-line + .ct-line { border-top: 2px dashed var(--line); }
.ct-pic { display: block; width: 96px; height: 96px; border-radius: 20px; overflow: hidden; background: var(--soft); }
.ct-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ct-nopic { display: block; width: 100%; height: 100%; background: radial-gradient(circle at 50% 50%, var(--soft-2) 0 34%, transparent 35%); }
.ct-line-body { min-width: 0; padding-top: 4px; }
.ct-name { margin: 0; font-weight: 900; font-size: 1.16rem; line-height: 1.2; color: var(--text); }
.chrome-new .ct-name a { color: inherit; text-decoration: none; }
.chrome-new .ct-name a:hover { text-decoration: underline; text-decoration-color: var(--mark); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ct-details { list-style: none; margin: 6px 0 0; padding: 0; font-size: 0.96rem; line-height: 1.45; color: var(--text-soft); }
.ct-remove { display: inline-flex; align-items: center; min-height: 40px; margin-top: 2px; font-size: 0.95rem; color: var(--text-soft); }
.ct-remove:hover { color: var(--accent-ink); }
.ct-price { padding-top: 4px; font-weight: 900; font-size: 1.16rem; line-height: 1.2; color: var(--text); white-space: nowrap; }
.ct-line.has-error .ct-pic { opacity: 0.55; }
.ct-line-error { margin: 8px 0 0; font-weight: 800; font-size: 0.95rem; line-height: 1.4; color: #8a1525; }
/* A cookie designed on the website: its picture, its reference and the way back to change it. */
.ct-design { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: 8px 0 0; font-weight: 800; font-size: 0.95rem; color: var(--text); }
.ct-design img { flex: none; width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 0 0 2px var(--line); }
.ct-design-gone { margin: 8px 0 0; font-weight: 700; font-size: 0.93rem; line-height: 1.4; color: var(--text-soft); }
.ct-held { margin: 0; padding: 14px 0 16px; border-top: 2px dashed var(--line); font-weight: 800; font-size: 0.96rem; line-height: 1.4; color: var(--accent-ink); }

/* ---------- when can I get it? ---------- */
.ct-when { padding: clamp(1.25rem, 3vw, 1.75rem); border-radius: var(--r-lg); background: var(--field); }
.chrome-new .ct-when h2 { margin: 0 0 12px; font: 900 clamp(1.3rem, 1.2rem + 0.5vw, 1.5rem)/1.15 var(--font-body); color: var(--field-ink); }
.ct-pc label { display: block; margin: 0 0 8px; font-weight: 800; color: var(--field-ink); }
.ct-pc-row { display: flex; align-items: stretch; gap: 10px; }
.chrome-new .ct-pc input { width: 7.2rem; min-width: 0; height: 52px; margin: 0; padding: 0 18px; border: 2px solid var(--field-line); border-radius: 999px; background: #fff; color: var(--text); font: 800 1.1rem/1 var(--font-body); }
.chrome-new .ct-pc input:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
.ct-pc input::placeholder { color: var(--muted); font-weight: 600; opacity: 0.8; }
.ct-pc .f-btn { height: 48px; padding-block: 0; }
.ct-err { margin: 8px 0 0; font-weight: 800; font-size: 0.94rem; color: #8a1525; }
.ct-err[hidden] { display: none; }

.ct-ways { min-width: 0; margin: 16px 0 0; padding: 0; border: 0; display: grid; gap: 7px; transition: opacity 0.15s ease; }
.ct-when.is-busy .ct-ways { opacity: 0.5; }
.ct-ways-h { float: left; width: 100%; margin: 0 0 3px; padding: 0; font-weight: 700; font-size: 0.95rem; line-height: 1.4; color: var(--field-ink); }
.ct-ways-h + * { clear: both; }
.ct-way { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 14px; min-height: 58px; padding: 10px 18px 10px 14px; border-radius: 18px; background: #fff; cursor: pointer; transition: box-shadow 0.15s ease; -webkit-tap-highlight-color: transparent; }
.ct-way input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.ct-way-dot { display: grid; place-items: center; width: 28px; height: 28px; border: 2.5px solid var(--field-line); border-radius: 50%; background: #fff; color: transparent; transition: background-color 0.15s ease, border-color 0.15s ease; }
.ct-way-dot svg { width: 60%; height: 60%; }
.ct-way-name { font-weight: 900; line-height: 1.25; color: var(--text); }
.ct-way-name small { margin-left: 5px; font-size: 0.95em; font-weight: 800; color: var(--accent-ink); }
.ct-way-when { text-align: right; line-height: 1.3; color: var(--text); }
.ct-way-when strong { font-weight: 900; white-space: nowrap; }
.ct-way-when.is-soft { font-size: 0.94rem; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .ct-way:not(.is-off):hover { box-shadow: 0 0 0 2.5px var(--field-line); } }
.ct-way.is-on { box-shadow: 0 0 0 3px var(--mark); }
.ct-way.is-on .ct-way-dot { border-color: var(--accent); background: var(--accent); color: var(--on-accent); -webkit-mask: radial-gradient(circle at 88% 12%, transparent 21%, #000 22%); mask: radial-gradient(circle at 88% 12%, transparent 21%, #000 22%); }
.ct-way input:focus-visible + .ct-way-dot { outline: 3px solid var(--mark); outline-offset: 3px; }
.ct-way.is-off { cursor: default; background: rgba(255, 255, 255, 0.55); }
.ct-way.is-off .ct-way-dot { border-style: dashed; opacity: 0.6; }
.ct-way.is-off .ct-way-name { font-weight: 800; color: var(--text-soft); }
.ct-way.is-off .ct-way-when { max-width: 30ch; font-size: 0.94rem; color: var(--text-soft); }
.ct-way-msg { margin: 4px 2px 0; font-weight: 700; font-size: 0.96rem; line-height: 1.45; color: var(--field-ink); }
.ct-when-note { margin: 14px 2px 0; font-size: 0.93rem; line-height: 1.5; color: var(--field-ink); }
.ct-when-note[hidden] { display: none; }
.ct-when-note strong { font-weight: 900; }

/* ---------- the summary ---------- */
.ct-sum { position: sticky; top: calc(var(--head-h) + 18px); padding: clamp(1.4rem, 2.6vw, 1.9rem); border-radius: var(--r-lg); background: #fff; box-shadow: var(--lift); }
.chrome-new .ct-sum h2 { margin: 0 0 14px; font-size: 1.55rem; line-height: 1; }
.ct-rows { margin: 0; display: grid; gap: 9px; }
.ct-rows div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.ct-rows dt { font-weight: 700; color: var(--text); }
.ct-rows dt small { margin-left: 6px; font-size: 0.86rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ct-rows dd { margin: 0; font-weight: 800; color: var(--text); text-align: right; }
.ct-rows .is-open dd { font-weight: 700; font-size: 0.95rem; color: var(--text-soft); }
.ct-total { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 16px 0 0; padding-top: 16px; border-top: 2px dashed var(--line); }
.ct-total span { font-weight: 900; font-size: 1.1rem; color: var(--text); }
.ct-total strong { font: 400 clamp(2.3rem, 1.9rem + 1.6vw, 2.9rem)/1 var(--font-display); color: var(--heading); font-variant-numeric: tabular-nums; }
.ct-total strong.is-new { animation: ct-pop 0.28s var(--ease-out); transform-origin: 100% 60%; }
.ct-gst { margin: 6px 0 0; font-size: 0.9rem; text-align: right; color: var(--muted); }
.ct-go { display: flex; width: 100%; margin-top: 20px; }
.ct-safe { margin: 16px 0 0; font-weight: 800; font-size: 0.95rem; line-height: 1.4; text-align: center; color: var(--text); }
.ct-next { margin: 6px 0 0; font-size: 0.93rem; line-height: 1.45; text-align: center; color: var(--text-soft); }
.ct-next strong { font-weight: 900; }
.ct-stop { margin: 18px 0 0; padding: 14px 16px; border-radius: var(--r-md); background: #fbeaec; font-weight: 800; line-height: 1.4; color: #8a1525; }
.ct-promises { list-style: none; margin: 20px 0 0; padding: 18px 0 0; border-top: 2px dashed var(--line); display: grid; gap: 10px; }
.ct-promises li { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 0.97rem; line-height: 1.3; color: var(--text); }
.ct-codes { margin: 18px 0 0; font-size: 0.93rem; line-height: 1.45; color: var(--text-soft); }
.ct-more { margin: 14px 0 0; }

/* ---------- the bar on a phone ---------- */
.ct-bar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 8px 12px 24px; border-radius: 999px; background: #fff; box-shadow: var(--lift), 0 0 0 1px rgba(91, 65, 43, 0.06); animation: ct-in 0.22s var(--ease-out); }
.ct-bar[hidden] { display: none; }
.ct-bar p { margin: 0; display: flex; flex-direction: column; line-height: 1.1; }
.ct-bar span { font-size: 0.82rem; font-weight: 800; color: var(--muted); }
.ct-bar strong { font: 400 1.45rem/1.1 var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.ct-bar .f-btn { flex: none; padding-inline: 1.7em; }
.has-ct-bar .f-foot { padding-bottom: 104px; }
.chrome-new.has-ct-bar .f-preview { bottom: 92px; }

/* ---------- nothing in it yet ---------- */
.ct-empty { display: grid; justify-items: center; padding: clamp(2rem, 6vw, 4rem) clamp(1.25rem, 4vw, 3rem) clamp(2.25rem, 6vw, 4rem); border-radius: var(--r-xl); background: var(--field); text-align: center; }
.ct-undo + .ct-empty { margin-top: 18px; }
.ct-empty-art { position: relative; width: 150px; height: 150px; margin-bottom: 20px; }
.ct-bis { display: block; width: 100%; height: 100%; filter: drop-shadow(0 20px 20px rgba(var(--shade-deep), 0.3)); }
.ct-bis span { display: block; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 34% 40%, var(--accent-deep) 0 6%, transparent 6.5%), radial-gradient(circle at 60% 30%, var(--accent-deep) 0 4.5%, transparent 5%), radial-gradient(circle at 66% 62%, var(--accent-deep) 0 6.5%, transparent 7%), radial-gradient(circle at 38% 70%, var(--accent-deep) 0 4.5%, transparent 5%), var(--accent); box-shadow: inset 0 0 0 9px rgba(255, 255, 255, 0.07); -webkit-mask: radial-gradient(circle at 84% 16%, transparent 20.6%, #000 21%); mask: radial-gradient(circle at 84% 16%, transparent 20.6%, #000 21%); }
.ct-empty-art i { position: absolute; border-radius: 50%; background: var(--accent); }
.ct-empty-art i:nth-of-type(1) { right: 2%; top: -2%; width: 13px; height: 13px; }
.ct-empty-art i:nth-of-type(2) { right: -9%; top: 13%; width: 8px; height: 8px; }
.ct-empty-art i:nth-of-type(3) { right: 15%; top: -9%; width: 6px; height: 6px; }
.chrome-new .ct-empty h2 { margin: 0; font-size: clamp(2rem, 1.5rem + 2.4vw, 3rem); line-height: 1; color: var(--field-head); }
.ct-empty p { margin: 12px 0 0; max-width: 34ch; font-weight: 700; font-size: 1.1rem; line-height: 1.45; color: var(--field-ink); }
.chrome-new .ct-empty a.f-link { color: var(--accent-deep); border-color: rgba(var(--shade-deep), 0.35); }
.ct-empty .ct-empty-go { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 26px; max-width: none; margin-top: 26px; }

/* ---------- while it loads ---------- */
.ct-skel span { display: block; border-radius: var(--r-lg); background: var(--soft); animation: ct-wait 1.2s ease-in-out infinite alternate; }
.ct-skel-a { height: 136px; }
.ct-skel-b { height: 260px; }
.ct-skel-c { height: 420px; }

@keyframes ct-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes ct-pop { from { transform: scale(0.92); opacity: 0.4; } }
@keyframes ct-wait { from { opacity: 1; } to { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) {
  .ct-undo, .ct-bar, .ct-total strong.is-new, .ct-skel span { animation: none; }
  .ct-free-track span { transition: none; }
}

/* ---------- narrower screens ---------- */
@media (max-width: 900px) {
  .ct-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ct-sum { position: static; }
  .ct-skel-c { height: 300px; }
}
@media (max-width: 560px) {
  .ct-line { grid-template-columns: 76px minmax(0, 1fr) auto; }
  .ct-pic { width: 76px; height: 76px; border-radius: 16px; }
  .ct-name, .ct-price { font-size: 1.06rem; }
  /* When each way would arrive goes under its name. */
  .ct-way { grid-template-columns: auto minmax(0, 1fr); padding-block: 12px; }
  .ct-way-when { grid-column: 2; text-align: left; }
  .ct-way.is-off .ct-way-when { max-width: none; }
}
