/* BaharSoft Garments: five-language controls and mobile fit */
.garments-old-lang{display:none!important}
.garments-i18n-controls{display:flex;align-items:center;gap:5px;flex-wrap:wrap;direction:ltr}
.garments-i18n-controls button,.garments-i18n-controls a{appearance:none;border:1px solid rgba(167,139,250,.42);border-radius:7px;background:#19142a;color:#fff;text-decoration:none;font:800 10px/1 system-ui,sans-serif;padding:8px 9px;cursor:pointer;white-space:nowrap}
.garments-i18n-controls button.active{background:linear-gradient(135deg,#7c3aed,#a855f7);border-color:#c4b5fd;box-shadow:0 0 14px rgba(168,85,247,.35)}
.garments-i18n-controls a{background:linear-gradient(135deg,#f59e0b,#f97316);border-color:#fbbf24}
.garments-i18n-controls [data-garments-hear]{background:linear-gradient(135deg,#0891b2,#06b6d4);border-color:#22d3ee}
.garments-i18n-controls.authbar{margin-bottom:9px;justify-content:center;padding:7px;border:1px solid rgba(167,139,250,.18);border-radius:9px;background:rgba(15,10,28,.55)}
.brand-actions>.garments-i18n-controls{display:flex}
html[dir="rtl"] .main,html[dir="rtl"] .rightbar,html[dir="rtl"] .authpane{text-align:right}

/* Keep the Sales/POS workspace inside the normal 1100 × 680 app window. */
@media(min-width:901px){
  .window:not(.web-maximized) .main:has(.pos-main-container){display:flex;flex-direction:column;overflow:hidden!important;min-width:0}
  .window:not(.web-maximized) .main:has(.pos-main-container) .pagehead{flex:0 0 auto}
  .window:not(.web-maximized) .main:has(.pos-main-container) #content{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;overflow:hidden!important;padding-bottom:8px}
  .window:not(.web-maximized) .pos-topbar{flex:0 0 auto}
  .window:not(.web-maximized) #posContainerWrap{flex:1 1 auto;min-height:0;overflow:hidden}
  .window:not(.web-maximized) .pos-main-container{height:100%;min-height:0;grid-template-columns:minmax(0,1fr) minmax(285px,.9fr)!important;gap:9px!important;align-items:stretch!important}
  .window:not(.web-maximized) .pos-catalog-panel,.window:not(.web-maximized) .pos-cart-panel{height:100%;min-width:0;min-height:0;overflow:hidden}
  .window:not(.web-maximized) .pos-products-grid{flex:1 1 auto;min-height:0;overflow-y:auto;align-content:start;padding-right:3px;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  /* Normal desktop mode must always show a complete product card. */
  .window:not(.web-maximized) .pos-card{min-height:252px!important;align-self:start}
  .window:not(.web-maximized) .pos-card-media{display:flex!important;flex:0 0 140px!important;height:140px!important;min-height:140px!important;background:#0e0a1c!important}
  .window:not(.web-maximized) .pos-card-media img{display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center center!important;background:#0e0a1c}
  .window:not(.web-maximized) .pos-card-body{flex:1 0 auto!important;padding:7px!important}
  .window:not(.web-maximized) .pos-card-footer{margin-top:auto!important;gap:4px!important}
  .window:not(.web-maximized) .pos-card-price{font-size:12px!important}
  .window:not(.web-maximized) .pos-card-add-btn{display:inline-flex!important;flex:0 0 auto;min-height:28px!important;padding:0 6px!important;font-size:9.5px!important}
  .window:not(.web-maximized) .pos-cart-panel{padding:9px!important;gap:7px!important;overflow-y:auto!important;scrollbar-width:thin}
  .window:not(.web-maximized) .pos-cart-items-wrapper{max-height:105px!important;min-height:62px}
  .window:not(.web-maximized) .pos-empty-cart{padding:6px!important;min-height:58px!important}
  .window:not(.web-maximized) .pos-empty-cart-icon{font-size:22px!important;margin-bottom:2px!important}
  .window:not(.web-maximized) .pos-billing-summary{gap:5px!important;padding-top:5px!important}
  .window:not(.web-maximized) .pos-paid-wrapper{gap:5px!important}
  .window:not(.web-maximized) .pos-quick-cash-row{display:flex!important;flex-wrap:wrap!important;gap:4px!important}
  .window:not(.web-maximized) .pos-cash-chip{flex:1 1 48px!important;min-width:0;padding:5px 4px!important}
  .window:not(.web-maximized) .pos-checkout-actions{position:sticky;bottom:-9px;background:linear-gradient(180deg,rgba(20,16,36,.9),#141024 22%);padding-top:5px;z-index:2}
  .window:not(.web-maximized) .pos-btn-checkout,.window:not(.web-maximized) .pos-btn-save-only{min-height:34px!important;padding:7px!important}
}

@media(max-width:900px){
  .window{width:calc(100vw - 8px)!important;height:calc(100vh - 8px)!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;left:4px!important;top:4px!important;transform:none!important;border-radius:9px!important;resize:none!important}
  .titlebar{cursor:default}.brandbar{height:auto!important;min-height:54px;padding:6px 9px!important;align-items:flex-start!important}.brand-actions{gap:5px!important;flex-wrap:wrap!important;justify-content:flex-end}.brand-actions>.garments-i18n-controls{max-width:100%;overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px}.garments-i18n-controls button,.garments-i18n-controls a{padding:7px 8px;font-size:9px}
  .layout{display:block!important;overflow:auto!important}.sidebar{width:100%!important;height:auto!important;min-height:0!important;display:flex!important;gap:5px!important;overflow-x:auto!important;padding:7px!important;border-right:0!important;border-bottom:1px solid var(--line)}.sidebar .navbtn{flex:0 0 auto!important;padding:8px 10px!important}.sidebar .side-note{display:none!important}
  .main{width:100%!important;min-width:0!important;overflow:visible!important}.rightbar{width:100%!important;height:auto!important;border-left:0!important;border-top:1px solid var(--line);overflow:visible!important}.content{overflow:visible!important}
  .auth{align-items:flex-start!important;overflow:auto!important;padding:8px!important}.authbox{width:100%!important;min-height:0!important;grid-template-columns:1fr!important}.authvisual{display:none!important}.authpane{padding:14px!important}.mobile-auth-brand{display:flex!important}
  .grid.g4,.grid.g3{grid-template-columns:repeat(2,minmax(0,1fr))!important}.grid.g2{grid-template-columns:1fr!important}
  .pos-main-container{grid-template-columns:1fr!important}.pos-catalog-panel,.pos-cart-panel{min-width:0!important}.pos-cart-panel{overflow-y:auto!important}.pos-products-grid,.product-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.modalbox{width:calc(100vw - 20px)!important;max-height:calc(100vh - 24px)!important}.modalbody{overflow:auto!important}
  table{min-width:620px}.tablewrap,.table-wrap{overflow-x:auto!important}
}
@media(max-width:520px){
  .titlebar{padding:0 7px!important}.appname{max-width:48vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.window-controls{gap:3px!important}.window-control{padding:4px 6px!important;font-size:9px!important}
  .brandbar{flex:0 0 auto!important;flex-wrap:wrap!important;align-content:flex-start!important;gap:6px!important;overflow:visible!important}
  .brand-left{width:100%!important;min-width:0!important;flex:0 0 100%!important}.brand-text h1{font-size:13px!important}.brand-text small{display:none}
  .brand-actions{width:100%!important;min-width:0!important;max-width:none!important;flex:0 0 100%!important;display:flex!important;flex-wrap:wrap!important;justify-content:flex-start!important;overflow:visible!important}
  .brand-actions>.garments-i18n-controls{display:contents!important}
  .brand-actions button,.brand-actions a,.brand-actions label{flex:0 0 auto!important}
  .layout{padding:0!important}.pagehead{padding:8px!important;gap:6px;flex-wrap:wrap}.content{padding:8px!important}
  .grid.g4,.grid.g3{grid-template-columns:1fr!important}.pos-products-grid,.product-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.formgrid,.form-grid{grid-template-columns:1fr!important}.authpane{padding:10px!important}.garments-i18n-controls.authbar{overflow-x:auto;justify-content:flex-start;flex-wrap:nowrap}
}

/* BaharSoft mobile POS/cart responsive fix — 2026-10-13 */
@media(max-width:600px){
  .main:has(.pos-main-container) .content{overflow:visible!important;padding:8px!important}
  #posContainerWrap{overflow:visible!important}
  .pos-main-container{display:flex!important;flex-direction:column!important;gap:14px!important;height:auto!important;min-height:0!important;overflow:visible!important}
  .pos-catalog-panel{width:100%!important;height:auto!important;min-width:0!important;overflow:visible!important}
  .pos-products-grid{width:100%!important;max-height:58vh!important;min-height:360px;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;padding-right:3px!important;scrollbar-gutter:stable;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  /* Show the complete product photo on phones instead of cropping it. */
  .pos-card{min-width:0!important;align-self:start}
  .pos-card-media{height:clamp(135px,42vw,180px)!important;min-height:135px!important;background:#0e0a1c!important}
  .pos-card-media img{width:100%!important;height:100%!important;max-width:100%!important;object-fit:contain!important;object-position:center center!important;background:#0e0a1c}
  /* Product/variant cards: keep the whole garment visible on mobile. */
  .product-media{height:clamp(145px,44vw,190px)!important;min-height:145px!important;background:#0e0a1c!important}
  .product-media img{position:absolute!important;inset:0!important;margin:auto!important;display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center center!important;background:#0e0a1c}
  .pos-card-body{padding:6px!important;gap:3px!important}
  .pos-card-title{font-size:10.5px!important;min-height:27px!important}
  .pos-card-pill{font-size:8px!important;padding:1px 4px!important}
  .pos-card-footer{gap:4px!important}
  .pos-card-price{font-size:12px!important}
  .pos-card-add-btn{min-height:30px!important;padding:0 6px!important;font-size:9px!important;white-space:nowrap}
  .pos-cart-panel{width:100%!important;height:auto!important;max-height:none!important;min-width:0!important;overflow:visible!important;padding:11px!important;gap:11px!important}
  .pos-cart-header{align-items:flex-start!important;gap:8px!important}
  .pos-cart-header h3{font-size:14px!important;line-height:1.35;flex-wrap:wrap}
  .pos-cart-clear-btn{min-height:34px;padding:6px 9px!important;white-space:nowrap}
  .pos-customer-row{grid-template-columns:minmax(0,1fr)!important;gap:7px!important;padding:8px!important}
  .pos-customer-row select{width:100%!important;min-width:0!important;min-height:36px!important}
  .pos-invoice-badge{justify-self:start}
  .pos-cart-items-wrapper{max-height:none!important;overflow:visible!important;padding:0!important}
  .pos-cart-item{grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:'info total' 'qty qty';gap:9px!important;padding:10px!important;align-items:center!important}
  .pos-item-info{grid-area:info;min-width:0!important}
  .pos-item-title{font-size:12px!important;line-height:1.35;white-space:normal!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .pos-item-meta{font-size:10.5px!important;line-height:1.45}
  .pos-item-total-col{grid-area:total;align-self:start;gap:6px!important}
  .pos-item-line-total{font-size:12px!important;min-width:64px!important}
  .pos-item-remove-btn{width:32px!important;height:32px!important;font-size:15px!important}
  .pos-item-qty-ctrl{grid-area:qty;justify-self:stretch;display:grid!important;grid-template-columns:38px minmax(0,1fr) 38px;gap:6px!important;padding:3px!important}
  .pos-qty-btn{width:38px!important;height:34px!important;font-size:17px!important}
  .pos-qty-display{font-size:13px!important;align-self:center}
  .pos-billing-summary{padding:11px!important;gap:9px!important;font-size:12px!important}
  .pos-bill-line{min-height:34px;gap:8px!important}
  .pos-bill-input-sm{width:112px!important;height:34px!important;font-size:12px!important}
  .pos-bill-total-line{font-size:13px!important;padding-top:8px!important}
  .pos-paid-wrapper{gap:8px!important}
  .pos-quick-cash-row{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px!important}
  .pos-cash-chip{min-height:36px!important;font-size:11px!important;padding:7px 5px!important}
  .pos-due-badge{min-height:36px;font-size:11px!important;gap:7px;flex-wrap:wrap}
  .pos-checkout-actions{position:static!important;bottom:auto!important;background:none!important;padding:0!important;gap:8px!important}
  .pos-btn-checkout{min-height:48px!important;height:auto!important;padding:10px!important;font-size:12.5px!important}
  .pos-btn-save-only{min-height:42px!important;height:auto!important;padding:9px!important;font-size:11.5px!important}
}
