/* ================================================================
   PC-Bot Widget — Glassmorphism + Samsung Edge Lighting
   ================================================================ */

@property --aibot-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes aibot-edge-rotate {
  to { --aibot-angle: 360deg; }
}
@keyframes aibot-bubble-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-5px); }
}
@keyframes aibot-input-glow {
  0%, 100% { box-shadow: 0 0 0 1.5px rgba(255,255,255,0.65), 0 0 8px rgba(255,255,255,0.18); }
  25%       { box-shadow: 0 0 0 1.5px rgba(64,224,255,0.85), 0 0 10px rgba(64,224,255,0.32); }
  50%       { box-shadow: 0 0 0 1.5px rgba(135,206,235,0.72), 0 0 8px rgba(135,206,235,0.24); }
  75%       { box-shadow: 0 0 0 1.5px rgba(0,191,255,0.80), 0 0 10px rgba(0,191,255,0.30); }
}

/* ── Variables ──────────────────────────────────────────────────── */
#aibot-window,
#aibot-bubble,
.aibot-hdr-btn {
  --aibot-text:        #ffffff;
  --aibot-text-light:  rgba(255, 255, 255, 0.48);
  --aibot-border:      rgba(255, 255, 255, 0.14);
  --aibot-bot-bubble:  rgba(255, 255, 255, 0.22);
  --aibot-user-bubble: rgba(60, 110, 230, 0.45);
  --aibot-radius:      20px;
  --aibot-radius-sm:   16px;
  /* Outer frame — cyan, white, gold, purple */
  --el-1: #00ddff;
  --el-2: #ffffff;
  --el-3: #ffd700;
  --el-4: #cc44ff;
  --el-5: #ffffff;
  --el-6: #00ddff;
  /* Inner elements — white / turquoise / sky blue */
  --el-in-1: #ffffff;
  --el-in-2: #40e0ff;
  --el-in-3: #87ceeb;
  --el-in-4: #00bfff;
  --el-in-5: #ffffff;
}

/* ── Bubble ─────────────────────────────────────────────────────── */
#aibot-bubble {
  position: fixed !important;
  bottom: 24px !important;
  left: 24px !important;
  width: auto !important;
  min-width: 175px !important;
  height: 52px !important;
  min-height: 52px !important;
  padding: 0 20px 0 18px !important;
  margin: 0 !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  border-radius: 26px !important;
  border: none !important;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  z-index: 9999;
  color: #fff;
  /* Glass */
  background: rgba(51, 122, 183, 0.85) !important;
  backdrop-filter: blur(18px) saturate(1.8);
  -webkit-backdrop-filter: blur(18px) saturate(1.8);
  /* Glow */
  box-shadow:
    0 0 18px rgba(0, 200, 255, 0.35),
    0 0 36px rgba(50, 122, 183, 0.25),
    0 6px 22px rgba(0, 0, 0, 0.35);
  animation: aibot-bubble-float 3s ease-in-out infinite;
}
/* Edge lighting ring — pill shape */
#aibot-bubble::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 28px;
  padding: 2px;
  background: conic-gradient(
    from var(--aibot-angle) at 50% 50%,
    var(--el-1), var(--el-2), var(--el-3), var(--el-4), var(--el-5), var(--el-6)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: aibot-edge-rotate 5s linear infinite;
}
#aibot-bubble:hover {
  animation: none;
  box-shadow:
    0 0 26px rgba(0, 220, 255, 0.70),
    0 0 50px rgba(50, 122, 183, 0.45),
    0 8px 26px rgba(0, 0, 0, 0.40);
}
.aibot-bubble-icon {
  display: flex; align-items: center; flex-shrink: 0;
}
.aibot-bubble-label {
  font-size: 15px; font-weight: 700; color: #fff;
  letter-spacing: 0.4px; white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* ── Chat window ────────────────────────────────────────────────── */
#aibot-window {
  position: fixed;
  bottom: 96px;
  left: 24px;
  width: 430px;
  height: min(75vh, 760px);
  min-height: 420px;

  /* Multi-layer lit background — base #337ab7 */
  background:
    /* Top light */
    radial-gradient(ellipse 70% 40% at 50% 5%,  rgba(255, 255, 255, 0.18) 0%, transparent 65%),
    /* Center glow */
    radial-gradient(ellipse 55% 50% at 50% 50%, rgba(180, 225, 255, 0.22) 0%, transparent 65%),
    /* Left accent */
    radial-gradient(ellipse 40% 35% at 20% 55%, rgba(0, 200, 255, 0.12) 0%, transparent 60%),
    /* Right accent */
    radial-gradient(ellipse 35% 30% at 80% 45%, rgba(100, 180, 255, 0.10) 0%, transparent 55%),
    /* Base solid */
    #337ab7 !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border-radius: var(--aibot-radius, 20px) !important;
  border: none !important;

  /* Ambient glow — stronger spread */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.10),
    -8px 0 60px rgba(0, 210, 255, 0.45),
    8px 0 60px rgba(180, 50, 255, 0.35),
    0 0 100px rgba(0, 150, 255, 0.25),
    0 0 40px rgba(0, 210, 255, 0.20),
    0 28px 70px rgba(0, 0, 0, 0.55);

  display: flex;
  flex-direction: column;
  z-index: 9998;
  direction: rtl;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  color: var(--aibot-text);
  transition: opacity .28s, transform .28s;
  box-sizing: border-box;
}

/* Edge lighting — 2px ring, crisp */
#aibot-window::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--aibot-radius) + 3px);
  padding: 2px;
  background: conic-gradient(
    from var(--aibot-angle) at 50% 50%,
    var(--el-1), var(--el-2), var(--el-3), var(--el-4), var(--el-5), var(--el-6)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: aibot-edge-rotate 8s linear infinite;
  pointer-events: none;
}

#aibot-window.aibot-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(0.94);
}
@keyframes aibot-slide-up {
  from { opacity: 0; transform: translateY(24px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
#aibot-window:not(.aibot-hidden) {
  animation: aibot-slide-up .30s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Header ─────────────────────────────────────────────────────── */
#aibot-header {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--aibot-border);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-radius: var(--aibot-radius) var(--aibot-radius) 0 0;
  overflow: hidden;
}
#aibot-header-info { display: flex; align-items: center; gap: 11px; }
#aibot-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.30);
  overflow: hidden; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 0 12px rgba(0, 200, 255, 0.25);
}
#aibot-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 18%;
  border-radius: 50%;
  display: block;
}
#aibot-header-title { font-weight: 700; font-size: 15px; color: #fff; }
#aibot-header-actions { display: flex; gap: 6px; }
.aibot-icon-btn {
  background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85); cursor: pointer; padding: 5px;
  border-radius: 8px; transition: background .15s;
  display: flex; align-items: center;
}
.aibot-icon-btn:hover { background: rgba(255,255,255,0.20); color: #fff; }
.aibot-icon-btn svg { width: 18px; height: 18px; }

/* ── Messages ───────────────────────────────────────────────────── */
#aibot-messages {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth;
  min-width: 0;
}
#aibot-messages::-webkit-scrollbar { width: 3px; }
#aibot-messages::-webkit-scrollbar-track { background: transparent; }
#aibot-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.20); border-radius: 4px; }

/* ── Bubbles ────────────────────────────────────────────────────── */
.aibot-msg { display: flex; flex-direction: column; max-width: 82%; min-width: 0; }
.aibot-msg.bot  { align-self: flex-end;   align-items: flex-end;   }
.aibot-msg.user { align-self: flex-start; align-items: flex-start; }
/* When a message contains suggestion chips — stretch to full width */
.aibot-msg:has(.aibot-suggestions) { max-width: 100%; width: 100%; }
.aibot-bubble {
  padding: 10px 14px; border-radius: var(--aibot-radius-sm);
  line-height: 1.58; word-break: break-word;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.13);
}
.aibot-msg.bot  .aibot-bubble {
  background: var(--aibot-bot-bubble);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.32);
  border-bottom-right-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.10),
    0 0 18px rgba(255,255,255,0.20),
    0 0 36px rgba(255,255,255,0.08),
    inset 0 0 14px rgba(255,255,255,0.05);
}
.aibot-msg.user .aibot-bubble {
  background: var(--aibot-user-bubble);
  color: #fff;
  border: 2px solid rgba(120,170,255,0.50);
  border-bottom-left-radius: 4px;
  box-shadow:
    0 0 0 1px rgba(100,160,255,0.20),
    0 0 20px rgba(100,160,255,0.38),
    0 0 40px rgba(100,160,255,0.14),
    inset 0 0 14px rgba(120,170,255,0.08);
}
.aibot-msg-time { font-size: 10px; color: var(--aibot-text-light); margin-top: 3px; padding: 0 4px; }

/* ── Quick replies ──────────────────────────────────────────────── */
/* Suggestions inside messages — wrap so long chips don't overflow */
#aibot-window .aibot-msg .aibot-suggestions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  justify-content: center !important;
  margin-top: 6px !important;
}
/* Welcome-actions suggestions — single scrollable row */
#aibot-window .aibot-suggestions {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  justify-content: space-evenly !important;
  margin-top: 6px !important;
  overflow-x: auto !important;
  padding-bottom: 2px;
  scrollbar-width: none;
}
#aibot-window .aibot-suggestions::-webkit-scrollbar { display: none; }
#aibot-window .aibot-suggestion {
  background: rgba(255,255,255,0.08) !important;
  border: 1.5px solid rgba(255,255,255,0.32) !important;
  color: rgba(255,255,255,0.92) !important;
  border-radius: 20px !important; padding: 6px 10px !important;
  font-size: 13px !important; cursor: pointer; font-family: inherit;
  white-space: nowrap !important; flex-shrink: 0 !important;
  transition: background .15s, border-color .15s, box-shadow .15s;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12),
    0 0 14px rgba(255,255,255,0.14),
    inset 0 0 8px rgba(255,255,255,0.05);
  text-decoration: none !important;
}
#aibot-window .aibot-suggestion:hover {
  background: rgba(255,255,255,0.15) !important;
  border-color: rgba(255,255,255,0.55) !important;
  color: #fff !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.22),
    0 0 22px rgba(255,255,255,0.22),
    inset 0 0 10px rgba(255,255,255,0.08);
}

/* ── Product carousel ───────────────────────────────────────────── */
.aibot-msg.bot.aibot-carousel-wrapper,
.aibot-carousel-wrapper {
  width: calc(100% - 16px) !important; max-width: calc(100% - 16px) !important;
  align-self: stretch !important; padding: 0 !important;
  background: transparent !important; box-shadow: none !important; border: none !important;
}
.aibot-carousel { display: flex; align-items: center; gap: 5px; width: 100%; margin-top: 6px; }
.aibot-carousel-arrow {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.20) !important;
  background: rgba(255,255,255,0.10) !important;
  color: rgba(255,255,255,0.80) !important;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s; padding: 0; font-size: 15px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.aibot-carousel-arrow:hover:not(:disabled) { background: rgba(255,255,255,0.22) !important; color: #fff !important; }
.aibot-carousel-arrow:disabled { opacity: 0.25; cursor: default; }
.aibot-carousel-track { flex: 1; overflow: hidden; min-width: 0; }
.aibot-product-card {
  display: none; background: #ffffff !important; border: none !important;
  border-radius: 12px !important; overflow: hidden; width: 100%; animation: aibot-fade-in .18s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18) !important;
}
.aibot-product-card.aibot-card-active { display: block; }
.aibot-product-card:hover { border-color: rgba(255,255,255,0.28); }
@keyframes aibot-fade-in {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0);   }
}
.aibot-product-img { width: 100%; height: 130px; object-fit: contain; background: #f8f9fa; display: block; padding: 8px; box-sizing: border-box; }
.aibot-product-body { padding: 10px 12px 12px; }
.aibot-product-name {
  font-weight: 600; font-size: 12.5px; color: #1a1a2e; margin-bottom: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.aibot-product-price { font-weight: 700; color: #0066cc; font-size: 16px; }
.aibot-product-was   { font-size: 11px; color: #888; text-decoration: line-through; margin-right: 5px; }
.aibot-product-save  { font-size: 11px; color: #e53935; font-weight: 600; }
.aibot-product-link {
  display: block; text-align: center;
  background: linear-gradient(135deg, #0088cc, #337ab7);
  border: none; color: #fff !important; text-decoration: none;
  padding: 9px; font-size: 13px; font-weight: 700; transition: opacity .15s;
  margin-top: 8px; border-radius: 8px;
}
.aibot-product-link:hover { opacity: 0.88; }
.aibot-carousel-counter { text-align: center; font-size: 11.5px; color: var(--aibot-text-light); margin-top: 4px; }

/* ── Links & bold ───────────────────────────────────────────────── */
.aibot-link { color: #7dd8ff; text-decoration: underline; word-break: break-all; }
.aibot-link:hover { color: #b3eaff; }
.aibot-bold { font-weight: 700; color: #b3eaff; }

/* ── Spec Picker ───────────────────────────────────────────────── */
.aibot-spec-picker-msg { max-width: 100% !important; width: 100%; }
.aibot-spec-picker { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; width: 100%; }
.aibot-spec-section { display: flex; flex-direction: column; gap: 5px; }
.aibot-spec-label { font-weight: 700; font-size: 12px; color: rgba(200,225,255,0.85); padding-right: 2px; }
.aibot-spec-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.aibot-spec-chip {
  background: rgba(255,255,255,0.08) !important; border: 1px solid rgba(255,255,255,0.20) !important;
  color: rgba(255,255,255,0.80) !important; border-radius: 14px; padding: 5px 11px;
  font-size: 12px; cursor: pointer; font-family: inherit; line-height: 1.3;
  outline: none; user-select: none; transition: background .15s, border-color .15s; box-shadow: none !important;
}
.aibot-spec-chip:hover:not(.active):not(.aibot-more-btn) {
  background: rgba(255,255,255,0.16) !important; border-color: rgba(255,255,255,0.40) !important; color: #fff !important;
}
.aibot-spec-chip.active, .aibot-spec-chip.active:hover {
  background: rgba(80,130,255,0.36) !important; border-color: rgba(140,190,255,0.60) !important;
  color: #fff !important; font-weight: 700 !important;
}
.aibot-more-btn {
  background: rgba(255,255,255,0.05) !important; border: 1px dashed rgba(255,255,255,0.28) !important;
  color: rgba(200,225,255,0.75) !important; font-weight: 600; font-size: 11px;
}
.aibot-more-btn:hover { background: rgba(255,255,255,0.12) !important; }
.aibot-spec-hidden { display: none !important; }
.aibot-spec-custom { display: flex; }
.aibot-spec-input,
#aibot-widget .aibot-spec-input,
#aibot-messages input.aibot-spec-input,
#aibot-messages input[type="text"].aibot-spec-input,
#aibot-messages input[type="tel"].aibot-spec-input {
  width: 100% !important; border: 1.5px solid rgba(255,255,255,0.25) !important; border-radius: 8px !important;
  padding: 7px 10px !important; font-size: 13px !important; font-family: inherit !important; direction: rtl;
  color: #fff !important; -webkit-text-fill-color: #fff !important; caret-color: #fff !important;
  background: rgba(255,255,255,0.10) !important; outline: none !important; box-shadow: none !important;
  transition: border-color .15s; -webkit-appearance: none !important; appearance: none !important;
}
.aibot-spec-input:focus,
#aibot-messages input.aibot-spec-input:focus {
  border-color: rgba(120,180,255,0.60) !important;
  background: rgba(255,255,255,0.14) !important;
  outline: none !important;
  box-shadow: none !important;
}
.aibot-spec-input:-webkit-autofill,
.aibot-spec-input:-webkit-autofill:focus,
#aibot-messages input.aibot-spec-input:-webkit-autofill {
  -webkit-text-fill-color: #fff !important;
  -webkit-box-shadow: 0 0 0 1000px rgba(30,50,90,0.95) inset !important;
}
.aibot-spec-input::placeholder,
#aibot-messages input.aibot-spec-input::placeholder { color: rgba(200,225,255,0.55) !important; font-size: 12px; }
.aibot-spec-submit {
  margin-top: 8px; width: 100%; background: rgba(80,130,255,0.40);
  border: 1px solid rgba(120,170,255,0.30); color: #fff; border-radius: 10px;
  padding: 9px; font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background .15s; backdrop-filter: blur(6px);
}
.aibot-spec-submit:hover { background: rgba(80,130,255,0.62); }

/* ── Typing indicator ───────────────────────────────────────────── */
.aibot-typing {
  display: flex; gap: 5px; align-items: center; padding: 10px 14px;
  background: var(--aibot-bot-bubble); border-radius: var(--aibot-radius-sm);
  align-self: flex-end; border-bottom-right-radius: 3px;
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.aibot-typing span { width: 7px; height: 7px; border-radius: 50%; background: rgba(200,230,255,0.65); animation: aibot-bounce .9s infinite; }
.aibot-typing span:nth-child(2) { animation-delay: .15s; }
.aibot-typing span:nth-child(3) { animation-delay: .30s; }
@keyframes aibot-bounce {
  0%,80%,100% { transform: translateY(0); opacity: .45; }
  40%          { transform: translateY(-6px); opacity: 1; }
}
.aibot-typing-label { font-size: 10px; color: var(--aibot-text-light); margin-top: 2px; padding: 0 4px; align-self: flex-end; }

/* ── Welcome actions ────────────────────────────────────────────── */
#aibot-welcome-actions {
  padding: 10px 14px 4px; display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; flex-shrink: 0;
  border-top: 1px solid var(--aibot-border);
  background: rgba(0, 0, 0, 0.10);
}

/* ── Input wrap ─────────────────────────────────────────────────── */
#aibot-input-wrap {
  display: flex; flex-direction: column; flex-shrink: 0;
  border-top: 1px solid var(--aibot-border);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 0 0 var(--aibot-radius) var(--aibot-radius);
  overflow: visible;
}
#aibot-input-area { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px 8px; }

/* Input frame wrapper — holds the edge lighting ::before */
#aibot-input-frame {
  flex: 1;
  position: relative;
  border-radius: 18px;
}

#aibot-input {
  width: 100%; border: none !important; outline: none !important; border-radius: 18px;
  padding: 9px 16px; font-size: 14px; direction: rtl;
  font-family: inherit; color: #fff; -webkit-text-fill-color: #fff; caret-color: #fff;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .15s;
  resize: none; overflow-y: auto;
  min-height: 38px; max-height: 120px; line-height: 1.45; display: block; box-sizing: border-box;
  animation: aibot-input-glow 6s ease-in-out infinite;
  scrollbar-width: none; -ms-overflow-style: none;
  -webkit-appearance: none; appearance: none;
  box-shadow: none !important;
}
#aibot-input::-webkit-scrollbar { display: none; }
#aibot-input:focus { background: rgba(255,255,255,0.12); outline: none !important; border: none !important; box-shadow: none !important; }
#aibot-input:-webkit-autofill,
#aibot-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff !important;
  -webkit-box-shadow: 0 0 0 1000px rgba(30,50,90,0.95) inset !important;
}
#aibot-input::placeholder { color: rgba(255,255,255,0.65); }

/* Send button — filled gradient circle (Telegram style) */
#aibot-send {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #00c8ff 0%, #0088cc 50%, #0055aa 100%);
  border: none !important; outline: none !important;
  cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: box-shadow .2s, transform .15s;
  box-shadow:
    0 0 12px rgba(0, 180, 255, 0.55),
    0 0 24px rgba(0, 140, 220, 0.30),
    0 3px 10px rgba(0, 0, 0, 0.30);
}
#aibot-send:hover {
  transform: scale(1.08);
  box-shadow:
    0 0 18px rgba(0, 200, 255, 0.80),
    0 0 36px rgba(0, 160, 255, 0.45),
    0 4px 14px rgba(0, 0, 0, 0.35);
}
#aibot-send:disabled {
  background: rgba(255,255,255,0.15);
  box-shadow: none;
  cursor: default;
}
#aibot-send svg { width: 18px; height: 18px; position: relative; z-index: 2; }

/* ── WhatsApp Lead Button ───────────────────────────────────────── */
.aibot-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25d366;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  margin: 8px 0 4px;
  transition: background 0.2s, transform 0.15s;
}
.aibot-wa-btn:hover {
  background: #1ebe5a;
  transform: translateY(-1px);
}
.aibot-lead-divider {
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin: 6px 0 2px;
}

/* ── Customer Rating ────────────────────────────────────────────── */
.aibot-rating-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 10px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  direction: rtl;
}
.aibot-rate-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  background: rgba(255, 255, 255, 0.14) !important;
  border: 1px solid rgba(255, 255, 255, 0.30) !important;
  border-radius: 50px !important;
  padding: 6px 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  cursor: pointer !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
  transition: background 0.15s, border-color 0.15s !important;
  flex-shrink: 0 !important;
  font-family: inherit !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none !important;
}
.aibot-rate-btn:hover {
  background: rgba(255, 255, 255, 0.26) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
}
.aibot-rate-btn:focus,
.aibot-rate-btn:active {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: rgba(255, 255, 255, 0.50) !important;
  box-shadow: none !important;
  outline: none !important;
}
.aibot-rating-thanks {
  padding: 2px 14px 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  direction: rtl;
}

/* ── Hint Bubble (shown near bubble 3.5s after page load) ─────────── */
#aibot-hint-bubble {
  position: fixed !important;
  bottom: 88px !important;
  left: 24px !important;
  background: linear-gradient(135deg, #ffffff 0%, #eaf6ff 100%) !important;
  border: 1.5px solid rgba(0, 180, 255, 0.35) !important;
  border-radius: 16px !important;
  padding: 12px 18px !important;
  box-shadow:
    0 6px 24px rgba(0, 150, 255, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.10) !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  line-height: 1.55 !important;
  color: #1a3a5c !important;
  direction: rtl !important;
  text-align: right !important;
  max-width: 230px !important;
  cursor: pointer !important;
  display: block !important;
  opacity: 0 !important;
  transform: translateY(10px) scale(0.96) !important;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22,1,0.36,1) !important;
  pointer-events: none !important;
  z-index: 999998 !important;
}
#aibot-hint-bubble:hover {
  box-shadow:
    0 8px 30px rgba(0, 150, 255, 0.28),
    0 2px 10px rgba(0, 0, 0, 0.12) !important;
  transform: translateY(-2px) scale(1.01) !important;
}
/* Arrow pointing down toward bubble button */
#aibot-hint-bubble::after {
  content: '' !important;
  position: absolute !important;
  bottom: -9px !important;
  left: 30px !important;
  width: 0 !important;
  height: 0 !important;
  border-left: 9px solid transparent !important;
  border-right: 9px solid transparent !important;
  border-top: 9px solid #d6efff !important;
}
#aibot-hint-bubble.aibot-hint-visible {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  pointer-events: auto !important;
}
/* Gentle pulse after entrance */
@keyframes aibot-hint-pulse {
  0%   { box-shadow: 0 6px 24px rgba(0,150,255,0.18), 0 2px 8px rgba(0,0,0,0.10); }
  50%  { box-shadow: 0 6px 32px rgba(0,180,255,0.38), 0 2px 8px rgba(0,0,0,0.10); }
  100% { box-shadow: 0 6px 24px rgba(0,150,255,0.18), 0 2px 8px rgba(0,0,0,0.10); }
}
#aibot-hint-bubble.aibot-hint-visible {
  animation: aibot-hint-pulse 2s ease-in-out 0.5s 2;
}

/* ── Rating Toast (shown near bubble on window close) ───────────── */
#aibot-rating-toast {
  position: fixed;
  bottom: 96px;
  left: 16px;
  right: auto;
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 100%);
  border: 1.5px solid rgba(0, 120, 220, 0.18);
  border-radius: 18px;
  padding: 14px 16px 12px;
  box-shadow:
    0 8px 28px rgba(10, 39, 105, 0.16),
    0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  direction: rtl;
  font-size: 13.5px;
  font-weight: 600;
  color: #1a3a5c;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22,1,0.36,1);
  pointer-events: none;
  z-index: 999999;
  min-width: 220px;
}
#aibot-rating-toast .aibot-toast-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#aibot-rating-toast .aibot-toast-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
/* Arrow pointing down toward bubble — left side (default) */
#aibot-rating-toast::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 32px;
  right: auto;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid #deeeff;
}
/* Bubble on right side — toast + arrow shift right */
#aibot-rating-toast.aibot-toast-right {
  left: auto;
  right: 16px;
}
#aibot-rating-toast.aibot-toast-right::after {
  left: auto;
  right: 32px;
}
#aibot-rating-toast.aibot-toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.aibot-toast-rate-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: linear-gradient(135deg, #1a6fd4 0%, #1558b0 100%) !important;
  border: none !important;
  border-radius: 50px !important;
  padding: 7px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  cursor: pointer !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
  transition: opacity 0.15s, transform 0.12s !important;
  flex-shrink: 0 !important;
  font-family: inherit !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: 0 2px 8px rgba(26,111,212,0.30) !important;
  outline: none !important;
}
.aibot-toast-rate-btn:hover {
  opacity: 0.88 !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(26,111,212,0.40) !important;
}
.aibot-toast-rate-btn:focus,
.aibot-toast-rate-btn:active {
  opacity: 0.92 !important;
  transform: translateY(0) !important;
  box-shadow: 0 2px 6px rgba(26,111,212,0.25) !important;
  outline: none !important;
}
.aibot-toast-skip {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: rgba(26, 58, 92, 0.35);
  cursor: pointer;
  font-size: 15px;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
.aibot-toast-skip:hover { color: rgba(26, 58, 92, 0.7); }
.aibot-toast-skip:focus { outline: none; box-shadow: none; }

/* ── Credit ─────────────────────────────────────────────────────── */
#aibot-credit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row;
  padding: 0 12px 8px;
  font-size: 10px;
  color: rgba(255,255,255,0.26);
  letter-spacing: 0.4px;
  font-family: inherit;
  direction: ltr;
}
.aibot-credit-build {
  color: rgba(255,255,255,0.26);
  font-size: 10px;
}
/* Disclaimer + tooltip */
.aibot-disclaimer {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: default;
  direction: rtl;
}
.aibot-disclaimer-label {
  font-size: 10px;
  color: rgba(255,255,255,0.30);
}
.aibot-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.50);
  font-size: 9px;
  font-style: italic;
  font-weight: 700;
  font-family: Georgia, 'Times New Roman', serif;
  color: rgba(255,255,255,0.65);
  line-height: 1;
  cursor: help;
  position: relative;
  flex-shrink: 0;
}
.aibot-tooltip-bubble {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 270px;
  background: #0A2769;
  color: #fff;
  font-size: 11.5px;
  line-height: 1.65;
  padding: 12px 14px;
  border-radius: 12px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.35);
  text-align: right;
  direction: rtl;
  white-space: normal;
  z-index: 1000000;
  pointer-events: auto;
  font-weight: 400;
  letter-spacing: 0;
}
.aibot-tooltip-link {
  color: #7ec8f7 !important;
  text-decoration: underline !important;
  cursor: pointer !important;
}
/* Arrow pointing down toward ⓘ */
.aibot-tooltip-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 10px;
  border: 7px solid transparent;
  border-top-color: #0A2769;
}
.aibot-disclaimer.aibot-icon-hover .aibot-tooltip-bubble,
.aibot-disclaimer.aibot-tooltip-pinned .aibot-tooltip-bubble {
  display: block;
}

/* ── Lists ──────────────────────────────────────────────────────── */
.aibot-bubble ul { margin: 4px 0; padding-right: 16px; padding-left: 0; list-style: disc; }
.aibot-bubble li { margin-bottom: 2px; line-height: 1.45; }

/* ── Skeleton ───────────────────────────────────────────────────── */
.aibot-skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.14) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%; animation: aibot-shimmer 1.5s infinite; border-radius: 6px;
}
@keyframes aibot-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Accessibility ───────────────────────────────────────────────── */
#aibot-window *:focus-visible { outline: 2px solid rgba(120,200,255,0.65); outline-offset: 2px; }
.aibot-carousel-arrow:focus-visible { outline: 2px solid rgba(255,255,255,0.55); outline-offset: 2px; }

/* ── Tablet 521–900px ───────────────────────────────────────────── */
@media (max-width: 900px) {
  #aibot-window {
    width: calc(100vw - 32px);
    max-width: 430px;
    left: 16px;
    height: min(72vh, 700px);
    bottom: 90px;
  }
  #aibot-bubble {
    left: 16px !important;
    bottom: 20px !important;
  }
}

/* ── Mobile ≤520px ──────────────────────────────────────────────── */
@media (max-width: 520px) {

  /* Bubble — centered, safe area, no float animation */
  #aibot-bubble {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    animation: none !important;
    min-width: 150px !important;
    height: 48px !important;
  }
  #aibot-bubble:hover { animation: none !important; transform: translateX(-50%) !important; }

  /* Full-screen widget */
  #aibot-window {
    left: 0 !important;
    right: 0 !important;
    width: auto !important;       /* מתמתח בין left:0 ל-right:0 — לא מושפע מ-scrollbar */
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    bottom: 0 !important;
    border-radius: 0 !important;
    min-height: unset !important;
  }

  /* Virtual keyboard open — visualViewport מכווץ את הגובה בזמן אמת */
  /* סלקטור ספציפי יותר (#id + .class) מנצח את !important של #id בלבד */
  #aibot-window.aibot-keyboard-open {
    height: var(--aibot-vp-height, 100dvh) !important;
    max-height: var(--aibot-vp-height, 100dvh) !important;
    top: 0 !important;
    bottom: auto !important;
  }
  #aibot-window::before { display: none; }

  /* Header — safe area for notch */
  #aibot-header {
    border-radius: 0 !important;
    padding-top: max(12px, env(safe-area-inset-top, 12px));
  }

  /* Messages — full width on mobile */
  .aibot-msg { max-width: 88% !important; }

  /* Input wrap — above home indicator */
  #aibot-input-wrap {
    border-radius: 0 !important;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
  }

  /* Welcome actions */
  #aibot-welcome-actions { padding: 8px 10px 4px !important; }

  /* Touch targets — min 44px */
  .aibot-icon-btn { padding: 8px !important; min-width: 36px; min-height: 36px; }
  #aibot-send { width: 46px !important; height: 46px !important; }
  .aibot-carousel-arrow { width: 44px !important; height: 44px !important; flex-shrink: 0; }

  /* iOS — prevent zoom on input focus */
  #aibot-input { font-size: 16px !important; }

  /* Suggestions */
  #aibot-window .aibot-suggestion { font-size: 12px !important; padding: 5px 11px !important; }

  /* Product card */
  .aibot-product-img { height: 130px !important; }
  .aibot-product-name { font-size: 12px !important; }


  /* Avatar slightly smaller */
  #aibot-avatar { width: 44px !important; height: 44px !important; }
  #aibot-header-title { font-size: 14px !important; }

  /* Hide bubble when widget is open */
  #aibot-window:not(.aibot-hidden) ~ #aibot-bubble { display: none !important; }
}

/* ── Mobile: hide bubble when chat is open ──────────────────────── */
/* Class toggled by JS; CSS limits the hide to mobile only.
   Uses !important to defeat the base rule's display:flex !important */
@media (max-width: 768px) {
  #aibot-bubble.aibot-bubble-hidden { display: none !important; }
}

/* ── iPhone SE / tiny ≤375px ────────────────────────────────────── */
@media (max-width: 375px) {
  #aibot-bubble { min-width: 130px !important; }
  .aibot-bubble-label { font-size: 13px !important; }
  #aibot-messages { padding: 12px 10px !important; }
  #aibot-input-area { padding: 8px 10px 6px !important; }
}


/* ── Header Trigger Button [aibot_trigger] + JS-injected mobile btn ─ */
.aibot-hdr-btn {
  position: relative;
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  align-self: center !important;
  gap: 8px;
  height: 36px !important;
  padding: 0 14px 0 12px !important;
  border: none !important;
  border-radius: 18px !important;
  cursor: pointer;
  color: #fff !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  /* Same brand glass as bubble — !important to override theme button styles */
  background: rgba(51, 122, 183, 0.85) !important;
  backdrop-filter: blur(18px) saturate(1.8) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.8) !important;
  box-shadow:
    0 0 18px rgba(0, 200, 255, 0.35),
    0 0 36px rgba(50, 122, 183, 0.25),
    0 6px 22px rgba(0, 0, 0, 0.35) !important;
  color: #fff !important;
  border-radius: 20px !important;
}
/* Edge lighting ring — same colors as #aibot-bubble */
.aibot-hdr-btn::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  padding: 2px;
  background: conic-gradient(
    from var(--aibot-angle, 0deg) at 50% 50%,
    var(--el-1, #00ddff), var(--el-2, #ffffff), var(--el-3, #ffd700),
    var(--el-4, #cc44ff), var(--el-5, #ffffff), var(--el-6, #00ddff)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: aibot-edge-rotate 5s linear infinite;
  pointer-events: none;
}
.aibot-hdr-btn:hover {
  box-shadow:
    0 0 22px rgba(0, 220, 255, 0.60),
    0 0 40px rgba(50, 122, 183, 0.38),
    0 6px 18px rgba(0, 0, 0, 0.32);
}
.aibot-hdr-icon {
  flex-shrink: 0;
  display: block;
}
.aibot-hdr-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* Desktop header mode — bubble stays visible */
.aibot-hdr-btn--desktop {
  margin-right: 10px;
  flex-shrink: 0;
}

/* כשיש כפתור header (class מוגדר ב-JS) — הסתר בועה צפה ועדכן hint */
@media (max-width: 768px) {
  body.aibot-header-mode #aibot-bubble { display: none !important; }

  /* hint bubble — מתחת לכפתור header, חץ כלפי מעלה */
  body.aibot-header-mode #aibot-hint-bubble {
    top: 62px !important;
    bottom: auto !important;
    left: 5px !important;
    right: auto !important;
    max-width: 220px !important;
  }
  body.aibot-header-mode #aibot-hint-bubble::after {
    bottom: auto !important;
    top: -9px !important;
    left: 24px !important;
    right: auto !important;
    border-top: none !important;
    border-bottom: 9px solid #d6efff !important;
  }
}

/* ── Comparison Cards ──────────────────────────── */
.aibot-msg.bot:has(.aibot-compare-wrap) {
  max-width: 100% !important;
  width: 100% !important;
  align-self: stretch !important;
}
.aibot-bubble.aibot-compare-wrap {
  padding: 10px 10px 8px !important;
  width: 100%;
  border-radius: 12px;
  background: #f8faff;
  border: 1px solid #e0e7ff;
}
.aibot-compare-header {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 8px;
  font-weight: 500;
  direction: rtl;
}
/* שורת כרטיסיות — גלילה אופקית */
.aibot-compare-cards {
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  direction: rtl;
  -webkit-overflow-scrolling: touch;
  align-items: stretch;
}
.aibot-compare-cards::-webkit-scrollbar { height: 4px; }
.aibot-compare-cards::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* כרטיסית מוצר */
.aibot-compare-card {
  flex: 0 0 auto;
  width: 168px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  direction: rtl;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
/* תמונת מוצר */
.aibot-compare-img-link {
  display: block;
  background: #f9fafb;
  border-bottom: 1px solid #f0f0f0;
}
.aibot-compare-img {
  width: 100%;
  height: 100px;
  object-fit: contain;
  display: block;
  padding: 6px;
}
/* כותרת כרטיסית */
.aibot-compare-card-title {
  font-size: 11px;
  font-weight: 700;
  color: #1e3a5f;
  line-height: 1.4;
  white-space: pre-line;   /* שורה שנייה ל-מקט */
  padding: 7px 8px 6px;
  border-bottom: 1px solid #f3f4f6;
  min-height: 44px;
}
/* גוף שדות */
.aibot-compare-fields {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
/* שורת מאפיין */
.aibot-compare-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  min-height: 18px;
}
.aibot-compare-row-empty .aibot-compare-value {
  color: #d1d5db;
}
.aibot-compare-label {
  color: #9ca3af;
  font-size: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.aibot-compare-value {
  color: #111827;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  word-break: break-word;
  max-width: 100px;
}
/* מחיר — תחתית */
.aibot-compare-card-price {
  padding: 7px 8px;
  border-top: 1px solid #f0f4ff;
  background: #f8faff;
  font-size: 15px;
  font-weight: 800;
  color: #1d4ed8;
  text-align: center;
  margin-top: auto;
}

/* ── Session restore banner ────────────────────── */
.aibot-session-banner {
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  padding: 6px 4px 4px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 6px;
}

/* AIBOT boundary additions: original source above is namespace-only port. */
#aibot-root [hidden]{display:none!important}
#aibot-root button,#aibot-root textarea,#aibot-root input{font-family:inherit}
#aibot-root .aibot-turn{display:contents}
#aibot-root .aibot-bubble{white-space:pre-wrap}
#aibot-root .aibot-product-details{font-size:11px;color:#20334d;margin:6px 0;white-space:normal}
#aibot-root .aibot-product-details summary{cursor:pointer;color:#0066cc}
#aibot-root .aibot-product-details p{margin:4px 0;overflow-wrap:anywhere}
#aibot-root .aibot-meta{font-size:10px;white-space:normal}
#aibot-root .aibot-status{margin:0 14px;font-size:11px;color:#fff;white-space:pre-wrap}
#aibot-root .aibot-status:empty{display:none}
#aibot-root .aibot-retry{margin:4px 14px;align-self:start}
#aibot-root .aibot-lead-form-wrapper{max-width:100%;width:100%}
#aibot-root .aibot-callback{display:flex;flex-direction:column;gap:6px;margin-top:8px}
#aibot-root .aibot-callback label{font-size:11px}
#aibot-root .aibot-lead-actions{display:flex;gap:6px;margin-top:4px}
#aibot-root .aibot-lead-actions button{flex:1}
#aibot-root .aibot-lead-status{font-size:11px;white-space:normal}
#aibot-root .aibot-trace{font-size:10px;direction:ltr;text-align:left;background:#1e1e2e;color:#cdd6f4;padding:8px 12px;border-radius:8px;overflow:auto;max-height:200px;white-space:pre-wrap;overflow-wrap:anywhere}
#aibot-root :focus-visible{outline:2px solid #b3eaff!important;outline-offset:2px}
@media(prefers-reduced-motion:reduce){#aibot-root *,#aibot-root *::before,#aibot-root *::after{animation:none!important;scroll-behavior:auto!important}}

/* Owner-approved quick-start correction; retain the original button styling. */
#aibot-window #aibot-welcome-actions{background:transparent;border-top:0}
