/* ====================================================
   VIUDAS TOAST SYSTEM — Premium Notification Component
   Inspirado en Sonner / shadcn Toast
   Compatible con el tema oscuro dorado del sitio
   ==================================================== */

/* --- Toast Container (fijo en esquina inferior derecha) --- */
#viudas-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100vw - 48px);
}

/* --- Individual Toast --- */
.viudas-toast {
  pointer-events: all;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 42px 14px 16px;
  background: linear-gradient(135deg, #141414 0%, #0e0e0e 100%);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 10px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(255,255,255,0.04) inset;
  cursor: pointer;
  overflow: hidden;
  animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  will-change: transform, opacity;
}

.viudas-toast.is-dismissing {
  animation: toastSlideOut 0.28s ease forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
    max-height: 120px;
    margin-bottom: 0;
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(0.92);
    max-height: 0;
    margin-bottom: -10px;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* --- Toast Icon --- */
.viudas-toast__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 1px;
}

/* --- Toast Content --- */
.viudas-toast__content {
  flex: 1;
  min-width: 0;
}

.viudas-toast__title {
  font-family: 'Zelta-Six', Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.35;
  margin: 0 0 2px;
}

.viudas-toast__message {
  font-family: 'Zelta-Six', Arial, sans-serif;
  font-size: 0.80rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.45;
  margin: 0;
}

/* --- Close Button --- */
.viudas-toast__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background 0.2s ease;
  padding: 0;
}

.viudas-toast__close:hover {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
}

/* --- Progress Bar --- */
.viudas-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 0 0 10px 10px;
  transform-origin: left center;
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ===================== TYPE VARIANTS ===================== */

/* SUCCESS */
.viudas-toast--success {
  border-color: rgba(0, 255, 102, 0.25);
}
.viudas-toast--success .viudas-toast__icon {
  background: rgba(0, 255, 102, 0.15);
  color: #00ff66;
  border: 1px solid rgba(0, 255, 102, 0.3);
}
.viudas-toast--success .viudas-toast__progress {
  background: #00ff66;
}
.viudas-toast--success .viudas-toast__title {
  color: rgba(255, 255, 255, 0.97);
}

/* ERROR */
.viudas-toast--error {
  border-color: rgba(217, 28, 28, 0.30);
}
.viudas-toast--error .viudas-toast__icon {
  background: rgba(217, 28, 28, 0.15);
  color: #e05555;
  border: 1px solid rgba(217, 28, 28, 0.35);
}
.viudas-toast--error .viudas-toast__progress {
  background: #d91c1c;
}

/* INFO */
.viudas-toast--info {
  border-color: rgba(212, 175, 55, 0.22);
}
.viudas-toast--info .viudas-toast__icon {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-main, #d4af37);
  border: 1px solid rgba(212, 175, 55, 0.30);
}
.viudas-toast--info .viudas-toast__progress {
  background: var(--gold-main, #d4af37);
}

/* WARNING */
.viudas-toast--warning {
  border-color: rgba(255, 215, 0, 0.25);
}
.viudas-toast--warning .viudas-toast__icon {
  background: rgba(255, 215, 0, 0.12);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.30);
}
.viudas-toast--warning .viudas-toast__progress {
  background: #ffd700;
}

/* --- Responsive --- */
@media (max-width: 500px) {
  #viudas-toast-container {
    bottom: 16px;
    right: 12px;
    left: 12px;
    max-width: 100%;
    width: auto;
  }
}
