/* ─── Social Proof WooCommerce Widget ─────────────────────────────────────────
   Diseñado para NO romper el layout existente del tema.
   Todos los estilos están scoped bajo #spw-widget.
   ─────────────────────────────────────────────────────────────────────────── */

/* Widget container */
#spw-widget {
    position: fixed;
    z-index: 999999;
    max-width: 300px;
    width: calc(100% - 32px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #1a1a1a;
    pointer-events: auto;

    /* Entrance animation hidden by default */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;

    /* Isolate from page layout */
    box-sizing: border-box;
    margin: 0;
}

/* Position variants */
#spw-widget.spw-bottom-left {
    bottom: 20px;
    left: 16px;
    right: auto;
}

#spw-widget.spw-bottom-right {
    bottom: 20px;
    right: 16px;
    left: auto;
}

/* Visible state */
#spw-widget.spw-show {
    opacity: 1;
    transform: translateY(0);
}

/* Clickable link wrapper */
.spw-link {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    transition: background 0.2s;
}

.spw-link:hover {
    background: #f9f9f9;
    text-decoration: none;
    color: inherit;
}

.spw-link:visited {
    color: inherit;
}

/* Inner layout */
.spw-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

/* Product image */
.spw-image-wrap {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f3f3;
}

.spw-image-wrap img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    display: block;
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

/* Text content */
.spw-content {
    flex: 1;
    min-width: 0;
}

.spw-content p {
    margin: 0 0 2px;
    padding: 0;
    border: none;
    background: none;
    line-height: 1.35;
}

.spw-name {
    font-size: 13px;
    color: #1a1a1a;
}

.spw-name strong {
    font-weight: 700;
}

.spw-location {
    color: #888;
    font-weight: 400;
}

.spw-action {
    font-size: 12px;
    color: #555;
}

.spw-product {
    font-size: 11.5px;
    font-weight: 600;
    color: #222;
    /* Show up to 2 lines, fill the available content column */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    width: 100%;
}

/* Bottom row: recientemente + badge */
.spw-time {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px !important;
    font-size: 11.5px;
}

.spw-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #00b386;
    border-radius: 50%;
    flex-shrink: 0;
}

.spw-recently {
    color: #00b386;
    font-weight: 600;
}

.spw-badge {
    width: 14px !important;
    height: 14px !important;
    display: inline-block;
    vertical-align: middle;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.spw-verify {
    color: #888;
    font-size: 11px;
}

/* Close button */
.spw-close {
    position: absolute;
    top: -4px;
    right: -4px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #bbb;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 50%;
    transition: color 0.2s;
}

.spw-close:hover {
    color: #555;
    background: #f3f3f3;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    #spw-widget {
        /* Fixed 210px so it never reaches the WhatsApp button */
        max-width: 210px;
        width: 210px;
        font-size: 11.5px;
    }

    #spw-widget.spw-bottom-left {
        bottom: 14px;
        left: 10px;
    }

    #spw-widget.spw-bottom-right {
        bottom: 14px;
        right: 10px;
    }

    .spw-link {
        padding: 10px 12px;
    }

    .spw-image-wrap,
    .spw-image-wrap img {
        width: 36px;
        height: 36px;
    }

    .spw-product {
        font-size: 11px;
        -webkit-line-clamp: 2;
        width: 100%;
    }

    .spw-name {
        font-size: 11px;
    }
}
