/* --- cart --- */
.cart-line{
  display: flex;
  gap: 12px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
}
/* enter: only lines new since the last render get tagged (see renderCart), so
   adjusting qty — which re-renders the whole list — doesn't re-flash it.
   leave: the Remove button fades the line out before the list re-renders. */
@keyframes cartLineIn{ from{ opacity: 0; transform: translateX(8px); } to{ opacity: 1; transform: none; } }
.cart-line-enter{ animation: cartLineIn 0.24s ease both; }
.cart-line-leave{
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.cart-line-media{
  height: 70px;
  /* real product photos are square (640x640) — matching that exactly
     means no crop AND no letterbox, regardless of object-fit */
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--tint-a), var(--tint-b));
  position: relative;
  overflow: hidden;
  flex: none;
}
.cart-line-media img{
  position: absolute;
  top: 50%;
  left: 50%;
  width: 58%;
  opacity: 0.9;
  transform: translate(-50%, -50%);
  filter: invert(var(--logo-invert, 1)); /* default = light theme (inverted white->black logo) */
}
:root[data-theme="light"] .cart-line-media img{ --logo-invert: 1; }
:root[data-theme="dark"] .cart-line-media img{ --logo-invert: 0; }
/* real product photo, same treatment as .swatch.has-photo on the shop cards */
.cart-line-media.has-photo img{
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: none;
  object-fit: cover;
  opacity: 1;
  filter: none;
}
.cart-line-info{ flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cart-line-top{ display: flex; justify-content: space-between; gap: 10px; font: var(--font-display); font-size: 0.78rem; }
.cart-line-price{ font: var(--font-mono); color: var(--muted); flex: none; }
.cart-line-size{
  font: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cart-line-qty{ display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.cart-line-qty .qty-value{ font: var(--font-mono); min-width: 16px; text-align: center; }
.cart-line-qty .remove{ margin-left: auto; }
.cart-empty{
  padding: 40px var(--gutter);
  text-align: center;
  font: var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cart-summary{ padding: 16px var(--gutter) 0; }
.cart-subtotal-row{
  display: flex;
  justify-content: space-between;
  font: var(--font-display);
  font-size: 0.85rem;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.checkout{ border: 1px solid var(--ink); padding: 14px 16px; justify-content: center; width: 100%; }
/* cart reads as a receipt — keep it a narrow column even on wide screens */
.cart-view{ width: 100%; max-width: 760px; margin: 0 auto; padding-bottom: 40px; }

/* --- mini-cart: slide-in confirmation shown right after Add to Cart, so a
   single add previews the item without yanking the user off the PDP. Kept in
   the DOM (not toggled via [hidden]) so the panel can transition; `.open`
   gates visibility + pointer-events together. --- */
.mini-cart{
  position: fixed;
  inset: 0;
  z-index: 60; /* above navbar (5) and the PDP sheet */
  visibility: hidden;
  pointer-events: none;
  /* delay flipping to hidden until the fade/slide-out finishes, otherwise
     the exit animation is cut off the instant `.open` is removed */
  transition: visibility 0s linear 0.28s;
}
.mini-cart.open{ visibility: visible; pointer-events: auto; transition-delay: 0s; }
.mini-cart-backdrop{
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.mini-cart.open .mini-cart-backdrop{ opacity: 1; }
.mini-cart-panel{
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(360px, 90vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.28s ease;
}
.mini-cart.open .mini-cart-panel{ transform: translateX(0); opacity: 1; }
.mini-cart-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--line);
}
.mini-cart-title{
  display: flex;
  align-items: center;
  gap: 8px;
  font: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.mini-cart-title svg{ color: var(--accent-text); }
/* reuse the cart-line layout but drop its row divider — it's a lone preview */
.mini-cart-line{ border-bottom: none; }
.mini-cart-actions{
  margin-top: auto;
  padding: 16px var(--gutter);
  border-top: 1px solid var(--line);
}
