/* Cart badge bump + mini cart.
   The badge pops when an item lands (scale 1 > 1.6 at 30% of .5s, each leg on the house ease), after a short
   "Adding to cart..." beat on the button; the cart itself is a modal on an 80% black scrim with line items,
   quantity inputs, remove links and a subtotal, kept in localStorage. Front-end only: no payments, no network.
   Measured from Lordburger's Webflow cart (js/main.js cart block, css/extra.css) + Patty Wagon's badge bump. */
:root {
  --cbb-bump-scale: 1.6;                    /* badge peak */
  --cbb-bump-dur: .5s;                      /* whole bump; the peak is at 30% (150ms) */
  --cbb-ease: cubic-bezier(.16, 1, .3, 1);  /* applied to each leg: up 0-30%, down 30-100% */
  --cbb-accent: #e4572e;                    /* badge + buttons */
  --cbb-accent-ink: #fff;
  --cbb-ink: #000;
  --cbb-paper: #fff;
  --cbb-rule: #e6e6e6;                      /* hairlines inside the cart */
  --cbb-line: 3px;                          /* the chunky outline on buttons and the cart square */
  --cbb-scrim: rgba(0, 0, 0, .8);
  --cbb-panel-w: 480px;
  --cbb-badge-size: 16px;                   /* 20px on big screens in the source */
  --cbb-badge-font: 12px;
  --cbb-badge-inset: 4px;
  --cbb-font: inherit;
}

/* ---- the badge (put it inside any positioned cart button) */
.cbb-badge {
  position: absolute; top: var(--cbb-badge-inset); right: var(--cbb-badge-inset);
  box-sizing: content-box; height: var(--cbb-badge-size); min-width: var(--cbb-badge-size); padding: 4px;
  display: flex; align-items: center; justify-content: center;
  border-radius: calc(var(--cbb-badge-size) / 2 + 1px);
  background: var(--cbb-accent); color: var(--cbb-accent-ink);
  font: 700 var(--cbb-badge-font)/1 var(--cbb-font); font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.cbb-badge.is-bump { animation: cbb-bump var(--cbb-bump-dur) var(--cbb-ease); }
@keyframes cbb-bump { 0% { scale: 1; } 30% { scale: var(--cbb-bump-scale); } 100% { scale: 1; } }

/* ---- optional: the cart square the source hangs in the header corner (64px, rules left + bottom) */
.cbb-cart {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; padding: 8px 16px; box-sizing: border-box;
  background: var(--cbb-paper); color: var(--cbb-ink);
  border: 0; border-left: var(--cbb-line) solid var(--cbb-ink); border-bottom: var(--cbb-line) solid var(--cbb-ink);
  cursor: pointer; font: inherit;
}
.cbb-cart svg { width: 28px; height: 28px; display: block; }

/* ---- optional: the chunky button (add to cart / checkout): 3px outline, 8px radius, 900 caps */
.cbb-btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 9px 15px; box-sizing: border-box;
  background: var(--cbb-accent); color: var(--cbb-accent-ink);
  border: var(--cbb-line) solid var(--cbb-ink); border-radius: 8px;
  font: 900 20px/1.35 var(--cbb-font); text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.cbb-btn[aria-busy="true"] { cursor: progress; }
.cbb-btn:focus-visible, .cbb-cart:focus-visible, .cbb-close:focus-visible, .cbb-remove:focus-visible { outline: 3px solid var(--cbb-ink); outline-offset: 2px; }

/* ---- the cart modal (appears at once, like the source) */
html.cbb-open { overflow: hidden; }
.cbb-modal {
  position: fixed; inset: 0; z-index: 1001; background: var(--cbb-scrim);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  font-family: var(--cbb-font); color: var(--cbb-ink);
}
.cbb-modal[hidden] { display: none; }
.cbb-panel {
  width: 100%; max-width: var(--cbb-panel-w); min-width: min(320px, 100%); max-height: 100%; box-sizing: border-box;
  padding: 8px; background: var(--cbb-paper); display: flex; flex-direction: column; overflow: auto;
  box-shadow: 0 5px 25px rgba(0, 0, 0, .25);
}
.cbb-head { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-bottom: 1px solid var(--cbb-rule); }
.cbb-head h4 { margin: 0; font-size: 24px; font-weight: 900; line-height: 1.35; text-transform: uppercase; }
.cbb-close { width: 32px; height: 32px; margin: -8px -8px -8px 0; padding: 8px; border: 0; background: none; color: var(--cbb-ink); cursor: pointer; }
.cbb-close svg { width: 16px; height: 16px; display: block; }
.cbb-body { flex: 1; display: flex; flex-direction: column; }
.cbb-list { flex: 1; padding: 12px 24px; overflow: auto; margin: 0; list-style: none; }
.cbb-item { display: flex; align-items: flex-start; padding: 12px 0; }
.cbb-thumb { flex: none; width: 60px; aspect-ratio: 1; object-fit: cover; background: var(--cbb-swatch, #ddd); display: block; }
.cbb-info { flex: 1; display: flex; flex-direction: column; margin: 0 16px; min-width: 0; }
.cbb-name { font-weight: 700; }
.cbb-remove { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--cbb-ink); font: inherit; font-size: 14px; line-height: 1.7; text-decoration: underline; cursor: pointer; }
.cbb-qty {
  width: 60px; height: 38px; box-sizing: border-box; padding: 8px 6px 8px 12px; margin-bottom: 10px;
  background: #fafafa; border: 1px solid #ddd; border-radius: 3px; font: inherit; line-height: 20px; color: var(--cbb-ink);
}
.cbb-qty:focus { border-color: #3898ec; outline: none; }
.cbb-foot { flex: none; display: flex; flex-direction: column; padding: 16px 24px 24px; border-top: 1px solid var(--cbb-rule); }
.cbb-sum { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.cbb-sum b { font-size: 24px; font-weight: 900; }
.cbb-foot .cbb-btn { min-height: 80px; }
.cbb-empty { flex: 1; display: flex; justify-content: center; align-items: center; padding: 100px 24px; }

@media (min-width: 1920px) {
  :root { --cbb-badge-size: 20px; --cbb-badge-font: 14px; --cbb-panel-w: 640px; }
  .cbb-panel { padding: 24px; }
  .cbb-head h4 { font-size: 32px; }
  .cbb-foot .cbb-btn { min-height: 96px; }
}
@media (max-width: 767px) {
  .cbb-list, .cbb-foot { padding-left: 16px; padding-right: 16px; }
  .cbb-btn { font-size: 16px; }
}
@media (max-width: 479px) {
  .cbb-modal { flex-direction: row; align-items: stretch; }   /* the panel runs the full height of a phone */
  .cbb-qty { font-size: 16px; }                                 /* 16px stops iOS zooming into the input */
}
@media (prefers-reduced-motion: reduce) {
  .cbb-badge.is-bump { animation: none; }
}
