/**
 * Social Proof Notifications — Frontend Styles v1.16
 */

/* ── Reset & isolation ──────────────────────────────────────── */
#snp-popup,
#snp-popup * {
    box-sizing: border-box;
    font-family: inherit;
    margin: 0;
    padding: 0;
}

/* ── Outer container ────────────────────────────────────────── */
#snp-popup {
    position: fixed !important;
    z-index: 999999;
    max-width: 380px;           /* wider — fits long names on one line */
    width: calc(100% - 40px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* Positions — always set both sides explicitly to prevent stale values */
#snp-popup.snp-bottom-left  { bottom: 24px; top: auto;  left: 20px;  right: auto; transform: translateY(20px); }
#snp-popup.snp-bottom-right { bottom: 24px; top: auto;  left: auto;  right: 20px; transform: translateY(20px); }
#snp-popup.snp-top-left     { bottom: auto; top: 24px;  left: 20px;  right: auto; transform: translateY(-20px); }
#snp-popup.snp-top-right    { bottom: auto; top: 24px;  left: auto;  right: 20px; transform: translateY(-20px); }

/* Shown */
#snp-popup.snp-show { opacity: 1 !important; transform: translateY(0) !important; pointer-events: auto; }

/* Hidden */
#snp-popup.snp-hide.snp-bottom-left,
#snp-popup.snp-hide.snp-bottom-right {
    opacity: 0 !important; transform: translateY(14px) !important;
    pointer-events: none;
    transition: opacity 0.28s ease-in, transform 0.28s ease-in;
}
#snp-popup.snp-hide.snp-top-left,
#snp-popup.snp-hide.snp-top-right {
    opacity: 0 !important; transform: translateY(-14px) !important;
    pointer-events: none;
    transition: opacity 0.28s ease-in, transform 0.28s ease-in;
}

/* ── Shell: clips card + anchors close button ───────────────── */
#snp-popup .snp-shell {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
}

/* ── Close button ───────────────────────────────────────────── */
#snp-popup .snp-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    border: none;
    color: #ffffff !important;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
#snp-popup .snp-close:hover { background: rgba(0,0,0,0.80); }

/* ── Card ───────────────────────────────────────────────────── */
#snp-popup .snp-inner {
    display: flex;
    align-items: stretch;   /* makes image fill full card height */
    width: 100%;
    min-height: 90px;
    box-shadow: 0 4px 20px rgba(0,0,0,.28), 0 1px 6px rgba(0,0,0,.14);
}

/* Shapes */
#snp-popup.snp-style-bold .snp-shell,
#snp-popup.snp-style-bold .snp-inner { border-radius: 12px; }
#snp-popup.snp-style-card .snp-shell,
#snp-popup.snp-style-card .snp-inner { border-radius: 18px; }
#snp-popup.snp-style-pill .snp-shell,
#snp-popup.snp-style-pill .snp-inner { border-radius: 60px; }

/* ── Product image — square (1:1), fills full card height ────── */
/* --snp-img-size is set inline by JS from the admin "Image size" slider (50-120px) */
#snp-popup .snp-thumb {
    display: block;
    flex-shrink: 0;
    width: var(--snp-img-size, 90px);
    height: 100%;           /* fill the card's full height (min-height: 90px) */
    aspect-ratio: 1 / 1;    /* keep it square even if card grows taller */
    object-fit: cover;
    object-position: center;
}
#snp-popup .snp-thumb-placeholder {
    flex-shrink: 0;
    width: var(--snp-img-size, 90px);
    height: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.08);
}
#snp-popup .snp-thumb-placeholder::after {
    content: '';
    width: 32px;
    height: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(255,255,255,.45)' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 2L3 6v14a2 2 0 002 2h14a2 2 0 002-2V6l-3-4z'/%3E%3Cline x1='3' y1='6' x2='21' y2='6'/%3E%3Cpath d='M16 10a4 4 0 01-8 0'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ── Text body ──────────────────────────────────────────────── */
#snp-popup .snp-body {
    padding: 13px 36px 13px 14px;  /* right padding keeps text clear of close btn */
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
#snp-popup.snp-style-pill .snp-body {
    padding: 10px 32px 10px 14px;
}

#snp-popup .snp-who {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#snp-popup .snp-product {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}
#snp-popup.snp-style-pill .snp-product { font-size: 13px; }

#snp-popup .snp-time {
    font-size: 12px;
    margin-top: 1px;
    opacity: .75;
}
#snp-popup .snp-verified {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 3px;
    opacity: .9;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    /* Reduce side inset but preserve the chosen left/right position */
    #snp-popup { max-width: calc(100% - 24px); }
    #snp-popup.snp-bottom-left,
    #snp-popup.snp-top-left    { left: 12px !important; right: auto !important; }
    #snp-popup.snp-bottom-right,
    #snp-popup.snp-top-right   { right: 12px !important; left: auto !important; }
    /* Both the real image AND the placeholder must shrink together
       so layout stays consistent regardless of whether the product
       has a thumbnail. Caps at 75px on small screens even if the
       admin "Image size" setting is larger. */
    #snp-popup .snp-thumb,
    #snp-popup .snp-thumb-placeholder { width: min(var(--snp-img-size, 90px), 75px); }
    #snp-popup .snp-who        { font-size: 12px; white-space: normal; }
    #snp-popup .snp-product    { font-size: 13px !important; }
}

/* ── WoodMart ───────────────────────────────────────────────── */
.wd-sticky-header ~ #snp-popup,
body.wd-header-sticky #snp-popup { z-index: 1000000 !important; }

/* ── Elementor ──────────────────────────────────────────────── */
.elementor-popup-modal ~ #snp-popup { z-index: 1000001 !important; }

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #snp-popup,
    #snp-popup.snp-show,
    #snp-popup.snp-hide {
        transition: opacity 0.2s ease !important;
        transform: none !important;
    }
}
