/* Mp Asociados — Toasts emergentes "Novedades del día"
 * Posicion: esquina superior derecha (desktop) / centro inferior (mobile)
 * Animacion: slide-in desde derecha, fade out
 * Branded estandar v4.1
 */

#mp-novedades-toasts {
  position: fixed;
  bottom: 20px;          /* ABAJO a la derecha — no choca con WhatsApp FAB que va abajo-izquierda */
  right: 20px;
  width: 360px;
  max-width: calc(100vw - 32px);
  z-index: 9000;
  pointer-events: none;  /* el contenedor no captura, los toasts sí */
}

.mp-toast {
  position: relative;
  background: #fff;
  border: 1px solid rgba(26,58,107,0.12);
  border-radius: 6px;
  box-shadow: 0 -12px 36px -8px rgba(15,37,73,0.22), 0 4px 12px -2px rgba(15,37,73,0.08);
  padding: 18px 20px 22px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  opacity: 0;
  transform: translateY(20px);    /* desde abajo (slide-up) */
  transition: opacity 380ms ease, transform 380ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  overflow: hidden;
  border-left: 3px solid #1A3A6B;
}

.mp-toast--enter {
  opacity: 1;
  transform: translateY(0);
}

.mp-toast--exit {
  opacity: 0;
  transform: translateY(15px);
}

/* Variantes por tipo */
.mp-toast--urgent {
  border-left-color: #C8A95A;
  background: linear-gradient(180deg, #fff 0%, #FCFAF5 100%);
}
.mp-toast--warning {
  border-left-color: #C8A95A;
}
.mp-toast--cta {
  background: linear-gradient(135deg, #0F2549 0%, #1A3A6B 100%);
  color: #fff;
  border-left-color: #C8A95A;
}
.mp-toast--info {
  border-left-color: #1A3A6B;
}

/* Estructura interna */
.mp-toast__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #4A5568;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s;
}
.mp-toast--cta .mp-toast__close { color: rgba(255,255,255,0.7); }
.mp-toast__close:hover { background: rgba(26,58,107,0.08); color: #1A3A6B; }
.mp-toast--cta .mp-toast__close:hover { background: rgba(255,255,255,0.12); color: #fff; }

.mp-toast__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-right: 28px;
}

.mp-toast__icono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #1A3A6B;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.mp-toast--urgent .mp-toast__icono { background: #C8A95A; color: #0F2549; }
.mp-toast--warning .mp-toast__icono { background: rgba(200,169,90,0.18); color: #8a6f24; border: 1px solid #C8A95A; }
.mp-toast--cta .mp-toast__icono { background: #C8A95A; color: #0F2549; }

.mp-toast__titulo {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1A3A6B;
}
.mp-toast--cta .mp-toast__titulo { color: #C8A95A; }
.mp-toast--urgent .mp-toast__titulo { color: #8a6f24; }

.mp-toast__body {
  margin-bottom: 12px;
}

.mp-toast__valor {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1A3A6B;
  line-height: 1.25;
  margin-bottom: 6px;
}
.mp-toast--cta .mp-toast__valor { color: #fff; }
.mp-toast--info[data-kind] .mp-toast__valor { font-size: 1.5rem; }

.mp-toast__meta {
  font-size: 0.8125rem;
  color: #4A5568;
  line-height: 1.45;
}
.mp-toast--cta .mp-toast__meta { color: rgba(255,255,255,0.78); }

.mp-toast__link {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2E5DA6;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s;
}
.mp-toast__link:hover { border-bottom-color: #2E5DA6; }
.mp-toast--cta .mp-toast__link { color: #C8A95A; }
.mp-toast--cta .mp-toast__link:hover { border-bottom-color: #C8A95A; }
.mp-toast--urgent .mp-toast__link { color: #1A3A6B; }

/* Barra de progreso (visual decorativo del tiempo de exposición) */
.mp-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(26,58,107,0.06);
}
.mp-toast--cta .mp-toast__progress { background: rgba(255,255,255,0.10); }
.mp-toast__progress-bar {
  height: 100%;
  background: #C8A95A;
  width: 100%;
  transform-origin: left center;
  animation: mp-toast-progress 7s linear forwards;
}
@keyframes mp-toast-progress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.mp-toast__counter {
  position: absolute;
  bottom: 8px;
  right: 14px;
  font-size: 0.6875rem;
  color: rgba(74,85,104,0.55);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.mp-toast--cta .mp-toast__counter { color: rgba(255,255,255,0.45); }

/* Mobile: el toast ocupa el ancho completo abajo y deja espacio al WhatsApp FAB (que esta en bottom-left) */
@media (max-width: 600px) {
  #mp-novedades-toasts {
    bottom: 16px;
    right: 16px;
    left: 88px;          /* deja espacio para WhatsApp FAB de 52px + 16px margin + 20px buffer */
    width: auto;
    max-width: none;
  }
  .mp-toast {
    padding: 14px 16px 18px;
  }
  .mp-toast__valor {
    font-size: 1rem;
  }
  .mp-toast__meta { font-size: 0.75rem; }
}
@media (max-width: 380px) {
  /* En pantallas muy chicas, ocultar el WhatsApp FAB cuando hay toast activo, o reducir el left */
  #mp-novedades-toasts { left: 72px; }
}

/* Cuando el menu nav-open esta activo, ocultar toasts mobile para no chocar */
body.nav-open #mp-novedades-toasts { display: none; }

/* Reducir movimiento si usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
  .mp-toast { transition: opacity 200ms ease; transform: none !important; }
  .mp-toast__progress-bar { animation: none; transform: scaleX(1); }
}
