/* ============================================
   POS MODULE STYLES
   ============================================ */

.pos-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--space-4);
    height: calc(100vh - 100px);
    /* Adjust based on header/nav */
    overflow: hidden;
}

/* Left Column: Products */
.pos-products-area {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    overflow: hidden;
    padding-right: var(--space-2);
}

.pos-header {
    flex-shrink: 0;
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-3);
    overflow-y: auto;
    padding-bottom: var(--space-4);
    padding-right: var(--space-2);
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.product-image {
    height: 100px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.product-image i {
    width: 32px;
    height: 32px;
}

.product-details {
    padding: var(--space-3);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-weight: 600;
    margin-bottom: var(--space-1);
    font-size: var(--font-size-sm);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-stock {
    font-size: 11px;
    margin-bottom: auto;
    font-weight: 500;
}

.product-price {
    font-weight: 700;
    color: var(--color-primary);
    margin-top: var(--space-2);
    font-size: var(--font-size-base);
}

/* Right Column: Cart */
.pos-cart-area {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.cart-header {
    padding: var(--space-3);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.client-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    cursor: pointer;
    margin-right: var(--space-3);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: background var(--transition-base);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.client-selector:hover {
    background: var(--bg-hover);
    border-color: var(--color-primary);
}

.client-info {
    display: flex;
    flex-direction: column;
}

.client-info .label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
}

.client-info .value {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-2);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-controls {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.qty-btn {
    border: none;
    background: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
}

.qty-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.qty-val {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: var(--font-size-xs);
}

.item-price {
    font-weight: 600;
    text-align: right;
    min-width: 70px;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.remove-btn {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-sm);
}

.cart-footer {
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.totals-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.total-highlight {
    font-weight: 700;
    font-size: var(--font-size-xl);
    color: var(--text-primary);
    margin-top: var(--space-3);
    margin-bottom: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px dashed var(--border-color);
}

.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    opacity: 0.5;
    text-align: center;
}

.empty-cart i {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-2);
    stroke-width: 1.5;
}

/* Modal styles for Checkout */
.total-display {
    background: var(--bg-tertiary);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.total-display .text-3xl {
    color: var(--color-success);
}