/* ==========================================================================
   SOCIAL PROOF POPUP - Beta Repuestos
   Dos variantes: consumidor (naranja) y mayorista (azul/morado)
   ========================================================================== */

/* --- Base del popup --- */
.br-social-proof {
    position: fixed;
    bottom: 70px;
    left: 20px;
    z-index: 9998;
    max-width: 390px;
    width: calc(100% - 40px);
    border-radius: 16px;
    padding: 16px 42px 16px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    position: fixed;

    /* Estado inicial */
    transform: translateX(-120%) scale(0.85);
    opacity: 0;
    visibility: hidden;
    transition:
        transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.5s ease,
        visibility 0s linear 0.65s;
}

/* === VARIANTE CONSUMIDOR (gradiente naranja — texto NEGRO) === */
.br-social-proof.br-sp-consumer {
    background: linear-gradient(135deg, #FFB347 0%, #FF8A50 50%, #FF5023 100%);
    color: #1a1a1a;
    box-shadow:
        0 16px 48px rgba(255, 80, 35, 0.3),
        0 4px 16px rgba(255, 80, 35, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* === VARIANTE MAYORISTA (mismo gradiente azul que la sección newsletter) === */
.br-social-proof.br-sp-wholesale {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(var(--br-primary-rgb, 255,80,35), 0.08) 0%, transparent 60%),
        linear-gradient(135deg,
            var(--br-bg-footer, #1A1A2E) 0%,
            var(--br-bg-mid, #16213E) 50%,
            var(--br-bg-deep, #0F3460) 100%);
    box-shadow:
        0 16px 48px rgba(15, 52, 96, 0.35),
        0 4px 16px rgba(15, 52, 96, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* --- Visible (spring bounce) --- */
.br-social-proof.br-sp-visible {
    transform: translateX(0) scale(1);
    opacity: 1;
    visibility: visible;
    transition:
        transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.4s ease,
        visibility 0s linear 0s;
}

/* --- Salida --- */
.br-social-proof:not(.br-sp-visible) {
    transform: translateX(-120%) scale(0.85);
    opacity: 0;
    transition:
        transform 0.5s cubic-bezier(0.55, 0, 0.67, 0.27),
        opacity 0.35s ease,
        visibility 0s linear 0.5s;
}

/* --- Hover --- */
.br-social-proof.br-sp-consumer:hover {
    box-shadow:
        0 20px 56px rgba(255, 80, 35, 0.4),
        0 8px 24px rgba(255, 80, 35, 0.25);
    transform: translateX(0) scale(1.03) translateY(-3px);
}

.br-social-proof.br-sp-wholesale:hover {
    box-shadow:
        0 20px 56px rgba(15, 52, 96, 0.45),
        0 8px 24px rgba(15, 52, 96, 0.3);
    transform: translateX(0) scale(1.03) translateY(-3px);
}

/* --- Icono circular --- */
.br-sp-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    position: relative;
}

.br-sp-consumer .br-sp-icon {
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.br-sp-wholesale .br-sp-icon {
    background: var(--br-primary, #FF5023);
    box-shadow: 0 4px 12px rgba(255, 80, 35, 0.3);
}

/* Anillo de pulso */
.br-sp-visible .br-sp-icon::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    opacity: 0;
    animation: br-sp-pulse 2s ease-out 0.4s;
}

@keyframes br-sp-pulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* --- Contenido --- */
.br-sp-content {
    flex: 1;
    min-width: 0;
    line-height: 1.45;
}

/* --- Etiqueta superior (COMPRA VERIFICADA / GANANCIA MAYORISTA) --- */
.br-sp-label {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 5px;
}

.br-sp-consumer .br-sp-label {
    background: rgba(0, 0, 0, 0.12);
    color: #1a1a1a;
}

.br-sp-wholesale .br-sp-label {
    background: rgba(255, 80, 35, 0.25);
    color: var(--br-primary, #FF5023);
}

/* --- Texto principal --- */
.br-sp-buyer {
    font-weight: 700;
    font-size: 13.5px;
    display: block;
    margin-bottom: 2px;
}

/* Consumidor: texto negro */
.br-sp-consumer .br-sp-buyer {
    color: #1a1a1a;
    text-shadow: none;
}

/* Mayorista: texto blanco */
.br-sp-wholesale .br-sp-buyer {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* --- Producto --- */
.br-sp-product {
    font-size: 12.5px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

/* Consumidor: producto negro */
.br-sp-consumer .br-sp-product {
    color: rgba(0, 0, 0, 0.7);
}

/* Mayorista: producto blanco, precios naranja */
.br-sp-wholesale .br-sp-product {
    color: rgba(255, 255, 255, 0.85);
}

/* --- Tiempo + verificado --- */
.br-sp-time {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Consumidor: tiempo oscuro */
.br-sp-consumer .br-sp-time {
    color: rgba(0, 0, 0, 0.5);
}

/* Mayorista: tiempo claro */
.br-sp-wholesale .br-sp-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Punto verde pulsante */
.br-sp-time::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #69F0AE;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(105, 240, 174, 0.6);
    animation: br-sp-dot 2s ease-in-out infinite;
}

@keyframes br-sp-dot {
    0%, 100% { box-shadow: 0 0 4px rgba(105, 240, 174, 0.4); }
    50% { box-shadow: 0 0 10px rgba(105, 240, 174, 0.8); }
}

/* --- Monto + verbo destacado (verde dinero sobre fondo oscuro) --- */
.br-sp-amount,
.br-sp-wholesale .br-sp-amount,
.br-sp-wholesale .br-sp-product .br-sp-amount {
    display: inline-block;
    font-weight: 800;
    font-size: 15px;
    color: #69F0AE !important;
    text-shadow: 0 0 10px rgba(105, 240, 174, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Verbo "ganó" / "ahorró" también en verde */
.br-sp-verb {
    color: #69F0AE !important;
    font-weight: 700;
}

/* Cuando hay monto, el producto se muestra en blanco normal */
.br-sp-wholesale .br-sp-product {
    white-space: normal;
    line-height: 1.3;
}

/* --- Botón cerrar --- */
.br-sp-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

/* Consumidor: cerrar oscuro */
.br-sp-consumer .br-sp-close {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.5);
}
.br-sp-consumer .br-sp-close:hover {
    background: rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
    transform: scale(1.15);
}

/* Mayorista: cerrar claro */
.br-sp-wholesale .br-sp-close {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}
.br-sp-wholesale .br-sp-close:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: scale(1.15);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 600px) {
    .br-social-proof {
        bottom: 75px;
        left: 10px;
        max-width: 320px;
        width: calc(100% - 20px);
        padding: 12px 36px 12px 12px;
        gap: 10px;
        border-radius: 14px;
    }

    .br-sp-icon { width: 40px; height: 40px; font-size: 17px; }
    .br-sp-label { font-size: 8px; }
    .br-sp-buyer { font-size: 12.5px; }
    .br-sp-product { font-size: 11.5px; }
    .br-sp-time { font-size: 10px; }
    .br-sp-amount { font-size: 13px; }
}

@media (max-width: 380px) {
    .br-social-proof {
        max-width: calc(100% - 16px);
        left: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .br-social-proof,
    .br-social-proof.br-sp-visible,
    .br-social-proof:not(.br-sp-visible) {
        transition: opacity 0.2s ease, visibility 0s linear 0.2s !important;
        transform: none !important;
    }
    .br-sp-visible .br-sp-icon::after,
    .br-sp-time::before {
        animation: none !important;
    }
}
