/* ==============================================================================
   ZENITH POS & MOBILE POS - DEDICATED POS TERMINAL STYLESHEET
   ============================================================================== */

/* POS Layout Container */
.pos-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg-main);
}

.pos-main-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    padding: 16px;
}

.pos-cart-panel {
    width: 440px;
    background-color: var(--bg-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.25);
    z-index: 1020;
}

/* POS Header Container & Balanced Two-Line Topbar */
.pos-topbar-container,
.pos-topbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
}

.pos-topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.pos-row-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}

.pos-row-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin-left: auto;
}

/* Order Type Selector Tabs */
.order-type-tabs {
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-card);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    height: 38px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.order-type-btn {
    height: 32px;
    padding: 0 13px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    user-select: none;
}

.order-type-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

.order-type-btn.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.order-type-btn i {
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.hotkey-hint {
    font-size: 10px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.22);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
    border: 1px solid rgba(255, 255, 255, 0.12);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.order-type-btn.active .hotkey-hint {
    background: rgba(0, 0, 0, 0.28);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Price Book Selector Wrapper */
.pos-pricebook-wrapper {
    min-width: 150px;
    max-width: 190px;
    flex-shrink: 0;
}

.pos-topbar-select {
    height: 38px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    background-color: var(--form-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--form-text) !important;
    border-radius: var(--radius-md) !important;
    padding: 0 28px 0 12px !important;
    display: flex;
    align-items: center;
    box-shadow: none !important;
}

/* Topbar Buttons */
.pos-topbar-btn {
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 0 12px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: var(--radius-md) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
}

.pos-topbar-btn.pos-icon-btn {
    width: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
}

#tableSelectBtn {
    max-width: 220px;
}

#currentTableLabel,
#currentRoomLabel,
#currentDeliveryLabel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* POS Search Bar & Shortcuts */
.pos-search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    align-items: center;
}

.pos-search-wrapper {
    position: relative;
    flex: 1;
}

.pos-search-wrapper .search-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 16px;
    pointer-events: none;
    z-index: 5;
    transition: color 0.2s ease;
}

#posSearchInput {
    background-color: var(--form-bg) !important;
    border: 1.5px solid var(--form-border) !important;
    color: var(--form-text) !important;
    border-radius: var(--radius-md) !important;
    padding: 12px 18px 12px 46px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    height: 48px !important;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
}

#posSearchInput::placeholder,
#posSearchInput::-webkit-input-placeholder,
#posSearchInput::-moz-placeholder,
#posSearchInput:-ms-input-placeholder {
    color: var(--form-placeholder) !important;
    opacity: 1 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
}

#posSearchInput:focus {
    background-color: var(--form-bg) !important;
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2) !important;
    color: var(--form-text) !important;
}

.pos-search-wrapper:focus-within .search-icon {
    color: var(--border-focus) !important;
}

/* Mobile POS Search Input */
#mobileSearchInput {
    background-color: var(--form-bg) !important;
    border: 1px solid var(--form-border) !important;
    color: var(--form-text) !important;
    border-radius: var(--radius-sm) !important;
    font-size: 13.5px !important;
}

#mobileSearchInput::placeholder,
#mobileSearchInput::-webkit-input-placeholder,
#mobileSearchInput::-moz-placeholder,
#mobileSearchInput:-ms-input-placeholder {
    color: var(--form-placeholder) !important;
    opacity: 1 !important;
    font-size: 13px !important;
}

/* Category Filter Bar */
.pos-category-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 12px;
    scrollbar-width: thin;
}

.pos-cat-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

[data-theme="light"] .pos-cat-chip,
:root:not([data-theme="dark"]) .pos-cat-chip {
    color: #334155;
    background-color: #ffffff;
    border-color: #cbd5e1;
}

.pos-cat-chip:hover {
    border-color: var(--border-focus);
    color: var(--text-main);
    transform: translateY(-1px);
}

[data-theme="light"] .pos-cat-chip.active,
:root:not([data-theme="dark"]) .pos-cat-chip.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1) !important;
    border-color: #4f46e5 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35) !important;
}

[data-theme="dark"] .pos-cat-chip.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(99, 102, 241, 0.18));
    border-color: #6366f1;
    color: #818cf8;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.sc-badge {
    font-size: 10px;
    background: var(--accent-amber-light);
    color: var(--accent-amber);
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 700;
}

/* Items Grid */
.pos-items-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    grid-auto-rows: 215px;
    align-content: start; /* Prevents rows from stretching vertically across container */
    gap: 12px;
    padding-right: 4px;
    padding-bottom: 20px;
}

.pos-item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    box-sizing: border-box;
}

.pos-item-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: var(--shadow-md);
}

.pos-item-card:active {
    transform: scale(0.98);
}

.pos-item-card.keyboard-highlight {
    border: 2px solid #6366f1 !important;
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.65) !important;
    transform: translateY(-4px) scale(1.02);
    z-index: 10;
}

.pos-item-img {
    height: 105px;
    width: 100%;
    object-fit: cover;
    background-color: #1e293b;
    flex-shrink: 0;
    display: block;
}

.pos-item-badge-top {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    z-index: 2;
}

.pos-item-body {
    padding: 8px 10px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2px;
    box-sizing: border-box;
}

.pos-item-info {
    min-width: 0;
    overflow: hidden;
}

.pos-item-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-main);
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    height: 32px;
    max-height: 32px;
}

.pos-item-meta {
    font-size: 10.5px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.pos-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
    flex-shrink: 0; /* CRITICAL: Never let footer shrink, clip, or hide price */
    padding-top: 3px;
    min-height: 26px;
}

.pos-item-price {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--accent-emerald);
    font-family: var(--font-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    line-height: 1.1;
}

.pos-item-add-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
    line-height: 1;
    border: none;
    background: var(--primary);
    color: #fff;
    transition: all 0.15s ease;
}

.pos-item-add-btn:hover {
    transform: scale(1.1);
    background: var(--primary-hover);
}

[data-theme="light"] .pos-item-price,
:root:not([data-theme="dark"]) .pos-item-price {
    color: #059669;
}

[data-theme="dark"] .pos-item-price {
    color: #34d399;
}

.pos-item-soldout {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #f87171;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Cart Panel */
.pos-cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
}

.pos-cart-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
}

.cart-item-row {
    background-color: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.2s ease;
}

.cart-item-row.selected {
    border-color: #6366f1 !important;
    background-color: rgba(99, 102, 241, 0.16) !important;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
    border-left: 4px solid #6366f1 !important;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.cart-item-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    word-break: break-word;
    line-height: 1.25;
}

.cart-item-name > span:first-child {
    display: inline-block;
    max-width: 100%;
    word-break: break-word;
}

.cart-item-mods {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    word-break: break-word;
}

.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-card);
    padding: 2px 4px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    flex-shrink: 0; /* CRITICAL: Never let qty controls shrink */
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--bg-card-hover);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.15s ease;
}

.qty-btn:hover {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.qty-val {
    font-size: 13px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    font-family: var(--font-mono);
    color: var(--text-main);
}

.cart-item-price {
    font-size: 13.5px;
    font-weight: 800;
    color: #10b981;
    min-width: 70px;
    text-align: right;
    font-family: var(--font-mono);
    flex-shrink: 0; /* CRITICAL: Never let price shrink or hide */
    white-space: nowrap;
    line-height: 1.2;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0; /* CRITICAL: Never let action buttons shrink or hide */
}

/* Cart Calculation Summary */
.pos-cart-summary {
    padding: 14px 20px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.summary-row.total-row {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

.total-amount-display {
    color: #10b981;
    font-size: 22px;
    font-family: var(--font-mono);
}

/* Cart Action Buttons */
.pos-cart-actions {
    padding: 14px 20px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.actions-grid-top {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.actions-grid-bottom {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 8px;
}

.btn-pos-action {
    padding: 11px 10px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all 0.2s ease;
}

.btn-hold { background: rgba(245, 158, 11, 0.15); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.3); }
.btn-hold:hover { background: #f59e0b; color: #fff; }

.btn-recall { background: rgba(6, 182, 212, 0.15); color: #0891b2; border: 1px solid rgba(6, 182, 212, 0.3); }
.btn-recall:hover { background: #06b6d4; color: #fff; }

.btn-discount { background: rgba(168, 85, 247, 0.15); color: #9333ea; border: 1px solid rgba(168, 85, 247, 0.3); }
.btn-discount:hover { background: #a855f7; color: #fff; }

[data-theme="dark"] .btn-hold { color: #fbbf24; }
[data-theme="dark"] .btn-recall { color: #22d3ee; }
[data-theme="dark"] .btn-discount { color: #c084fc; }

.btn-kot { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.btn-kot:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4); }

.btn-pay { background: linear-gradient(135deg, #10b981, #059669); color: #fff; font-size: 15px; font-weight: 800; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
.btn-pay:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4); }

/* Payment Method Selection Buttons */
.pay-method-btn {
    background-color: var(--bg-card) !important;
    border: 1.5px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: var(--radius-sm) !important;
    transition: all 0.2s ease;
}

.pay-method-btn:hover {
    background-color: var(--bg-card-hover) !important;
    border-color: var(--border-focus) !important;
    color: var(--text-main) !important;
    transform: translateY(-2px);
}

[data-theme="light"] .pay-method-btn.active,
:root:not([data-theme="dark"]) .pay-method-btn.active {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff) !important;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25) !important;
    color: #3730a3 !important;
}

[data-theme="dark"] .pay-method-btn.active {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.25), rgba(99, 102, 241, 0.15)) !important;
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3) !important;
    color: #ffffff !important;
}

/* Quick Numpad Modal */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.numpad-key {
    height: 52px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.numpad-key:hover {
    background: var(--primary-light);
    border-color: var(--border-focus);
    color: var(--primary);
}

.numpad-key:active {
    transform: scale(0.95);
}

/* ==============================================================================
   RESPONSIVE POS TERMINAL MEDIA QUERIES
   ============================================================================== */

/* Laptops & Tablets Landscape (992px - 1199.98px) */
@media (max-width: 1199.98px) {
    .pos-topbar-container {
        gap: 6px;
    }
    .order-type-btn {
        padding: 0 10px;
        font-size: 12px;
    }
    .pos-pricebook-wrapper {
        min-width: 125px;
    }
    .pos-topbar-btn {
        padding: 0 9px !important;
        font-size: 12px !important;
    }
    .pos-cart-panel {
        width: 380px;
    }
    .pos-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
        grid-auto-rows: 200px;
        align-content: start;
        gap: 10px;
    }
    .pos-item-img {
        height: 95px;
    }
    .pos-item-body {
        padding: 6px 8px;
    }
    .pos-item-title {
        font-size: 12px;
        height: 30px;
        max-height: 30px;
    }
    .pos-item-meta {
        font-size: 10px;
    }
    .pos-item-price {
        font-size: 13.5px;
    }
}

/* Tablets Portrait & Small Screens (<= 991.98px) */
@media (max-width: 991.98px) {
    .pos-wrapper {
        position: relative;
        height: 100vh;
        overflow: hidden;
    }

    .pos-main-panel {
        padding: 12px;
        padding-bottom: 90px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Cart Panel converts to off-canvas slide drawer on tablets & phones */
    .pos-cart-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 400px;
        max-width: 90vw;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1050;
        box-shadow: -8px 0 35px rgba(0, 0, 0, 0.6);
    }

    .pos-cart-panel.show-mobile {
        transform: translateX(0);
    }

    /* Mobile Backdrop for POS Cart Panel */
    .pos-mobile-cart-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(4px);
        z-index: 1045;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .pos-mobile-cart-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

    /* POS Mobile Floating Cart Trigger */
    .pos-mobile-floating-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--glass-bg);
        backdrop-filter: blur(14px);
        border-top: 1px solid var(--border-color);
        padding: 12px 18px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
        z-index: 1040;
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .pos-mobile-floating-bar.hidden {
        transform: translateY(115%);
        pointer-events: none;
    }

    /* Category bar horizontal touch-scrolling */
    .pos-category-bar {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding-bottom: 4px;
    }

    .pos-category-bar::-webkit-scrollbar {
        display: none;
    }

    .pos-cat-chip {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .pos-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        grid-auto-rows: 195px;
        gap: 10px;
    }
}

/* Mobile Screens (<= 767.98px) */
@media (max-width: 767.98px) {
    .hotkey-hint {
        display: none !important;
    }

    .pos-topbar-container {
        gap: 8px;
        margin-bottom: 10px;
    }

    .pos-topbar-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .pos-topbar-row-1 .pos-row-left {
        flex: 1;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .pos-topbar-row-1 .pos-row-left::-webkit-scrollbar {
        display: none;
    }

    .order-type-tabs {
        flex-shrink: 0;
        display: flex;
        gap: 4px;
    }

    .order-type-btn {
        height: 32px;
        padding: 0 10px;
        font-size: 11.5px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .pos-topbar-row-1 .pos-row-right {
        flex-shrink: 0;
        display: inline-flex;
        gap: 4px;
    }

    .pos-topbar-row-2 {
        flex-wrap: wrap;
        gap: 6px;
    }

    .pos-topbar-row-2 .pos-row-left {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }

    .pos-topbar-row-2 .pos-row-right {
        display: flex;
        gap: 6px;
        width: 100%;
    }

    #posKotBotBtn,
    #posEditBillBtn {
        flex: 1;
        text-align: center;
        justify-content: center;
        font-size: 11.5px !important;
        padding: 6px 8px !important;
    }

    .pos-topbar-btn {
        padding: 6px 10px !important;
        font-size: 11.5px !important;
    }

    .pos-pricebook-wrapper {
        flex: 1;
        min-width: 120px;
    }

    .pos-pricebook-wrapper select {
        height: 32px;
        font-size: 11.5px;
    }

    .pos-cart-panel {
        max-width: 95vw;
    }

    .pos-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        grid-auto-rows: 185px;
        align-content: start;
        gap: 8px;
    }
    .pos-item-img {
        height: 85px;
    }
    .pos-item-body {
        padding: 6px 8px;
    }
    .pos-item-title {
        font-size: 11.5px;
        height: 28px;
        max-height: 28px;
    }
    .pos-item-meta {
        font-size: 9.5px;
    }
    .pos-item-price {
        font-size: 12.5px;
    }
    .pos-item-add-btn {
        width: 24px;
        height: 24px;
        min-width: 24px;
        font-size: 12px;
    }

    .actions-grid-top {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px;
    }

    .actions-grid-bottom {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .btn-pos-action {
        padding: 9px 5px;
        font-size: 11px;
    }

    /* Stack Payment Modal Columns on Mobile */
    #paymentModal .modal-body .row > .col-md-6:first-child {
        border-right: none !important;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 18px;
        margin-bottom: 12px;
    }
}

/* Extra Small Phones (<= 575.98px) */
@media (max-width: 575.98px) {
    .pos-main-panel {
        padding: 8px;
        padding-bottom: 84px;
    }

    /* Fullscreen Drawer for Cart on Phones */
    .pos-cart-panel {
        width: 100vw;
        max-width: 100vw;
    }

    /* Clean 2-Column Dish Grid for Phones */
    .pos-items-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-auto-rows: 175px;
        gap: 8px;
    }

    .pos-item-img {
        height: 80px;
    }

    .pos-item-body {
        padding: 5px 6px;
    }

    .pos-item-title {
        font-size: 11px;
        height: 26px;
        max-height: 26px;
        line-height: 1.2;
    }

    .pos-item-price {
        font-size: 12px;
    }

    .pos-item-add-btn {
        width: 22px;
        height: 22px;
        min-width: 22px;
        font-size: 11px;
    }

    .actions-grid-top {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 4px;
    }

    .actions-grid-bottom {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .btn-pos-action {
        padding: 8px 3px;
        font-size: 10px;
    }

    .btn-pos-action i {
        font-size: 15px !important;
    }

    .numpad-key {
        height: 48px;
        font-size: 18px;
    }

    .pos-search-wrapper input {
        font-size: 13px;
        height: 38px;
    }

    .pos-mobile-floating-bar {
        padding: 10px 14px;
    }

    .mobile-cart-badge {
        font-size: 11px;
        padding: 2px 6px;
    }
}

/* ==============================================================================
   DEDICATED MOBILE POS VIEW SPECIFIC STYLES
   ============================================================================== */
.mobile-pos-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: var(--bg-main);
    overflow: hidden;
}

.mobile-pos-header {
    padding: 12px 16px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-pos-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    padding-bottom: 90px;
    -webkit-overflow-scrolling: touch;
}

.mobile-pos-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
    z-index: 1050;
}

.mobile-cart-badge {
    background: #4f46e5;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    margin-right: 8px;
}

/* ==============================================================================
   BILL SEARCH & EDIT MODAL & BANNER STYLES
   ============================================================================== */
.actions-grid-top.actions-grid-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

.btn-save-edit {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4) !important;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.btn-save-edit:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.5) !important;
    color: #fff !important;
}

.bill-filter-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 6px 14px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.bill-filter-btn:hover {
    color: var(--text-main);
    border-color: var(--border-focus);
}

.bill-filter-btn.active {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    border-color: #4f46e5;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.bill-card-row {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.bill-card-row:hover {
    border-color: rgba(79, 70, 229, 0.5);
    background-color: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.pos-editing-banner {
    animation: fadeInBanner 0.25s ease-in-out;
}

@keyframes fadeInBanner {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==============================================================================
   KOT & BOT TICKET BADGES & CARDS
   ============================================================================== */
.badge-kot {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    font-weight: 700 !important;
    padding: 3px 8px !important;
    border-radius: var(--radius-sm) !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-bot {
    background: rgba(2, 132, 199, 0.15) !important;
    color: #0284c7 !important;
    border: 1px solid rgba(2, 132, 199, 0.35) !important;
    font-weight: 700 !important;
    padding: 3px 8px !important;
    border-radius: var(--radius-sm) !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kot-bot-card-row {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.kot-bot-card-row:hover {
    border-color: rgba(79, 70, 229, 0.4);
    background-color: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Header Line 2 Buttons & Balance */
.pos-topbar-row-2 {
    gap: 12px;
}

#posKotBotBtn {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(2, 132, 199, 0.08)) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    color: var(--text-main) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#posKotBotBtn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(2, 132, 199, 0.18)) !important;
    border-color: rgba(239, 68, 68, 0.6) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

#posEditBillBtn {
    background: rgba(245, 158, 11, 0.08) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    color: #f59e0b !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#posEditBillBtn:hover {
    background: rgba(245, 158, 11, 0.18) !important;
    border-color: rgba(245, 158, 11, 0.6) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2) !important;
}

/* KOT & BOT Modal Filter Pills */
.kot-bot-filter-btn {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 6px 14px;
    font-size: 13px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.kot-bot-filter-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
}

.kot-bot-filter-btn.active {
    background: #4f46e5;
    color: #ffffff;
    border-color: #4f46e5;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.kot-item-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-right: 6px;
    margin-bottom: 4px;
}

/* Item & Bill Discount Styling */
.item-disc-btn {
    font-size: 11px !important;
    padding: 1px 7px !important;
    border-radius: var(--radius-sm) !important;
    border: 1px dashed rgba(245, 158, 11, 0.5) !important;
    color: #fbbf24 !important;
    background: rgba(245, 158, 11, 0.08) !important;
    line-height: 1.3 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.item-disc-btn:hover {
    background: rgba(245, 158, 11, 0.22) !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.item-discount-pill {
    font-size: 11px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 2px 7px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
}

.item-discount-pill:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

#discountRow {
    transition: all 0.2s ease;
    border-radius: var(--radius-sm);
    padding: 2px 4px;
    margin: 0 -4px;
}

#discountRow:hover {
    background: rgba(245, 158, 11, 0.1);
}

.btn-xs {
    padding: 3px 8px !important;
    font-size: 11px !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
}

.item-add-qty-preset {
    min-width: 44px;
    font-weight: 700 !important;
    transition: all 0.18s ease;
}

.item-add-qty-preset.active {
    background: #3b82f6 !important;
    color: #ffffff !important;
    border-color: #3b82f6 !important;
}

/* Keyboard Hotkey KBD Badge Styling */
.hotkey-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    line-height: 1;
    color: #f8fafc;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
    vertical-align: middle;
}

.hotkey-kbd.kbd-primary { background: #4f46e5; border-color: #6366f1; border-bottom-color: #4338ca; }
.hotkey-kbd.kbd-success { background: #059669; border-color: #10b981; border-bottom-color: #047857; }
.hotkey-kbd.kbd-warning { background: #d97706; border-color: #f59e0b; border-bottom-color: #b45309; }
.hotkey-kbd.kbd-danger  { background: #dc2626; border-color: #ef4444; border-bottom-color: #b91c1c; }
.hotkey-kbd.kbd-info    { background: #0284c7; border-color: #38bdf8; border-bottom-color: #0369a1; }
.hotkey-kbd.kbd-purple  { background: #7c3aed; border-color: #a855f7; border-bottom-color: #6d28d9; }

