/* ── Widget root ── */
.drive-chat-widget {
  --chat-primary: #25D366;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-primary);
  font-size: 14px;
}

/* ── Toggle button ── */
.drive-chat-widget__button {
  height: 61px;
  padding: 0 25px 0 19px;
  gap: 10px;
  border-radius: 28px;
  background: var(--chat-primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.2s;
  animation: driveChatPulse 2s ease-out infinite;
}

.drive-chat-widget__button:hover {
  transform: scale(1.05);
}

.drive-chat-widget__button-label {
  font-size: 20px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s, max-width 0.2s;
}

.drive-chat-widget__button.is-open {
  padding: 0;
  width: 61px;
  justify-content: center;
  gap: 0;
  animation: none;
}

.drive-chat-widget__button.is-open .drive-chat-widget__button-label {
  opacity: 0;
  max-width: 0;
}

.drive-chat-widget__button:hover {
  animation: none;
}

/* ── Chat panel ── */
.drive-chat-widget__panel {
  display: flex;
  flex-direction: column;
  position: absolute;
  bottom: 73px;
  right: 0;
  width: 320px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}

.drive-chat-widget__panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0s;
}

/* ── Header ── */
.drive-chat-widget__header {
  background: var(--chat-primary);
  color: #fff;
  padding: 14px 16px;
  gap: 10px;
}

.drive-chat-widget__header-logo {
  width: 36px;
  height: 36px;
  object-fit: cover;
}

.drive-chat-widget__header-name {
  font-size: 15px;
}

/* ── Close button ── */
.drive-chat-widget__close {
  background: none;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.drive-chat-widget__close:hover {
  opacity: 1;
}

/* ── Messages area ── */
.drive-chat-widget__messages {
  padding: 12px;
  min-height: 80px;
  max-height: 320px;
  gap: 8px;
  background: #f0f2f5;
  overflow-y: auto;
}

/* ── Message bubble ── */
.drive-chat-widget__msg {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 10px;
  line-height: 1.4;
  word-break: break-word;
  background: #fff;
  color: #111;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ── Footer ── */
.drive-chat-widget__footer {
  display: flex;
  padding: 10px 12px;
  gap: 8px;
}

/* ── Message input ── */
.drive-chat-widget__input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  resize: none;
  outline: none;
  font-family: var(--font-primary);
}

.drive-chat-widget__input:focus {
  border-color: var(--chat-primary);
}

/* ── Send button ── */
.drive-chat-widget__send {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--chat-primary);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
}

.drive-chat-widget__send:hover {
  opacity: 0.88;
}

/* ── Mobile positioning ── */
@media (max-width: 1024px) {
  .drive-chat-widget {
    bottom: 75px;
  }
}

/* ── Toggle pulse animation ── */
@keyframes driveChatPulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
  70%  { box-shadow: 0 0 0 30px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
