/* =========================================================
   FINIX POS
   BLACK + SILVER THEME
   ========================================================= */

.pos-page {
    color: #e7e9eb;
}


/* =========================================================
   HEADER
   ========================================================= */

.pos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 4px 20px;
    border-bottom: 1px solid #292d32;
}

.pos-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border: 1px solid #777d84;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: #f1f2f3;
    background: linear-gradient( 145deg, #3a3e43, #111316 );
    box-shadow: inset 0 1px 1px rgba(255,255,255,.18), 0 4px 15px rgba(0,0,0,.4);
}

.pos-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #f2f3f4;
}

.pos-subtitle {
    margin-top: 2px;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #858b92;
}


/* =========================================================
   CUSTOMER
   ========================================================= */

.register-status {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.customer-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #858b92;
    font-weight: 600;
}

.pos-customer-combobox {
    width: 245px;
}


    /* Fluent UI Combobox */



        .pos-customer-combobox::part(control):hover {
            border-color: #858b92;
        }


/* =========================================================
   CATEGORY BAR
   ========================================================= */

.category-wrapper {
    margin-top: 18px;
    margin-bottom: 20px;
    padding: 10px;
    border: 1px solid #272b30;
    border-radius: 10px;
    overflow-x: auto;
}

.category-tabs {
    display: flex;
    gap: 7px;
/*    min-width: max-content;*/
    flex-wrap: wrap;
}


/* category buttons */

.category-tab {
    background: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #d5d9dd !important;
}

    .category-tab:hover {
        background: #25292e !important;
        color: #f2f3f4 !important;
        border-color: #72777d !important;
        transform: translateY(-1px);
    }

    .category-tab.selected {
        background: #181b1f !important;
        color: #ffffff !important;
        border-color: #181b1f !important;
        font-weight: 700;
        box-shadow: 0 3px 10px rgba(0, 0, 0, .15);
    }

        .category-tab.selected::part(control) {
            background: #181b1f !important;
            color: #ffffff !important;
            border-color: #181b1f !important;
        }

    .category-tab::part(control) {
        background: #ffffff !important;
        color: #333333 !important;
        border-color: #d5d9dd !important;
    }

    .category-tab:hover::part(control) {
        background: #eeeeee !important;
        color: #222222 !important;
    }


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.pos-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 20px;
    align-items: start;
}


/* =========================================================
   PRODUCTS
   ========================================================= */

.products-section {
    min-width: 0;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 14px;
}

.section-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #747a81;
}

.products-header h2 {
    margin: 2px 0 0;
    font-size: 20px;
    font-weight: 600;
    color: #82817f;
}

.product-count {
    padding: 5px 10px;
    border: 1px solid #30343a;
    border-radius: 20px;
    font-size: 11px;
    color: #9da3a9;
    background: #121519;
}


/* =========================================================
   PRODUCT GRID
   ========================================================= */

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 15px !important;
}


/* =========================================================
   PRODUCT CARD
   ========================================================= */


/*.products-section {
    max-height: calc(100vh - 135px);
    overflow-y: auto;
    overflow-x: hidden;
    align-content: flex-start;
    padding-right: 15px !important;
}*/

    ::-webkit-scrollbar {
        width: 6px;
    }

    ::-webkit-scrollbar-track {
        background: #eeeeee;
        border-radius: 10px;
    }

    ::-webkit-scrollbar-thumb {
        background: #9da2a7;
        border-radius: 10px;
    }

        ::-webkit-scrollbar-thumb:hover {
            background: #70757a;
        }

.product-wrapper {
    min-width: 0;
}

.product-card {
    position: relative;
    min-height: 205px;
    max-height: 260px;
    padding: 18px !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /*    background: linear-gradient( 145deg, #1b1e22, #111316 ) !important;*/
    border: 1px solid #30343a !important;
    border-radius: 12px !important;
    box-shadow: 0 5px 18px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.035);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

    .product-card:hover {
        transform: translateY(-4px);
        border-color: #737980 !important;
        box-shadow: 0 12px 30px rgba(0,0,0,.5), 0 0 20px rgba(200,205,210,.045);
    }

.pos-selector-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    border: 1px solid #272b30;
    border-radius: 10px;
    padding: 10px 14px;
}

/* ===== Customer Selector Card ===== */
.pos-selector-box {
    flex: 1;
    min-width: 260px;
    max-width: 500px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e4e8;
    border-radius: 12px;
    padding: 8px 14px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    position: relative;
    z-index: 1;
}
.pos-selector-box:hover {
    border-color: #c0c4cc;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
    transform: translateY(-1px);
}
.pos-selector-box:focus-within {
    border-color: #6b7280;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.15);
}

.pos-selector-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #2b2f36, #4a4f58);
    border-radius: 10px;
    flex-shrink: 0;
}
    .pos-selector-icon svg,
    .pos-selector-icon fluent-icon {
        color: #d9dade; /* silver icon on dark chip */
        fill: #fff !important;
    }

.pos-selector-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.pos-selector-label {
    font-size: 10.5px;
    font-weight: 700;
    color: #8a8f98;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 2px;
}
.pos-selector-combobox {
    width: 100%;
    background: #ececec;
    padding: 0 5px;
}
.pos-selector-combobox::part(control) {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    font-size: 14.5px;
    font-weight: 600;
    color: #1f2328;
}

/* Add-customer button */
#btnAddCustomers {
    border-radius: 10px !important;
    background: linear-gradient(135deg, #2b2f36, #4a4f58) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#btnAddCustomers:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* ===== Right-side action buttons ===== */
.cst-button {
    display: flex;
    gap: 10px;
}
#btnGoDashboard,
#btnCancelReset {
    border-radius: 10px !important;
    padding: 10px 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.2px;
    background: linear-gradient(135deg, #24272d, #3a3e46) !important;
    border: 1px solid #4a4f58 !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
#btnGoDashboard:hover,
#btnCancelReset:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, #3a3e46, #545a64) !important;
}
.cart-box .pos-selector-row {
    margin: 16px 12px 12px;
    border: none;
    padding: 0;
}

.cart-box .pos-selector-box {
    max-width: 100%;
    min-width: 0; 
    width: 100%;
    box-sizing: border-box;
}

.cart-box .pos-selector-content {
    min-width: 0; 
}

.cart-box .pos-selector-combobox {
    width: 100%;
    min-width: 0;
}   

/* =========================================================
   PRODUCT AVATAR
   ========================================================= */

.product-avatar {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 10px;
    background: linear-gradient( 145deg, #d5d8da, #777d83 );
    color: #0b0c0e;
    font-size: 17px;
    font-weight: 800;
    box-shadow: inset 0 1px 2px rgba(255,255,255,.5), 0 5px 12px rgba(0,0,0,.35);
}


/* =========================================================
   PRODUCT NAME
   ========================================================= */

.product-name {
    width: 100%;
    min-height: 38px;
    font-size: 14px;
    font-weight: 600;
    color: #82817f;
    line-height: 1.35;
    overflow: hidden;
}


/* =========================================================
   PRODUCT PRICE
   ========================================================= */

.product-price {
    margin-top: 8px;
    font-size: 18px;
    font-weight: 700;
    color: #82817f;
    letter-spacing: .3px;
}

    .product-price span {
        margin-right: 3px;
        font-size: 10px;
        font-weight: 500;
        color: #858b92;
    }


/* =========================================================
   ADD BUTTON
   ========================================================= */

.primary-btn {
    width: 100%;
    min-height: 37px;
    margin-top: auto;
    border-radius: 7px !important;
    background: #181b1f !important;
    border: 1px solid #181b1f !important;
    color: #ffffff !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: 1px;
    transition: all .2s ease;
}

    /* Fluent UI internal button */
    .primary-btn::part(control) {
        background: #181b1f !important;
        border: 1px solid #181b1f !important;
        color: #ffffff !important;
    }

    .primary-btn:hover::part(control) {
        background: #33373b !important;
        border-color: #33373b !important;
        color: #ffffff !important;
    }

/* =========================================================
   CART
   ========================================================= */

.cart-section {
    position: sticky;
    top: 15px;
}

.cart-box {
    min-height: 560px;
    display: flex;
    flex-direction: column;
/*    background: linear-gradient( 145deg, #171a1e, #0e1012 );*/
    border: 1px solid #363a40;
    border-radius: 13px;
/*    overflow: hidden;*/
    box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04);
}




/* =========================================================
   CART HEADER
   ========================================================= */

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #2c3035;
}

.cart-title {
    margin: 3px 0 0;
    font-size: 20px;
    font-weight: 600;
    color: #30343a;
}

.cart-count {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #d3d6d9;
    color: #0b0c0e;
    font-size: 12px;
    font-weight: 800;
}


/* =========================================================
   CART ITEMS
   ========================================================= */

.cart-height {
    flex: 1;
    min-height: 250px; 
    max-height: 250px;
    overflow-y: auto;
    padding: 10px 15px;
}

    




/* cart item */

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 5px;
    border-bottom: 1px solid #272b30 !important;
    background: #ececec;
    margin-bottom: 5px;
    border-radius: 9px !important;
}

    .cart-item:last-child {
        border-bottom: none;
    }

.cart-item-avatar {
    width: 35px;
    height: 35px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #292d32;
    color: #cfd2d5;
    font-size: 11px;
    font-weight: 700;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #30343a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-meta {
    margin-top: 3px;
    font-size: 10px;
    color: #30343a;
}

.cart-item-price {
    font-size: 12px;
    font-weight: 700;
    color: #30343a;
}


/* =========================================================
   EMPTY CART
   ========================================================= */

.empty-cart {
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #70767c;
    font-size: 12px;
}

.empty-cart-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border: 1px solid #3b4046;
    border-radius: 50%;
    font-size: 22px;
    color: #858b92;
}

.empty-cart small {
    margin-top: 4px;
    color: #555b61;
}


/* =========================================================
   CART FOOTER
   ========================================================= */

.cart-footer {
    padding: 18px;
    border-top: 1px solid #30343a;
/*    background: rgba(0,0,0,.12);*/
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
    color: #30343a;
}

    .total-row strong {
        color: #30343a;
        font-weight: 600;
    }

.total-divider {
    height: 1px;
    margin: 14px 0;
    background: #363a40;
}


.cart-item-quantity {
    color: #82817f;
}

/* =========================================================
   GRAND TOTAL
   ========================================================= */

.grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

    .grand-total span {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: #82817f;
    }

    .grand-total small {
        display: block;
        margin-top: 3px;
        font-size: 9px;
        color: #666c72;
    }

    .grand-total strong {
        font-size: 22px;
        font-weight: 700;
        color: #82817f;
    }


/* =========================================================
   SAVE SALE
   ========================================================= */

.save-sale-btn {
    width: 100%;
    min-height: 44px;
    border-radius: 7px !important;
    background: linear-gradient( 145deg, #f0f1f2, #b6bbc0 ) !important;
    color: #08090b !important;
    border: 1px solid #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 1.5px;
    transition: all .2s ease;
}

    .save-sale-btn:hover {
        background: linear-gradient( 145deg, #ffffff, #d0d3d6 ) !important;
        box-shadow: 0 6px 20px rgba(255,255,255,.13);
    }

 

    .save-sale-btn::part(control) {
        background: #181b1f !important;
        border: 1px solid #181b1f !important;
        color: #ffffff !important;
    }

.cart-action-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.flex-btn {
    flex: 1;
    min-width: 0;
}

.preview-sale-btn {
    white-space: nowrap;
}

    /* =========================================================
   LOADING
   ========================================================= */
    .loading-area {
        min-height: 500px;
        display: flex;
        align-items: center;
        justify-content: center;
    }


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {

    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pos-content {
        grid-template-columns: minmax(0, 1fr) 300px;
    }
}


@media (max-width: 900px) {

    .pos-content {
        grid-template-columns: 1fr;
    }

    .cart-section {
        position: static;
    }

    .cart-box {
        min-height: auto;
    }

    .products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


@media (max-width: 650px) {

    .pos-page {
        padding: 15px;
    }

    .pos-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .register-status {
        width: 100%;
    }

    .pos-customer-combobox {
        width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 420px) {

    .products-grid {
        grid-template-columns: 1fr;
    }
}
