/* =============================================
   Codlion Sales Pop — Toast Notification
   Bottom-left corner, slide-in animation
   ============================================= */

.cl-sales-pop {
    position: fixed;
    bottom: 60px;
    left: 20px;
    z-index: 9998;
    max-width: 340px;
    width: calc(100vw - 40px);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-120%);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.4s;
    pointer-events: none;
}

.cl-sales-pop.cl-sp-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
    pointer-events: auto;
}

.cl-sp-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--cl-surface, #ffffff);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--cl-border-light, #f0f0f0);
    position: relative;
}

.cl-sp-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--cl-surface-muted, #f5f5f5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cl-sp-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cl-sp-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--cl-primary, #2563eb);
    color: var(--cl-surface, #ffffff);
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 8px;
}

.cl-sp-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cl-sp-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--cl-text-primary, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-sp-action {
    font-size: 12px;
    color: var(--cl-text-secondary, #4b5563);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-sp-meta {
    font-size: 11px;
    color: var(--cl-text-muted, #9ca3af);
    font-weight: 700;
}

.cl-sp-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: transparent;
    color: var(--cl-text-muted, #9ca3af);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.2s ease, background 0.2s ease;
}

.cl-sp-close:hover {
    color: var(--cl-text-secondary, #4b5563);
    background: var(--cl-surface-muted, #f3f4f6);
}

/* Mobile: smaller and higher position to avoid cart panel overlap */
@media (max-width: 991px) {
    .cl-sales-pop {
        bottom: 60px;
        left: 12px;
        max-width: 300px;
        width: calc(100vw - 24px);
    }

    .cl-sp-card {
        padding: 10px 12px;
        gap: 10px;
    }

    .cl-sp-image {
        width: 42px;
        height: 42px;
    }

    .cl-sp-avatar {
        font-size: 15px;
    }


    .cl-sp-name {
        font-size: 12px;
    }

    .cl-sp-action {
        font-size: 11px;
    }

    .cl-sp-meta {
        font-size: 10px;
        font-weight: 700;
    }
}

/* RTL: mirror to bottom-right */
html[dir="rtl"] .cl-sales-pop {
    left: auto;
    right: 20px;
    transform: translateX(120%);
}

html[dir="rtl"] .cl-sales-pop.cl-sp-visible {
    transform: translateX(0);
}

@media (max-width: 991px) {
    html[dir="rtl"] .cl-sales-pop {
        right: 12px;
    }
}

/* Accessibility: respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .cl-sales-pop,
    .cl-sales-pop.cl-sp-visible {
        transition: opacity 0.2s ease, visibility 0s;
        transform: none;
    }
}
