/* Public CSS */
.vs-pos-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.vs-pos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
}

.vs-pos-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.vs-pos-branch-selector {
    display: flex;
    align-items: center;
}

.vs-pos-branch-selector label {
    margin-right: 10px;
    font-weight: 500;
}

.vs-pos-branch-selector select {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background-color: #fff;
}

.vs-pos-main {
    display: flex;
    flex-wrap: wrap;
    padding: 15px;
    gap: 20px;
}

.vs-pos-products {
    flex: 2;
    min-width: 300px;
}

.vs-pos-products-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 10px;
}

.vs-pos-search {
    display: flex;
    flex: 1;
}

.vs-pos-search input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px 0 0 4px;
}

.vs-pos-search button {
    padding: 8px 15px;
    background-color: #4299e1;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.vs-pos-search button:hover {
    background-color: #3182ce;
}

.vs-pos-categories select {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background-color: #fff;
}

.vs-pos-products-grid {
    display: grid;
    gap: 15px;
}

.vs-pos-products-grid.grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.vs-pos-products-grid.list {
    grid-template-columns: 1fr;
}

.vs-product-item {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

.vs-product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.vs-product-image {
    height: 150px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f7fafc;
}

.vs-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.vs-product-details {
    padding: 12px;
    flex: 1;
}

.vs-product-name {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

.vs-product-sku {
    font-size: 12px;
    color: #718096;
    margin-bottom: 8px;
}

.vs-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.vs-product-stock {
    font-size: 12px;
    color: #718096;
}

.vs-product-actions {
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background-color: #f8f9fa;
}

.vs-add-to-cart {
    width: 100%;
    padding: 8px 12px;
    background-color: #48bb78;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.vs-add-to-cart:hover {
    background-color: #38a169;
}

.vs-pos-pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.vs-pos-pagination button {
    padding: 8px 12px;
    margin: 0 5px;
    background-color: #edf2f7;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
}

.vs-pos-pagination button.active {
    background-color: #4299e1;
    color: white;
    border-color: #4299e1;
}

.vs-pos-cart {
    flex: 1;
    min-width: 300px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
}

.vs-pos-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8f9fa;
}

.vs-pos-cart-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.vs-pos-cart-actions button {
    padding: 6px 10px;
    background-color: #f56565;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.vs-pos-cart-actions button:hover {
    background-color: #e53e3e;
}

.vs-pos-cart-items {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    max-height: 300px;
}

.vs-empty-cart {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
}

.vs-cart-table {
    width: 100%;
    border-collapse: collapse;
}

.vs-cart-table th {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 500;
    color: #4a5568;
}

.vs-cart-table td {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.vs-cart-quantity {
    width: 50px;
    padding: 4px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    text-align: center;
}

.vs-remove-from-cart {
    padding: 4px 8px;
    background-color: #f56565;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.vs-remove-from-cart:hover {
    background-color: #e53e3e;
}

.vs-pos-cart-totals {
    padding: 15px;
    border-top: 1px solid #e2e8f0;
    background-color: #f8f9fa;
}

.vs-pos-cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.vs-pos-cart-total:last-child {
    margin-bottom: 0;
}

.vs-total-label {
    font-weight: 500;
    color: #4a5568;
}

.vs-total-value {
    font-weight: 500;
}

.vs-grand-total {
    font-size: 18px;
    font-weight: 700;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.vs-pos-checkout {
    padding: 15px;
    border-top: 1px solid #e2e8f0;
}

.vs-pos-client, .vs-pos-prescription, .vs-pos-payment, .vs-pos-payment-reference, .vs-pos-notes {
    margin-bottom: 15px;
}

.vs-pos-client label, .vs-pos-prescription label, .vs-pos-payment label, .vs-pos-payment-reference label, .vs-pos-notes label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #4a5568;
}

.vs-client-search-container {
    position: relative;
}

.vs-client-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #cbd5e0;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.vs-client-search-results ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vs-client-search-results li {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
}

.vs-client-search-results li:last-child {
    border-bottom: none;
}

.vs-client-search-results li:hover {
    background-color: #edf2f7;
}

.vs-selected-client {
    margin-top: 10px;
}

.vs-selected-client p {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #edf2f7;
    border-radius: 4px;
    margin: 0;
}

.vs-selected-client button {
    background: none;
    border: none;
    color: #f56565;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin-left: 10px;
}

.vs-pos-prescription {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.vs-pos-prescription input {
    flex: 1;
}

.vs-pos-prescription button {
    padding: 8px 15px;
    background-color: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.vs-pos-prescription button:hover {
    background-color: #3182ce;
}

.vs-pos-client input, .vs-pos-prescription input, .vs-pos-payment select, .vs-pos-payment-reference input, .vs-pos-notes textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background-color: #fff;
}

.vs-pos-notes textarea {
    height: 80px;
    resize: vertical;
}

.vs-pos-checkout-actions {
    margin-top: 20px;
    text-align: center;
}

.vs-checkout-button {
    width: 100%;
    padding: 12px 20px;
    background-color: #48bb78;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.vs-checkout-button:hover {
    background-color: #38a169;
}

.vs-checkout-button:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
}

.vs-pos-receipt-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.vs-pos-receipt-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.vs-pos-receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.vs-pos-receipt-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.vs-close-receipt {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #a0aec0;
}

.vs-close-receipt:hover {
    color: #4a5568;
}

.vs-pos-receipt-body {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.vs-pos-receipt-footer {
    padding: 15px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
}

.vs-pos-receipt-footer button {
    padding: 8px 15px;
    background-color: #4299e1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.vs-pos-receipt-footer button:hover {
    background-color: #3182ce;
}

.vs-pos-receipt-footer button#vs-new-sale {
    background-color: #48bb78;
}

.vs-pos-receipt-footer button#vs-new-sale:hover {
    background-color: #38a169;
}

/* Responsive styles */
@media (max-width: 768px) {
    .vs-pos-main {
        flex-direction: column;
    }
    
    .vs-pos-products, .vs-pos-cart {
        width: 100%;
    }
    
    .vs-pos-products-header {
        flex-direction: column;
    }
    
    .vs-pos-products-grid.grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .vs-pos-receipt-content {
        width: 95%;
    }
}
