#cart-panel {
    position: fixed;
    right: -850px;
    top: 0;
    width: 800px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.5) !important;
    transition: right 0.3s ease !important;
    z-index: 1000 !important;
}

#cart-panel h2 {
    border-bottom: 1px solid #e6e6e6;
    padding: 10px 0 25px 0;
}
#cart-panel.open {
    right: 0 !important; /* Position when the panel is open */
}

#cart-content {
    padding: 20px !important;
    width: 800px;
    max-width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

#cart-content .removeFromCart {
    font-size: 14px;
    font-weight: bold;
    color: #D13930;
}

#cart-content table {
    width: 100%;
}

#cart-content table .small-text,
#cartPanelSmall .small-text {
    font-size: 12px;
}

#cart-content table td,
#cart-content table table th {
    display: table-cell;
    vertical-align: top;
    padding: 15px 15px 30px 0;
    border-bottom: 1px #E8E8E8 solid;
}

#cart-content table table {
    width: 50%;
    display: inline-block;
    margin-bottom: 30px;
}

#cart-content table table > tbody {
    width: 100%;
    display: inline-table;
}

#cart-content table table td,
#cart-content table table th {
    padding: 15px 15px 15px 0;
}

#cart-content table table td {
    text-align: right;
    font-weight: bold;
}

#cart-content table table th {
    text-align: left;
    font-weight: normal;
}

#cart-panel .close-btn {
    position: absolute !important;
    top: 5px !important;
    left: -40px !important;
    background: none !important;
    border: none !important;
    font-size: 24px;
    cursor: pointer !important;
    font-family: FontAwesome,sans-serif,sans-serif;
    text-shadow:0 0 2px #000;
    transition:.2s;
    color: #fff;
}

#cart-panel-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    z-index: 999; /* Ensure it's below the cart panel but above other content */
    display: none; /* Initially hidden */
}

/* Show the backdrop when the cart panel is open */
#cart-panel.open + #cart-panel-backdrop {
    display: block;
}

#loading-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #333;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    z-index: 1001; /* Ensure it's above the backdrop and cart panel content */
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}


.tblCartPanelProducts .product_image { width: 80px; height: auto; }
.tblCartPanelProducts img { display: inline; }

.popover {
    width:300px;
}

.popover .popover-body {
    overflow-x: auto; /* Ensure horizontal overflow is handled */
}

#cartPanelSmall img { display: inline; }
#cartPanelSmall .product_req_price {
    margin-top:15px;
    font-weight: bold;
}
#cartPanelSmall .subtotal_price {
    border-top: 1px #e6e6e6 solid;
    font-weight: bold;
    padding: 10px 0 30px 0;
    margin-top: 15px;
}

#cartPanelSmall .subtotal_price .col-4 {
    text-align: right;
}

#cartPanelSmall .btn {
    width: 100%;
}

/* Styles for devices with a screen width of 800px or less */
@media screen and (max-width: 800px) {
    #cart-panel {
        width: 100%; /* Full width on smaller screens */
        left: -1000%; /* Adjust accordingly to hide off-screen */
    }

    #cart-panel.open {
        left: 0; /* Bring the panel fully into view when open */
    }

    #cart-panel .close-btn {
        position: absolute !important;
        top: 5px !important;
        right: 10px !important; /* Position inside the panel */
        left: auto !important;  /* Override left positioning */
        background: none !important;
        border: none !important;
        font-size: 24px;
        cursor: pointer !important;
        color: #333; /* Visible against a lighter background */
        z-index: 1001; /* Ensure it's above other content */
    }

    #cart_container {
    }
}

@media (max-width: 430px) {

    .tblCartPanelProducts table { width: 100%; }
    .tblCartPanelProducts,
    .tblCartPanelProducts thead,
    .tblCartPanelProducts tbody,
    .tblCartPanelProducts th,
    .tblCartPanelProducts td,
    .tblCartPanelProducts tr {
        display: block;
    }

    .tblCartPanelProducts tr {
        margin-bottom: 10px; /* Add space between rows */
    }

    .tblCartPanelProducts td {
        display: block !important;
        padding: 10px;
        border: none;
        border-bottom: 1px solid #ddd;
        position: relative;
    }

    .tblCartPanelProducts td * {
        display: block;
        margin-bottom: 5px; /* Space between each element */
    }

    .tblCartPanelProducts td div.qty_selector {
        display: inline-block;
    }

    .tblCartPanelProducts td::before {
        content: attr(data-label); /* Display the column label using data-label attribute */
        font-weight: bold;
        text-transform: uppercase;
        margin-right: 10px;
    }

    .tblCartPanelProducts .product_image {
        width: auto;
    }
}