@font-face {
  font-family: 'Discovery';
  src: url('https://trp-elc.co.il/wp-content/uploads/2026/05/Discovery_Fs-Regular-1.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --csc-blue: #2563eb;
  --csc-blue-2: #4f8bfd;
  --csc-blue-dark: #1e50c8;
  --csc-bg: #f2f6ff;
}

#csc-root {
  position: fixed; bottom: 90px; left: 20px; z-index: 99999;
  font-family: 'Discovery', -apple-system, Segoe UI, Arial, sans-serif;
}

/* ---- כפתור פתיחה ---- */
#csc-root #csc-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 rgba(37,99,235,.45));
  transition: transform .15s;
  padding: 0 !important; margin: 0; line-height: 1; overflow: visible;
}
#csc-root #csc-toggle:hover, #csc-root #csc-toggle:focus { background: transparent !important; transform: scale(1.07); outline: none; }
#csc-root #csc-toggle img {
  display: block; width: 100% !important; height: 100% !important; max-width: none;
  object-fit: contain; border: 0; border-radius: 0; pointer-events: none;
}
#csc-root #csc-toggle.csc-noimg {
  background: var(--csc-blue) !important; color: #fff; font-size: 34px;
}
#csc-badge {
  position: absolute; top: -2px; right: -2px;
  background: #e53935; color: #fff; font-size: 12px; font-weight: 700;
  width: 22px; height: 22px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; border: 2px solid #fff;
}

/* ---- בועת פנייה ---- */
#csc-bubble {
  position: absolute; bottom: 22px; left: 92px; right: auto; background: #fff; color: #222;
  padding: 10px 14px; border-radius: 14px; font-size: 13px; white-space: nowrap;
  box-shadow: 0 3px 12px rgba(0,0,0,.18); cursor: pointer;
  opacity: 0; transform: translateY(8px); transition: all .3s; pointer-events: none;
}
#csc-bubble.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ---- חלון ---- */
#csc-window {
  display: none; position: absolute; bottom: 88px; left: 0;
  width: 380px; max-width: calc(100vw - 40px); height: 560px; max-height: 72vh;
  background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(15,40,100,.28);
  flex-direction: column;
}
#csc-window.open { display: flex; animation: csc-pop .25s ease; }
@keyframes csc-pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---- כותרת עם גרדיאנט ורובוט ---- */
#csc-header {
  position: relative;
  background: linear-gradient(135deg, var(--csc-blue-2) 0%, var(--csc-blue) 55%, var(--csc-blue-dark) 100%);
  color: #fff; padding: 18px 20px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 22px 22px 0 0;
}
#csc-header-text { flex: 1; padding-right: 4px; }
#csc-header { padding-right: 16px; }
#csc-title { font-size: 21px; font-weight: 800; line-height: 1.2; }
#csc-subtitle { font-size: 13px; opacity: .92; margin-top: 3px; }
#csc-header-avatar {
  order: -1; width: 62px; height: 62px; object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.25));
  margin-left: 10px; margin-right: 0;
}
#csc-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;
}
#csc-close::before {
  content: ''; position: absolute; inset: -8px; /* אזור לחיצה מורחב */
}
#csc-close:hover { background: rgba(255,255,255,.32); }

/* ---- אזור הודעות ---- */
#csc-messages { flex: 1; overflow-y: auto; padding: 16px 14px; background: var(--csc-bg); }
#csc-messages::-webkit-scrollbar { width: 5px; }
#csc-messages::-webkit-scrollbar-thumb { background: #c9d6f2; border-radius: 3px; }

.csc-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.csc-row-user { justify-content: flex-start; flex-direction: row-reverse; }
.csc-avatar {
  width: 38px; height: 38px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
}

.csc-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);
}
.csc-bot  { background: #fff; color: #222; border-bottom-right-radius: 6px; }
.csc-user { background: var(--csc-blue); color: #fff; border-bottom-left-radius: 6px; }
.csc-bot a { color: var(--csc-blue); }
.csc-typing { color: #7a8db3; letter-spacing: 4px; animation: csc-blink 1s ease-in-out infinite; }
@keyframes csc-blink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* ---- צ'יפים ---- */
.csc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 46px 14px 0; }
.csc-chip {
  border: 1.5px solid #d5e2fb; color: var(--csc-blue); 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);
}
.csc-chip:hover { background: var(--csc-blue); color: #fff; border-color: var(--csc-blue); }

/* ---- כרטיסי מוצרים ---- */
.csc-products { display: flex; flex-direction: column; gap: 9px; margin: 0 46px 12px 0; }
.csc-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;
}
.csc-card:hover { box-shadow: 0 5px 16px rgba(15,40,100,.14); }
.csc-card-link { display: flex; gap: 10px; padding: 10px; text-decoration: none; color: #222; }
.csc-card-link img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.csc-card-name { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.csc-card-price { font-size: 14.5px; color: var(--csc-blue); font-weight: 800; margin-top: 4px; }
.csc-card-price s { color: #999; font-weight: 400; font-size: 12px; }
.csc-sale { background: #e53935; color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 10px; margin-right: 4px; }
.csc-low { display: block; color: #e53935; font-size: 12px; font-weight: 700; margin-top: 3px; }
.csc-stars { color: #f5a623; font-size: 12px; }
.csc-add {
  border: none; background: #eef4ff; color: var(--csc-blue); font-weight: 700;
  padding: 9px; cursor: pointer; font-size: 13.5px; font-family: inherit; width: 100%;
  border-top: 1px solid #e6edfb; transition: background .15s;
}
.csc-add:hover { background: var(--csc-blue); color: #fff; }
.csc-add.csc-added { background: #2e7d32; color: #fff; }

/* ---- כפתורי קשר ---- */
.csc-contact-row { display: flex; flex-direction: column; gap: 7px; margin: 0 46px 12px 0; }
.csc-contact-btn {
  display: block; text-align: center; background: var(--csc-blue); color: #fff;
  padding: 11px; border-radius: 14px; text-decoration: none; font-weight: 700; font-size: 14px;
  box-shadow: 0 3px 10px rgba(37,99,235,.3);
}
.csc-contact-btn:hover { background: var(--csc-blue-dark); color: #fff; }
.csc-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 46px 12px 0; box-shadow: 0 3px 10px rgba(37,211,102,.3);
}
.csc-wa:hover { color: #fff; }

/* ---- שורת קלט ---- */
#csc-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 6px; background: #fff;
}
#csc-input {
  flex: 1; border: 1.5px solid #e3eaf7; background: #f7f9fe;
  padding: 12px 18px; font-size: 14px; outline: none;
  border-radius: 26px; font-family: inherit;
}
#csc-input:focus { border-color: var(--csc-blue-2); background: #fff; }
#csc-send {
  width: 46px; height: 46px; border-radius: 50%; border: none; flex-shrink: 0;
  background: linear-gradient(135deg, var(--csc-blue-2), var(--csc-blue-dark));
  color: #fff; font-size: 17px; cursor: pointer;
  box-shadow: 0 3px 10px rgba(37,99,235,.35);
  transform: scaleX(-1); /* חץ מצביע שמאלה ב-RTL */
  display: flex; align-items: center; justify-content: center;
}
#csc-send:hover { filter: brightness(1.08); }

/* ---- פוטר ---- */
#csc-footer {
  text-align: center; font-size: 12px; color: #8a97ad;
  padding: 4px 0 10px; background: #fff;
}

/* ---- מובייל ---- */
@media (max-width: 600px) {
  #csc-root { bottom: 140px; left: 12px; }
  #csc-root #csc-toggle { width: 62px; height: 62px; }
  #csc-bubble { left: 70px; bottom: 14px; font-size: 12px; white-space: normal; width: 170px; }
  #csc-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;
  }
}
