/* ============================================================
   FASE NUEVE — confirmación al añadir al carrito (v01)
   Miniatura que vuela al icono del carrito, pulso del icono y
   confirmación discreta. Sin movimiento con prefers-reduced-motion.
   ============================================================ */

.f9-cart-fly {
  position: fixed;
  z-index: 100000;
  border-radius: 14px;
  object-fit: cover;
  background: #f2f3f5;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  pointer-events: none;
  will-change: transform, opacity;
}

.f9-cart-pulse { animation: f9-cart-pulse .6s cubic-bezier(.2, .7, .2, 1); }
@keyframes f9-cart-pulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

.f9-cart-toast {
  position: fixed;
  z-index: 99999;
  top: 88px;
  right: 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: center;
  width: min(380px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  color: #f6f7f9;
  background: rgba(12, 14, 18, .97);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .22s ease, transform .22s ease;
}
.f9-cart-toast[hidden] { display: none; }
.f9-cart-toast.has-image { grid-template-columns: 56px 1fr auto; }
.f9-cart-toast.is-visible { opacity: 1; transform: none; }
.f9-cart-toast.is-reduced { transform: none; }

.f9-cart-toast__img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  background: #f2f3f5;
}
.f9-cart-toast__text { min-width: 0; }
.f9-cart-toast__text strong {
  display: block;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .02em;
}
.f9-cart-toast__text span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #c9ced8;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.f9-cart-toast__text small { display: block; margin-top: 4px; color: #8f96a3; font-size: 11px; }

.f9-cart-toast__close {
  align-self: start;
  min-width: 36px;
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  color: #a7adba;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.f9-cart-toast__close:hover { color: #fff; background: rgba(255, 255, 255, .06); }

.f9-cart-toast__actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.f9-cart-toast__view,
.f9-cart-toast__keep {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 11px;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .06em;
  text-decoration: none;
  cursor: pointer;
}
.f9-cart-toast__view { border: 1px solid #ff5a1f; color: #111; background: #ff5a1f; }
.f9-cart-toast__view:hover { filter: brightness(1.06); }
.f9-cart-toast__keep { border: 1px solid rgba(255, 255, 255, .16); color: #f6f7f9; background: transparent; }
.f9-cart-toast__keep:hover { border-color: rgba(255, 90, 31, .6); color: #ff8a5c; }
.f9-cart-toast :where(a, button):focus-visible { outline: 3px solid #ff5a1f; outline-offset: 2px; }

/* Minicarrito: cantidad, subtotal y FINALIZAR COMPRA (la compra se confirma en el checkout). */
.f9-cart-toast__text .f9-cart-toast__meta { color: #eef0f4; font-weight: 750; }
.f9-cart-toast__text .f9-cart-toast__subtotal { color: #c9ced8; }
.f9-cart-toast__actions.has-checkout .f9-cart-toast__view:not(.f9-cart-toast__checkout) { border-color: rgba(255, 255, 255, .24); color: #f6f7f9; background: transparent; }
.f9-cart-toast__actions.has-checkout .f9-cart-toast__keep { grid-column: 1 / -1; min-height: 40px; }

/* Éxito confirmado por el servidor: acento verde, compatible con la identidad F9. */
.f9-cart-toast { border-color: rgba(22, 179, 100, .5); box-shadow: 0 18px 48px rgba(0, 0, 0, .45), inset 3px 0 0 #16b364; }
.f9-cart-toast__text strong { color: #5ee6a0; }
.f9-cart-toast__text strong::before { content: "✓ "; }

@media (max-width: 720px) {
  .f9-cart-toast { top: auto; right: 12px; bottom: 12px; left: 12px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .f9-cart-toast { transform: none; transition: opacity .2s ease; }
  .f9-cart-pulse { animation: f9-cart-state .6s ease; }
  @keyframes f9-cart-state {
    0%, 100% { opacity: 1; }
    40% { opacity: .55; }
  }
}
