/* assets/css/mobile-pos.css */
:root {
    --pos-green: #006400;
    --pos-green-dark: #004d00;
    --pos-bg: #f5f5f5;
    --pos-card-bg: #ffffff;
    --pos-text: #333;
    --pos-border: #e0e0e0;
    --pos-danger: #ff4747;
    --pos-primary: #006400; /* Matching the image's primary green */
    --pos-secondary: #007bff;
    --pos-accent: #ffc107;
    --pos-ongoing: #cc0000;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--pos-bg);
    color: var(--pos-text);
    overflow: hidden; /* We'll use internal scrolling */
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Section */
.pos-header {
    background-color: var(--pos-green);
    color: white;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
}

.pos-search-container {
    padding: 10px;
    background-color: white;
    display: flex;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid var(--pos-border);
}

.pos-search-input {
    flex: 1;
    border: 1px solid var(--pos-border);
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 16px;
    outline: none;
    background: #fdfdfd;
}

.btn-add-item {
    background-color: white;
    border: 2px solid var(--pos-green);
    color: var(--pos-green);
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
}

/* Cart / Selected Items Section */
.pos-cart-section {
    flex-shrink: 0;
    max-height: 45vh; /* Allow it to grow but don't hide everything else */
    overflow-y: auto;
    background: white;
    border-bottom: 2px solid #eee;
}

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

.pos-table th {
    background: var(--pos-green);
    color: white;
    text-align: left;
    padding: 8px;
    font-size: 12px;
}

.pos-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.item-name-cell {
    font-weight: 600;
    font-size: 13px;
    max-width: 120px;
}

.item-variant {
    font-size: 11px;
    color: #888;
    display: block;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f8f8;
    border-radius: 6px;
    padding: 4px;
}

.btn-qty {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
}

.qty-val {
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.btn-delete {
    color: var(--pos-danger);
    cursor: pointer;
    font-size: 16px;
}

/* Action Buttons Grid */
.pos-actions-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 10px;
    background: white;
}

.btn-action {
    padding: 8px;
    border-radius: 6px;
    border: none;
    color: white;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

.btn-online { background-color: var(--pos-green); }
.btn-ongoing { background-color: var(--pos-ongoing); }
.btn-qrcode { background-color: var(--pos-secondary); }
.btn-more { background-color: #d35400; }

/* Category Scroll */
.pos-categories {
    display: flex;
    overflow-x: auto;
    padding: 10px;
    gap: 10px;
    background: white;
    border-top: 1px solid #eee;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.pos-categories::-webkit-scrollbar {
    display: none;
}

.category-tab {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 12px;
    white-space: nowrap;
    background: white;
    color: #666;
    cursor: pointer;
}

.category-tab.active {
    background-color: var(--pos-green);
    color: white;
    border-color: var(--pos-green);
}

.pos-products-grid {
    flex: 1;
    overflow-y: auto;
    background: white;
    width: 100%;
}

.product-list-item:active {
    background-color: #e9ecef !important;
}

.product-list-img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    background: #f8fafc;
    border: 1px solid #eee;
}

.product-list-info {
    flex: 1;
}

.product-list-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    display: block;
    margin-bottom: 2px;
}

.product-list-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--pos-green);
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.product-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #eee;
}

.product-info {
    padding: 8px;
}

.product-title {
    font-size: 11px;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
    height: 2.4em;
    overflow: hidden;
    line-height: 1.2;
}

.product-variant {
    font-size: 9px;
    color: #888;
}

.product-price {
    font-size: 12px;
    font-weight: 800;
    color: var(--pos-green);
    display: block;
    margin-top: 4px;
}

/* Footer Section */
.pos-footer {
    background: white;
    padding: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.grand-total-bar {
    background-color: var(--pos-green);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 800;
    font-size: 18px;
}

.bottom-actions {
    display: flex;
    padding: 8px;
    gap: 8px;
    background: #1e1e1e;
}

.btn-bottom-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-calc { background-color: var(--pos-secondary); }
.btn-clear { background-color: var(--pos-danger); }

.btn-bottom-main {
    flex: 1;
    height: 48px;
    border-radius: 8px;
    border: none;
    color: black; /* yellow and green buttons have black text usually or white, but in image it looks dark/white */
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.btn-quick-order {
    background-color: #2ecc71;
    color: white;
}

.btn-place-order {
    background-color: #f1c40f;
    color: black;
}

/* Responsive fixes */
@media (max-width: 400px) {
    .pos-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
