/* OPTIKA-POS-19 — mobilni prikaz (telefon) za kasu i backoffice. Učitava se iza ostalih stilova. */
@media screen and (max-width:760px){
  /* ===== KASA ===== */
  html body .pos39-shell{width:100%!important;max-width:100vw!important;min-width:0!important;margin:0!important;left:0!important;transform:none!important}
  html body .pos39-shell .pos39-work{width:100%!important;min-width:0!important;max-width:100vw!important;grid-template-columns:minmax(0,1fr)!important}
  html body .pos39-shell .pos39-work>*{min-width:0!important;max-width:100%!important;box-sizing:border-box}
  html body .pos39-top{grid-template-columns:minmax(0,1fr) auto!important;gap:8px!important}
  html body .pos39-top .pos39-brand{min-width:0!important;overflow:hidden}
  html body .pos39-top .pos39-brand b,html body .pos39-top .pos39-brand small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;max-width:100%}
  html body .pos39-search{min-width:0!important;max-width:100%!important}
  html body .pos39-toolbar{flex-wrap:wrap!important;gap:6px!important}
  html body .pos39-toolbar{flex-wrap:nowrap!important;align-items:center!important}html body .pos39-toolbar .pos-ctx{min-width:0!important;max-width:100%!important;flex:1 1 0!important}html body .pos39-toolbar .pos-ctx[open]{flex-basis:100%!important}html body .pos39-toolbar:has(.pos-ctx[open]){flex-wrap:wrap!important}html body .pos39-hotkeys{flex:none!important;margin:0!important}
  html body .pos39-toolbar .pos-ctx>summary{display:block!important;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap!important}
  html body .pos39-toolbar form{max-width:100%!important;min-width:0!important}
  /* grupe: vodoravna traka kao u aplikacijama */
  html body .pos39-cats{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overscroll-behavior-x:contain;scroll-snap-type:x proximity;gap:8px!important;padding-bottom:4px!important;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  html body .pos39-cats::-webkit-scrollbar{display:none}
  html body .pos39-cats .pos39-cat{flex:0 0 auto!important;min-width:128px!important;max-width:62vw;scroll-snap-align:start}
  html body .pos39-cats .pos39-cat b{white-space:nowrap}
  /* kartice artikala: 2 stupca, kompaktno */
  html body .pos39-products{min-width:0!important}
  html body .pos39-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  html body .pos39-product{min-width:0!important}
  html body .pos39-product b{font-size:15px!important;line-height:1.25!important;overflow-wrap:anywhere}
  html body .pos39-product-meta strong{font-size:17px!important}
  html body .pos39-today-fiscal,html body .pos39-today-list{min-width:0!important;max-width:100%!important}
  html body .pos39-today-list p{white-space:normal!important}
  /* prozori (dijalozi) preko cijelog ekrana */
  html body dialog.pos39-modal>*,html body .pos-display-card{width:100vw!important;max-width:100vw!important;max-height:calc(100dvh - 20px);overflow:auto;box-sizing:border-box}
  html body .pos39-fiscal-grid{grid-template-columns:minmax(0,1fr)!important}
  html body .pos39-fiscal-dates,html body .pos39-fiscal-dates.pst-period3{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important}
  html body .pos39-fiscal-dates.pst-period3 label:first-child{grid-column:1/-1}
  html body #posDisplayModal .pos-preset-segment,html body #posDisplayModal .pos-face-segment{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  html body input,html body select,html body textarea{font-size:16px} /* iOS ne zumira polja */

  /* --- kasa kao aplikacija: jedno skrolanje, donja traka, traka računa --- */
  html body .pos39-shell,html body .pos39-shell .pos39-work{height:auto!important;min-height:0!important;overflow:visible!important}
  html body .pos39-shell .pos39-work{grid-template-rows:none!important;grid-auto-rows:auto!important;padding-bottom:0!important}
  html body .pos39-products,html body .pos39-grid{height:auto!important;max-height:none!important;overflow:visible!important}
  html body .pos39-top .pos39-brand small{display:none!important}
  html body .pos39-top-stats>div,html body .pos39-top-stats .pos39-mobile-cart{display:none!important}
  html body .pos39-hotkeys>span{display:none!important}
  html body .pos39-hotkeys{margin-left:auto}
  html body .pos39-products-head>span{display:none!important}
  html body .pos39-nav{position:fixed!important;left:0!important;right:0!important;bottom:0!important;top:auto!important;z-index:70!important;width:100%!important;max-width:100vw!important;margin:0!important;display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:0!important;height:auto!important;min-height:0!important;padding:6px 2px calc(6px + env(safe-area-inset-bottom))!important;background:#fff!important;border-radius:0!important;border-top:1px solid #dde4ec!important;box-shadow:0 -6px 18px rgba(15,35,60,.08)!important}
  html body .pos39-shell .pos39-nav>a,html body .pos39-shell .pos39-nav>button{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;min-width:0!important;min-height:50px!important;padding:2px!important;margin:0!important;background:transparent!important;border:0!important;border-radius:12px!important;color:#3a4a60!important;font-size:19px!important;line-height:1!important;box-shadow:none!important}
  html body .pos39-shell .pos39-nav>a span,html body .pos39-shell .pos39-nav>button span{font-size:10.5px!important;font-weight:700!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block!important}
  html body .pos39-shell .pos39-nav>a.active{color:#f57c00!important;background:#fff4ea!important}
  html body .pos39-nav .pos39-copyright{display:none!important}
  html body:has(.pos39-shell){padding-bottom:calc(150px + env(safe-area-inset-bottom))!important}
  html[data-pos-theme="dark"] body .pos39-nav{background:#1b2633!important;border-top-color:#344456!important}
  html[data-pos-theme="dark"] body .pos39-shell .pos39-nav>a,html[data-pos-theme="dark"] body .pos39-shell .pos39-nav>button{color:#d5dee8!important}
  .mmc-cartbar{position:fixed;left:10px;right:10px;bottom:calc(70px + env(safe-area-inset-bottom));z-index:69;transition:transform .2s ease,opacity .2s ease}
  .mmc-cartbar.hide{transform:translateY(16px);opacity:0;pointer-events:none}
  .mmc-cartbar button{width:100%;display:flex;align-items:center;gap:12px;padding:12px 16px;border:0;border-radius:16px;background:#142033;color:#fff;font:inherit;text-align:left;box-shadow:0 10px 24px rgba(15,35,60,.28);cursor:pointer}
  .mmc-cartbar.empty button{background:#e9eef5;color:#475469;box-shadow:0 6px 14px rgba(15,35,60,.10)}
  .mmc-cartbar .t{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.2}
  .mmc-cartbar .t b{font-size:15px}.mmc-cartbar .t small{font-size:12px;opacity:.8}
  .mmc-cartbar strong{font-size:18px;white-space:nowrap}
  .mmc-cartbar em{font-style:normal;font-weight:800;font-size:13px;background:#f57c00;color:#fff;border-radius:10px;padding:7px 10px;white-space:nowrap}
  .mmc-cartbar.empty em{display:none}

  html body #posTodayFiscalMobile:not([hidden]),html body #posTodayFiscalMobile,html body .pos39-shell details.pos39-today-fiscal.pos39-today-fiscal-mobile{display:none!important}
  html body .pos39-shell .pos39-theme-toggle{position:static!important;top:auto!important;right:auto!important;width:auto!important;min-width:64px}
  html body .pos39-shell .pos39-ticket{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}
  html body .pos39-shell .pos39-lines{flex:none!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}
  html body .pos39-ticket-empty{padding:18px 10px!important}
  html body .pos39-cats .pos39-cat{min-width:118px!important;padding:10px 12px!important;min-height:0!important}
  html body .pos39-cats .pos39-cat span{font-size:11px!important}

  html body dialog.pos39-modal{width:100vw!important;max-width:100vw!important;margin:auto 0 0!important;padding:0!important;left:0;right:0}
  html body dialog.pos39-modal>*{margin:0 auto!important;border-radius:20px 20px 0 0!important;max-height:calc(100dvh - 40px)!important;padding-bottom:calc(16px + env(safe-area-inset-bottom))!important}
  html body dialog.pos39-modal *{min-width:0}
  html body .pos39-fiscal-card{width:auto!important;max-width:100%!important;box-sizing:border-box!important}
  html body .pos39-fiscal-sheet header{position:sticky;top:0;z-index:2;background:inherit}
  /* kartice bez slike: "+" u donjem redu (uz "Bez zalihe"), nikad preko cijene */
  html body .pos39-shell .pos39-product.no-img .pos39-product-copy{padding-bottom:0!important}
  html body .pos39-shell .pos39-product.no-img .pos-stock-inline{display:inline-flex!important;align-items:center;align-self:flex-start;min-height:30px;margin-top:8px!important}
  html body .pos39-shell .pos39-product.no-img .pos39-product-price-compact{position:absolute!important;top:auto!important;left:auto!important;right:10px!important;bottom:13px!important;width:auto!important;height:auto!important;margin:0!important;padding:0!important}
  html body .pos39-shell .pos39-product.no-img .pos39-product-price-compact button{width:34px!important;height:34px!important;min-width:0!important;min-height:0!important;padding:0!important;font-size:18px!important;line-height:1!important;border-radius:10px!important}
  html body .pos39-shell .pos39-product.no-img .pos39-product-meta{gap:6px;align-items:baseline}
  html body .pos39-shell .pos39-product.no-img .pos39-product-meta small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  html body .pos39-shell .pos39-product.no-img .pos39-product-meta strong{flex:none;margin-left:auto}
}

/* ===== BACKOFFICE na telefonu/tabletu: gornja traka + meni kao ladica ===== */
@media screen and (max-width:900px){
  html body aside.app-sidebar{position:sticky!important;top:0!important;z-index:80!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;display:block!important;padding:0!important;overflow:visible!important;box-shadow:0 4px 14px rgba(5,15,30,.25)}
  html body aside.app-sidebar .sidebar-top{display:flex!important;align-items:center!important;gap:10px!important;min-height:56px!important;padding:6px 12px!important;margin:0!important;border:0!important}
  html body aside.app-sidebar .sidebar-top .brand{flex:1 1 auto;min-width:0;display:flex!important;flex-direction:column;justify-content:center}
  html body aside.app-sidebar .sidebar-top .brand strong{font-size:19px!important;line-height:1.1!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html body aside.app-sidebar .sidebar-top .brand small,html body aside.app-sidebar .sidebar-top .brand em{display:none!important}
  html body aside.app-sidebar .sidebar-toggle{display:inline-flex!important;width:44px!important;height:44px!important;min-width:44px;align-items:center;justify-content:center;font-size:22px!important}
  html body aside.app-sidebar .mobile-logout{display:inline-flex!important;align-items:center;min-height:40px;padding:6px 12px!important;font-size:14px!important}
  html body aside.app-sidebar .side-nav,html body aside.app-sidebar .sidebar-user{display:none!important}
  html body.mmc-drawer-open aside.app-sidebar .side-nav{display:block!important;position:fixed!important;top:56px!important;left:0!important;bottom:0!important;width:min(86vw,340px)!important;max-height:none!important;overflow-y:auto!important;overscroll-behavior:contain;padding:10px 10px calc(20px + env(safe-area-inset-bottom))!important;background:inherit;background-color:#0d1a30;z-index:91;box-shadow:12px 0 30px rgba(0,0,0,.35);animation:mmcDrawer .18s ease-out}
  html body.mmc-drawer-open aside.app-sidebar .sidebar-user{display:flex!important;position:fixed!important;left:0;bottom:0;width:min(86vw,340px);z-index:92;background:#0d1a30;padding:10px 14px calc(10px + env(safe-area-inset-bottom))!important}
  html body.mmc-drawer-open::after{content:"";position:fixed;inset:56px 0 0 0;background:rgba(5,15,30,.45);z-index:79}
  html body.mmc-drawer-open{overflow:hidden!important}
  /* sažeti meni s računara ne smije pokvariti telefon */
  html body.sidebar-collapsed aside.app-sidebar{width:100%!important}
  html body.sidebar-collapsed aside.app-sidebar .brand{display:flex!important}
  html body.sidebar-collapsed aside.app-sidebar .side-text,html body.sidebar-collapsed aside.app-sidebar .chev{display:inline!important}
  html body.sidebar-collapsed aside.app-sidebar .side-subnav .side-link{display:flex!important}
  html body.sidebar-collapsed aside.app-sidebar .side-group[open] .side-subnav{display:block!important}
  html body.sidebar-collapsed aside.app-sidebar .side-link,html body.sidebar-collapsed aside.app-sidebar .side-group summary{justify-content:flex-start!important}
  html body main.app-main{margin-left:0!important;width:100%!important;max-width:100vw!important;padding-left:12px!important;padding-right:12px!important;box-sizing:border-box}
  html body main.app-main>header.app-header{top:56px!important}
  html{scroll-padding-top:150px}
  /* široke tabele: vodoravno klizanje unutar okvira umjesto odsijecanja */
  .mmc-hscroll{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%;margin:0 0 12px;border-radius:10px;background:linear-gradient(90deg,#fff 30%,rgba(255,255,255,0)) left/24px 100% no-repeat local,linear-gradient(270deg,#fff 30%,rgba(255,255,255,0)) right/24px 100% no-repeat local,radial-gradient(farthest-side at 0 50%,rgba(15,35,60,.18),transparent) left/10px 100% no-repeat scroll,radial-gradient(farthest-side at 100% 50%,rgba(15,35,60,.18),transparent) right/10px 100% no-repeat scroll}
  .mmc-hscroll>table{margin:0!important}
  /* forme i dugmad prilagođeni prstu */
  html body main .btn,html body main button:not(.mmc-back):not(.sidebar-toggle){min-height:40px}
  html body main .formgrid{grid-template-columns:minmax(0,1fr)!important}
  html body main .formgrid>*{grid-column:auto!important}
  html body main .actions{flex-wrap:wrap!important}

  html body footer.app-copyright{position:static!important;display:block!important;margin:18px auto calc(14px + env(safe-area-inset-bottom))!important;text-align:center;background:none!important;box-shadow:none!important;border:0!important}
  html body main.app-main>header.app-header .header-sub,html body main.app-main>header.app-header .header-date{display:none!important}
  html body main.app-main>header.app-header{padding-top:8px!important;padding-bottom:8px!important;min-height:0!important}
  html body main.app-main>header.app-header h1{font-size:22px!important}
  html body .exec-kpis{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  html body .exec-kpis>*{min-width:0!important;padding:12px!important}
  html body .exec-kpis>* b,html body .exec-kpis>* strong{font-size:clamp(16px,4.8vw,20px)!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere}html body .exec-kpis>* *{text-overflow:clip!important}html body .exec-kpis>*>div:last-child{min-width:0}
}
@keyframes mmcDrawer{from{transform:translateX(-24px);opacity:.4}to{transform:none;opacity:1}}

/* OPTIKA-POS-45: scroll area ends above the fixed profile footer. */
@media(max-width:900px){
 html body.mmc-drawer-open aside.app-sidebar .side-nav{
  bottom:var(--mmc-drawer-footer-height,90px)!important;
  padding-bottom:calc(32px + env(safe-area-inset-bottom,0px))!important;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-y;
  box-sizing:border-box;
 }
 html body.mmc-drawer-open aside.app-sidebar .sidebar-user{box-sizing:border-box}
}
