/* POS screen — spacing & layout fixes */

#main-content .sp-pos-layout {
    padding: 0 0.25rem 1.25rem;
}

#main-content .sp-pos-layout > .row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

#main-content .sp-pos-layout > .row > [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

#main-content .sp-pos-layout > .row:first-child {
    margin-bottom: 1rem;
}

#main-content .sp-pos-search {
    margin-bottom: 0;
}

#main-content .sp-pos-customer {
    margin-bottom: 0;
}

#main-content .sp-pos-layout > .row:nth-child(2) {
    margin-top: 0.25rem;
}

/* Product panel */
#main-content .sp-pos-products-panel {
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    min-height: 0;
}

#main-content .sp-pos-products-panel #gridbox {
    flex: 1 1 auto;
    min-height: 280px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1rem 1rem 0.75rem;
    margin: 0;
    background: var(--erp-bg);
    border-radius: 0;
}

#main-content .sp-pos-products-panel #gridbox hr {
    margin: 1rem 0;
    border-color: var(--erp-border);
}

#main-content .sp-pos-products-panel .quick-menu,
#main-content .sp-pos-products-panel #proContainer,
#main-content .sp-pos-products-panel #item-list {
    padding-bottom: 0.5rem;
}

#main-content .sp-pos-products-panel .pos-grid-nav {
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
    margin: 0;
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--erp-border);
    background: var(--erp-card);
    clear: both;
}

#main-content .sp-pos-products-panel .pos-grid-nav .btn-group {
    flex: 1;
    margin: 0;
}

#main-content .sp-pos-products-panel .pos-grid-nav .btn {
    width: 100%;
    min-height: 42px;
    border-radius: var(--erp-radius-sm);
}

#main-content button.product,
#main-content .btn-prni.product {
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 1;
}

#main-content #sticker {
    position: relative;
    z-index: 2;
    margin-bottom: 0.75rem;
}

/* Cart column */
#main-content .sp-pos-cart-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#main-content #left-middle {
    flex: 1 1 auto;
    min-height: 200px;
    margin-bottom: 0.75rem;
    padding: 0 0.15rem;
}

#main-content #product-list {
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-sm);
    overflow: hidden;
    background: var(--erp-card);
}

#main-content .sp-pos-checkout {
    padding: 0 0.15rem 0.5rem;
}

#main-content #totalTable {
    margin-top: 0 !important;
    margin-bottom: 1.25rem !important;
}

#main-content #totalTable td {
    padding: 0.65rem 0.9rem !important;
}

#main-content #totalTable .gtotals_tds {
    padding: 0.85rem 0.9rem !important;
}

#main-content #botbuttons {
    margin-top: 0;
    padding: 0 0 0.25rem;
}

#main-content #botbuttons > .row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0;
}

#main-content #botbuttons .col-md-6 {
    flex: 1 1 calc(50% - 0.375rem);
    max-width: none;
    padding: 0 !important;
}

#main-content #botbuttons .btn {
    width: 100%;
    min-height: 52px;
}

@media (max-width: 991px) {
    #main-content .sp-pos-layout > .row:nth-child(2) > [class*="col-"] {
        margin-bottom: 1rem;
    }

    #main-content .sp-pos-products-panel #gridbox {
        min-height: 320px;
        max-height: 55vh;
    }

    #main-content #botbuttons .col-md-6 {
        flex: 1 1 100%;
    }
}
