/* WE INHALE programėlės sąsaja.
   Veikia TIK kai <html> turi klasę .is-app (iOS/Android programėlė arba telefone įdiegta PWA).
   Svetainė naršyklėje ir kompiuteryje nuo šio failo nesikeičia. */

html.is-app{
  --tabh:58px;
  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-t:env(safe-area-inset-top,0px);
  --appb:calc(var(--tabh) + var(--safe-b));
  -webkit-tap-highlight-color:transparent;
  -webkit-text-size-adjust:100%;
}
html.is-app.tab-off{--tabh:0px}
html.is-app body{padding-bottom:var(--appb);overscroll-behavior-y:none}
html.is-ios.is-native body{overscroll-behavior-y:auto}

/* ---------- Viršus: be žalios juostos, kompaktiška antraštė ---------- */
html.is-app .topbar{display:none!important}
html.is-app .header{top:0;padding-top:var(--safe-t)}
html.is-app .header-in{padding:6px 14px;gap:12px;min-height:56px;justify-content:center}
html.is-app .logo{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}
html.is-app .logo svg{width:92px}
html.is-app .menu-btn{display:inline-flex;margin-right:auto}
html.is-app .header-tools{margin-left:auto}
html.is-app .search-btn,html.is-app #account-link,html.is-app #cart-link{display:none!important}
html.is-app body.search-open .search{position:fixed;left:12px;right:12px;top:calc(var(--safe-t) + 62px);width:auto}
/* meniu (ir „Katalogas“) – virš apatinės juostos, juosta lieka matoma */
html.is-app .mnav{bottom:var(--appb);padding-bottom:8px}
html.is-app .mnav-body{padding-bottom:12px}

/* ---------- Apačia: be ilgos poraštės ---------- */
html.is-app .footer{display:none!important}
html.is-app .newsletter{display:none}
html.is-app[data-page="home"] .newsletter{display:block}

/* ---------- Apatinė meniu juosta ---------- */
.tabbar{display:none}
html.is-app .tabbar{
  display:grid;grid-template-columns:repeat(5,1fr);position:fixed;z-index:60;left:0;right:0;bottom:0;
  height:var(--appb);padding:0 6px var(--safe-b);box-sizing:border-box;
  background:rgba(11,12,11,.94);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  border-top:1px solid var(--line);transition:transform .2s ease;
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none
}
html.is-app.tab-off .tabbar,html.is-app.kb-open .tabbar{transform:translateY(110%);pointer-events:none}
html.is-app.tab-off .tabbar{display:none}
.tabbar a,.tabbar button{
  position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  min-width:0;height:var(--tabh);padding:0;border:0;background:none;color:var(--muted);
  font:inherit;font-size:11px;font-weight:700;letter-spacing:.1px;text-decoration:none;cursor:pointer
}
.tabbar svg{width:24px;height:24px;flex:none}
.tabbar span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tabbar .on{color:var(--accent)}
.tabbar .on::before{content:"";position:absolute;top:0;left:30%;right:30%;height:3px;border-radius:0 0 3px 3px;background:var(--accent)}
.tabbar a:active svg,.tabbar button:active svg{transform:scale(.9)}
.tb-n{position:absolute;top:5px;left:calc(50% + 6px);min-width:18px;height:18px;padding:0 5px;box-sizing:border-box;border-radius:999px;background:var(--accent);color:var(--ink);font-size:11px;font-weight:900;line-height:18px;text-align:center}
.tb-n[hidden]{display:none}
.tb-n.bump{animation:tbBump .45s ease}
@keyframes tbBump{40%{transform:scale(1.35)}}

/* ---------- Plaukiojantys mygtukai virš meniu juostos ---------- */
html.is-app .to-top,html.is-app .loy-fab{display:none!important}
html.is-app .toast{bottom:calc(var(--appb) + 14px)}
html.is-app .ck-fab{bottom:calc(var(--appb) + 14px)}
html.is-app .filter-fab{bottom:calc(var(--appb) + 14px)}
html.is-app .loy-pop{bottom:calc(var(--appb) + 12px);left:12px}
html.is-app #gidas{right:14px;bottom:calc(var(--appb) + 14px)}
html.is-app .gd-fab{width:52px;height:52px}
html.is-app .gd-pop{bottom:calc(var(--appb) + 76px);height:min(64vh,560px)}
html.is-app.kb-open .gd-pop{bottom:12px;height:min(52vh,460px)}
html.is-app.kb-open #gidas .gd-fab,html.is-app.kb-open .ck-fab,html.is-app.kb-open .filter-fab{display:none}

/* ---------- Prekės puslapis ---------- */
@media (max-width:900px){
  html.is-app .sbuy{bottom:var(--appb);padding:8px 12px;border-bottom:1px solid var(--line)}
  html.is-app .sbuy-i b{font-size:13px}
  html.is-app .sbuy .btn{min-height:40px;height:40px;padding:0 16px;font-size:13px;letter-spacing:.4px}
  html.is-app body.sbuy-on #gidas{bottom:calc(var(--appb) + 86px)}
  html.is-app.kb-open .sbuy{display:none}
  html.is-app .bb-bar{bottom:var(--appb);padding-bottom:12px}
}
html.is-app #g-main{touch-action:pan-y}
html.is-app #g-main img{transition:opacity .18s ease}
html.is-app #g-main.sw-fade img{opacity:.25}
.g-dots{display:none}
html.is-app .g-dots{display:flex;justify-content:center;gap:6px;margin-top:-4px}
html.is-app .g-dots i{width:7px;height:7px;border-radius:50%;background:var(--line-strong);transition:background .2s,width .2s}
html.is-app .g-dots i.on{width:18px;border-radius:4px;background:var(--accent)}
html.is-app .attr-row button,html.is-app [data-opt]{min-height:46px}
html.is-app .qty button{min-width:44px;min-height:44px}

/* ---------- Krepšelis iš apačios ---------- */
html.is-app .dr-panel,html.is-app .dr-panel.has-sug{
  top:auto;left:0;right:0;bottom:0;width:100%;max-height:calc(100vh - var(--safe-t) - 36px);
  border-left:0;border-top:1px solid var(--line-strong);border-radius:22px 22px 0 0;overflow:hidden;
  transform:translateY(102%);box-shadow:0 -20px 60px rgba(0,0,0,.55)
}
html.is-app .drawer.open .dr-panel{transform:none}
html.is-app .drawer.dragging .dr-panel{transition:none}
html.is-app .dr-panel::before{content:"";position:absolute;z-index:5;top:7px;left:50%;width:40px;height:5px;margin-left:-20px;border-radius:3px;background:var(--line-strong)}
html.is-app .dr-panel .dr-main{height:auto;max-height:calc(100vh - var(--safe-t) - 36px)}
html.is-app .dr-head{padding-top:20px}
html.is-app .dr-foot{padding-bottom:calc(14px + var(--safe-b))}

/* ---------- iOS: kad laukai nepriartintų ekrano ---------- */
html.is-ios input:not([type=checkbox]):not([type=radio]),html.is-ios select,html.is-ios textarea{font-size:16px}

/* ---------- Paskyra: kalba ir informacija (vietoje poraštės) ---------- */
.app-more{display:none}
html.is-app .app-more{display:block;max-width:560px;margin:0 auto;padding:0 16px 28px}
.app-more h2{margin:26px 2px 10px;font-size:12px;font-weight:800;letter-spacing:1.4px;text-transform:uppercase;color:var(--muted)}
.am-langs{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.am-langs button{height:46px;border-radius:14px;border:1px solid var(--line-strong);background:var(--surface);color:var(--text);font:inherit;font-weight:800;font-size:14px;cursor:pointer}
.am-langs button.on{border-color:var(--accent);color:var(--ink);background:var(--accent)}
.am-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:18px;overflow:hidden;background:var(--surface)}
.am-list a,.am-list button{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;padding:0 16px;border:0;border-top:1px solid var(--line);background:none;color:var(--text);font:inherit;font-weight:700;font-size:15px;text-align:left;text-decoration:none;cursor:pointer}
.am-list > :first-child{border-top:0}
.am-list svg{flex:none;width:18px;height:18px;color:var(--muted)}
.am-ver{margin:18px 2px 0;font-size:12px;color:var(--muted);text-align:center}

/* ---------- Patraukus žemyn – atnaujinti (Android ir PWA) ---------- */
.ptr{position:fixed;z-index:65;left:50%;top:calc(var(--safe-t,0px) + 8px);width:40px;height:40px;margin-left:-20px;border-radius:50%;background:var(--surface);border:1px solid var(--line-strong);display:flex;align-items:center;justify-content:center;color:var(--accent);opacity:0;transform:translateY(-60px);pointer-events:none;box-shadow:0 8px 20px rgba(0,0,0,.4)}
.ptr svg{width:22px;height:22px}
.ptr.go svg{animation:ptrSpin .8s linear infinite}
@keyframes ptrSpin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.tabbar,html.is-app .dr-panel{transition:none}.ptr.go svg{animation:none}}
