/* Professional Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.toast {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    min-width: 300px;
    border-left: 4px solid;
    animation: slideInRight 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

.toast-success {
    border-left-color: #28a745;
}

.toast-success .toast-icon {
    color: #28a745;
}

.toast-error {
    border-left-color: #dc3545;
}

.toast-error .toast-icon {
    color: #dc3545;
}

.toast-info {
    border-left-color: #17a2b8;
}

.toast-info .toast-icon {
    color: #17a2b8;
}

.toast-warning {
    border-left-color: #ffc107;
}

.toast-warning .toast-icon {
    color: #ffc107;
}

.toast-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin: 0 0 4px 0;
    color: #333;
}

.toast-message {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.toast-close:hover {
    background: #f5f5f5;
    color: #666;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    animation: progressBar 4s linear forwards;
}

.toast-success .toast-progress {
    background: #28a745;
}

.toast-error .toast-progress {
    background: #dc3545;
}

.toast-info .toast-progress {
    background: #17a2b8;
}

.toast-warning .toast-progress {
    background: #ffc107;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Cart Update Animation */
.cart-update-animation {
    animation: cartPulse 0.6s ease-in-out;
}

@keyframes cartPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: #28a745;
    }
    100% {
        transform: scale(1);
    }
}

/* Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Cart Dropdown Updates */
.cart-dropdown-updating {
    opacity: 0.7;
    pointer-events: none;
}

.cart-item-added {
    animation: itemAdded 0.5s ease-out;
}

@keyframes itemAdded {
    0% {
        background: #d4edda;
        transform: scale(1);
    }
    50% {
        background: #c3e6cb;
        transform: scale(1.02);
    }
    100% {
        background: transparent;
        transform: scale(1);
    }
}
