/* ===== WC Social Proof Popup – popup.css v4.0 ===== */
/* Autor: Gabriel Viza – Diseñador Web | gabrielviza.com */

/* ── Variables por defecto (fallback si el PHP no las inyecta) ─ */
#wcspp-popup {
    --wcspp-view-dot:       #22c55e;
    --wcspp-view-icon:      #fb923c;
    --wcspp-view-product:   #f97316;
    --wcspp-view-bar-start: #fb923c;
    --wcspp-view-bar-end:   #fbbf24;
    --wcspp-buy-dot:        #f97316;
    --wcspp-buy-icon:       #22c55e;
    --wcspp-buy-status:     #22c55e;
    --wcspp-buy-product:    #16a34a;
    --wcspp-buy-bar-start:  #22c55e;
    --wcspp-buy-bar-end:    #4ade80;
    --wcspp-buy-badge:      #22c55e;
}

/* ── Contenedor ─────────────────────────────────────────────── */
#wcspp-popup {
    position: fixed;
    bottom: 24px;
    left: 20px;
    z-index: 99999;
    max-width: 360px;
    width: calc(100vw - 40px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    pointer-events: none;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .38s cubic-bezier(.4,0,.2,1), transform .38s cubic-bezier(.4,0,.2,1);
}

#wcspp-popup.wcspp-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Pill "En vivo" ─────────────────────────────────────────── */
.wcspp-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border-radius: 20px;
    padding: 5px 12px 5px 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.05);
    margin-bottom: 6px;
    width: fit-content;
}

.wcspp-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Colores del punto desde variables */
.wcspp-popup--view     .wcspp-live-dot { background: var(--wcspp-view-dot); animation: wcspp-pulse-view 1.8s ease-in-out infinite; }
.wcspp-popup--purchase .wcspp-live-dot { background: var(--wcspp-buy-dot);  animation: wcspp-pulse-buy  1.8s ease-in-out infinite; }

@keyframes wcspp-pulse-view {
    0%,100% { box-shadow: 0 0 0 0   color-mix(in srgb, var(--wcspp-view-dot) 50%, transparent); }
    50%      { box-shadow: 0 0 0 7px color-mix(in srgb, var(--wcspp-view-dot)  0%, transparent); }
}
@keyframes wcspp-pulse-buy {
    0%,100% { box-shadow: 0 0 0 0   color-mix(in srgb, var(--wcspp-buy-dot) 50%, transparent); }
    50%      { box-shadow: 0 0 0 7px color-mix(in srgb, var(--wcspp-buy-dot)  0%, transparent); }
}

/* Fallback para navegadores sin color-mix */
@supports not (color: color-mix(in srgb, red 50%, transparent)) {
    .wcspp-popup--view     .wcspp-live-dot { animation: wcspp-pulse-green  1.8s ease-in-out infinite; }
    .wcspp-popup--purchase .wcspp-live-dot { animation: wcspp-pulse-orange 1.8s ease-in-out infinite; }
}
@keyframes wcspp-pulse-green  { 0%,100%{box-shadow:0 0 0 0 rgba(34,197,94,.5)} 50%{box-shadow:0 0 0 7px rgba(34,197,94,0)} }
@keyframes wcspp-pulse-orange { 0%,100%{box-shadow:0 0 0 0 rgba(249,115,22,.5)} 50%{box-shadow:0 0 0 7px rgba(249,115,22,0)} }

/* ── Tarjeta ─────────────────────────────────────────────────── */
.wcspp-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 4px 6px rgba(0,0,0,.05), 0 10px 30px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.04);
    position: relative;   /* ancla el botón cerrar */
    overflow: visible;    /* permite que .wcspp-close sobresalga si es necesario */
}

/* ── Botón cerrar ────────────────────────────────────────────── */
.wcspp-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 26px !important;
    height: 26px !important;
    background: #ffffff !important;   /* ← blanco */
    border-radius: 50% !important;
    cursor: pointer !important;
    color: #6b7280 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    padding: 0 !important;
    transition: background .2s, color .2s, border-color .2s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
}
.wcspp-close:hover {
    background: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: #111 !important;
}

/* ── Cuerpo (link) ───────────────────────────────────────────── */
.wcspp-body {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 46px 10px 14px;   /* padding-right deja espacio al botón cerrar */
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    overflow: hidden !important;
    border-radius: 18px 18px 0 0;
}
.wcspp-body:hover { background: rgba(0,0,0,.02); }

/* ── Imagen ──────────────────────────────────────────────────── */
.wcspp-img-wrap {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    position: relative;
}
.wcspp-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Sello ✓ – color desde variable */
.wcspp-sold-badge {
    display: none;
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    background: var(--wcspp-buy-badge);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
}
.wcspp-popup--purchase .wcspp-sold-badge { display: flex; }

/* ── Info ────────────────────────────────────────────────────── */
.wcspp-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    width: 0;   /* fuerza flex a respetar min-width:0 en todos los navegadores */
}

.wcspp-status-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}

.wcspp-status-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.wcspp-status-icon svg { width: 15px; height: 15px; }

/* Colores de ícono desde variables */
.wcspp-popup--view     .wcspp-status-icon svg { stroke: var(--wcspp-view-icon); }
.wcspp-popup--purchase .wcspp-status-icon svg { stroke: var(--wcspp-buy-icon);  }

.wcspp-status-text { font-size: 12px; font-weight: 500; color: #9ca3af; }
.wcspp-popup--purchase .wcspp-status-text { color: var(--wcspp-buy-status); font-weight: 600; }

.wcspp-visitor {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    display: block;
    line-height: 1.3;
}

.wcspp-action {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    display: block;
}

/* Nombre producto – color desde variables */
.wcspp-product-name {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}
.wcspp-popup--view     .wcspp-product-name { color: var(--wcspp-view-product); font-weight: 600; }
.wcspp-popup--purchase .wcspp-product-name { color: var(--wcspp-buy-product);  font-weight: 700; }

.wcspp-time {
    font-size: 11.5px;
    color: #9ca3af;
    margin-top: 3px;
    display: block;
}

/* ── Barra de progreso – colores desde variables ─────────────── */
.wcspp-progress {
    height: 3px;
    background: #f3f4f6;
    border-radius: 0 0 18px 18px;
    overflow: hidden;
}
.wcspp-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    transform: scaleX(1);
}
.wcspp-popup--view     .wcspp-progress-bar { background: linear-gradient(90deg, var(--wcspp-view-bar-start), var(--wcspp-view-bar-end)); }
.wcspp-popup--purchase .wcspp-progress-bar { background: linear-gradient(90deg, var(--wcspp-buy-bar-start),  var(--wcspp-buy-bar-end));  }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════ */

/* Móvil */
@media (max-width: 480px) {
    #wcspp-popup {
        left: 12px;
        right: 12px;
        bottom: 16px;
        width: auto;
        max-width: 100%;
    }
    .wcspp-img-wrap { width: 60px; height: 60px; }
    .wcspp-visitor  { font-size: 14px; }
    .wcspp-action   { font-size: 12px; }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    #wcspp-popup { max-width: 340px; left: 16px; bottom: 20px; }
}

/* Desktop grande */
@media (min-width: 1200px) {
    #wcspp-popup { max-width: 380px; }
}
