/* Sales notification: the card from the fb-improv pages (product box, soft glass, slides in from the left).
   Self-contained so it works on any sales page. Markup is injected by scripts/sales-notification.js. */
.sn {
  position: fixed;
  bottom: 24px;
  left: 20px;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-100%);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.sn.is-on {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

.sn__card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 350px;
  max-width: 350px;
  margin: 0;
  padding: 13px 16px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: #1a1a1a;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 22px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  -webkit-tap-highlight-color: transparent;
}

.sn__card:focus-visible { outline: 2px solid #8a3ff0; outline-offset: 2px; }

.sn__img {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: scale-down;
}

.sn__text {
  display: block;
  flex: 1;
  min-width: 0;
}

.sn__name {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sn__action {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Live count line (viewing / on checkout) */
.sn__live {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 400;
  color: #2f6bff;
}

.sn__live[hidden] { display: none; }

.sn__dot {
  position: relative;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

/* Runs only while the card shows, and scales rather than redraws: a pulse left running made the
   whole page redraw every frame, even with the card hidden. */
.sn.is-on .sn__dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.5);
  animation: sn-pulse 2s infinite;
}

@keyframes sn-pulse {
  0%   { transform: scale(1); opacity: 1; }
  70%  { transform: scale(2.5); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* Brief highlight on the PRO button after the card sends someone to pricing. */
.sn-flash { outline: 4px solid #8a3ff0 !important; outline-offset: 3px; }

@media (max-width: 768px) {
  .sn {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    right: 10px;
    max-width: calc(100% - 20px);
  }

  .sn__card { min-width: unset; max-width: 100%; width: 100%; padding: 11px 14px; }
  .sn__img { width: 44px; height: 44px; }
  .sn__name { font-size: 13px; }
  .sn__action { font-size: 12px; }

  footer { padding-bottom: 140px; }
}

@media (max-width: 480px) {
  .sn {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 8px;
    right: 8px;
    max-width: calc(100% - 16px);
  }

  .sn__card { padding: 9px 12px; gap: 10px; }
  .sn__img { width: 40px; height: 40px; }
  .sn__name { font-size: 12px; }
  .sn__action { font-size: 11px; }

  footer { padding-bottom: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  .sn { transition: none; }
  .sn.is-on .sn__dot::after { animation: none; opacity: 0; }
}
