/* cart — the side panel of the cart. */

.cart-drawer { position: fixed; inset: 0; z-index: 200; }

.cart-drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); opacity: 0; transition: opacity .2s ease; }

.cart-drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  display: flex; flex-direction: column; background: var(--surface); color: var(--body-text);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .18); transform: translateX(100%); transition: transform .2s ease;
}

.cart-drawer__inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.cart-drawer__panel:focus { outline: none; } /* it takes the focus when it opens; the ring belongs to its controls */

.cart-drawer.is-open .cart-drawer__backdrop { opacity: 1; }

.cart-drawer.is-open .cart-drawer__panel { transform: none; }

html.cart-is-open { overflow: hidden; padding-right: var(--cart-scrollbar, 0px); }

.cart-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--line); }

.cart-drawer__head h2 { margin: 0; font-size: 1.25rem; }

.cart-drawer__close { background: none; border: 0; color: var(--ink); cursor: pointer; padding: .3rem; }

.cart-drawer__close svg { width: 22px; height: 22px; display: block; }

.cart-drawer__body { flex: 1; overflow-y: auto; padding: .2rem 1.4rem; }

.cart-drawer__foot { padding: 1.1rem 1.4rem 1.3rem; border-top: 1px solid var(--line); display: grid; gap: .7rem; }

.cart-drawer__checkout { width: 100%; text-align: center; }

.cart-line--removed { display: flex; align-items: center; justify-content: space-between; gap: 1rem; grid-template-areas: none; font-size: .9rem; color: var(--muted); }

.cart-line--removed strong { color: var(--ink); }

.cart-line__undo { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--mark, var(--primary)); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Count beside a filter chip: quieter than the label it follows — it answers
   "is there anything here", it is not the thing being chosen. */

/* ---------- The panel's list: photo | name and the price of one | the line's total; under them, the quantity
   and «Remove». The sum is the goods' alone. ---------- */
.cart-note { margin: 0; font-size: .82rem; color: var(--muted); }

.cart-empty { display: grid; justify-items: center; gap: .5rem; padding: 2.5rem 1.4rem; text-align: center; }

.cart-empty__mark { color: var(--muted); opacity: .6; }

.cart-empty__mark svg { width: 3.2rem; height: 3.2rem; display: block; }

.cart-empty__title { margin: .3rem 0 0; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--ink); }

.cart-empty__text { margin: 0 0 .8rem; color: var(--muted); font-size: .92rem; }

.cart-line {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  grid-template-areas: "photo main total" "photo controls controls";
  column-gap: .9rem; row-gap: .55rem;
  align-items: start;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}

.cart-line:last-child { border-bottom: 0; }

.cart-line__qty { width: 4rem; padding: .45rem .5rem; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--bg); color: var(--ink); font-family: var(--font-body); }

.cart-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: 1rem; color: var(--ink); }

.cart-sum strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.qty--cart-line__qty { height: 36px; background: var(--bg); }

.qty--cart-line__qty input[type='number'] { width: 2.2rem; font-size: .92rem; }

.cart-lines__list { list-style: none; margin: 0; padding: 0; }

.cart-line__main { grid-area: main; display: grid; gap: .2rem; min-width: 0; }

.cart-line__name { color: var(--ink); font-weight: 600; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

a.cart-line__name:hover { color: var(--mark, var(--primary)); }

.cart-line__price { font-size: .85rem; color: var(--muted); }

.cart-line__tag {
  display: inline-block; margin-right: .35rem; padding: .05rem .45rem;
  border-radius: 999px; background: var(--tint); color: var(--ink);
  font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; vertical-align: .1em;
}

.cart-line__added { font-size: .8rem; color: var(--success, var(--mark, var(--primary))); }

.cart-line__added::before { content: '● '; }

.cart-line.is-added { background: var(--success-soft); margin: 0 -1.4rem; padding-left: 1.4rem; padding-right: 1.4rem; }

.cart-line__total { grid-area: total; font-family: var(--font-display); font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

.cart-line__controls { grid-area: controls; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.cart-line__remove {
  background: none; border: 0; padding: .2rem 0;
  color: var(--muted); font: inherit; font-size: .85rem;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

.cart-line__remove:hover { color: var(--danger, var(--ink)); }

.cart-line__photo { grid-area: photo; width: 4rem; height: 4rem; object-fit: cover; border-radius: var(--radius-small); background: var(--hover-wash); display: block; }

.cart-line__photo--contain { object-fit: contain; background: var(--plate, #fff); padding: .25rem; }

.cart-line__photo--none { display: grid; place-items: center; color: var(--muted); }

.cart-line__photo--none svg { width: 45%; height: 45%; }

.qty--cart-line__qty .qty__btn { width: 1.9rem; }
.cart-note.is-free { color: var(--success); }
