/* 
 * Cart Styles
 * 
 * Contains all CSS for the cart system, including:
 * - Floating cart
 * - Cart items
 * - Animations and transitions
 * - Notifications
 */

/* Cart Button */
.floating-cart-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.floating-cart-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #007bff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.floating-cart-icon:hover {
    transform: scale(1.05);
    background-color: #0069d9;
}

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

/* Cart Offcanvas */
#cartOffcanvas {
    width: 450px;
    max-width: 100vw;
}

#cartOffcanvas .offcanvas-body {
    padding: 0;
}

/* Cart Items Section */
.cart-items-container {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    scrollbar-width: thin;
}

.cart-items-container::-webkit-scrollbar {
    width: 5px;
}

.cart-items-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.cart-items-container::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.05);
}

.cart-item {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
    width: 100%;
    overflow: hidden;
    margin-bottom: 2px;
}

.cart-item:hover {
    background-color: #f1f3f5;
    transform: translateY(-2px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.05);
}

/* Cart Footer */
.cart-footer {
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Animation for cart count update */
.cart-count-updated {
    animation: pulse 0.5s ease-in-out;
}

/* Animation for cart icon update */
.cart-icon-updated {
    animation: flash 0.7s ease-in-out;
}

/* Cart items in offcanvas */
.cart-items {
    max-height: 60vh;
    overflow-y: auto;
}

.cart-item {
    transition: all 0.3s ease;
}

.cart-item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-image-small {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Custom font sizes for compact layout */
.fs-7 {
    font-size: 0.85rem;
}

.fs-8 {
    font-size: 0.75rem;
}

/* Cart notification */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: white;
    border-left: 4px solid #28a745;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 15px;
    border-radius: 4px;
    z-index: 1100;
    max-width: 300px;
    transform: translateX(calc(100% + 20px));
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

.cart-notification-error {
    border-left-color: #dc3545;
}

.cart-notification-content {
    display: flex;
    align-items: center;
}

.cart-notification-content i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.cart-notification-success i {
    color: #28a745;
}

.cart-notification-error i {
    color: #dc3545;
}

/* Checkout section */
.cart-summary {
    margin-bottom: 15px;
}

/* Animation keyframes */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes flash {
    0% {
        background-color: #007bff;
    }
    50% {
        background-color: #28a745;
        transform: scale(1.1);
    }
    100% {
        background-color: #007bff;
    }
}
