:root {
  /* ===== Design Tokens ===== */
  --cmd-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
  --cmd-radius: 18px;

  /* Brand Colors */
  --cmd-wa: #30B230;
  --cmd-wa-dark: #30B230;
  --cmd-blue: #0A66C2;
}

/* ===== Floating Buttons ===== */
.cmd-fab {
  position: fixed;
  width: 62px;
  height: 62px;
  border-radius: 999px;
  border: 0;
  box-shadow: var(--cmd-shadow);
  z-index: 99999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.2s ease;
}

.cmd-fab:active {
  transform: scale(0.97);
}

.cmd-fab-svg {
  display: block;
}

/* ===== Call Floating Button ===== */
.cmd-fab-call {
  left: 26px;
  bottom: 26px;
  background: var(--cmd-blue);
}

.cmd-fab-call:hover {
  opacity: 0.8;
}

.cmd-fab-call::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid black;
  background: rgba(48, 178, 48, 0.4);
  z-index: -1;
  animation: wa-ripple 2s infinite ease-out;
}

/* ===== WhatsApp Floating Button ===== */
.cmd-fab-wa {
  right: 26px;
  bottom: 26px;
  background: var(--cmd-wa);
  position: fixed;
  overflow: visible;
}

.cmd-fab-wa:hover {
  opacity: 0.8;
}

/* WhatsApp Notification Dot */
.cmd-fab-wa::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: #ff2d2d;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
  animation: blink-dot 3s infinite ease-in-out;
}

/* ===== Widget Base ===== */
.cmd-widget {
  position: fixed;
  z-index: 99999;
  width: 360px;
  max-width: calc(100vw - 40px);
  border-radius: var(--cmd-radius);
  box-shadow: var(--cmd-shadow);
  overflow: hidden;
  background: #ffffff;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.2s ease;
}

.cmd-widget.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===== Close Buttons ===== */
.cmd-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background-color: white;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.cmd-close:hover {
  opacity: 0.3;
}

/* ===== Call Widget ===== */
.cmd-call-widget {
  left: 26px;
  bottom: 110px;
  width: 290px;
  text-align: center;
  padding: 18px 16px 16px;
  border-radius: 16px;
}

.cmd-logo {
  width: 62px;
  height: 62px;
  border-radius: 999px;
  margin: 0 auto 10px;
  overflow: hidden;
}

.cmd-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cmd-title {
  font-weight: 700;
  font-size: 14px;
  color: #0f172a;
}

.cmd-online {
  margin-top: 4px;
  font-weight: 700;
  font-size: 12px;
  color: var(--cmd-wa);
}

.cmd-call-mid {
  margin: 14px 0;
  font-size: 13px;
  color: #334155;
  line-height: 1.35;
}

.cmd-call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--cmd-blue);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 14px;
}

.cmd-call-btn:hover {
  opacity: 0.8;
}

/* ===== WhatsApp Widget ===== */
.cmd-wa-widget {
  right: 26px;
  bottom: 110px;
  border-radius: 18px;
  width: 360px;
  height: max-content;
}

/* ===== WhatsApp Header ===== */
.cmd-wa-header {
  background: #008268;
  color: #fff;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cmd-wa-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cmd-wa-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.cmd-wa-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cmd-wa-name {
  font-weight: 800;
  font-size: 14px;
}

/* WhatsApp Close Button */
.cmd-close-wa {
  width: 21px;
  height: 21px;
  color: #fff;
  background-color: #008268;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cmd-close-wa:hover {
  opacity: 0.3;
}

/* ===== WhatsApp Body ===== */
.cmd-wa-body {
  padding: 14px;
  background: #efeae2;
  background-image: url("whatsappBackground.png");
}

.cmd-wa-day {
  width: fit-content;
  margin: 0 auto 12px;
  font-size: 12px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  color: #475569;
}

/* ===== WhatsApp Message Bubble ===== */
.cmd-wa-bubble {
  position: relative;
  background: #fff;
  border-radius: 0 10px 10px;
  padding: 12px 12px 26px;
  font-size: 13px;
  line-height: 1.45;
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  margin-bottom: 14px;
  max-width: 55%;
}

/* LEFT TAIL */
.cmd-wa-bubble::before {
  content: "";
  position: absolute;
  top: 0;
  left: -8px;
  border-bottom: 8px solid transparent;
  border-right: 8px solid #fff;
}

/* WhatsApp Message Time */
.cmd-wa-time {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 11px;
  color: #64748b;
}

/* ===== WhatsApp Button ===== */
.cmd-wa-btn {
  width: 70%;
  border: 0;
  background: var(--cmd-wa);
  color: #fff;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 40px;
  margin-left: 47px;
}

.cmd-wa-btn:hover {
  opacity: 0.9;
}

.cmd-wa-btn-ic {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cmd-wa-btn-text {
  font-size: 14px;
  line-height: 1;
}

/* Status Text */
.status-text {
  font-size: 12px;
}

/* ===== Ripple Animation ===== */
.cmd-fab-wa::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid black;
  background: rgba(48, 178, 48, 0.4);
  z-index: -1;
  animation: wa-ripple 2s infinite ease-out;
}

@keyframes wa-ripple {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }

  70% {
    transform: scale(1.8);
    opacity: 0;
  }

  100% {
    opacity: 0;
  }
}

/* ===== Notification Dot Animation ===== */
@keyframes blink-dot {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.2;
  }

  100% {
    opacity: 1;
  }
}

/* ===== Mobile Spacing ===== */
@media (max-width: 480px) {
  .cmd-fab-call {
    left: 16px;
    bottom: 16px;
  }

  .cmd-fab-wa {
    right: 16px;
    bottom: 16px;
  }

  .cmd-call-widget {
    left: 16px;
    bottom: 96px;
  }

  .cmd-wa-widget {
    right: 16px;
    bottom: 96px;
  }
}