/* =========================================================
   Sección "Alertas Personalizadas"
   Phone central + regalos flotando en órbita + aura radial
   ========================================================= */

.alerts {
  position: relative;
  z-index: 1;
  padding: clamp(60px, 8vw, 100px) clamp(16px, 4vw, 48px);
  /* Sólo clipamos horizontalmente — verticalmente dejamos que el blur
     del aura se funda con las secciones vecinas (sin esto se ve un
     borde duro entre #how, #alerts y la sección siguiente). */
  overflow-x: clip;
  overflow-y: visible;
}

/* Título y tarjetas SIEMPRE por encima del orbit, aunque algún regalo
   se asome al borde. */
.alerts > .section-head,
.alerts > .alert-types {
  position: relative;
  z-index: 20;
}

/* =========================================================
   STAGE — contenedor principal
   ========================================================= */
.alerts-stage {
  position: relative;
  max-width: 1100px;
  margin: 0 auto 70px;
  height: 720px;
  display: grid;
  place-items: center;
  isolation: isolate; /* contiene blend-modes hijos */
}

@media (max-width: 980px) { .alerts-stage { height: 640px; } }
@media (max-width: 640px) { .alerts-stage { height: 580px; margin-bottom: 40px; } }

/* ---------- Aura radial detrás del phone ---------- */
.alerts-aura {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 820px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(closest-side, rgba(254, 44, 85, 0.4), transparent 70%),
    conic-gradient(from 0deg,
      rgba(254, 44, 85, 0.22),
      rgba(139, 43, 226, 0.28),
      rgba(37, 244, 238, 0.16),
      rgba(254, 44, 85, 0.22));
  filter: blur(70px);
  opacity: 0.65;
  z-index: -1;
  animation: auraSpin 18s linear infinite;
  /* Funde los bordes del aura para que no haya transición brusca cuando
     el blur llega a los límites del stage o a la siguiente sección. */
  -webkit-mask-image: radial-gradient(closest-side, black 35%, transparent 85%);
          mask-image: radial-gradient(closest-side, black 35%, transparent 85%);
}
@keyframes auraSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@media (max-width: 640px) {
  .alerts-aura { width: 480px; filter: blur(40px); }
}

/* ---------- Anillos sutiles concéntricos ---------- */
.alerts-rings {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.alerts-rings span {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.06);
  transform: translate(-50%, -50%);
  animation: ringSpin 60s linear infinite;
}
.alerts-rings span:nth-child(1) {
  width: 460px; height: 460px;
  border-color: rgba(254, 44, 85, 0.12);
}
.alerts-rings span:nth-child(2) {
  width: 660px; height: 660px;
  border-color: rgba(37, 244, 238, 0.08);
  animation-direction: reverse;
  animation-duration: 90s;
}
@keyframes ringSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ---------- Phone wrapper ---------- */
.alerts-phone-wrap {
  position: relative;
  z-index: 5;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.5));
}
.alerts-phone-wrap .phone {
  --phone-w: 320px;
  transform: translateY(0);
  animation: phoneFloat 6s ease-in-out infinite;
}
@keyframes phoneFloat {
  0%, 100% { transform: translateY(-4px); }
  50%      { transform: translateY(8px); }
}
@media (max-width: 640px) {
  .alerts-phone-wrap .phone { --phone-w: 240px; }
}

/* =========================================================
   ORBIT — capa de regalos flotantes
   ========================================================= */
.alerts-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none; /* permite hover individual sólo en los gifts */
  z-index: 4;
  /* Funde los regalos cerca de los bordes verticales del stage en vez
     de cortarlos abruptamente (también evita que se vean encima del
     título o de las tarjetas si rozan los límites). */
  -webkit-mask-image: linear-gradient(180deg,
    transparent 0%,
    black 12%,
    black 88%,
    transparent 100%);
          mask-image: linear-gradient(180deg,
    transparent 0%,
    black 12%,
    black 88%,
    transparent 100%);
}

.float-gift {
  position: absolute;
  top: 50%; left: 50%;
  width: var(--gift-size, 76px);
  height: var(--gift-size, 76px);
  transform: translate(-50%, -50%) translate(var(--gift-x, 0), var(--gift-y, 0));
  pointer-events: auto;
  cursor: pointer;
  transition: transform .35s ease, filter .35s ease;
  animation: giftBob var(--bob-dur, 6s) ease-in-out infinite;
  animation-delay: var(--bob-delay, 0s);
  will-change: transform;
}

.float-gift img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.5))
          drop-shadow(0 0 18px var(--glow, rgba(254, 44, 85, 0.4)));
  transform: rotate(var(--gift-rot, 0deg));
  transition: transform .35s ease;
}

.float-gift:hover {
  z-index: 10;
  transform: translate(-50%, -50%) translate(var(--gift-x, 0), var(--gift-y, 0)) scale(1.18);
  filter: brightness(1.1);
}
.float-gift:hover img {
  transform: rotate(0deg);
}

/* Bob — flotación vertical sutil */
@keyframes giftBob {
  0%, 100% { translate: var(--gift-x, 0) calc(var(--gift-y, 0) - 6px); }
  50%      { translate: var(--gift-x, 0) calc(var(--gift-y, 0) + 6px); }
}

/* Algunos regalos VIP brillan más */
.float-gift.vip img {
  animation: vipPulse 2.5s ease-in-out infinite;
}
@keyframes vipPulse {
  0%, 100% { filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.5))
                     drop-shadow(0 0 18px var(--glow, rgba(254,44,85,0.5))); }
  50%      { filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.6))
                     drop-shadow(0 0 35px var(--glow, rgba(254,44,85,0.85))); }
}

/* Tooltip del regalo (nombre + costo) */
.float-gift::after {
  content: attr(data-label);
  position: absolute;
  top: 100%; left: 50%;
  transform: translate(-50%, 8px);
  background: rgba(10, 4, 24, 0.95);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(254, 44, 85, 0.35);
  transition: opacity .2s, transform .2s;
}
.float-gift:hover::after {
  opacity: 1;
  transform: translate(-50%, 12px);
}

/* =========================================================
   PINGS — partículas de "regalo recibido"
   ========================================================= */
.alerts-ping {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(254, 44, 85, 0.6);
  z-index: 3;
  animation: pingPulse 3s ease-out infinite;
  box-shadow: 0 0 0 0 rgba(254, 44, 85, 0.5);
}
.alerts-ping.ping-1 { top: 22%; left: 22%; animation-delay: 0s; }
.alerts-ping.ping-2 { top: 70%; left: 78%; animation-delay: 1s;  background: rgba(139, 43, 226, 0.6); }
.alerts-ping.ping-3 { top: 30%; left: 80%; animation-delay: 2s;  background: rgba(37, 244, 238, 0.6); }
@keyframes pingPulse {
  0%   { transform: scale(0.4); opacity: 0; }
  20%  { transform: scale(1);   opacity: 0.9; }
  100% { transform: scale(3.5); opacity: 0; box-shadow: 0 0 0 60px rgba(254, 44, 85, 0); }
}

/* =========================================================
   ALERT TYPE CARDS — abajo, compactas
   ========================================================= */
.alert-types {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.alert-type-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: transform .3s, border-color .3s, box-shadow .3s;
  overflow: hidden;
}
.alert-type-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--icon-color, var(--tt-pink));
  opacity: 0.6;
}
.alert-type-card:hover {
  transform: translateY(-3px);
  border-color: rgba(254, 44, 85, 0.45);
  box-shadow: 0 14px 32px rgba(254, 44, 85, 0.16);
}
.alert-type-icon {
  --icon-color: #FE2C55;
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--icon-color) 18%, transparent);
  color: var(--icon-color);
  border: 1px solid color-mix(in oklab, var(--icon-color) 35%, transparent);
  flex-shrink: 0;
}
.alert-type-icon svg { width: 22px; height: 22px; }
.alert-type-text h3 {
  font-size: 1.02rem;
  margin: 0 0 3px;
  color: var(--text);
}
.alert-type-text p {
  font-size: 0.86rem;
  margin: 0;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Reducir movimiento por accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .alerts-aura,
  .alerts-rings span,
  .alerts-phone-wrap .phone,
  .float-gift,
  .float-gift img,
  .alerts-ping {
    animation: none !important;
  }
}
