.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-drawer.open {
    right: 0;
}

.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

.cart-drawer-overlay.open {
    display: block;
}

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

.cart-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-drawer-footer {
    padding: 1rem;
    border-top: 1px solid #eee;
}

.cart-drawer .cart-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f5f5f5;
}

.cart-drawer .cart-item-body {
    width: 100%;
}

.cart-note {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.cart-note textarea {
    width: 100%;
    border: 1px solid #eee;
    padding: 0.5rem;
    resize: none;
    height: 80px;
}

.cart-drawer .icon-x {
    color: #999;
}

.cart-drawer .icon-x:hover {
    color: #dc3545;
}

/* Quantity controls */
.cart-item-quantity {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.cart-item-quantity button {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    border: none;
    font-weight: bold;
}

.cart-item-quantity input {
    width: 40px;
    height: 28px;
    text-align: center;
    border: 1px solid #eee;
    margin: 0 0.25rem;
}

.cart-icon-container {
    position: relative;
    display: inline-block;
}

/* ---------------------- */

/* Base styling for cart badge */
.cart-badge {
    position: absolute;
    min-width: 10px;
    height: 10px;
    line-height: 10px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    text-align: center;
    padding: 0 4px;
    font-weight: bold;
    display: none;
}

/* Desktop positioning */
@media (min-width: 992px) {
    .cart-badge {
        top: 24px;
        right: 12px;
    }

    #navbarDropdown-8 {
        position: relative;
    }
}

/* Mobile positioning */
@media (max-width: 991px) {
    .cart-badge {
        top: 8px;
        /*left: -0.8rem;*/
    }

    /* Mobile menu cart icon */
    #navbarMenuMobile .icon-shopping-bag {
        position: relative;
    }

    #navbarMenuMobile .cart-badge {
        top: -5px;
        right: -5px;
    }
}

/* Additional mobile header adjustments */
#navbarMenuMobile li {
    position: relative;
}

/* Fix for drawer style compatibility */
.cart-drawer-header h3 {
    margin-right: 20px;
}

/* ---------------------- */

/* Position the badge relative to icon-shopping-bag */
.icon-shopping-bag {
    position: relative;
}

/* For mobile */
#navbarMenuMobile .icon-shopping-bag {
    position: relative;
}

#navbarMenuMobile .cart-badge {
    top: 2px;
    right: 2px;
    /*display: block;*/
}

#navbarDropdown-8 {
    position: relative;
}