/* 1. Animation khung hình */
/* @keyframes toastIn {
    0% { transform: translateX(100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
} */
/* Mobile */

@keyframes toastIn {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 2. Container (Căn lề phải, xếp chồng dọc) */
.cc12-toast-container {
    position: fixed; 
    top: 20px; 
    right: 20px; 
    z-index: 9999;
    display: flex; 
    flex-direction: column; 
    align-items: flex-end;
    pointer-events: none;
}

/* Mobile */
@media (max-width: 768px) {
    .cc12-toast-container {
        top: auto;
        right: auto;

        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);

        align-items: center;
    }

    .cc12-toast {
        max-width: calc(100vw - 32px);
        width: fit-content;
    }

     .cc12-toast span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    @keyframes toastIn {
        from {
            transform: translateY(30px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}



/* 3. Toast (Ốm, ôm nội dung, mượt) */
.cc12-toast {
    display: inline-flex;
    align-items: flex-start;
    padding: 10px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    
    font-family: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    font-size: 14px;
    /* max-width: 400px; */
    max-width: min(400px, calc(100vw - 40px));

    width: fit-content;
    
    /* Gắn animation vào đây */
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        gap: 8px; /* TỰ ĐỘNG tạo khoảng cách 8px giữa icon, chữ, nút X */

    pointer-events: auto;
    touch-action: pan-x;
    user-select: none;
}
/* Bỏ hết margin thủ công ở icon và span */

/* Các thành phần con */
.cc12-toast i { margin-top: 2px; margin-right: 10px; opacity: 0.7; flex-shrink: 0; }
.cc12-toast span { flex: 1; word-break: break-word; color: #1f2937; margin: 0 5px; }

.toast-close {
    margin-left: 10px; padding: 0 4px;
    background: none; border: none; cursor: pointer;
    color: #a1a1aa; font-size: 16px; flex-shrink: 0;
    transition: color 0.2s;
}
.toast-close:hover { color: #000; }