.pos-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: calc(100vh - 110px);
}

.products-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    overflow-y: auto;
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 18px;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 14px 50px 14px 50px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.btn-clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-clear-search:hover {
    background: var(--danger);
}

.search-results {
    margin-bottom: 15px;
    padding: 12px 16px;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.search-results-header {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
}

.categories-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.category-tab {
    padding: 12px 24px;
    border: 2px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 48px;
}

.category-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.product-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.product-card:active {
    transform: translateY(0);
}

.product-card.highlight {
    animation: highlightPulse 0.5s ease;
}

@keyframes highlightPulse {
    0%, 100% {
        background-color: white;
    }
    50% {
        background-color: #dbeafe;
    }
}

.product-code {
    font-size: 11px;
    color: var(--text-light);
    background: var(--light);
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.product-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--dark);
    margin-bottom: 8px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.cart-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 90px;
    height: fit-content;
    max-height: calc(100vh - 110px);
}

.cart-header {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    max-height: calc(100vh - 450px);
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 13px;
    color: var(--text-light);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: var(--light);
    border-color: var(--primary);
}

.qty-value {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.cart-item-subtotal {
    font-weight: 700;
    color: var(--primary);
    min-width: 70px;
    text-align: right;
}

.btn-remove {
    width: 36px;
    height: 36px;
    border: 1px solid var(--danger);
    background: white;
    color: var(--danger);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: var(--danger);
    color: white;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}

.cart-total {
    padding: 20px 0;
    border-top: 2px solid var(--border);
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.total-label {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.total-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.payment-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 1024px) {
    .pos-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .cart-section {
        position: relative;
        top: 0;
        max-height: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-card {
        min-height: 120px;
    }
    
    .modal-content {
        padding: 24px;
    }
}
