/* ==========================================================================
   WooCommerce Sales Notification Popups — wsn-style.css
   Structural rules only. All colors/sizes come from --wsn-* CSS variables
   set by output_dynamic_css() in class-wsn-frontend.php.
   ========================================================================== */

/* ---- Container --------------------------------------------------------- */

#wsn-popup-container {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    max-width: 100vw;
}

/* ---- Popup card -------------------------------------------------------- */

.wsn-popup {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    position: relative;
    box-sizing: border-box;
    margin-top: 10px;

    /* Design tokens applied from PHP-generated :root vars */
    background:   var(--wsn-bg, #1a1a1a);
    color:        var(--wsn-text, #ffffff);
    border-radius: var(--wsn-radius, 10px);
    padding:      var(--wsn-padding, 14px);
    max-width:    var(--wsn-max-width, 320px);
    box-shadow:   var(--wsn-shadow, 0 6px 24px rgba(0,0,0,0.6));
    border:       var(--wsn-bw, 1px) solid var(--wsn-border, rgba(255,255,255,0.1));
    font-family:  var(--wsn-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);

    /* Animation base state — actual transitions injected per animation-style */
    transition: opacity var(--wsn-speed, 400ms) ease,
                transform var(--wsn-speed, 400ms) ease;
}

/* ---- Product image ---------------------------------------------------- */

.wsn-popup img {
    width:        var(--wsn-img-sz, 48px);
    height:       var(--wsn-img-sz, 48px);
    border-radius: var(--wsn-img-r, 6px);
    object-fit:   cover;
    flex-shrink:  0;
    display:      block;
    background:   rgba(255,255,255,0.06); /* neutral bg while image loads */
}

/* ---- Viewer-count icon ------------------------------------------------ */

.wsn-viewer-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
}

/* ---- Text content ----------------------------------------------------- */

.wsn-content {
    flex: 1;
    min-width: 0;
}

.wsn-title {
    margin: 0 0 2px;
    line-height: 1.3;
    font-size:   var(--wsn-title-sz, 13px);
    font-weight: var(--wsn-title-fw, 600);
    color:       var(--wsn-text, #ffffff);
}

.wsn-product {
    margin: 0 0 4px;
    line-height: 1.3;
    font-size: var(--wsn-sub-sz, 13px);
    color:     var(--wsn-subtext, #cccccc);
    overflow:  hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wsn-time {
    margin: 0;
    font-size: var(--wsn-time-sz, 11px);
    color:     var(--wsn-time, #888888);
}

/* Viewer popup message */
.wsn-viewer-msg {
    margin: 0;
    font-size:   var(--wsn-title-sz, 13px);
    font-weight: var(--wsn-title-fw, 600);
    color:       var(--wsn-text, #ffffff);
    line-height: 1.35;
}

/* ---- Close button ----------------------------------------------------- */

.wsn-close {
    position: absolute;
    top: 4px;
    right: 6px;
    cursor: pointer;
    font-size: 15px;
    color: var(--wsn-time, #888888);
    line-height: 1;
    background: none;
    border: none;
    padding: 4px 5px;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.wsn-close:hover {
    color: var(--wsn-text, #ffffff);
    background: rgba(255,255,255,0.08);
}

/* ---- Mobile override -------------------------------------------------- */

@media (max-width: 480px) {
    .wsn-popup {
        max-width: calc(100vw - 24px) !important;
    }
    #wsn-popup-container {
        left:   12px !important;
        right:  12px !important;
        bottom: 12px !important;
        top:    auto !important;
    }
}

/* ==========================================================================
   v3 additions — Flash Deal, Streak, Return Visitor
   ========================================================================== */

/* ---- Flash deal -------------------------------------------------------- */

.wsn-flash-icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
}

.wsn-flash-label {
    margin: 0 0 2px;
    font-size: var(--wsn-title-sz, 13px);
    font-weight: 700;
    color: var(--wsn-accent, #e74c3c);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wsn-flash-msg {
    margin: 0 0 4px;
    font-size: var(--wsn-sub-sz, 13px);
    color: var(--wsn-text, #ffffff);
    font-weight: 600;
}

.wsn-flash-timer {
    margin: 0;
    font-size: var(--wsn-time-sz, 11px);
    color: var(--wsn-time, #888888);
}

.wsn-countdown {
    font-weight: 700;
    color: var(--wsn-accent, #e74c3c);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
}

/* ---- Return visitor ---------------------------------------------------- */

.wsn-popup--return {
    border-color: var(--wsn-accent, #e74c3c);
}

.wsn-return-icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
}

.wsn-return-msg {
    margin: 0 0 8px;
    font-size: var(--wsn-sub-sz, 13px);
    color: var(--wsn-text, #ffffff);
    line-height: 1.4;
}

.wsn-cta-btn {
    display: inline-block;
    padding: 6px 14px;
    background: var(--wsn-accent, #e74c3c);
    color: #ffffff;
    border: none;
    border-radius: calc(var(--wsn-radius, 10px) - 4px);
    font-size: var(--wsn-time-sz, 11px);
    font-weight: 700;
    font-family: var(--wsn-font);
    cursor: pointer;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: opacity 0.15s ease;
}

.wsn-cta-btn:hover {
    opacity: 0.85;
}
