/* ==========================================================================
   Barra "personas viendo este producto ahora"
   Ubicación: justo debajo de .psp-price en single-product.php
   Ajustes (texto, min/max, intervalo): Customizer → Producto individual
   ========================================================================== */

.psp-viewers-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 20px 0;
    padding: 7px 14px 7px 12px;
    background: var(--poseidon-surface-hover, #f3f4f6);
    border: 1px solid var(--poseidon-border, rgba(0,0,0,.1));
    border-radius: 50px;
    font-size: 12.5px;
    line-height: 1.3;
    color: var(--poseidon-text-muted, #6b7280);
    letter-spacing: .1px;
    -webkit-font-smoothing: antialiased;
}

/* Punto "en vivo": pulso suave, sutil, sin parpadeo agresivo */
.psp-viewers-bar__dot {
    position: relative;
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--poseidon-success-border, #22c55e);
}

.psp-viewers-bar__dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--poseidon-success-border, #22c55e);
    opacity: .35;
    animation: psp-viewers-pulse 2.2s ease-out infinite;
}

@keyframes psp-viewers-pulse {
    0%   { transform: scale(.6); opacity: .45; }
    70%  { transform: scale(1.9); opacity: 0; }
    100% { transform: scale(1.9); opacity: 0; }
}

.psp-viewers-bar__text {
    white-space: normal;
}

/* Número: fuente monoespaciada para que el ancho no "salte" tanto al
   cambiar de dígitos y se sienta como un dato en vivo, no un slogan. */
.psp-viewers-bar__count {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    color: var(--poseidon-text, #111);
    font-variant-numeric: tabular-nums;
}

/* Animación al cambiar el número: fade + desplazamiento vertical breve,
   moderna y discreta (no es un contador que "gira" tipo odómetro,
   se ve premium y no cansa la vista si el usuario se queda mirando). */
.psp-viewers-bar__count.is-updating {
    animation: psp-viewers-count-change .5s cubic-bezier(.22,1,.36,1);
}

@keyframes psp-viewers-count-change {
    0%   { opacity: 0; transform: translateY(4px); filter: blur(2px); }
    45%  { opacity: 1; transform: translateY(0); filter: blur(0); }
    100% { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .psp-viewers-bar__dot::after,
    .psp-viewers-bar__count.is-updating {
        animation: none;
    }
}

@media (max-width: 480px) {
    .psp-viewers-bar {
        font-size: 12px;
        padding: 6px 12px 6px 10px;
    }
}
