/* General Reset and Box Sizing */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Main Container for the Entire Layout */
.container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden; /* Prevent overflow outside the viewport */
}

/* Left Panel - Cart and Delivery Rate Section */
.left-panel {
    width: 25%;
    background-color: #f0f0f0;
    padding: 20px;
    overflow-y: auto;
}

/* Right Panel - Items Section */
.right-panel {
    width: 75%;
    padding: 20px;
    overflow-y: auto;
}

/* Responsive Items Container in Grid */
#items-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 20px;
    background-color: #fff;
    overflow-y: scroll; /* Add overflow-y: scroll for separate scrollbar */
    width: 75%; /* Set the width to 75% */
    height: 100vh; /* Set the height to 100% of viewport height */
    position: absolute;
    right: 0; /* Position it to the right */
    top: 0;
}

/* Styling Individual Item Cards */
.item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background-color: #e0e0e0;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-sizing: border-box;
}

/* Images Inside Item Cards */
.item-card img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

/* Form Inside Item Card */
.item-card form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Item Details Section */
.item-details {
    text-align: center;
    margin-top: 10px;
}

.item-details label {
    width: 150px;
    display: inline-block;
    margin: 5px 0;
}

.item-details input[type="number"],
.item-details select {
    width: 150px;
    margin: 5px 0;
}

.item-details h3 {
    margin: 10px 0;
    font-size: 20px;
    font-weight: bold;
}

.item-details p {
    margin: 5px 0;
    color: #555;
    font-size: 16px;
}

/* Cart Section Styling */
.cart {
    flex: 0 0 25%; /* Set the width to 25% and fix the size */
    height: 100vh;
    background-color: #f8f8f8;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Cart Header */
.cart-header, h2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: bold;
}

/* Cart Table Styling */
.cart-table {
    width: 25%; /* Ensure the table takes the full width */
    border-collapse: collapse;
    margin: 10px 0;
    flex-grow: 1; /* Allows the table to grow and fill the available space */
}

.cart-table th, 
.cart-table td {
    padding: 0px;
    border: 1px solid #ddd;
    text-align: left;
    font-size: 15px;
}

/* Receipt Table */
.receipt-table {
     width: 25%; /* Ensure the table takes the full width */
    border-collapse: collapse;
    margin: 10px 0;
    flex-grow: 1; /* Allows the table to grow and fill the available space */
}

.receipt-table th, 
.receipt-table td {
    padding: 0px;
    border: 1px solid #ddd;
    text-align: left;
    font-size: 15px;
}

/* Buttons at the Bottom of the Cart */
.cart-buttons {
    margin-top: auto; /* Pushes the buttons to the bottom of the cart section */
    text-align: center;
    padding-top: 10px;
}

/* Additional Styles for Responsive Design */
@media (max-width: 768px) {
    .cart {
        flex: 0 0 100%; /* Full width on smaller screens */
        height: auto; /* Auto height to accommodate content */
    }
}

button, input, select {
    padding: 12px 18px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    margin: 5px;
}

button:hover {
    background-color: #ddd;
}

/* Reset Button Styling */
.reset-button {
    background-color: #ff4d4d;
    color: white;
    border: none;
    border-radius: 5px;
}

.reset-button:hover {
    background-color: #ff1a1a;
}

/* Print Button Styling */
.print-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    margin-top: 20px;
}

.print-button:hover {
    background-color: #45a049;
}

/* Responsive Layout Adjustments */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    #items-container {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .left-panel, .right-panel {
        width: 100%;
    }
}

/* Tablet Responsive Adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    #items-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .item-card {
        padding: 25px;
        max-width: 240px;
    }

    .item-details h3 {
        font-size: 22px;
    }

    .item-details p {
        font-size: 18px;
    }
}
