.mini-cart-wrapper {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
}

.cart-icon {
    width: 60px;
    height: 60px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    border: 2px solid #007bff;
}

.cart-icon:hover {
    transform: scale(1.1);
    background: #f8f9fa;
}

.cart-icon i {
    color: #007bff;
    font-size: 24px;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    font-weight: bold;
}

/* Thêm animation cho cart icon khi có sản phẩm mới */
@keyframes cartBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

.cart-icon.has-new-item {
    animation: cartBounce 0.8s ease;
}

.mini-cart {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    right: -400px;
    width: 400px;
    max-height: 80vh;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: -1;
    visibility: hidden;
    opacity: 0;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    margin: 20px;
}

.mini-cart.show {
    right: 0;
    z-index: 1000;
    visibility: visible;
    opacity: 1;
}

/* Thêm animation cho mini cart */
@keyframes slideIn {
    from {
        right: -400px;
        opacity: 0;
    }
    to {
        right: 0;
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        right: 0;
        opacity: 1;
    }
    to {
        right: -400px;
        opacity: 0;
    }
}

.mini-cart.show {
    animation: slideIn 0.3s ease forwards;
}

.mini-cart:not(.show) {
    animation: slideOut 0.3s ease forwards;
}

.mini-cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-cart-header h3 {
    margin: 0;
    font-size: 20px;
}

.close-cart {
    background: none;
    border: none;
    font-size: 20px;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-cart:hover {
    color: #343a40;
}

.mini-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    max-height: calc(80vh - 180px); /* Trừ đi phần header và footer */
}

.mini-cart-item {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.mini-cart-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.mini-cart-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-right: 15px;
}

.mini-cart-item-details {
    flex: 1;
    padding-right: 15px;
}

.mini-cart-item-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.mini-cart-item-price {
    font-size: 15px;
    color: #e44d26;
    margin-bottom: 8px;
}

.mini-cart-item-quantity {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-top: 5px;
}

.mini-cart-item-quantity .btn-quantity {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0 5px;
}

.mini-cart-item-quantity .btn-quantity:hover {
    background-color: #e0e0e0;
}

.mini-cart-item-quantity .btn-quantity:first-child {
    margin-left: 0;
}

.mini-cart-item-quantity span {
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

.mini-cart-item-quantity .btn-remove {
    margin-left: auto;
    background-color: transparent;
    border: none;
    color: #dc3545;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mini-cart-item-quantity .btn-remove:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.mini-cart-item-quantity .btn-remove i {
    pointer-events: none;
}

.mini-cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
    width: 100%;
}

.mini-cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.mini-cart-footer .d-flex {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

.mini-cart-footer .btn {
    padding: 8px 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 120px;
}

.mini-cart-footer .btn i {
    margin-right: 5px;
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    animation: slideIn 0.5s ease-in-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification .alert {
    margin: 0;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.notification .btn-close {
    padding: 0.5rem;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Toast Notification */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease-in-out forwards;
    min-width: 300px;
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toast.success .toast-icon i {
    color: #28a745;
}

.toast.error .toast-icon i {
    color: #dc3545;
}

.toast-content {
    flex-grow: 1;
}

.toast-message {
    margin: 0;
    font-size: 14px;
}

.toast-close {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Button styles */
.btn-quantity {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-quantity:hover {
    background: #f8f9fa;
    border-color: #ced4da;
}

.btn-quantity i {
    font-size: 12px;
    color: #6c757d;
}

.btn-remove {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: none;
    color: #dc3545;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover {
    color: #c82333;
}

/* Icon styles */
.mini-cart-header h3 i {
    margin-right: 8px;
    color: #007bff;
}

.mini-cart-item-price i {
    margin-right: 5px;
    color: #28a745;
    font-size: 14px;
}

.mini-cart-total i {
    margin-right: 5px;
    color: #ffc107;
}

/* Empty cart icon */
.mini-cart-body .text-center i {
    color: #dee2e6;
    margin-bottom: 10px;
}

/* Cart icon animation */
.cart-icon.has-new-item i {
    animation: cartBounce 0.8s ease;
}

/* Toast icon styles */
.toast-close i {
    font-size: 16px;
}
