/**
 * Styling untuk notifikasi keranjang belanja
 */

/* Animasi untuk ikon keranjang */
@keyframes cartBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.cart-bounce {
    animation: cartBounce 0.3s ease;
}

/* Notifikasi keranjang */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    overflow: hidden;
    transform: translateX(100%);
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
    opacity: 0;
}

.cart-notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Header notifikasi */
.cart-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #d32f2f, #ff6659);
}

/* Konten notifikasi */
.cart-notification-content {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-notification-image {
    width: 70px;
    height: 70px;
    margin-right: 15px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-notification-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.cart-notification-image .no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 24px;
}

.cart-notification-info {
    flex: 1;
}

.cart-notification-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 16px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-notification-price {
    color: #d32f2f;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 5px;
}

.cart-notification-quantity {
    color: #666;
    font-size: 14px;
}

/* Tombol aksi */
.cart-notification-actions {
    display: flex;
    padding: 15px;
    gap: 10px;
}

.view-cart-btn {
    flex: 1;
    background-color: #d32f2f;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s;
}

.view-cart-btn:hover {
    background-color: #b71c1c;
}

.continue-shopping-btn {
    flex: 1;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.continue-shopping-btn:hover {
    background-color: #e0e0e0;
}

/* Tombol tutup */
.cart-notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.cart-notification-close:hover {
    color: #333;
}

/* Responsif */
@media (max-width: 576px) {
    .cart-notification {
        width: calc(100% - 40px);
        top: 10px;
        right: 10px;
        left: 10px;
    }
}

/* Animasi sukses untuk tombol tambah ke keranjang */
.btn-add-cart.success {
    background-color: #4CAF50;
    pointer-events: none;
    transition: background-color 0.3s ease;
}

/* Animasi loading untuk tombol tambah ke keranjang */
.btn-add-cart.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-add-cart.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}