/* POS BKY v1.5 - Product Grid */

.pos-product-grid {
    display: grid;

    /* Mobile = 2 */
    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;
}

.pos-product-card {
    min-width: 0;

    overflow: hidden;

    background: #fff;

    border: 1px solid var(--app-border);
    border-radius: 12px;

    cursor: pointer;
    user-select: none;

    transition:
        transform .12s ease,
        box-shadow .12s ease,
        border-color .12s ease;
}

.pos-product-card:hover {
    transform: translateY(-2px);

    border-color: #c9d7ee;

    box-shadow:
        0 9px 22px rgba(15,23,42,.09);
}

.pos-product-card:active {
    transform: scale(.985);
}

.pos-product-card__image {
    width: 100%;
    aspect-ratio: 1 / 1;

    overflow: hidden;

    background: #f8fafc;
}

.pos-product-card__image img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}

.pos-product-card__body {
    padding: 10px;
}

.pos-product-card__name {
    min-height: 2.55em;

    margin: 0 0 7px;

    overflow: hidden;

    font-size: .88rem;
    font-weight: 650;
    line-height: 1.3;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pos-product-card__price {
    color: var(--app-primary);

    font-size: 1rem;
    font-weight: 750;
}

.pos-product-card__unit {
    color: var(--app-muted);
    font-size: .72rem;
}

/* Tablet Portrait = 3 */
@media (min-width: 768px) {
    .pos-product-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 12px;
    }
}

/* Tablet Landscape = 4 */
@media (min-width: 1024px) {
    .pos-product-grid {
        grid-template-columns:
            repeat(4, minmax(0, 1fr));
    }
}

/* >= 1366 x 768 = 6 */
@media (min-width: 1366px) and (min-height: 768px) {
    .pos-product-grid {
        grid-template-columns:
            repeat(6, minmax(0, 1fr));

        gap: 14px;
    }
}

/* ========================================================================== */
/* POS BKY v1.8 - Sale Screen                                                */
/* ========================================================================== */

.pos-sale-page {
    min-height: 100vh;
    background: var(--app-bg);
}

.pos-sale-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid var(--app-border);
}

.pos-sale-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pos-sale-brand__icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: 1.15rem;
}

.pos-sale-brand strong,
.pos-sale-brand small {
    display: block;
}

.pos-sale-brand strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.pos-sale-brand small {
    color: var(--app-muted);
}

.pos-sale-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
}

.pos-catalog-panel,
.pos-cart-panel {
    min-width: 0;
}

.pos-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.pos-search {
    flex: 1 1 240px;
    min-width: 180px;
}

.pos-category-list {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 12px;
    scrollbar-width: thin;
}

.pos-category-btn {
    flex: 0 0 auto;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    background: #fff;
    padding: 7px 12px;
    font-size: .82rem;
    white-space: nowrap;
}

.pos-category-btn.is-active {
    border-color: var(--app-primary);
    background: var(--app-primary);
    color: #fff;
}

.pos-product-card.is-out {
    opacity: .55;
    cursor: not-allowed;
}

.pos-product-card__stock {
    margin-top: 6px;
    color: var(--app-muted);
    font-size: .7rem;
}

.pos-cart-box {
    background: #fff;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    overflow: hidden;
}

.pos-cart-header {
    padding: 13px 14px;
    border-bottom: 1px solid var(--app-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pos-cart-items {
    max-height: 50vh;
    overflow-y: auto;
}

.pos-cart-empty {
    padding: 42px 18px;
    text-align: center;
    color: var(--app-muted);
}

.pos-cart-item {
    padding: 12px 14px;
    border-bottom: 1px solid var(--app-border);
}

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

.pos-cart-item__top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.pos-cart-item__name {
    min-width: 0;
    font-size: .88rem;
    font-weight: 650;
}

.pos-cart-item__meta {
    margin-top: 3px;
    color: var(--app-muted);
    font-size: .74rem;
}

.pos-cart-item__promo {
    display: inline-block;
    margin-top: 5px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--app-primary-soft);
    color: var(--app-primary);
    font-size: .7rem;
}

.pos-cart-item__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.pos-qty-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pos-qty-control button {
    width: 31px;
    height: 31px;
    padding: 0;
}

.pos-qty-value {
    min-width: 32px;
    text-align: center;
    font-weight: 700;
}

.pos-cart-summary {
    padding: 13px 14px;
    border-top: 1px solid var(--app-border);
    background: #fbfcfe;
}

.pos-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    font-size: .88rem;
}

.pos-summary-row.is-total {
    margin-top: 10px;
    margin-bottom: 0;
    padding-top: 10px;
    border-top: 1px dashed var(--app-border);
    font-size: 1.12rem;
    font-weight: 750;
}

.pos-checkout-btn {
    width: 100%;
    min-height: 48px;
    margin-top: 12px;
}

.pos-mobile-cart-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96);
    border-top: 1px solid var(--app-border);
    box-shadow: 0 -6px 20px rgba(15,23,42,.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 991.98px) {
    .pos-sale-layout {
        padding-bottom: calc(74px + env(safe-area-inset-bottom));
    }
}

.pos-mobile-cart-bar .btn {
    min-height: 46px;
}

.pos-stock-warning {
    color: #b02a37;
    font-size: .72rem;
    font-weight: 600;
}

.pos-payment-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pos-payment-option {
    position: relative;
}

.pos-payment-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pos-payment-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    cursor: pointer;
}

.pos-payment-option input:checked + label {
    border-color: var(--app-primary);
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

@media (min-width: 992px) {
    .pos-sale-layout {
        grid-template-columns: minmax(0, 1fr) 390px;
        align-items: start;
    }

    .pos-cart-panel {
        position: sticky;
        top: 73px;
    }

    .pos-mobile-cart-bar {
        display: none;
    }

    .pos-cart-items {
        max-height: calc(100vh - 350px);
    }
}


/* ========================================================================== */
/* POS BKY v1.8.4.5 - Prevent Double Tap Zoom                                */
/* ========================================================================== */

/*
 * touch-action: manipulation
 * - ปิดพฤติกรรม double-tap zoom บน element ที่ต้องกดรัว ๆ
 * - ยังไม่ปิด pinch-to-zoom ทั้งหน้า
 */
.pos-sale-page,
.pos-sale-page button,
.pos-sale-page .btn,
.pos-sale-page a,
.pos-product-card,
.pos-category-btn,
.pos-qty-control,
.pos-qty-control button,
.pos-mobile-cart-bar,
.pos-mobile-cart-bar button,
.js-plus,
.js-minus,
.js-remove,
.js-checkout {
    touch-action: manipulation;
}


/*
 * ป้องกัน browser เลือกข้อความ/ขึ้น highlight
 * ตอน cashier จิ้มการ์ดหรือ +/- รัว ๆ
 */
.pos-product-card,
.pos-product-card *,
.pos-category-btn,
.pos-qty-control,
.pos-qty-control *,
.js-plus,
.js-minus,
.js-remove {
    -webkit-user-select: none;
    user-select: none;

    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}


/*
 * Product Card เป็นพื้นที่กด ไม่ใช่พื้นที่ text selection
 */
.pos-product-card {
    -webkit-user-drag: none;
}


/*
 * รูปสินค้าไม่ให้ browser drag/select
 */
.pos-product-card img {
    pointer-events: none;

    -webkit-user-drag: none;
    user-drag: none;
}



/* ========================================================================== */
/* POS BKY v1.8.4.6 - POS Kiosk Mode                                         */
/* ========================================================================== */

/*
 * Kiosk Mode ใช้เฉพาะ POS-Sale.php
 *
 * pan-x pan-y:
 * - ยังเลื่อนหน้า / Modal / Offcanvas ได้
 * - ไม่อนุญาต pinch-zoom gesture
 * - ตัด double-tap zoom เมื่อทำงานร่วมกับ strict viewport
 */
html.pos-kiosk-mode,
html.pos-kiosk-mode body.pos-sale-page {
    touch-action: pan-x pan-y !important;
    -ms-touch-action: pan-x pan-y !important;

    overscroll-behavior: none;
}


/*
 * จุดกดรัว ๆ ใน POS
 * parent kiosk mode จะตัด pinch ออกอยู่แล้ว
 */
html.pos-kiosk-mode .pos-product-card,
html.pos-kiosk-mode .pos-category-btn,
html.pos-kiosk-mode .pos-qty-control,
html.pos-kiosk-mode .pos-qty-control button,
html.pos-kiosk-mode .js-plus,
html.pos-kiosk-mode .js-minus,
html.pos-kiosk-mode .js-remove,
html.pos-kiosk-mode .js-checkout,
html.pos-kiosk-mode .pos-mobile-cart-bar button,
html.pos-kiosk-mode .pos-sale-page button,
html.pos-kiosk-mode .pos-sale-page .btn {
    touch-action: manipulation !important;

    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}


/*
 * iOS Safari สามารถ Auto Zoom ตอน focus input ได้
 * ถ้า font-size ต่ำกว่า 16px
 */
html.pos-kiosk-mode .pos-sale-page input,
html.pos-kiosk-mode .pos-sale-page select,
html.pos-kiosk-mode .pos-sale-page textarea,
html.pos-kiosk-mode .pos-sale-page .form-control,
html.pos-kiosk-mode .pos-sale-page .form-select {
    font-size: 16px !important;
}


/*
 * ลด accidental selection / drag ตอน Cashier กดรัว ๆ
 */
html.pos-kiosk-mode .pos-product-card,
html.pos-kiosk-mode .pos-product-card *,
html.pos-kiosk-mode .pos-category-btn,
html.pos-kiosk-mode .pos-qty-control,
html.pos-kiosk-mode .pos-qty-control *,
html.pos-kiosk-mode .pos-payment-option label {
    -webkit-user-select: none;
    user-select: none;
}


/*
 * รูปสินค้าเป็น visual เท่านั้น
 */
html.pos-kiosk-mode .pos-product-card img {
    pointer-events: none;

    -webkit-user-drag: none;
    user-drag: none;
}


/* ========================================================================== */
/* POS BKY v1.11 - PromptPay Payment                                          */
/* ========================================================================== */

.pos-promptpay-box {
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: 16px;
    background: #f8f9fa;
}

.pos-promptpay-qr {
    width: 256px;
    min-height: 256px;
    padding: 8px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--app-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-promptpay-qr img,
.pos-promptpay-qr canvas {
    max-width: 240px !important;
    width: 100% !important;
    height: auto !important;
}

@media (max-width: 767.98px) {
    .pos-promptpay-box {
        padding: 12px;
    }

    .pos-promptpay-qr {
        width: 224px;
        min-height: 224px;
    }

    .pos-promptpay-qr img,
    .pos-promptpay-qr canvas {
        max-width: 208px !important;
    }
}


/* ========================================================================== */
/* POS BKY v1.15.1 - Payment / PromptPay Checkout UX                         */
/* ========================================================================== */

#paymentModal .payment-row {
    background: #fff;
}

#paymentModal .payment-row .form-label {
    margin-bottom: 6px;
    font-weight: 600;
}

#paymentModal .payment-row .input-group {
    flex-wrap: nowrap;
}

#paymentModal .payment-row .input-group > .form-control {
    min-width: 0;
}

#paymentModal .payment-auto-helper {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 20px;
    margin-top: 6px;
    font-size: .82rem;
    line-height: 1.35;
    color: var(--bs-primary);
    white-space: normal;
}

#paymentModal .payment-change-line {
    min-height: 20px;
    margin-top: 6px;
    font-size: .85rem;
    line-height: 1.35;
}

#paymentModal .pos-promptpay-box > .d-flex:first-child {
    min-height: 30px;
}

#paymentModal #promptPayLoading {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#paymentModal #promptPayLoading.d-none {
    display: none !important;
}

@media (max-width: 991.98px) {
    #paymentModal .payment-row .row {
        --bs-gutter-y: .85rem;
    }

    #paymentModal .payment-row .d-flex.justify-content-end {
        justify-content: flex-start !important;
        padding-top: 0 !important;
    }
}


/* ========================================================================== */
/* POS BKY v1.15.2 - Close Shift Modal Fixed Footer                          */
/* ========================================================================== */

/*
 * Close Shift มี form ครอบ modal-body + modal-footer
 * ถ้าปล่อย Bootstrap modal-dialog-scrollable ทำงานตามปกติ
 * form จะกลายเป็นลูกก้อนเดียวของ .modal-content และ Footer สามารถถูกดัน
 * หลุดด้านล่างของ viewport ได้เมื่อเนื้อหานับเงินยาว
 *
 * โครงสร้าง:
 *
 * modal-content
 * ├─ modal-header       = fixed
 * └─ form               = flex column
 *    ├─ modal-body      = scroll
 *    └─ modal-footer    = fixed
 */
.close-shift-modal {
    --close-shift-modal-space: 16px;
}

.close-shift-modal .modal-dialog {
    width: auto;
    max-width: 900px;

    height: calc(100vh - (var(--close-shift-modal-space) * 2));
    height: calc(100dvh - (var(--close-shift-modal-space) * 2));

    margin: var(--close-shift-modal-space) auto;
}

.close-shift-modal .modal-content {
    width: 100%;
    height: 100%;
    max-height: 100%;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.close-shift-modal .modal-header {
    flex: 0 0 auto;

    position: relative;
    z-index: 5;

    background: #fff;
}

.close-shift-modal .close-shift-form {
    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.close-shift-modal .modal-body {
    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    overflow-x: hidden;
    overflow-y: auto;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;
}

.close-shift-modal .modal-body::-webkit-scrollbar {
    width: 8px;
}

.close-shift-modal .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.close-shift-modal .modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.close-shift-modal .modal-footer {
    flex: 0 0 auto;

    position: relative;
    z-index: 5;

    margin: 0;
    padding: 12px 16px;

    background: #fff;
    border-top: 1px solid var(--app-border);

    box-shadow: 0 -8px 18px rgba(15, 23, 42, .04);
}

.close-shift-modal .modal-footer .btn {
    min-width: 110px;
}

/*
 * ตารางนับเงินต้องเลื่อนเฉพาะ Modal Body
 * ไม่ให้ table ดัน Modal สูงเกิน viewport
 */
.close-shift-modal #cashCountRows .form-control {
    min-width: 74px;
}

.close-shift-modal .table-responsive {
    max-width: 100%;
}


/* Tablet */
@media (max-width: 991.98px) {

    .close-shift-modal {
        --close-shift-modal-space: 10px;
    }

    .close-shift-modal .modal-dialog {
        max-width: calc(100% - 20px);
    }
}


/* Mobile */
@media (max-width: 575.98px) {

    .close-shift-modal {
        --close-shift-modal-space: 0px;
    }

    .close-shift-modal .modal-dialog {
        width: 100%;
        max-width: 100%;

        height: 100vh;
        height: 100dvh;

        margin: 0;
    }

    .close-shift-modal .modal-content {
        border: 0;
        border-radius: 0;
    }

    .close-shift-modal .modal-header {
        padding: 12px 14px;
    }

    .close-shift-modal .modal-body {
        padding: 14px;
    }

    .close-shift-modal .modal-footer {
        padding: 10px 12px;

        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .close-shift-modal .modal-footer > * {
        margin: 0;
    }

    .close-shift-modal .modal-footer .btn {
        width: 100%;
        min-width: 0;
    }
}


/* ==========================================================================
   v1.26.0 - Payment Modal Fixed Footer
   ========================================================================== */

.payment-modal {
    --payment-modal-space: 12px;
}

.payment-modal .modal-dialog {
    width: auto;
    max-width: 1140px;
    height: calc(100vh - (var(--payment-modal-space) * 2));
    height: calc(100dvh - (var(--payment-modal-space) * 2));
    margin: var(--payment-modal-space) auto;
}

.payment-modal .modal-content {
    width: 100%;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.payment-modal .modal-header {
    flex: 0 0 auto;
    position: relative;
    z-index: 5;
    background: #fff;
}

.payment-modal .payment-form {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.payment-modal .modal-body {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.payment-modal .modal-footer {
    flex: 0 0 auto;
    position: relative;
    z-index: 10;
    margin: 0;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid var(--app-border);
    box-shadow: 0 -8px 20px rgba(15,23,42,.08);
}

.payment-modal .modal-footer .btn {
    min-width: 120px;
}

@media (max-width: 575.98px) {
    .payment-modal {
        --payment-modal-space: 6px;
    }

    .payment-modal .modal-dialog {
        max-width: none;
    }

    .payment-modal .modal-footer {
        gap: 8px;
        padding: 10px 12px;
    }

    .payment-modal .modal-footer .btn {
        flex: 1 1 0;
        min-width: 0;
    }
}


/* ==========================================================================
   v1.26.0 - Product Scope BOGO Badge / Group Filter
   ========================================================================== */

.pos-promotion-group-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 0 10px;
    padding: 1px 0 4px;
    scrollbar-width: none;
}

.pos-promotion-group-list::-webkit-scrollbar {
    display: none;
}

.pos-promo-group-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid #f6c453;
    border-radius: 999px;
    background: #fffaf0;
    color: #8a5200;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}

.pos-promo-group-btn.is-active {
    background: #ffb703;
    border-color: #ffb703;
    color: #342100;
}

.pos-product-card__image {
    position: relative;
}

.pos-product-card__promo-stack {
    position: absolute;
    top: 7px;
    left: 7px;
    right: 7px;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    pointer-events: none;
}

.pos-product-card__promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 4px 7px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 999px;
    background: rgba(220,53,69,.94);
    color: #fff;
    box-shadow: 0 2px 7px rgba(15,23,42,.16);
    font-size: .70rem;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .pos-product-card__promo-badge {
        padding: 3px 6px;
        font-size: .66rem;
    }
}


/* ==========================================================================
   v1.26.0 Hotfix - Force visible BOGO red pill on POS product cards
   ========================================================================== */

.pos-product-card {
    position: relative;
}

.pos-product-card__image {
    position: relative !important;
    overflow: hidden;
}

.pos-product-card__promo-stack {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    right: auto !important;
    z-index: 20 !important;

    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;

    max-width: calc(100% - 16px);
    pointer-events: none;
}

.pos-product-card__promo-badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;

    min-height: 25px;
    padding: 4px 9px !important;

    border: 2px solid #fff !important;
    border-radius: 999px !important;

    background: #dc3545 !important;
    color: #fff !important;

    box-shadow: 0 3px 9px rgba(0,0,0,.28) !important;

    font-size: .73rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    opacity: 1 !important;
    visibility: visible !important;
}

.pos-product-card.is-out .pos-product-card__promo-badge {
    opacity: 1 !important;
}

@media (max-width: 575.98px) {
    .pos-product-card__promo-stack {
        top: 5px !important;
        left: 5px !important;
        max-width: calc(100% - 10px);
    }

    .pos-product-card__promo-badge {
        min-height: 22px;
        padding: 3px 7px !important;
        font-size: .65rem !important;
    }
}


/* =========================================================
   v1.26.3 Manual Complimentary - Quick POS UI
   ========================================================= */
.pos-manual-gift-toolbar-btn {
    border-color: #dc3545;
    color: #dc3545;
}
.pos-manual-gift-toolbar-btn:hover {
    background: #dc3545;
    color: #fff;
}
.manual-gift-product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.manual-gift-product-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    background: #fff;
    text-align: left;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.manual-gift-product-card:hover {
    border-color: #dc3545;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
    transform: translateY(-1px);
}
.manual-gift-product-card__image {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    border-radius: 9px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}
.manual-gift-product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.manual-gift-product-card__placeholder {
    color: #adb5bd;
    font-size: 1.5rem;
}
.manual-gift-product-card__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.manual-gift-product-card__body strong {
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.manual-gift-product-card__body small {
    color: #6c757d;
}
.manual-gift-selection {
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 14px;
    background: #f8f9fa;
}
.manual-gift-unit-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.manual-gift-unit-btn {
    min-width: 105px;
    padding: 9px 14px;
    border: 1px solid #ced4da;
    border-radius: 10px;
    background: #fff;
    font-weight: 600;
}
.manual-gift-unit-btn.is-active {
    border-color: #dc3545;
    background: #dc3545;
    color: #fff;
}
@media (max-width: 991.98px) {
    .manual-gift-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .manual-gift-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .manual-gift-product-card { align-items: flex-start; padding: 8px; }
    .manual-gift-product-card__image { width: 54px; height: 54px; flex-basis: 54px; }
}

/* v1.41.16 Multi Sale Unit */
.pos-product-unit-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem;margin:.45rem 0}.pos-product-unit-actions .btn{white-space:nowrap;font-weight:600;padding:.35rem .4rem}.pos-product-unit-actions .btn:only-child{grid-column:1/-1}


/* ========================================================================== */
/* POS BKY v1.41.31.23 - Mobile Cart Single Scroll + Fixed Checkout          */
/* ========================================================================== */
@media (max-width: 991.98px) {
    #mobileCartCanvas {
        height: min(88dvh, 760px) !important;
        max-height: calc(100dvh - env(safe-area-inset-top));
    }

    #mobileCartCanvas .offcanvas-header {
        flex: 0 0 auto;
        border-bottom: 1px solid var(--app-border);
        background: #fff;
    }

    #mobileCartCanvas .offcanvas-body {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
        padding: 0 !important;
    }

    #mobileCart {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
    }

    #mobileCart .pos-cart-box {
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
        border: 0;
        border-radius: 0;
    }

    #mobileCart .pos-cart-header {
        flex: 0 0 auto;
    }

    #mobileCart .pos-cart-items {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    #mobileCart .pos-cart-summary {
        position: relative;
        z-index: 2;
        flex: 0 0 auto;
        padding-bottom: calc(13px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 18px rgba(15,23,42,.08);
        background: #fff;
    }

    #mobileCart .pos-checkout-btn {
        margin-top: 9px;
    }
}
