:root {
  --vidi-bg:         #ffffff;
  --vidi-surface:    #f5f5f5;
  --vidi-border:     #e0e0e0;
  --vidi-text:       #111111;
  --vidi-text-muted: #9b9b9b;
  --vidi-primary:    #e63946;
  --vidi-radius-sm:  12px;
}
/* ── Widget Container ───────────────────────── */
#vidi-chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999999;
}

/* ── Toggle Button ─────────────────────────── */
#vidi-chat-toggle {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: none;
  background: #2f2f2f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;

  box-shadow:
    0 0 12px rgba(255, 68, 88, 0.7),
    0 0 24px rgba(255, 68, 88, 0.5),
    0 0 42px rgba(255, 68, 88, 0.35);

  transition: transform 0.2s ease;

  animation: vidiPulse 2s infinite;
}

#vidi-chat-toggle:hover {
  transform: scale(1.08);
}

@keyframes vidiPulse {
  0% {
    box-shadow:
      0 0 10px rgba(255, 68, 88, 0.6),
      0 0 20px rgba(255, 68, 88, 0.4),
      0 0 35px rgba(255, 68, 88, 0.25);
  }

  50% {
    box-shadow:
      0 0 18px rgba(255, 68, 88, 1),
      0 0 38px rgba(255, 68, 88, 0.8),
      0 0 65px rgba(255, 68, 88, 0.55);
  }

  100% {
    box-shadow:
      0 0 10px rgba(255, 68, 88, 0.6),
      0 0 20px rgba(255, 68, 88, 0.4),
      0 0 35px rgba(255, 68, 88, 0.25);
  }
}

.vidi-toggle-logo {
  font-size: 18px;
  text-transform: uppercase;
  background: radial-gradient(circle at center, #ffffff 0%, #f25b5b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  line-height: 18px;
}

.vidi-toggle-close {
  display: none;
  position: absolute;
  top: -3px;
  right: -3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #333;
  color: #fff;
  font-size: 16px;
  align-items: center;
  justify-content: center;
}

#vidi-chat-toggle.is-open .vidi-toggle-close {
  display: flex;
}

/* ── Menu ──────────────────────────────────── */
#vidi-chat-menu {
  position: absolute;
  right: 0;
  bottom: 92px;
  width: 420px;
  background: #333333;
  border-radius: 28px;
  padding: 28px 14px 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

#vidi-chat-menu.vidi-hidden {
  display: none;
}

.vidi-menu-item {
  width: 100%;
  border: none;
  border-radius: 18px;
  background: #181716;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  text-align: left;
  transition: .2s ease;
}

.vidi-menu-item:hover {
  background: #1e1e1e;
  transform: translateY(-2px);
}

.vidi-menu-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 22px;
}

.vidi-menu-item span:nth-child(2) {
  flex: 1;
}

.vidi-menu-item strong {
  display: block;
  font-size: 22px;
  font-weight: 400;
}

.vidi-menu-item small {
  display: block;
  margin-top: 4px;
  color: #bcbcbc;
  font-size: 16px;
}

.vidi-menu-item b {
  font-size: 34px;
  font-weight: 300;
  transform: rotate(180deg);
}

/* ── Chat ──────────────────────────────────── */
#vidi-chat-panel {
  position: absolute;
  right: 0;
  bottom: 92px;
  width: 560px;
  height: 800px;
  background: #fff;
  border-radius: 34px;
  box-shadow: 0 12px 45px rgba(0, 0, 0, .18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

#vidi-chat-panel.vidi-hidden {
  display: none;
}


/* ── Header ────────────────────────────────── */
#vidi-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.vidi-chat-logo {
  width: 78px;
  height: 44px;
  background: #111;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vidi-chat-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 0px 8px;
}

.vidi-action-btn {
  line-height: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #555;
  transition: color 0.15s, background 0.15s;
}

.vidi-action-btn:hover {
  color: #111;
  background: rgba(0,0,0,0.06);
}

.vidi-action-btn svg {
  display: block;
  flex-shrink: 0;
}

/* ── Messages ──────────────────────────────── */
#vidi-chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-right: 10px;
}

#vidi-chat-messages::-webkit-scrollbar {
  width: 8px;
}

#vidi-chat-messages::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 20px;
}

.vidi-msg {
  display: flex;
  flex-direction: column;
}

.vidi-msg-bot::before {
  content: "💬 AI чат";
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #111;
}

.vidi-msg-user {
  align-self: flex-end;
  align-items: flex-end;
  max-width: 75%;
}

.vidi-bubble {
  font-size: 16px;
  line-height: 1.45;
  color: #222;
}

.vidi-msg-user .vidi-bubble {
  background: #f4f4f4;
  border-radius: 14px;
  padding: 12px 16px;
}

.vidi-msg-bot .vidi-bubble {
  background: transparent;
}

.vidi-msg-time {
  margin-top: 8px;
  font-size: 12px;
  color: #9b9b9b;
}

.vidi-msg-user .vidi-msg-time {
  text-align: right;
}

.vidi-msg-bot .vidi-msg-time {
  text-align: left;
}

/* ── Car Cards Carousel ───────────────────────────────────────────────────── */
.vidi-cards-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--vidi-border) transparent;
  /* Full-bleed — break out of message constraint */
  margin-left: -16px;
  margin-right: -16px;
  width: calc(100% + 32px);
  padding: 8px 16px 10px;
  box-sizing: border-box;
}

.vidi-cards-scroll::-webkit-scrollbar {
  height: 4px;
}

.vidi-cards-scroll::-webkit-scrollbar-thumb {
  background: var(--vidi-border);
  border-radius: 2px;
}

.vidi-cards-track {
  display: flex;
  gap: 10px;
  width: max-content;
  margin: 10px 0;
  padding: 0px 5px;
}


/* ── Car Card ─────────────────────────────────────────────────────────────── */
.vidi-car-card {
  width: 180px;
  flex-shrink: 0;
  background: var(--vidi-bg);
  border-radius: var(--vidi-radius-sm);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
  cursor: pointer;
}

.vidi-car-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}

.vidi-car-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.vidi-car-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
  background: var(--vidi-surface);
}

.vidi-car-body {
  padding: 8px 10px 10px;
}


/* ── Card Badges ──────────────────────────────────────────────────────────── */
.vidi-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}

.vidi-badge-new {
  background: #e8f5e9;
  color: #2e7d32;
}

.vidi-badge-stock {
  background: #e3f2fd;
  color: #1565c0;
}

.vidi-badge-used {
  background: #fff8e1;
  color: #f57f17;
}

/* ── Card Text ────────────────────────────────────────────────────────────── */
.vidi-car-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--vidi-text);
  line-height: 1.3;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vidi-car-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--vidi-primary);
  margin-bottom: 2px;
}

.vidi-car-leasing {
  font-size: 10px;
  color: var(--vidi-text-muted);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vidi-car-meta {
  font-size: 10px;
  color: var(--vidi-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}




/* ── Input ─────────────────────────────────── */
#vidi-chat-input-area {
  border: 1px solid #ececec;
  border-radius: 30px;
  display: flex;
  align-items: center;
  margin: 15px 0;
}

#vidi-chat-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 15px;
  font-size: 16px;
  outline: none;
}

#vidi-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  margin-right: 10px;
  background: #f3f3f3;
  font-size: 20px;
  cursor: pointer;
}

#vidi-chat-send:hover {
  background: #111;
  color: #fff;
}

/* ── Mobile ────────────────────────────────── */
@media (max-width: 640px) {
  #vidi-chat-widget {
    right: 14px;
    bottom: 14px;
  }

  #vidi-chat-menu,
  #vidi-chat-panel {
    width: calc(100vw - 28px);
    right: 0;
  }

  #vidi-chat-panel {
    height: calc(100vh - 120px);
    padding: 22px;
  }
}

/* =========== */

.vidi-toggle-close {
  display: none;
  position: absolute;
  top: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #333;
  color: #fff;
  font-size: 18px;
  line-height: 22px;
}

#vidi-chat-toggle.is-open .vidi-toggle-close {
  display: block;
}

#vidi-chat-menu {
  position: absolute;
  right: 0;
  bottom: 92px;
  width: 420px;
  background: #333333;
  border-radius: 28px;
  padding: 28px 14px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform-origin: bottom right;
}

#vidi-chat-menu.vidi-hidden {
  opacity: 0;
  transform: scale(0.9) translateY(10px);
  pointer-events: none;
}

.vidi-menu-title {

  font-size: 22px;
  text-transform: uppercase;
  background: radial-gradient(circle at center,
      #ffffff 0%,
      #f25b5b 100%);

  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  background-clip: text;
  color: transparent;
  margin: 0 0 15px 14px;
}

.vidi-menu-item {
  width: 100%;
  min-height: 55px;
  border: none;
  border-radius: 17px;
  background: #181716;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, background 0.18s ease;
}

.vidi-menu-item:hover {
  background: #1f1f1f;
  transform: translateY(-2px);
}

.vidi-menu-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.vidi-menu-item span:nth-child(2) {
  flex: 1;
}

.vidi-menu-item strong {
  color: #FFF;
  font-size: 14px;
  font-style: normal;
  font-weight: 300;
}

.vidi-menu-item small {
  color: #FFF;
  font-size: 12px;
  font-style: normal;
  font-weight: 200;
}

.vidi-menu-item b {
  font-size: 38px;
  font-weight: 300;
  color: #fff;
  transform: rotate(180deg);
}

#vidi-chat-panel {
  bottom: 92px;
  width: 420px;
  border-radius: 24px;
}

.vidi-chat-disclaimer {
  color: #181716;
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  padding: 0 10px;
}

/* ── Typing indicator ─────────────────────────────────────────────────────── */
.vidi-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: #f4f4f4;
  border-radius: 14px;
  height: 38px;
}

.vidi-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aaa;
  display: block;
  animation: vidiTypingBounce 1.2s infinite ease-in-out;
}

.vidi-typing span:nth-child(1) { animation-delay: 0s; }
.vidi-typing span:nth-child(2) { animation-delay: 0.2s; }
.vidi-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes vidiTypingBounce {
  0%, 60%, 100% { transform: translateY(0);    background: #ccc; }
  30%            { transform: translateY(-7px); background: #888; }
}


  background: #2f2f2f;
  color: #ff6b6b;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 0 12px rgba(255, 54, 74, 0.7);
}

@media (max-width: 480px) {
  #vidi-chat-widget {
    right: 16px;
    bottom: 16px;
  }

  #vidi-chat-menu,
  #vidi-chat-panel {
    width: calc(100vw - 32px);
    right: 0;
  }

  .vidi-menu-item strong {
    font-size: 19px;
  }

  .vidi-menu-item small {
    font-size: 15px;
  }
}
