/* ===================================
   SOCIAL PROOF POPUP - PURAFAMA.CL v2
   Optimizado para dark mode + WCAG AA
   Alineado con checkout refinado
   =================================== */

:root {
    --sp-bg: rgba(39, 39, 42, 0.98);
    --sp-border: rgba(253, 119, 2, 0.3);
    --sp-text-primary: #ffffff;
    --sp-text-secondary: #d4d4d8;
    --sp-text-muted: #a1a1aa;
    --sp-accent: #fb923c;
    --sp-accent-glow: rgba(253, 119, 2, 0.2);
    --sp-shadow: 0 8px 32px rgba(0, 0, 0, 0.5),
                 0 0 0 1px rgba(253, 119, 2, 0.15) inset;
}

[data-bs-theme="light"] {
    --sp-bg: rgba(255, 255, 255, 0.98);
    --sp-border: rgba(253, 119, 2, 0.2);
    --sp-text-primary: #18181b;
    --sp-text-secondary: #3f3f46;
    --sp-text-muted: #71717a;
    --sp-accent: #fd7702;
    --sp-shadow: 0 8px 32px rgba(0, 0, 0, 0.12),
                 0 0 0 1px rgba(253, 119, 2, 0.1) inset;
}

.social-proof-popup {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* Glassmorphism + Backdrop blur */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.social-proof-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.social-proof-popup.hide {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    pointer-events: none;
}

.social-proof-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 320px;
    max-width: 380px;
    padding: 18px 22px;
    
    background: var(--sp-bg);
    border: 2px solid var(--sp-border);
    border-radius: 14px;
    box-shadow: var(--sp-shadow);
    
    position: relative;
    cursor: default;
    
    /* Glassmorphism mejorado */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    
    /* Gradient overlay sutil */
    background-image: linear-gradient(
        135deg,
        rgba(253, 119, 2, 0.06) 0%,
        transparent 50%,
        rgba(253, 119, 2, 0.03) 100%
    );
    
    transition: all 0.3s ease;
}

/* Glow effect on hover mejorado */
.social-proof-popup.show .social-proof-content:hover {
    border-color: #fd7702;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(253, 119, 2, 0.25) inset,
        0 0 32px rgba(253, 119, 2, 0.2);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

[data-bs-theme="light"] .social-proof-popup.show .social-proof-content:hover {
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(253, 119, 2, 0.2) inset;
}

/* Close button */
.social-proof-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    padding: 0;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--sp-text-muted);
    cursor: pointer;
    
    opacity: 0;
    transition: all 0.2s ease;
}

.social-proof-content:hover .social-proof-close {
    opacity: 1;
}

.social-proof-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--sp-text-primary);
}

.social-proof-close:focus-visible {
    opacity: 1;
    outline: 2px solid var(--sp-accent);
    outline-offset: 2px;
}

/* Icon mejorado */
.social-proof-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    
    background: linear-gradient(135deg, #fd7702, #ea580c);
    border-radius: 12px;
    box-shadow:
        0 0 0 3px rgba(253, 119, 2, 0.15),
        0 4px 16px rgba(253, 119, 2, 0.35);
    
    /* Pulse animation mejorado */
    animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow:
            0 0 0 3px rgba(253, 119, 2, 0.15),
            0 4px 16px rgba(253, 119, 2, 0.35);
    }
    50% { 
        transform: scale(1.08);
        box-shadow:
            0 0 0 4px rgba(253, 119, 2, 0.25),
            0 6px 20px rgba(253, 119, 2, 0.45);
    }
}

/* Body */
.social-proof-body {
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

/* Tipografía mejorada */
.social-proof-message {
    margin: 0 0 6px 0;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 500;
    color: var(--sp-text-primary);
}

.social-proof-message .social-proof-name {
    display: block;
    font-weight: 700;
    color: var(--sp-text-primary);
    margin-bottom: 2px;
}

.social-proof-message .social-proof-action {
    display: inline;
    font-weight: 400;
    color: var(--sp-text-secondary);
}

.social-proof-message .social-proof-service {
    display: inline;
    font-weight: 700;
    color: var(--sp-accent);
}

.social-proof-time {
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--sp-text-muted);
}

/* Mobile responsive mejorado */
@media (max-width: 640px) {
    .social-proof-popup {
        left: 50%;
        transform: translateX(-50%) translateY(20px) scale(0.95);
        bottom: 16px;
    }
    
    .social-proof-popup.show {
        transform: translateX(-50%) translateY(0) scale(1);
    }
    
    .social-proof-popup.hide {
        transform: translateX(-50%) translateY(10px) scale(0.98);
    }
    
    .social-proof-content {
        min-width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
        padding: 16px 18px;
    }
    
    .social-proof-icon {
        width: 48px;
        height: 48px;
        font-size: 28px;
    }
    
    .social-proof-message {
        font-size: 14px;
    }
    
    .social-proof-close {
        opacity: 1; /* Always visible on mobile */
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .social-proof-popup,
    .social-proof-close,
    .social-proof-icon {
        animation: none !important;
        transition: opacity 0.2s ease !important;
    }
}

