.basket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.basket-tile {
    background-color: #e3f2fd;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.basket-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    background-color: #bbdefb;
}

.basket-tile h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.2em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.basket-tile h4::before {
    content: "🛒";
    font-size: 3em;
    line-height: 1;
    margin-bottom: 15px;
}

.basket-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.basket-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.basket-detail span:first-child {
    color: #666;
    font-weight: 500;
}

.basket-detail span:last-child {
    color: #333;
    font-weight: 500;
}

.savings-amount {
    color: #28a745;
    font-weight: bold;
    font-size: 1.5em;
}

.savings-amount.positive-savings {
    color: #28a745;
}

.savings-amount.negative-savings {
    color: #dc3545;
}

/* Basket header styles */
.basket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px;
}

.add-basket-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #2196F3;
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.add-basket-button:hover {
    background-color: #1976D2;
}

/* Basket popup styles */
.basket-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.basket-popup-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    position: relative;
    width: fit-content;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.basket-close-popup {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
}

.basket-close-popup:hover {
    color: #666;
}

.basket-actions {
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    margin-top: 20px;
    border-top: 1px solid #e9ecef;
}

.create-basket-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.create-basket-button:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.create-basket-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.create-basket-button::before {
    content: "🛒";
    font-size: 18px;
}

/* Basket Details Table Styles */
.basket-details-table {
    width: fit-content;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.basket-details-table th,
.basket-details-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.basket-details-table thead th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.basket-details-table th.product-info,
.basket-details-table td.product-info {
    background-color: #f8f9fa;
    border-right: 2px solid #e9ecef;
    width: fit-content;
    white-space: nowrap;
}

.basket-details-table td.price-cell {
    text-align: right;
    font-family: monospace;
    font-size: 0.9em;
    white-space: nowrap;
}

.basket-details-table td.price-cell.status-negative {
    background-color: #F28B82;
}

.basket-details-table td.price-cell.status-positive {
    background-color: #CCFF90;
}

.basket-details-table .current-supplier {
    position: relative;
    border-left: 3px solid #9e9e9e;
    border-right: 3px solid #9e9e9e;
}

.basket-details-table thead tr:first-child th.current-supplier {
    border-top: 3px solid #9e9e9e;
}

.basket-details-table tbody tr:last-child td.current-supplier {
    border-bottom: 3px solid #9e9e9e;
}

.basket-details-table .total-row {
    font-weight: bold;
    border-top: 2px solid #e0e0e0;
}

.basket-details-table .total-row .total-cell {
    font-size: 1.1em;
}

/* Supplier Matrix Table Styles */
.supplier-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
}

.supplier-matrix-container {
    max-height: 70vh;
    overflow: auto;
}

.supplier-matrix th,
.supplier-matrix td {
    padding: 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
    background: white;
}

.supplier-matrix thead th {
    position: sticky;
    top: 0;
    background: #f5f5f5;
    z-index: 1;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.supplier-matrix thead th:hover {
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    background: #f5f5f5;
    z-index: 4;
}

.supplier-matrix td:first-child {
    position: sticky;
    left: 0;
    background: #f5f5f5;
    text-align: left;
    z-index: 2;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.supplier-matrix td:first-child:hover {
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    background: #f5f5f5;
    z-index: 4;
}

.supplier-matrix td:last-child,
.supplier-matrix th:last-child {
    position: sticky;
    right: 0;
    background: #f5f5f5;
    z-index: 2;
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    padding: 0;
}

.supplier-matrix thead th:last-child {
    z-index: 3;
}

.supplier-matrix .cell-active {
    background-color: #e8f5e9;
}

.supplier-matrix .checkmark {
    color: #28a745;
    font-size: 1.2em;
}

.supplier-matrix td.product-selected {
    background-color: #28a745;
    color: white;
    font-weight: 500;
}

/* Add button styles */
.add-product-button {
    background-color: #2196F3;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    font-size: 20px;
    transition: background-color 0.2s ease;
}

.add-product-button:hover {
    background-color: #1976D2;
}

/* Quantity Selection Popup */
.quantity-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1100;
}

.quantity-popup-content {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    position: relative;
    width: 400px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

.quantity-popup-title {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

.quantity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quantity-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.product-name {
    flex: 1;
    margin-right: 15px;
    font-weight: 500;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background-color: #2196F3;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background-color 0.2s;
}

.quantity-btn:hover {
    background-color: #1976D2;
}

.quantity-input {
    width: 60px;
    height: 30px;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
}

.quantity-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.create-final-basket {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    transition: background-color 0.2s;
}

.create-final-basket:hover {
    background-color: #218838;
}