/* Cart Button in Header */
.header-cart-button {
    position: absolute;
    top: 60px;
    right: 60px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    z-index: 1000;
}

.header-cart-button i {
    font-size: 35px;
    color: white;
}

/* Add to Cart Button in Popup */
.add-to-cart-popup {
    display: block;
    margin: 20px auto 0;
    padding: 15px;
    background-color: #56008b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    text-align: center;
}

.add-to-cart-popup:hover {
    background-color: #6a0dad;
}

/* Cart Drawer Styles */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 30%;
    height: 100%;
    background-color: #0c031f;
    color: white;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: right 0.4s ease;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.cart-drawer.open {
    right: 0;
}

/* Cart Header */
.cart-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.cart-drawer-header h2 {
    margin: 0;
    font-size: 24px;
}

.close-cart {
    position: absolute;
    top: 5px; /* Align to the top */
    right: 15px; /* Align to the right */
    cursor: pointer;
    font-size: 35px;
    background: none;
    border: none;
    color: white;
    padding: 10px;
}

.close-cart:hover {
    color: #ff0000;
}

/* Cart Content */
.cart-content {
    padding-top: 10px;
    margin-bottom: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Individual Cart Item */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #444;
}

.cart-item img {
    width: 70px; /* Increased size */
    height: 70px; /* Increased size */
    object-fit: cover;
    border-radius: 5px;
}

.cart-item-info {
    flex-grow: 1;
    padding-left: 10px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-item-info h4 {
    margin: 0;
    font-size: 18px;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    background-color: white; /* Added white background */
    padding: 2px 5px;
    border-radius: 5px;
}

.quantity-selector button {
    background-color: #56008b;
    color: white;
    border: none;
    border-radius: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-selector button:hover {
    background-color: #6a0dad;
}

.quantity-selector .quantity {
    margin: 0 10px;
    font-size: 18px;
    font-weight: bold;
    color: #0c031f; /* Darker text for better contrast */
}

.cart-item .remove-item {
    font-size: 25px;
    cursor: pointer;
    background: white;
    border: none;
    color: red;
    padding: 1px 7px;
    border-radius: 9px;
    margin-left: 40px;
}

.remove-item:hover {
    background-color: red;
    color: white;
}

/* Cart Footer */
.cart-footer {
    margin-top: auto; /* Pushes footer to the bottom */
    background-color: #0c031f;
    padding: 10px 0;
}

.cart-footer .total-cost {
    font-size: 18px;
    text-align: right;
    padding-right: 20px;
    margin-bottom: 10px;
}

.cart-footer button {
    width: 100%;
    padding: 15px;
    background-color: #56008b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    text-align: center;
}

.cart-footer button:hover {
    background-color: #6a0dad;
}

/* Mobile View Adjustments */
@media (max-width: 767px) {
    .cart-drawer {
        width: 100%;
    }

    .header-cart-button {
        position: absolute;
        top: 45px;
        right: 40px;
        background-color: transparent;
        border: none;
        cursor: pointer;
        z-index: 1000;
    }
    
    .header-cart-button i {
        font-size: 30px;
        color: white;
    }

    .cart-item .remove-item {
        margin-left: 15px;
    }
}
