/* ==========================================================================
   OFFCUT — Thread Theme · Cart page
   ========================================================================== */

/* ==========================================================================
   01 · HEAD
   ========================================================================== */
.bhead { padding-top: calc(var(--bar-h) + var(--head-h) + clamp(28px, 4vw, 56px)); }
.bhead__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.bhead__title { font-weight: 500; font-size: clamp(3.4rem, 8vw, 8.4rem); line-height: .82; letter-spacing: -.07em; }
.bhead__title sup { font-family: var(--f-serif); font-style: italic; font-weight: 400; font-size: .32em; letter-spacing: 0; vertical-align: top; margin-left: .12em; position: relative; top: .1em; }
.steps { display: flex; gap: 6px; padding-bottom: 10px; }
.steps li { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; color: var(--mute-2); border: 1px solid var(--line-2); }
.steps li .mono { font-size: 10px; }
.steps li.is-on { color: var(--paper); background: var(--ink); border-color: var(--ink); }

/* reward tiers */
.tiers { margin-top: clamp(28px, 3.5vw, 48px); padding: 20px 22px 44px; border-radius: var(--r-m); background: var(--white); }
.tiers__msg { font-size: 14px; margin-bottom: 18px; }
.tiers__msg b { font-weight: 600; }
.tiers__track { position: relative; height: 4px; border-radius: 4px; background: var(--paper-2); }
.tiers__fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--ink); transition: width 1s var(--ease); }
.tier { position: absolute; top: 50%; left: var(--at); transform: translate(-100%, -50%); }
.tier > b { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--white); border: 2px solid var(--paper-2); transition: background-color .5s var(--ease), border-color .5s; margin-left: auto; }
.tier > span { position: absolute; right: 0; top: 22px; white-space: nowrap; text-align: right; font-size: 12px; color: var(--mute); display: grid; }
.tier > span small { font-size: 10px; }
.tier__s { display: none; }
.tier.is-hit > b { background: var(--ink); border-color: var(--ink); box-shadow: 0 0 0 4px var(--white); }
.tier.is-hit > span { color: var(--ink); font-weight: 500; }
.tier:first-of-type { transform: translate(-50%, -50%); }
.tier:first-of-type > b { margin: 0 auto; }
.tier:first-of-type > span { right: auto; left: 50%; transform: translateX(-50%); text-align: center; }
.tiers.is-done .tiers__fill { background: var(--ok); }

/* ==========================================================================
   02 · BAG
   ========================================================================== */
.bag {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
  padding-block: clamp(28px, 3vw, 44px) clamp(64px, 7vw, 110px);
}
.bag[hidden] { display: none; }
.bag__main { display: grid; gap: 24px; min-width: 0; }

.hold { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-m); background: var(--sw-butter); font-size: 13.5px; }
.hold .i { width: 18px; height: 18px; }
.hold b { font-variant-numeric: tabular-nums; font-weight: 600; }

.lines { border-top: 1px solid var(--line); }
.bl {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 22px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.lines.is-anim .bl { animation: blIn .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }   /* first paint only — not on every qty change */
@keyframes blIn { from { opacity: 0; transform: translateY(12px); } }
.bl.is-leaving { animation: blOut .45s var(--ease) forwards; }
@keyframes blOut { to { opacity: 0; transform: translateX(-16px); } }
.bl__img { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--r-s); overflow: hidden; background: var(--bg); isolation: isolate; }
.bl__img img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; transition: transform 1.2s var(--ease); }
.bl__img:hover img { transform: scale(1.05); }
.bl__info { display: grid; gap: 6px; align-content: start; min-width: 0; }
.bl__name { font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.bl__name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.bl__meta { color: var(--mute); font-size: 13.5px; }
.bl__flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.flag-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 11.5px; background: var(--paper-2); color: var(--ink-3); }
.flag-pill--low { color: var(--signal); background: #fde9e1; }
.flag-pill--low::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.flag-pill--ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.flag-pill--deal { background: var(--sw-sage); color: var(--ink); }
.bl__ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.bl__ctrl .select { height: 38px; font-size: 13px; }
.stepper { display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--line); border-radius: 999px; }
.stepper button { width: 36px; height: 100%; display: grid; place-items: center; border-radius: 999px; transition: background-color .25s; }
.stepper button:hover:not(:disabled) { background: var(--paper-2); }
.stepper button:disabled { opacity: .3; cursor: not-allowed; }
.stepper button .i { width: 14px; height: 14px; }
.stepper output { min-width: 22px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.bl__acts { display: flex; gap: 16px; margin-top: 8px; font-size: 12.5px; color: var(--mute); }
.bl__acts button { display: inline-flex; align-items: center; gap: 6px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); transition: color .25s, text-decoration-color .25s; }
.bl__acts button:hover { color: var(--ink); text-decoration-color: currentColor; }
.bl__acts .i { width: 14px; height: 14px; }
.bl__price { display: grid; gap: 4px; justify-items: end; align-content: start; text-align: right; font-variant-numeric: tabular-nums; }
.bl__price b { font-size: 17px; font-weight: 500; }
.bl__price s { color: var(--mute-2); font-size: 13px; }
.bl__price small { color: var(--mute); font-size: 12px; }
.bl--gift .bl__img { background: var(--sw-sage); }
.bl--gift .bl__price b { color: var(--ok); }

/* removed → undo row */
.bl-undo { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; margin: 10px 0; border-radius: var(--r-m); background: var(--paper-2); font-size: 13.5px; animation: blIn .5s var(--ease) both; }
.bl-undo b { font-weight: 500; }
.bl-undo button { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* gift */
.gift { border-radius: var(--r-m); background: var(--white); overflow: hidden; }
.gift__toggle { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 18px; cursor: pointer; }
.gift__ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--sw-clay); }
.gift__ico svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.gift__toggle b { display: block; font-weight: 500; font-size: 14.5px; }
.gift__toggle small { color: var(--mute); font-size: 12.5px; }
.gift__toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch__ui { position: relative; width: 40px; height: 24px; border-radius: 999px; background: rgba(13, 13, 12, .14); transition: background-color .35s var(--ease); }
.switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .45s var(--ease); }
.gift__toggle input:checked + .switch__ui { background: var(--ink); }
.gift__toggle input:checked + .switch__ui::after { transform: translateX(16px); }
.gift__toggle input:focus-visible + .switch__ui { outline: 1.5px solid var(--ink); outline-offset: 3px; }
.gift__body { display: grid; gap: 16px; padding: 4px 18px 20px; border-top: 1px solid var(--line-2); padding-top: 18px; animation: blIn .5s var(--ease) both; }
.wraps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wrap { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-s); border: 1px solid var(--line); cursor: pointer; transition: border-color .3s; font-size: 13.5px; }
.wrap input { position: absolute; opacity: 0; pointer-events: none; }
.wrap:has(input:checked) { border-color: var(--ink); }
.wrap:has(input:focus-visible) { outline: 1.5px solid var(--ink); outline-offset: 2px; }
.wrap__sw { width: 36px; height: 36px; border-radius: 6px; background: var(--c); flex: none; }
.wrap b { display: block; font-weight: 500; }
.wrap small { color: var(--mute); font-size: 12px; }
.note { position: relative; display: grid; gap: 8px; }
.note .mono { color: var(--mute); font-size: 10px; }
.note textarea { resize: vertical; min-height: 84px; padding: 12px 14px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--paper); font-size: 14px; line-height: 1.5; outline: none; font-family: var(--f-serif); font-style: italic; font-size: 18px; }
.note textarea:focus { border-color: var(--ink); }
.note small { position: absolute; right: 10px; bottom: 8px; font-family: var(--f-mono); font-size: 10px; color: var(--mute); }
.fopt-inline { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; }
.fopt-inline input { width: 18px; height: 18px; accent-color: var(--ink); }

/* saved for later */
.saved__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.saved__head sup { color: var(--mute); }
.saved__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sv { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; border-radius: var(--r-m); background: var(--white); font-size: 13px; animation: blIn .5s var(--ease) both; }
.sv__img { width: 64px; aspect-ratio: 4 / 5; border-radius: var(--r-xs); overflow: hidden; background: var(--bg); }
.sv__img img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.sv b { display: block; font-weight: 500; }
.sv small { color: var(--mute); }
.sv__acts { display: flex; gap: 12px; margin-top: 6px; font-size: 12px; }
.sv__acts button { text-decoration: underline; text-underline-offset: 3px; }
.sv__acts button:first-child { font-weight: 500; }

/* ==========================================================================
   SUMMARY
   ========================================================================== */
.sum { align-self: stretch; }
.sum__in {
  position: sticky; top: calc(var(--bar-h) + var(--head-h) + 20px);
  display: grid; gap: 16px;
  padding: 24px;
  border-radius: var(--r-l);
  background: var(--white);
  transition: top .6s var(--ease);
}
.bar-hidden .sum__in { top: calc(var(--head-h) + 20px); }
.sum__title { font-size: 20px; font-weight: 500; letter-spacing: -.03em; }
.sum__rows { display: grid; gap: 10px; margin: 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.sum__rows div { display: flex; justify-content: space-between; gap: 16px; font-variant-numeric: tabular-nums; }
.sum__rows dt { color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.sum__rows dd { margin: 0; font-weight: 500; }
.sum__rows .is-save dd, .sum__rows .is-save dt { color: var(--ok); }
.sum__rows .is-free dd { color: var(--ok); }
.sum__rows .tagx { font-family: var(--f-mono); font-size: 10px; padding: 3px 7px; border-radius: 999px; background: var(--paper-2); color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.sum__rows .tagx button { line-height: 0; }
.sum__rows .tagx .i { width: 11px; height: 11px; }

.promo { display: flex; gap: 6px; }
.promo input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; outline: none; }
.promo input:focus { border-color: var(--ink); }
.promo input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--f-sans); font-size: 13px; }
.promo__msg { font-size: 12.5px; margin-top: -8px; min-height: 0; }
.promo__msg:empty { display: none; }
.promo__msg.is-ok { color: var(--ok); }
.promo__msg.is-err { color: #b23a12; }
.promo.is-shake { animation: shake .5s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.ship-to { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; }
.ship-to .mono { color: var(--mute); font-size: 10px; }
.ship-to .select { justify-self: end; height: 34px; }
.ship-to__eta { grid-column: 1 / -1; font-size: 12.5px; color: var(--mute); }
.ship-to__eta b { color: var(--ink); font-weight: 500; }

.sum__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; border-top: 1px solid var(--line); }
.sum__total span { font-size: 15px; font-weight: 500; }
.sum__total b { font-size: 34px; font-weight: 500; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.sum__tax { color: var(--mute); font-size: 10px; margin-top: -12px; text-align: right; }
.sum__cta { --bh: 58px; font-size: 15px; }
.sum__split { text-align: center; font-size: 12.5px; color: var(--mute); margin-top: -6px; }
.sum__split b { color: var(--ink); font-weight: 500; }
.express { display: grid; gap: 8px; }
.express > .mono { font-size: 10px; color: var(--mute); text-align: center; display: flex; align-items: center; gap: 12px; }
.express > .mono::before, .express > .mono::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.express div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.xpay { height: 42px; border-radius: var(--r-s); background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; letter-spacing: -.01em; transition: opacity .25s; }
.xpay:hover { opacity: .85; }
.xpay--k { background: #ffb3c7; color: var(--ink); }
.sum__trust { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); }
.sum__trust li { display: flex; align-items: center; gap: 10px; }
.sum__trust .i { width: 16px; height: 16px; }

/* ==========================================================================
   03 · EMPTY
   ========================================================================== */
.bempty { background: var(--sw-sand); overflow: hidden; margin-top: clamp(24px, 3vw, 40px); }
.bempty__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 64px); min-height: clamp(520px, 64vh, 700px); }
.bempty__art { position: relative; align-self: stretch; min-height: 420px; isolation: isolate; background: var(--sw-sand); }
.bempty__word {
  position: absolute; left: -1%; bottom: -3%;
  font-weight: 500; font-size: clamp(7rem, 19vw, 21rem); line-height: .8; letter-spacing: -.08em;
  color: var(--ink);
}
.bempty__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; mix-blend-mode: multiply; filter: contrast(1.1) brightness(1.08); }
.bempty__copy { display: grid; gap: 20px; justify-items: start; padding-block: 64px; }
.bempty__copy .eyebrow { color: var(--ink-3); }
.bempty__copy .lede { color: var(--ink-3); }
.bempty__ctas { display: flex; gap: 10px; flex-wrap: wrap; }

/* mobile checkout bar */
.mbar {
  position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 48;
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 18px;
  border-radius: 999px;
  background: rgba(244, 242, 238, .78);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .4);
  transform: translateY(calc(100% + 20px));
  transition: transform .6s var(--ease);
}
.mbar.is-on { transform: none; }
.mbar span { display: grid; line-height: 1.1; }
.mbar small { color: var(--mute); font-size: 10px; }
.mbar b { font-size: 20px; font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.mbar .btn { --bh: 46px; }

.page-cart .proof { display: none; }    /* no social-proof nudges while they're about to pay */

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .bag { grid-template-columns: minmax(0, 1fr); }
  .sum__in { position: static; }
  .mbar { display: flex; }
  .page-cart .to-top { bottom: 76px; }
}
@media (max-width: 760px) {
  .steps li:not(.is-on) { padding: 0 10px; }
  .steps li:not(.is-on) .mono { display: none; }
  .bempty__in { grid-template-columns: minmax(0, 1fr); }
  .bempty__art { order: 2; margin-inline: calc(var(--gutter) * -1); min-height: 360px; }
  .bempty__copy { padding-block: 48px 0; }
}
@media (max-width: 640px) {
  .steps { width: 100%; justify-content: space-between; gap: 4px; }
  .steps li { padding: 0 10px; font-size: 12px; }
  .tiers { padding: 16px 16px 46px; }
  .tier > span { font-size: 11px; }
  .tier__l { display: none; }
  .tier__s { display: inline; }
  .bl { grid-template-columns: 96px minmax(0, 1fr); gap: 10px 14px; }
  .bl__img { grid-row: span 2; }
  .bl__price { grid-column: 2; justify-items: start; text-align: left; grid-row: 2; display: flex; gap: 8px; align-items: baseline; }
  .bl__ctrl { grid-column: 1 / -1; }
  .bl__info { display: contents; }
  .bl__info > .bl__head { grid-column: 2; }
  .bl__ctrl, .bl__acts { grid-column: 1 / -1; }
  .wraps { grid-template-columns: minmax(0, 1fr); }
  .sum__in { padding: 20px 16px; }
}
