/* Shared responsive behavior for application shells. */
html{max-width:100%;-webkit-text-size-adjust:100%}body{min-width:0}img,video,canvas{max-width:100%}input,select,textarea{max-width:100%}.main-content{min-width:0}.overflow-x-auto{max-width:100%;overscroll-behavior-x:contain}.admin-page{min-width:0}.admin-page .flex>*,.admin-page .grid>*{min-width:0}.admin-page table{width:100%}.admin-page .dataTables_wrapper{max-width:100%;overflow-x:auto}.admin-page .dataTables_filter input{max-width:60vw}.admin-page .select2-container{max-width:100%}.admin-page .flex.justify-between{gap:12px;flex-wrap:wrap}.admin-page .flex.gap-2,.admin-page .flex.gap-3{flex-wrap:wrap}.fixed.inset-0[class*="bg-black"]{padding:12px;overflow-y:auto;overscroll-behavior:contain}.fixed.inset-0[class*="bg-black"]>.bg-white{max-height:calc(100dvh - 24px);overflow-y:auto}button:focus-visible,a:focus-visible{outline:2px solid #2563eb;outline-offset:3px}
@media(max-width:767px){.admin-page{padding:16px!important}.admin-page h1{font-size:1.35rem;overflow-wrap:anywhere}.admin-page .grid-cols-2,.admin-page .grid-cols-3,.admin-page .grid-cols-4{grid-template-columns:minmax(0,1fr)}.admin-page button,.admin-page a[class*="px-"],.main-content>header button{min-height:40px}.admin-page input:not([type=checkbox]):not([type=radio]),.admin-page select,.admin-page textarea{font-size:16px}.main-content>header>div,body>header>div{padding:10px 12px!important;gap:8px;flex-wrap:wrap}.main-content>header>div>.flex,body>header>div>.flex{gap:8px;flex-wrap:wrap;min-width:0;max-width:100%}.main-content>header h2{max-width:65vw;overflow:hidden;text-overflow:ellipsis}.main-content>header select{max-width:65vw}.admin-page .dataTables_length,.admin-page .dataTables_filter,.admin-page .dataTables_info,.admin-page .dataTables_paginate{float:none!important;text-align:start!important;margin:8px 0}.admin-page .dataTables_paginate{display:flex;flex-wrap:wrap}.fixed.inset-0[class*="bg-black"]{padding:8px}.fixed.inset-0[class*="bg-black"]>.bg-white{max-height:calc(100dvh - 16px)}}
.pos-grid{height:100dvh!important}.pos-products,.pos-cart{height:100dvh!important}.pos-header-row{flex-wrap:wrap;gap:10px}.pos-brand{min-width:0;flex:1 1 180px}.pos-brand h1{overflow-wrap:anywhere;line-height:1.35}.pos-order-types{flex-wrap:wrap;flex-shrink:0}.pos-order-types button{white-space:nowrap;min-height:38px}.pos-quick-actions{flex-wrap:wrap;gap:6px}.pos-actions-row{flex-wrap:wrap}.pos-search{min-width:180px}.pos-tools-toggle,.pos-mobile-tabs,.pos-cart-close{display:none}
@media(max-width:767px){.pos-grid,.pos-grid.laundry-mode{display:block!important;height:100dvh!important}.pos-products{height:calc(100dvh - 68px)!important}.pos-header-row{display:flex;align-items:center}.pos-brand{flex:1 1 calc(100% - 130px)}.pos-brand h1{font-size:16px;max-width:65vw}.pos-tools-toggle{display:flex;align-items:center;gap:5px;border:1px solid #e2e8f0;border-radius:8px;padding:8px 10px;min-height:40px;font-size:13px}.pos-order-types{order:2;width:100%;display:flex;gap:6px}.pos-order-types button{flex:1;padding:9px 6px}.pos-quick-actions{display:none!important;order:3;width:100%;padding-top:6px;border-top:1px solid #e2e8f0}.pos-quick-actions.mobile-tools-open{display:flex!important}.pos-quick-actions>a,.pos-quick-actions>button{min-width:40px;min-height:40px}.pos-actions-row{padding:8px 12px!important;gap:8px!important}.pos-search{flex-basis:100%!important;min-width:0}.pos-actions-row button{min-height:40px;min-width:40px}.pos-cart{display:none!important;position:fixed;inset:0 0 68px;height:calc(100dvh - 68px)!important;z-index:35;overflow-y:auto!important}.pos-grid.mobile-cart-open .pos-cart{display:flex!important}.pos-grid.mobile-cart-open .pos-products{visibility:hidden}.pos-cart-close{display:block;min-height:40px;padding:6px 10px;color:#2563eb}.pos-mobile-tabs{display:flex;position:fixed;inset:auto 0 0;z-index:40;height:68px;background:#fff;border-top:1px solid #e2e8f0;padding:8px 12px max(8px,env(safe-area-inset-bottom));gap:8px}.pos-mobile-tabs button{flex:1;border-radius:10px;padding:8px;font-size:14px;font-weight:600}.pos-mobile-tabs .selected{background:#2563eb;color:white}.pos-mobile-tabs .unselected{background:#f1f5f9;color:#334155}.product-card{padding:10px!important;border-radius:12px!important}.product-card:hover{transform:none!important}.pos-products .categories-scroll{flex-shrink:0}}
@media(max-width:420px){.pos-products .grid.grid-cols-2{gap:8px}.pos-brand h1{max-width:52vw}.pos-header-row{gap:8px}.pos-cart .px-4{padding-left:12px;padding-right:12px}}@media print{.pos-mobile-tabs,.pos-tools-toggle,.pos-cart-close{display:none!important}}

@media(max-width:1023px){.sidebar-container{z-index:60!important}.sidebar-close{position:absolute;inset-inline-end:8px;top:8px;width:36px;height:36px;border-radius:8px;background:#f1f5f9;color:#334155;font-size:24px;z-index:1}.sidebar-container>div>div:first-of-type{padding-inline-end:48px}}

.pos-options-panel{width:calc(100vw - 32px);max-width:32rem!important;max-height:calc(100dvh - 32px);overflow-y:auto}.pos-options-panel .flex.justify-between{gap:12px}.pos-options-panel button{flex-shrink:0}

/* Product details get the full cart width; controls never squeeze the name. */
.pos-cart .cart-item{flex-direction:column;align-items:stretch}
.cart-item-info{min-inline-size:0;overflow-wrap:anywhere}
.cart-item-name{display:block;inline-size:100%;min-inline-size:0;white-space:normal;overflow-wrap:anywhere;line-height:1.5}
.cart-item-footer{display:flex;align-items:center;flex-wrap:wrap;gap:.75rem}
.cart-item-actions,.cart-item-quantity{display:flex;align-items:center;gap:.5rem;flex:0 0 auto}
.cart-item-quantity button,.cart-item-remove{display:flex;align-items:center;justify-content:center;inline-size:2.75rem;block-size:2.75rem;flex-shrink:0}
.cart-item-count{min-inline-size:2rem}
.cart-item-total{flex:1 1 5rem;min-inline-size:0;margin-inline-start:auto;text-align:end;overflow-wrap:anywhere}

/* POS terminals/tablets keep both panels; phone tabs are limited to widths below 768px. */
.pos-fullscreen-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;min-width:44px;min-height:44px;border:1px solid #dbeafe;border-radius:10px;background:#eff6ff;color:#2563eb}
.pos-fullscreen-toggle[aria-pressed=true]{background:#2563eb;color:white}
.pos-header-row .pos-brand{flex-basis:150px}
@media(min-width:768px) and (max-width:1366px){
 .pos-grid{grid-template-columns:minmax(0,1fr) clamp(280px,32vw,380px)}
 .pos-grid.laundry-mode{grid-template-columns:minmax(0,1fr) clamp(300px,36vw,440px)}
 .pos-products>header{padding:6px 10px}.pos-header-row{gap:6px}.pos-brand{gap:8px}.pos-brand h1{font-size:15px}
 .pos-fullscreen-toggle{order:1}.pos-order-types{order:2;flex:1 1 100%;gap:4px}.pos-order-types button{flex:1;padding:6px;min-height:40px}
 .pos-quick-actions{order:3;width:100%;gap:4px}.pos-quick-actions>a,.pos-quick-actions>button,.pos-quick-actions>div>button{min-width:44px;min-height:44px;padding:8px}
 .pos-actions-row{padding:6px 10px!important;gap:4px!important}.pos-actions-row button{min-width:44px;min-height:44px;padding:8px}.pos-search{min-width:120px}
 .pos-products>.overflow-y-auto{padding:12px}.pos-catalog-grid{grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}
 .pos-catalog-grid .product-card{padding:8px;border-radius:12px}.pos-catalog-grid .product-card>.aspect-square{aspect-ratio:4/3;max-height:110px;margin-bottom:6px}
 .pos-catalog-grid .product-card h3{font-size:13px;line-height:1.45;min-height:2.9em}.pos-catalog-grid .product-card p{font-size:14px}
 .pos-catalog-grid .product-card:hover{transform:none}
 .pos-cart .cart-item{padding:10px}.pos-cart .cart-item-footer{gap:6px}
}
@media(max-width:767px){.pos-header-row .pos-brand{flex:1 1 120px}.pos-fullscreen-toggle{order:0}}
@media print{.pos-fullscreen-toggle{display:none!important}}

/* Direct touch pans natively; mouse-emulated POS panels also support drag scrolling. */
[data-pos-drag-scroll]{-webkit-user-select:none;user-select:none;overscroll-behavior:contain}
[data-pos-drag-scroll="y"]{touch-action:pan-y pinch-zoom}
[data-pos-drag-scroll="x"]{touch-action:pan-x pinch-zoom}
[data-pos-drag-scroll] input,[data-pos-drag-scroll] textarea,[data-pos-drag-scroll] [contenteditable=true]{-webkit-user-select:text;user-select:text;touch-action:auto}
[data-pos-drag-scroll] img{-webkit-user-drag:none}
.pos-grid button,.pos-grid a,.product-card{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.pos-cart .cart-item-name:disabled{pointer-events:none}
.pos-dragging,.pos-dragging *{cursor:grabbing!important}
@media(hover:hover) and (pointer:fine){.product-card:hover{border-color:#3b82f6}}
@media(hover:none),(pointer:coarse){.product-card:hover{transform:none!important;box-shadow:none}}

/* Compact basket: a full-width name, then quantities and both prices in one row. */
.pos-cart-header{flex-shrink:0;padding:8px 10px!important}
.pos-cart-header>div:first-child{margin-bottom:4px}.pos-cart-header h2{font-size:15px}
.pos-cart-header button{touch-action:manipulation;min-height:32px;min-width:40px}
.pos-cart-items{min-height:0;padding:6px 8px!important}
.pos-cart .cart-item{padding:6px 8px;gap:2px;border-radius:9px}
.pos-cart-items>.cart-item{margin-top:0!important;margin-bottom:6px!important}
.pos-cart .cart-item-name{font-size:14px;line-height:1.4;font-weight:600}
.pos-cart .cart-item-info>p{font-size:12px;line-height:1.4;margin:0}
.pos-cart .cart-item-footer{gap:4px;flex-wrap:nowrap}
.pos-cart .cart-item-actions{gap:6px}.pos-cart .cart-item-quantity{gap:2px}
.pos-cart .cart-item-quantity button,.pos-cart .cart-item-remove{inline-size:40px;block-size:40px;min-inline-size:40px;background:transparent;border:1px solid transparent}
.pos-cart .cart-item-quantity button{background:#f1f5f9;border-color:#e2e8f0}
.pos-cart .cart-item-quantity button:active{background:#dbeafe}.pos-cart .cart-item-remove:active{background:#fee2e2}
.pos-cart .cart-item-count{min-inline-size:24px;font-size:14px}
.pos-cart .cart-item-remove svg{width:17px;height:17px}
.pos-cart .cart-item-total{flex:1 1 75px;font-size:14px;line-height:1.3}
.pos-cart .cart-item-unit-price{font-size:12px;font-weight:400;line-height:1.4;margin-top:2px}
.pos-cart-footer{flex-shrink:0;max-height:50dvh;overflow-y:auto;padding:8px!important}
.pos-cart-footer> :not([hidden])~:not([hidden]){margin-top:6px!important}
.cart-total-row{display:flex;align-items:center;gap:6px;border-block:1px solid #e2e8f0}
.cart-total-toggle{flex:1;min-width:0;min-height:40px;gap:8px;font-size:16px;text-align:start}
.cart-total-toggle>span{overflow-wrap:anywhere;text-align:end}
.cart-notes-toggle{position:relative;display:flex;align-items:center;justify-content:center;flex:0 0 40px;min-height:40px;border-radius:8px;color:#64748b}
.cart-notes-toggle.has-notes{color:#2563eb;background:#dbeafe}.cart-notes-dot{position:absolute;right:7px;top:7px;width:5px;height:5px;background:#2563eb;border-radius:50%}
.cart-quick-actions>button{flex-direction:row!important;justify-content:center;flex-wrap:wrap;gap:3px;min-height:40px;padding:5px 2px!important;line-height:1.3}
.pos-cart-footer>.grid.grid-cols-2>button{min-height:44px;padding:8px!important;line-height:1.3}

/* POS tools stay between the business name and fullscreen, in both directions. */
.pos-header-row{display:grid!important;grid-template-columns:minmax(88px,140px) minmax(0,1fr) 44px;align-items:center;gap:8px}
.pos-header-row .pos-brand{grid-column:1;grid-row:1;min-width:0;flex-wrap:wrap;gap:4px}
.pos-header-row .pos-brand h1{max-width:100%;font-size:14px;line-height:1.35}
.pos-header-row .pos-quick-actions{display:flex!important;grid-column:2;grid-row:1;order:0;width:auto;min-width:0;flex-wrap:wrap;justify-content:flex-end;gap:4px;border:0;padding:0}
.pos-header-row .pos-fullscreen-toggle{grid-column:3;grid-row:1;order:0}
.pos-header-row .pos-order-types{grid-column:1/-1;order:0;width:100%;display:flex;gap:6px}
.pos-header-row .pos-order-types button{flex:1;min-height:40px}
.pos-quick-actions>a,.pos-quick-actions>button,.pos-quick-actions>div>button{flex-shrink:0;min-width:40px;min-height:40px;padding:8px}
.pos-quick-actions>.pos-language-switcher a{display:flex;align-items:center;justify-content:center;min-width:36px;min-height:40px;padding:4px}
.pos-connection-indicator{min-width:28px;min-height:40px;justify-content:center}
.pos-connection-label{display:none}
@media(min-width:768px) and (max-width:1366px){.pos-header-row{grid-template-columns:104px minmax(0,1fr) 44px}}
@media(max-width:767px){
 .pos-header-row{grid-template-columns:minmax(72px,100px) minmax(0,1fr) 40px;gap:6px}
 .pos-header-row .pos-quick-actions{flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;touch-action:pan-x pinch-zoom;scrollbar-width:thin;padding:3px 0}
 .pos-header-row .pos-quick-actions>div{flex-shrink:0}
 .pos-header-row .pos-quick-actions>div>div.absolute{position:fixed;inset-inline:12px;top:90px;width:auto;max-height:calc(100dvh - 110px);overflow:auto}
 .pos-header-row .pos-fullscreen-toggle{min-width:40px;min-height:40px}
}

.pos-header-row .pos-quick-actions{flex-wrap:nowrap;overflow:visible}
.pos-toolbar-scroll{display:flex;align-items:center;flex:1 1 auto;min-width:0;gap:4px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;padding:3px 0}
.pos-toolbar-scroll>*{flex-shrink:0}
.pos-toolbar-scroll>a,.pos-toolbar-scroll>button,.pos-toolbar-scroll>div>button,.pos-profile>button{min-width:40px;min-height:40px;padding:8px}
.pos-toolbar-scroll .pos-language-switcher a{display:flex;align-items:center;justify-content:center;min-width:34px;min-height:40px;padding:4px}
.pos-profile{flex:0 0 40px}
.pos-toolbar-scroll .pos-notifications-panel{position:fixed;inset-inline-start:auto;inset-inline-end:12px;top:70px;width:min(320px,calc(100vw - 24px));max-height:calc(100dvh - 90px);overflow-y:auto}

/* New desktop builds own the POS toolbar; keep web popovers accessible in the page. */
.native-pos-toolbar #pos-tools{width:0!important;min-width:0!important;padding:0!important;gap:0!important;justify-self:end}
.native-pos-toolbar #pos-tools .pos-toolbar-scroll{overflow:visible;width:0;gap:0}
.native-pos-toolbar #pos-tools button[data-desktop-pos-action],.native-pos-toolbar #pos-tools a[data-desktop-pos-action],.native-pos-toolbar .pos-language-switcher,.native-pos-toolbar .pos-connection-indicator,.native-pos-toolbar [data-pos-fullscreen]{display:none!important}
.native-pos-toolbar #pos-tools .pos-profile{width:0!important;min-width:0!important;flex-basis:0!important}
.native-pos-toolbar .pos-profile>div{position:fixed!important;top:12px;inset-inline-end:12px;inset-inline-start:auto;z-index:1000}
.native-pos-toolbar .pos-notifications-panel{top:12px!important}
.native-pos-toolbar .pos-header-row{grid-template-columns:minmax(0,1fr) 0!important}
.native-pos-toolbar .pos-brand{max-width:none!important}
.pos-header-row .pos-quick-actions>.pos-toolbar-scroll{flex-shrink:1;min-width:0}

/* Search tools never cover the keypad toggle; numeric search opens a floating pad. */
.pos-search-icon{position:absolute;inset-inline-start:12px;top:14px;pointer-events:none}
[data-number-pad-placement="floating"]{padding-inline-start:36px!important}
.recent-order-actions{display:grid;grid-template-columns:repeat(3,44px);gap:6px;min-width:144px;width:max-content}
.recent-order-actions button{width:44px!important;min-height:44px;height:auto!important;display:flex;align-items:center;justify-content:center;padding:6px;line-height:1.3}
.recent-order-actions .recent-order-split{grid-column:span 2;width:auto!important;white-space:nowrap;background:#eef2ff;font-size:12px}

.listed-order-actions{flex:1 1 100%;min-width:0}.listed-order-actions>span:first-child{margin-inline-end:auto}
.listed-order-print-actions{display:flex;flex-wrap:wrap;gap:6px;min-width:0}.listed-order-print-actions button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:8px 10px;border-radius:8px;font-size:12px;flex:1 1 auto}.listed-order-print-actions svg{flex-shrink:0}
