/* Floating Cart Button */
.floating-cart-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--primary, #d81b60);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 999;
    transition: transform 0.2s, background 0.3s;
}

.floating-cart-btn:hover {
    transform: scale(1.05);
    background: var(--dark, #222);
}

.floating-cart-btn .floating-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: white;
    color: var(--primary, #d81b60);
    border: 2px solid var(--primary, #d81b60);
    font-size: 0.8rem;
    font-weight: bold;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Flying Image Wrapper for Arc Animation */
.flying-image-wrapper {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    transition: transform 0.8s linear;
}

/* Flying Image Clone */
.flying-image-clone {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.3, -0.8, 0.7, 1), opacity 0.8s ease-in;
    transform-origin: center center;
}

/* Animations */
.animate-fly {
    animation: flyToCart 0.8s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

@keyframes flyToCart {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.1);
        opacity: 0;
    }
}

.cart-bounce {
    animation: bounceEffect 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceEffect {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Add to Cart Button States */
.btn-added {
    background-color: #2e7d32 !important;
    color: white !important;
    border-color: #2e7d32 !important;
}

/* Cart Modal Overlay */
.cart-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    justify-content: flex-end; /* Slide in from right or flex-end */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cart-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Slide Up/Side Panel */
.cart-modal-panel {
    background: white;
    width: 400px;
    max-width: 100%;
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

@media (max-width: 768px) {
    /* On mobile, slide up from bottom */
    .cart-modal-overlay {
        align-items: flex-end;
    }
    .cart-modal-panel {
        width: 100%;
        height: 70vh;
        transform: translateY(100%);
        border-radius: 15px 15px 0 0;
    }
}

.cart-modal-overlay.active .cart-modal-panel {
    transform: translateX(0);
}
@media (max-width: 768px) {
    .cart-modal-overlay.active .cart-modal-panel {
        transform: translateY(0);
    }
}

.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    border-bottom: 1px solid #eee;
}

.cart-modal-header h4 { margin: 0; }
.cart-modal-close {
    background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #555;
}

.cart-modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    position: relative;
}

/* Cart Items in Modal */
.ajax-cart-item {
    display: flex; gap: 1rem; margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #eee;
}
.ajax-cart-img {
    width: 70px; height: 70px; object-fit: cover; border-radius: 4px;
}
.ajax-cart-details { flex-grow: 1; }
.ajax-cart-footer { padding-top: 1rem; }
