/* js/features/nudges/nudges.css
   Carrusel de sugerencias contextuales del dashboard (Inicio).
   Tarjetas deslizables con gradiente, chip de icono y puntos indicadores. */

#nudge-carousel.nudge-carousel {
  display: none;
  margin: 4px 0 14px;
}
#nudge-carousel.nudge-carousel.visible {
  display: block;
  animation: nudgeIn .45s cubic-bezier(.16,.84,.44,1) both;
}

@keyframes nudgeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Pista deslizable: 1 tarjeta por viewport, swipe nativo con snap */
.nudge-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px;          /* aire para sombras */
  margin: -2px;
}
.nudge-track::-webkit-scrollbar { display: none; }

/* ── Tarjeta ─────────────────────────────────────────────────────────────── */
.nudge-card {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: center;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 20px;
  padding: 16px 16px 15px;
  color: #fff;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon body"
    "cta  cta";
  column-gap: 13px;
  row-gap: 13px;
  box-shadow: 0 10px 26px -10px rgba(60,40,90,.45);
  transition: transform .28s ease, opacity .28s ease;
}
.nudge-card--out {
  transform: scale(.94);
  opacity: 0;
}

/* Temas de color */
.nudge-card.nudge-violet {
  background: linear-gradient(135deg, #7b5ea7 0%, #9b7fd4 55%, #b79be6 100%);
}
.nudge-card.nudge-coral {
  background: linear-gradient(135deg, #e8794b 0%, #f4956a 55%, #ffb38a 100%);
}
.nudge-card.nudge-teal {
  background: linear-gradient(135deg, #1f8a7d 0%, #2fa697 55%, #5fc4b6 100%);
}

/* Círculo decorativo translúcido */
.nudge-deco {
  position: absolute;
  top: -46px;
  right: -34px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.30), rgba(255,255,255,0) 70%);
  pointer-events: none;
}

/* Botón cerrar */
.nudge-x {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff;
  cursor: pointer;
  z-index: 2;
  transition: background .15s ease, transform .15s ease;
}
.nudge-x:hover { background: rgba(255,255,255,.32); transform: rotate(90deg); }
.nudge-x i { width: 15px; height: 15px; }

/* Chip de icono grande */
.nudge-icon {
  grid-area: icon;
  align-self: start;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.20);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: nudgeIcon 3.4s ease-in-out infinite;
}
.nudge-icon i { width: 26px; height: 26px; }
@keyframes nudgeIcon {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

.nudge-body { grid-area: body; min-width: 0; padding-right: 26px; }

.nudge-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .9;
  margin-bottom: 5px;
}
.nudge-tag i { width: 11px; height: 11px; }

.nudge-title {
  margin: 0 0 4px;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.2;
  font-family: var(--sans, system-ui, sans-serif);
}
.nudge-sub {
  margin: 0;
  font-size: .8rem;
  line-height: 1.4;
  opacity: .94;
}

/* CTA */
.nudge-cta {
  grid-area: cta;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: 13px;
  padding: 11px 14px;
  background: #fff;
  color: #4a3270;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: .85rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px -4px rgba(0,0,0,.25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.nudge-card.nudge-coral .nudge-cta { color: #b14a1f; }
.nudge-card.nudge-teal .nudge-cta { color: #15665c; }
.nudge-cta:hover { transform: translateY(-1px); box-shadow: 0 7px 16px -5px rgba(0,0,0,.3); }
.nudge-cta:active { transform: translateY(0); }
.nudge-cta i { width: 16px; height: 16px; transition: transform .2s ease; }
.nudge-cta:hover i { transform: translateX(3px); }

/* ── Puntos indicadores ────────────────────────────────────────────────── */
.nudge-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
}
.nudge-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 99px;
  background: color-mix(in srgb, var(--c1, #9b7fd4) 30%, transparent);
  cursor: pointer;
  transition: width .25s ease, background .25s ease;
}
.nudge-dot.active {
  width: 20px;
  background: var(--c1, #9b7fd4);
}

@media (min-width: 560px) {
  .nudge-title { font-size: 1.08rem; }
}
