.cw-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: var(--font-text);
  direction: ltr;
}

.cw-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #25d366;
  border: none;
  color: #fff;
  font-size: 26px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  position: relative;
}

.cw-icon--hidden {
  display: none;
}

.cw-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #dd3131;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cw-box {
  width: 320px;
  max-width: 90vw;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  position: absolute;
  bottom: 0;
  right: 0;
}

.cw-header {
  background: #25d366;
  color: #fff;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cw-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.cw-header-text {
  flex: 1;
  line-height: 1.3;
}

.cw-header-text h2 {
  font-weight: 400;
  font-size: 1rem;
}

.cw-status-online {
  display: block;
  font-size: 12px;
  opacity: 0.85;
}

#cw-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.7rem;
  cursor: pointer;
  line-height: 1;
}

.cw-body {
  padding: 14px;
  background: #ece5dd;
  min-height: 60px;
}

.cw-bubble {
  background: #dcf8c6;
  padding: 8px 10px 6px;
  border-radius: 10px;
  max-width: 90%;
}

.cw-bubble-text {
  margin: 0 0 4px;
  font-size: 13.5px;
  line-height: 1.5;
}

.cw-bubble-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

.cw-bubble-time {
  font-size: 11px;
  color: #667781;
}

.cw-bubble-ticks {
  font-size: 12px;
}

.cw-bubble-ticks {
  width: 16px;
  height: auto;
  display: inline-block;
}

.cw-status-msg {
  margin-top: 8px;
  font-size: 12.5px;
  padding: 6px 10px;
  border-radius: 8px;
}

.cw-status-msg--sending {
  background: #fff3cd;
  color: #856404;
}

.cw-status-msg--success {
  background: #d4edda;
  color: #155724;
}

.cw-status-msg--error {
  background: #f8d7da;
  color: #721c24;
}

.cw-form {
  border-top: 1px solid #eee;
  background: #fff;
  padding: 10px;
}

.cw-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cw-text-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 13.5px;
  outline: none;
  box-sizing: border-box;
}

.cw-text-input:focus {
  border-color: #25d366;
}

.cw-send-default {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  border: none;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    opacity 0.15s,
    transform 0.15s;
}

.cw-send-default:disabled {
  cursor: pointer;
}

.cw-send-default i {
  transform: translate(-2px, 2px);
}

.cw-input-row--typing .cw-send-default {
  display: none;
}

.cw-actions {
  display: none;
  gap: 8px;
  margin-top: 10px;
}

.cw-actions:not([hidden]) {
  display: flex;
}

.cw-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 20px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  color: #333;
  transition: background 0.15s;
}

.cw-action-btn:hover {
  background: #f5f5f5;
}

.cw-action-btn--wa {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}

.cw-action-btn--wa:hover {
  background: #1ebc59;
}

.cw-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .cw-widget {
    right: 10px;
    bottom: 10px;
  }

  .cw-box {
    width: calc(100vw - 20px);
  }
}
