/* component-toast.css — Add-to-cart success toast */

#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  pointer-events: none;
}

@media (max-width: 640px) {
  #toast-container {
    left: 1rem;
    right: 1rem;
    top: 1rem;
    align-items: stretch;
  }
}

.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-width: 300px;
  max-width: 380px;
  padding: 1.1rem 1.4rem;
  border-radius: 12px;

  background: rgba(31, 31, 33, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 3px solid var(--color-primary);

  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(227, 252, 2, 0.08),
    -2px 0 12px rgba(227, 252, 2, 0.15);

  pointer-events: auto;
  cursor: default;
  animation: toast-enter 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast--exiting {
  animation: toast-exit 0.25s ease-in forwards;
}

@keyframes toast-enter {
  from { opacity: 0; transform: translateX(24px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-exit {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(16px) scale(0.95); }
}

@media (max-width: 640px) {
  @keyframes toast-enter {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes toast-exit {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(-8px) scale(0.97); }
  }
  .toast { min-width: 0; max-width: none; }
}

.toast__image {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast__image-fallback {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.3), rgba(0, 216, 214, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.6rem;
}

.toast__body { flex: 1; min-width: 0; }

.toast__label {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.toast__title {
  font-size: 1.4rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast__meta {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.2rem;
}

.toast__dismiss {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: color 0.2s ease;
  border-radius: 4px;
}

.toast__dismiss:hover { color: rgba(255, 255, 255, 0.7); }

.toast__progress {
  position: absolute;
  bottom: 0;
  left: 3px;
  right: 0;
  height: 2px;
  background: rgba(227, 252, 2, 0.4);
  border-radius: 0 0 12px 12px;
  transform-origin: left;
  animation: toast-progress 3000ms linear forwards;
}

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .toast, .toast.toast--exiting { animation: none; }
  .toast__progress              { animation: none; display: none; }
}
