/* ============================================================
   Fanor Toast — sistema unificado de notificaciones del plugin.
   Reemplaza alert() y los avisos nativos de WooCommerce
   (.woocommerce-message / -error / -info).
   Independiente de los tokens: puede cargar en cualquier página.
   Paleta heredada del sistema de avisos previo (confident).
   ============================================================ */

.fanor-toast-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  max-width: calc(100vw - 48px);
}

.fanor-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  background: #FFFFFF;
  color: #1a1a1a;
  border-left: 4px solid #2D7A4F;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-family: var(--fanor-font-body, 'Manrope', system-ui, sans-serif);
  font-size: 14px;
  line-height: 1.45;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1), opacity 240ms ease;
  box-sizing: border-box;
}

.fanor-toast.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.fanor-toast.is-leaving {
  transform: translateX(120%);
  opacity: 0;
}

/* Variantes por tipo */
.fanor-toast--success { border-left-color: #2D7A4F; }
.fanor-toast--error   { border-left-color: #B33A3A; }
.fanor-toast--info    { border-left-color: #C9A96E; }
.fanor-toast--warning { border-left-color: #C97E1F; }

.fanor-toast__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.fanor-toast--success .fanor-toast__icon { color: #2D7A4F; }
.fanor-toast--error   .fanor-toast__icon { color: #B33A3A; }
.fanor-toast--info    .fanor-toast__icon { color: #C9A96E; }
.fanor-toast--warning .fanor-toast__icon { color: #C97E1F; }

.fanor-toast__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.fanor-toast__text {
  flex: 1;
  word-break: break-word;
  font-weight: 500;
  color: #1a1a1a;
}

/* Aviso con lista (`opciones.lineas`): título + una línea por campo. Márgenes y
   viñetas a (0,2,0) porque el toast se pinta en cualquier página y el Kit de
   Elementor estila `p` y `ul` a (0,1,1). */
.fanor-toast .fanor-toast__titulo {
  margin: 0;
  padding: 0;
  font-weight: 600;
}

.fanor-toast .fanor-toast__lista {
  margin: 6px 0 0;
  padding: 0 0 0 18px;
  list-style: disc;
  font-weight: 400;
}

.fanor-toast .fanor-toast__lista li {
  margin: 0;
  padding: 0;
}

.fanor-toast .fanor-toast__lista li + li {
  margin-top: 3px;
}

/* Botón de cierre — blindado contra el borde/hover del tema (Elementor). */
.fanor-toast__close {
  flex-shrink: 0;
  -webkit-appearance: none !important;
  appearance: none !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  text-shadow: none;
  cursor: pointer;
  color: #999999 !important;
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
  padding: 0 !important;
  margin: -1px 0 0 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 150ms ease, background-color 150ms ease;
}

.fanor-toast__close:hover,
.fanor-toast__close:focus,
.fanor-toast__close:focus-visible,
.fanor-toast__close:active {
  color: #1a1a1a !important;
  background-color: #f1f1f1 !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Móvil: el stack baja al fondo y los toasts ocupan todo el ancho */
@media (max-width: 600px) {
  .fanor-toast-stack {
    top: auto;
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
  }
  .fanor-toast {
    min-width: 0;
    max-width: none;
    width: 100%;
    font-size: 13.5px;
    padding: 12px 14px;
  }
}
