/* ================================================================
   WooCommerce Urgency Booster – Frontend Styles
   ================================================================ */

/* ── 1. Urgency Bar ── */
.wub-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    position: relative;
    margin-bottom: 12px;
    border-radius: 8px;
    direction: rtl;
    animation: wub-slidein 0.4s ease;
}

.wub-bar-pulse {
    width: 10px; height: 10px;
    background: #ef4444;
    border-radius: 50%;
    flex-shrink: 0;
    animation: wub-pulse 1.4s infinite;
}

.wub-bar-text { flex: 1; }

.wub-bar-close {
    background: none; border: none; cursor: pointer;
    font-size: 13px; opacity: 0.6; padding: 2px 6px;
    color: inherit; line-height: 1;
}
.wub-bar-close:hover { opacity: 1; }

/* ── 2. Hot Badge ── */
.wub-hot-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
    direction: rtl;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}

.wub-hot-pulse {
    width: 8px; height: 8px;
    background: #fff;
    border-radius: 50%;
    animation: wub-pulse 1.2s infinite;
    flex-shrink: 0;
}

/* ── 3. Stock Badge ── */
.wub-stock-wrap {
    margin: 12px 0;
    padding: 12px 14px;
    background: #fff8f0;
    border: 1.5px solid #ffd6a5;
    border-radius: 10px;
    direction: rtl;
}

.wub-stock-label {
    font-size: 13px;
    font-weight: 700;
    color: #c2410c;
    margin-bottom: 8px;
}

.wub-stock-bar {
    background: #fde8d0;
    border-radius: 99px;
    height: 7px;
    overflow: hidden;
    margin-bottom: 7px;
}

.wub-stock-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316);
    border-radius: 99px;
    transition: width 1s ease;
}

.wub-sold-label {
    font-size: 12px;
    color: #16a34a;
    font-weight: 600;
}

/* ── 4. Viewers ── */
.wub-viewers {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin: 8px 0;
    direction: rtl;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 20px;
}

.wub-viewers-dots {
    display: flex; gap: 3px; align-items: center;
}

.wub-viewers-dots span {
    width: 7px; height: 7px;
    background: #22c55e;
    border-radius: 50%;
    animation: wub-blink 1.4s infinite;
}

.wub-viewers-dots span:nth-child(2) { animation-delay: 0.2s; }
.wub-viewers-dots span:nth-child(3) { animation-delay: 0.4s; }

#wub-viewers-count {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    min-width: 24px;
    text-align: center;
    transition: all 0.3s;
}

/* ── 5. Countdown ── */
.wub-countdown {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 10px;
    direction: rtl;
    flex-wrap: wrap;
}

.wub-countdown-label {
    font-size: 13px;
    font-weight: 700;
    color: inherit;
    white-space: nowrap;
}

.wub-countdown-timer {
    display: flex;
    align-items: center;
    gap: 4px;
    direction: ltr;
}

.wub-cd-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.12);
    border-radius: 7px;
    padding: 4px 10px;
    min-width: 42px;
}

.wub-cd-block span {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
}

.wub-cd-block small {
    font-size: 10px;
    font-weight: 600;
    opacity: 0.75;
    margin-top: 1px;
}

.wub-cd-sep {
    font-size: 22px;
    font-weight: 800;
    padding-bottom: 8px;
    opacity: 0.6;
}

/* ── 6. Trust Strip ── */
.wub-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin: 14px 0 8px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    direction: rtl;
}

.wub-trust-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.wub-trust-item span:first-child { font-size: 15px; }

/* ── 7. Social Proof Popup ── */
.wub-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99998;
    width: 290px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    overflow: hidden;
    direction: rtl;
    transform: translateX(130%);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wub-popup[hidden] { display: block !important; }

.wub-popup.wub-popup-show {
    transform: translateX(0);
}

.wub-popup-inner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 10px;
}

.wub-popup-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.wub-popup-body { flex: 1; min-width: 0; }

.wub-popup-text {
    font-size: 12.5px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.wub-popup-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
}

.wub-popup-close {
    background: none; border: none; cursor: pointer;
    font-size: 12px; color: #94a3b8; padding: 0 2px; line-height: 1;
    flex-shrink: 0;
}
.wub-popup-close:hover { color: #475569; }

.wub-popup-progress {
    height: 3px;
    background: linear-gradient(90deg, #25D366, #128C7E);
    transform-origin: right;
    animation: none;
}

.wub-popup-progress.wub-progress-run {
    animation: wub-progress-shrink linear forwards;
}

/* ── Keyframes ── */
@keyframes wub-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.45); opacity: 0.6; }
}

@keyframes wub-blink {
    0%, 80%, 100% { opacity: 1; }
    40%           { opacity: 0.2; }
}

@keyframes wub-slidein {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes wub-progress-shrink {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .wub-popup { right: 12px; bottom: 12px; width: calc(100vw - 24px); max-width: 320px; }
    .wub-countdown { gap: 8px; }
    .wub-cd-block { min-width: 36px; padding: 4px 7px; }
    .wub-cd-block span { font-size: 18px; }
    .wub-trust { gap: 5px 10px; }
}
