/* Phone/portrait add-to-cart flight, driven by static/js/touch-cart-flight.js. Desktop never gets a flight. */
body:is([data-layout="mobile"], [data-layout="portrait"]) .cart-flight {
  position: fixed;
  z-index: 2000;
  margin: 0;
  pointer-events: none;
  will-change: transform;
}

body:is([data-layout="mobile"], [data-layout="portrait"]) .cart-flight > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 13px;
  background: #f3f3f3;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  will-change: transform;
}

/* While a photo is in the air the badge shows the count from before the add, drawn over the real number. */
body:is([data-layout="mobile"], [data-layout="portrait"]) #cart-toggle .cart-badge[data-flight-held]::after {
  content: attr(data-flight-held);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: inherit;
  color: inherit;
  font: inherit;
  line-height: 1;
}

/* The cart was empty before this add: no badge until the photo lands. */
body:is([data-layout="mobile"], [data-layout="portrait"]) #cart-toggle .cart-badge[data-flight-held=""] {
  visibility: hidden;
}
