:root {
    scroll-behavior: smooth;
    --primary-color: rgb(25,135,84,1);
    --second-color: #8cc63e;
  }

/* Cart Icon Styles */
.cart-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--second-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 9999999;
}

.cart-icon:hover {
    transform: scale(1.1);
    background-color: var(--primary-color);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e67e22;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Cart Sidebar Styles */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Start off-screen */
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background-color: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 999999;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0; /* Slide in */
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

.cart-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.close-cart {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #777;
    transition: color 0.3s ease;
}

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

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.empty-cart-message {
    text-align: center;
    color: #777;
    padding: 30px 0;
}

.error-message {
    text-align: center;
    color: #e74c3c;
    padding: 20px 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.cart-item-details p {
    margin: 5px 0;
    color: #777;
    font-size: 14px;
}

.item-quantity {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.item-quantity span {
    margin-right: 10px;
    color: #777;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.qty-btn:hover {
    background-color: #e9e9e9;
}

.qty-input {
    width: 40px;
    height: 28px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    margin: 0 5px;
    font-size: 14px;
}

.cart-item-price {
    font-weight: bold;
    color: #4a90e2;
    margin: 0 15px;
}

.remove-item {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px;
}

.remove-item:hover {
    color: #c0392b;
}

.cart-total {
    padding: 20px;
    border-top: 1px solid #eee;
    font-size: 18px;
    font-weight: bold;
    text-align: right;
    color: #333;
}

.cart-actions {
    padding: 0 20px 20px 20px;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.checkout-btn:hover {
    background-color: #219653;
}

/* Animation for cart items */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item {
    animation: fadeIn 0.3s ease forwards;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
    }
    
    .cart-icon {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
}