/* פשוט ללא גלוטן · עיצוב חלקי האפליקציה (סרגל תחתון, התקנה, גרסה חדשה, safe-area) */

/* ============ safe-area: אייפונים עם "חריץ" ופס בית ============ */
body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
.header{padding-top:env(safe-area-inset-top)}
.drawer{padding-top:env(safe-area-inset-top)}
.drawer-foot{padding-bottom:calc(18px + env(safe-area-inset-bottom))}
.fab,.wa-float{margin-bottom:env(safe-area-inset-bottom)}
.notice-bar{margin-bottom:env(safe-area-inset-bottom)}

/* ============ סרגל ניווט תחתון (טלפון בלבד) ============ */
:root{--tabbar-h:64px}
.tabbar{display:none}
@media (max-width:760px){
  .tabbar{
    position:fixed;z-index:68;bottom:0;inset-inline:0;
    display:grid;grid-template-columns:repeat(5,1fr);align-items:end;
    height:calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding:0 max(6px,env(safe-area-inset-left)) env(safe-area-inset-bottom) max(6px,env(safe-area-inset-right));
    background:rgba(255,255,255,.96);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
    border-top:1px solid var(--line);box-shadow:0 -6px 22px rgba(34,31,27,.07)
  }
  .tab{
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    height:var(--tabbar-h);min-width:0;padding:6px 2px 8px;
    background:none;border:0;color:var(--ink-faint);text-decoration:none;
    font:inherit;font-size:12px;font-weight:600;line-height:1.1;cursor:pointer;
    -webkit-tap-highlight-color:transparent
  }
  .tab svg{width:25px;height:25px;flex:none}
  .tab > span[data-t]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .tab.on{color:var(--green-deep)}
  .tab.on svg{stroke-width:2.2}
  .tab:focus-visible{outline:3px solid #A65F2A;outline-offset:-4px;border-radius:12px}
  .tab:active{transform:scale(.94)}

  /* העגלה באמצע: עיגול ירוק בולט */
  .tab-cart{color:var(--green-deep);font-weight:700}
  .tab-cart-ico{
    position:relative;display:grid;place-items:center;width:52px;height:52px;margin-top:-22px;
    border-radius:50%;background:var(--green);color:#fff;
    box-shadow:0 6px 16px rgba(46,82,57,.35);border:3px solid #fff
  }
  .tab-cart-ico svg{width:24px;height:24px}
  .tab-count{
    position:absolute;top:-4px;inset-inline-end:-6px;min-width:21px;height:21px;padding:0 5px;
    border-radius:999px;background:var(--amber);color:#fff;border:2px solid #fff;
    font-size:11.5px;font-weight:800;line-height:17px;text-align:center
  }
  .tab-count[hidden]{display:none}

  /* הסרגל מחליף בטלפון את כפתור העגלה ועיגול הוואטסאפ הצפים */
  body.has-tabbar .fab,body.has-tabbar .wa-float{display:none!important}
  body.has-tabbar{padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom))}
  body.has-tabbar .notice-bar{bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px);margin-bottom:0}
}

/* ============ הצעה להתקנה ============ */
.pwa-install{
  position:fixed;z-index:77;inset-inline:12px;margin:0 auto;max-width:460px;
  bottom:calc(14px + env(safe-area-inset-bottom));
  display:flex;align-items:center;gap:11px;padding:12px 14px;padding-inline-end:40px;
  background:var(--green-deep);color:#fff;border-radius:18px;box-shadow:var(--shadow-l);
  animation:pwaUp .35s cubic-bezier(.32,.72,0,1)
}
.pwa-install img{width:44px;height:44px;border-radius:50%;flex:none}
.pwa-install-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;font-size:13px;line-height:1.35;opacity:.95}
.pwa-install-txt b{font-size:15px;line-height:1.25}
.pwa-go{flex:none;background:#fff;color:var(--green-deep);border:0;border-radius:999px;padding:9px 16px;font:inherit;font-weight:800;font-size:14.5px;cursor:pointer}
/* כפתור "פתיחה בכרום" (דפדפן סמסונג): בשורה משלו מתחת להסבר, כדי שהטקסט לא יידחס */
.pwa-install.is-wide{flex-wrap:wrap}
.pwa-install.is-wide .pwa-install-txt{flex-basis:calc(100% - 56px)}
a.pwa-go{text-decoration:none;display:block;text-align:center;flex:1 1 100%}
.pwa-x{position:absolute;top:7px;inset-inline-end:7px;width:28px;height:28px;border-radius:50%;border:0;background:rgba(255,255,255,.14);color:#fff;font-size:12px;cursor:pointer;display:grid;place-items:center;padding:0}
.pwa-install :focus-visible{outline:3px solid #fff;outline-offset:2px}
.pwa-share{
  display:inline-block;width:15px;height:17px;vertical-align:-3px;
  background:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v15M7 7l5-5 5 5'/%3E%3Cpath d='M8 11H5v15h14V11h-3'/%3E%3C/svg%3E")
}
@media (max-width:760px){
  body.has-tabbar .pwa-install{bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px)}
}
.foot-install{background:none;border:0;padding:0;color:inherit;font:inherit;text-decoration:underline;cursor:pointer}

/* ============ "יש גרסה חדשה" ============ */
.pwa-update{
  position:fixed;z-index:78;top:calc(var(--header-h) + env(safe-area-inset-top) + 10px);inset-inline:12px;margin:0 auto;max-width:420px;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 10px 10px 18px;background:var(--ink);color:#fff;border-radius:999px;box-shadow:var(--shadow-l);
  font-size:14.5px;font-weight:600;animation:pwaDown .35s cubic-bezier(.32,.72,0,1)
}
.pwa-update button{flex:none;background:var(--amber);color:#fff;border:0;border-radius:999px;padding:9px 18px;font:inherit;font-weight:800;cursor:pointer}
.pwa-update button:focus-visible{outline:3px solid #fff;outline-offset:2px}

@keyframes pwaUp{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}
@keyframes pwaDown{from{transform:translateY(-16px);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.pwa-install,.pwa-update{animation:none}.tab:active{transform:none}}
html.a11y-still .pwa-install,html.a11y-still .pwa-update{animation:none}

/* ============ בתוך האפליקציה המותקנת ============ */
html.is-app .foot-install{display:none}
