:root {
  --zsc-c: #2563eb;
  --zsc-shadow: rgba(37,99,235,.45);
  --zsc-bg: #f2f6ff;
}
#zsc-root { position: fixed; bottom: 170px; z-index: 99999; font-family: -apple-system, Segoe UI, Arial, sans-serif; }
#zsc-root.zsc-pos-left { left: 20px; }
#zsc-root.zsc-pos-right { right: 20px; }

/* ---- כפתור פתיחה ---- */
#zsc-root #zsc-toggle {
  position: relative; display: block; width: 84px; height: 84px; min-width: 0; min-height: 0;
  border: none !important; border-radius: 50% !important; cursor: pointer;
  background: transparent !important; box-shadow: none !important;
  filter: drop-shadow(0 6px 16px var(--zsc-shadow)); transition: transform .15s;
  padding: 0 !important; margin: 0; line-height: 1; overflow: visible;
}
#zsc-root #zsc-toggle:hover, #zsc-root #zsc-toggle:focus { background: transparent !important; transform: scale(1.07); outline: none; }
#zsc-root #zsc-toggle img { display: block; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; border: 3px solid #fff; border-radius: 50%; pointer-events: none; box-sizing: border-box; }
#zsc-root #zsc-toggle.zsc-noimg { background: var(--zsc-c) !important; color: #fff; font-size: 34px; }

/* ---- בועת פנייה ---- */
#zsc-bubble {
  position: absolute; bottom: 14px; background: #fff; color: #1a1a1a; padding: 12px 18px; border-radius: 18px; font-size: 15px; font-weight: 700; line-height: 1.35; white-space: normal; width: 200px; border: 2px solid var(--zsc-c);
  box-shadow: 0 3px 12px rgba(0,0,0,.18); cursor: pointer; opacity: 0; transform: translateY(8px); transition: all .3s; pointer-events: none;
}
.zsc-pos-left #zsc-bubble { left: 92px; }
.zsc-pos-right #zsc-bubble { right: 92px; }
#zsc-bubble.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ---- חלון ---- */
#zsc-window {
  display: none; position: fixed; bottom: 20px; width: 380px; max-width: calc(100vw - 40px); height: 560px; max-height: calc(100vh - 40px);
  background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 12px 40px rgba(15,40,100,.28); flex-direction: column;
}
.zsc-pos-left #zsc-window { left: 20px; }
.zsc-pos-right #zsc-window { right: 20px; }
#zsc-window.open { display: flex; animation: zsc-pop .25s ease; }
@keyframes zsc-pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---- כותרת ---- */
#zsc-header {
  position: relative; background: linear-gradient(135deg, color-mix(in srgb, var(--zsc-c) 75%, #fff) 0%, var(--zsc-c) 55%, color-mix(in srgb, var(--zsc-c) 75%, #000) 100%);
  color: #fff; padding: 18px 16px 20px 20px; display: flex; align-items: center; justify-content: space-between; border-radius: 22px 22px 0 0;
}
@supports not (color: color-mix(in srgb, red, blue)) { #zsc-header { background: var(--zsc-c); } }
#zsc-header-text { flex: 1; padding-right: 4px; }
#zsc-title { font-size: 20px; font-weight: 800; line-height: 1.2; }
#zsc-subtitle { font-size: 13px; opacity: .92; margin-top: 3px; }
#zsc-header-avatar { order: -1; width: 58px; height: 58px; object-fit: cover; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); filter: drop-shadow(0 3px 6px rgba(0,0,0,.25)); margin-left: 10px; }
#zsc-close { position: absolute; top: 10px; left: 10px; z-index: 5; background: rgba(255,255,255,.22); border: none; color: #fff; width: 38px; height: 38px; border-radius: 50%; font-size: 18px; cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center; }
#zsc-close::before { content: ''; position: absolute; inset: -8px; }
#zsc-close:hover { background: rgba(255,255,255,.32); }

/* ---- הודעות ---- */
#zsc-messages { flex: 1; overflow-y: auto; padding: 16px 14px; background: var(--zsc-bg); }
#zsc-messages::-webkit-scrollbar { width: 5px; }
#zsc-messages::-webkit-scrollbar-thumb { background: #c9d6f2; border-radius: 3px; }
.zsc-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.zsc-row-user { justify-content: flex-start; flex-direction: row-reverse; }
.zsc-avatar { width: 36px; height: 36px; object-fit: cover; border-radius: 50%; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
.zsc-msg { max-width: 78%; padding: 12px 16px; border-radius: 18px; font-size: 14.5px; line-height: 1.55; word-wrap: break-word; box-shadow: 0 2px 8px rgba(15,40,100,.07); }
.zsc-bot { background: #fff; color: #222; border-bottom-right-radius: 6px; }
.zsc-user { background: var(--zsc-c); color: #fff; border-bottom-left-radius: 6px; }
.zsc-bot a { color: var(--zsc-c); }
.zsc-typing { color: #7a8db3; letter-spacing: 4px; animation: zsc-blink 1s ease-in-out infinite; }
@keyframes zsc-blink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* ---- צ'יפים ---- */
.zsc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 44px 14px 0; }
.zsc-chip { border: 1.5px solid #d5e2fb; color: var(--zsc-c); background: #fff; border-radius: 22px; padding: 9px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; box-shadow: 0 2px 6px rgba(15,40,100,.06); }
.zsc-chip:hover { background: var(--zsc-c); color: #fff; border-color: var(--zsc-c); }

/* ---- כרטיסי מוצרים ---- */
.zsc-products { display: flex; flex-direction: column; gap: 9px; margin: 0 44px 12px 0; }
.zsc-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e6edfb; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 8px rgba(15,40,100,.07); transition: box-shadow .15s; }
.zsc-card:hover { box-shadow: 0 5px 16px rgba(15,40,100,.14); }
.zsc-card-link { display: flex; gap: 10px; padding: 10px; text-decoration: none; color: #222; }
.zsc-card-link img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.zsc-card-name { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.zsc-card-price { font-size: 14.5px; color: var(--zsc-c); font-weight: 800; margin-top: 4px; }
.zsc-card-price s { color: #999; font-weight: 400; font-size: 12px; }
.zsc-sale { background: #e53935; color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 10px; margin-right: 4px; }
.zsc-low { display: block; color: #e53935; font-size: 12px; font-weight: 700; margin-top: 3px; }
.zsc-stars { color: #f5a623; font-size: 12px; }
.zsc-add { display: block; text-align: center; text-decoration: none; border: none; background: #eef4ff; color: var(--zsc-c); font-weight: 700; padding: 9px; cursor: pointer; font-size: 13.5px; font-family: inherit; width: 100%; box-sizing: border-box; border-top: 1px solid #e6edfb; transition: background .15s; }
.zsc-add:hover { background: var(--zsc-c); color: #fff; }
.zsc-add.zsc-added { background: #2e7d32; color: #fff; }

/* ---- כפתורי קשר / קישורים ---- */
.zsc-contact-row { display: flex; flex-direction: column; gap: 7px; margin: 0 44px 12px 0; }
.zsc-contact-btn { display: block; text-align: center; background: var(--zsc-c); color: #fff; padding: 11px; border-radius: 14px; text-decoration: none; font-weight: 700; font-size: 14px; box-shadow: 0 3px 10px var(--zsc-shadow); }
.zsc-contact-btn:hover { filter: brightness(.92); color: #fff; }
.zsc-link-btn { background: #fff; color: var(--zsc-c); border: 1.5px solid var(--zsc-c); box-shadow: none; }
.zsc-link-btn:hover { background: var(--zsc-c); color: #fff; }
.zsc-wa { display: block; text-align: center; background: #25d366; color: #fff; padding: 11px; border-radius: 14px; text-decoration: none; font-weight: 700; font-size: 14px; margin: 0 44px 12px 0; box-shadow: 0 3px 10px rgba(37,211,102,.3); }
.zsc-wa:hover { color: #fff; }

/* ---- קלט ---- */
#zsc-input-row { display: flex; align-items: center; gap: 8px; padding: 12px 14px 6px; background: #fff; }
#zsc-input { flex: 1; border: 1.5px solid #e3eaf7; background: #f7f9fe; padding: 12px 18px; font-size: 16px; outline: none; border-radius: 26px; font-family: inherit; }
#zsc-input:focus { border-color: var(--zsc-c); background: #fff; }
#zsc-send { width: 46px; height: 46px; border-radius: 50%; border: none; flex-shrink: 0; background: var(--zsc-c); color: #fff; font-size: 17px; cursor: pointer; box-shadow: 0 3px 10px var(--zsc-shadow); transform: scaleX(-1); display: flex; align-items: center; justify-content: center; }
#zsc-send:hover { filter: brightness(1.08); }
#zsc-footer { text-align: center; font-size: 12px; color: #8a97ad; padding: 4px 0 10px; background: #fff; }

/* ---- מובייל ---- */
@media (max-width: 600px) {
  #zsc-root { bottom: 210px; }
  #zsc-close { left: 64px; }
  #zsc-root.zsc-pos-left { left: 12px; }
  #zsc-root.zsc-pos-right { right: 12px; }
  #zsc-root #zsc-toggle { width: 62px; height: 62px; }
  #zsc-bubble { bottom: 8px; font-size: 13.5px; width: 165px; padding: 8px 12px; }
  .zsc-pos-left #zsc-bubble { left: 70px; } .zsc-pos-right #zsc-bubble { right: 70px; }
  .zsc-pos-left #zsc-window, .zsc-pos-right #zsc-window { left: 0; right: 0; bottom: 0; }
  #zsc-window { position: fixed; bottom: 0; left: 0; right: 0; width: 100%; max-width: 100%; height: 82vh; max-height: 82vh; border-radius: 20px 20px 0 0; }
}
