/* General body styling for dark mode and Inter font */
body {
    font-family: 'Inter', sans-serif;
    background-color: #121212;
    color: #e0e0e0;
}

/* Global container for content, max-width to prevent stretching on large screens */
.container-fluid {
    max-width: 1200px;
}

/* Custom card styling with dark background, border, and hover effect */
.custom-card {
    background-color: #1e1e1e;
    border: 1px solid #333;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.custom-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Custom button styling to match the brand's pink and dark themes */
.custom-btn-primary {
    background-color: #fca5a5;
    color: #1a202c;
    border-color: #fca5a5;
    transition: background-color 0.2s, border-color 0.2s;
}
.custom-btn-primary:hover {
    background-color: #f87171;
    border-color: #f87171;
}
.custom-btn-secondary {
    background-color: #333;
    color: #e0e0e0;
    border-color: #333;
    transition: background-color 0.2s, border-color 0.2s;
}
.custom-btn-secondary:hover {
    background-color: #4a4a4a;
    border-color: #4a4a4a;
}
.custom-btn-danger {
    background-color: #ef4444;
    color: #fff;
    border-color: #ef4444;
}
.custom-btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
}

/* Loading spinner animation */
.loading {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #fca5a5;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Specific styling for shopping cart items */
.cart-item-card {
    background-color: #2a2a2a;
}

/* Class for the selected delivery date button */
.delivery-btn-selected {
    background-color: #fca5a5;
    color: #1a202c;
    border: 2px solid #f87171;
}

/* Custom scrollbar styles for a better look in dark mode */
.custom-scroll::-webkit-scrollbar {
    width: 8px;
}
.custom-scroll::-webkit-scrollbar-track {
    background: #1e1e1e;
}
.custom-scroll::-webkit-scrollbar-thumb {
    background-color: #4a4a4a;
    border-radius: 4px;
}
.btn.show {
    color: white !important;
}

/* Floating Checkout Button */
#floating-checkout-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    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.3);
}

/* Animation for when an item is added to the cart */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* New animation for flying item to basket */
@keyframes fly-to-cart {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0.2);
        opacity: 0.5;
    }
}

.flying-item {
    position: fixed;
    z-index: 999;
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    animation: fly-to-cart 0.8s forwards;
}

/* Hide the regular cart section on small screens and the floating button on larger ones */
@media (max-width: 767.98px) {
    #cart-section {
        display: none;
    }
    #floating-checkout-btn.d-none {
        display: flex !important;
    }
    .dropdown-menu {
        width: 100%;
    }
}
@media (min-width: 768px) {
    #floating-checkout-btn {
        display: none !important;
    }
}
.add-to-cart-btn[disabled] {
    background-color: #3e3e3e;
    color: #9e9e9e;
    cursor: not-allowed;
    border-color: #3e3e3e;
}

.sticky-top-cart {
    /* Half transparent dark grey background */
    background-color: rgba(30, 30, 30, 0.5); 
    
    padding: .5em;
    
    /* Ensure the element is sticky or fixed */
    position: sticky; 
    top: 0;
    z-index: 1010; /* Higher than regular content but lower than modals (z-index 1050/1051 [3, 4]) */
    
    /* (Optional: Add blur effect for modern sticky header) */
    backdrop-filter: blur(5px);
}