/* =========================================================================
   Realtime Sales Notification Toast (Social Proof) — toko.kelistrikan.com
   Optimalisasi: Lebih Kompak/Kecil, Posisi Kiri Bawah, Responsif & Elegan
   ========================================================================= */

.tk-sales-notif {
    position: fixed;
    bottom: 14px !important;
    left: 14px !important;
    right: auto !important;
    z-index: 99998;
    max-width: 295px;
    width: auto;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(245, 136, 0, 0.22);
    border-radius: 12px;
    padding: 8px 10px;
    box-shadow: 0 8px 24px rgba(4, 18, 31, 0.1), 0 2px 6px rgba(245, 136, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 9px;
    transform: translateY(120%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, visibility 0.35s;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

.tk-sales-notif.pos-bottom-right {
    left: auto !important;
    right: 14px !important;
    bottom: 14px !important;
}

.tk-sales-notif.pos-bottom-left {
    left: 14px !important;
    right: auto !important;
    bottom: 14px !important;
}

.tk-sales-notif.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.tk-sales-notif:hover {
    border-color: #f58800;
    box-shadow: 0 12px 28px rgba(245, 136, 0, 0.16), 0 4px 8px rgba(4, 18, 31, 0.06);
    background: #ffffff;
}

/* Product Thumbnail & Buyer Avatar Badge */
.tk-notif-img-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    min-width: 42px;
    flex-shrink: 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    box-sizing: border-box;
}

.tk-notif-img-wrap img.tk-notif-prod-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.tk-notif-avatar-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    background: #ffedd5;
    flex-shrink: 0;
}

.tk-notif-avatar-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Text Content Area */
.tk-notif-content {
    flex: 1;
    min-width: 0;
    text-align: left;
    overflow: hidden;
}

.tk-notif-buyer {
    font-size: 10.5px;
    color: #64748b;
    margin: 0 0 1px 0;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.tk-notif-buyer strong {
    color: #0f172a;
    font-weight: 700;
}

.tk-notif-product {
    font-size: 11.5px;
    font-weight: 700;
    color: #0c1b30;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    transition: color 0.2s;
}

.tk-sales-notif:hover .tk-notif-product {
    color: #ea580c;
}

/* Live Verified Status */
.tk-notif-status {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tk-pulse-dot {
    width: 5px;
    height: 5px;
    min-width: 5px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: tkPulse 1.8s infinite;
    flex-shrink: 0;
}

@keyframes tkPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.tk-notif-time {
    font-size: 9.5px;
    font-weight: 600;
    color: #ea580c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Close Button (Compact & Unobtrusive) */
.tk-notif-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1;
    padding: 2px 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: -2px;
    margin-right: -2px;
}

.tk-notif-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

/* =========================================================================
   Mobile Optimization (Lebih Kecil, Rapi & Kekiri Bawah)
   ========================================================================= */
@media (max-width: 768px) {
    .tk-sales-notif,
    .tk-sales-notif.pos-bottom-left {
        bottom: 72px !important; /* Sedikit di atas navigasi/menu bawah (tab-bar 64px) */
        left: 10px !important;
        right: auto !important;
        max-width: min(270px, calc(100vw - 20px)) !important;
        width: auto !important;
        padding: 7px 9px !important;
        gap: 8px !important;
        border-radius: 11px !important;
        box-shadow: 0 6px 20px rgba(4, 18, 31, 0.12), 0 2px 5px rgba(245, 136, 0, 0.08) !important;
    }

    .tk-sales-notif.pos-bottom-right {
        bottom: 72px !important;
        right: 10px !important;
        left: auto !important;
        max-width: min(270px, calc(100vw - 20px)) !important;
        width: auto !important;
    }

    .tk-notif-img-wrap {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        border-radius: 8px !important;
        padding: 2px !important;
    }

    .tk-notif-avatar-badge {
        width: 15px !important;
        height: 15px !important;
        min-width: 15px !important;
        bottom: -2px !important;
        right: -2px !important;
    }

    .tk-notif-buyer {
        font-size: 10px !important;
        margin-bottom: 1px !important;
    }

    .tk-notif-product {
        font-size: 11px !important;
        line-height: 1.25 !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
    }

    .tk-notif-status {
        margin-top: 2px !important;
        gap: 4px !important;
    }

    .tk-pulse-dot {
        width: 4.5px !important;
        height: 4.5px !important;
        min-width: 4.5px !important;
    }

    .tk-notif-time {
        font-size: 9px !important;
    }

    .tk-notif-close {
        font-size: 11px !important;
        padding: 2px 3px !important;
    }
}
