/* Toast Notification System */

.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.toast {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 16px 20px;
    position: relative;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.4s ease;
    pointer-events: all;
    border-left: 4px solid #28a745;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto 10px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    animation: toastSlideIn 0.4s ease-out;
}

@keyframes toastSlideIn {
    0% {
        transform: translateY(-100px) scale(0.9);
        opacity: 0;
    }
    50% {
        transform: translateY(-10px) scale(1.02);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.toast.success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.toast.success .toast-icon {
    color: #28a745;
    font-size: 20px;
}

.toast.error {
    border-left-color: #dc3545;
}

.toast.warning {
    border-left-color: #ffc107;
}

.toast.info {
    border-left-color: #007bff;
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #28a745;
}

.toast.error .toast-icon {
    color: #dc3545;
}

.toast.warning .toast-icon {
    color: #ffc107;
}

.toast.info .toast-icon {
    color: #007bff;
}

.toast-content {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: #666;
}

/* Alternative bottom-left position */
.toast-container.bottom-left {
    top: auto;
    bottom: 20px;
    left: 20px;
    right: auto;
}

.toast-container.bottom-left .toast {
    transform: translateX(-400px);
}

.toast-container.bottom-left .toast.show {
    transform: translateX(0);
}

/* Loading spinner animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Button loading state */
.add-to-cart-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .toast-container {
        left: 10px;
        right: 10px;
        max-width: none;
        transform: translateX(0);
    }
    
    .toast-container.bottom-left {
        left: 10px;
        right: 10px;
    }
    
    .toast {
        transform: translateY(-100px);
    }
    
    .toast-container.bottom-left .toast {
        transform: translateY(100px);
    }
    
    .toast.show,
    .toast-container.bottom-left .toast.show {
        transform: translateY(0);
    }
}