.cutm-floating-wrap {
  position: fixed;
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cutm-launcher,
.cutm-fan-item {
  box-sizing: border-box;
  border: 0;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}

.cutm-launcher {
  position: relative;
  z-index: 3;
  width: auto;
  min-width: var(--cutm-launcher-size);
  height: var(--cutm-launcher-size);
  padding: 0 16px;
  background: var(--cutm-launcher-bg, #e53935);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
}

.cutm-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .22);
}

.cutm-circle .cutm-launcher,
.cutm-circle .cutm-fan-item {
  border-radius: 999px;
}

.cutm-rounded .cutm-launcher,
.cutm-rounded .cutm-fan-item {
  border-radius: 16px;
}

.cutm-launcher-icon,
.cutm-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
}

.cutm-launcher-icon {
  font-size: var(--cutm-launcher-icon-size, 24px);
}

.cutm-item-icon {
  font-size: var(--cutm-item-icon-size, 22px);
}

.cutm-icon-img {
  width: 1em;
  height: 1em;
  object-fit: contain;
  display: block;
}

.cutm-icon-fallback {
  font-size: 1em;
  line-height: 1;
  font-weight: 700;
  display: inline-block;
}

.cutm-launcher-label {
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
  white-space: nowrap;
}

.cutm-fan-items {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cutm-fan-item {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cutm-item-size);
  height: var(--cutm-item-size);
  margin-left: calc(var(--cutm-item-size) / -2);
  margin-top: calc(var(--cutm-item-size) / -2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  transition: transform .28s ease, opacity .22s ease, visibility .22s ease;
  transform: translate(0, 0) scale(.86);
  opacity: 0;
  visibility: hidden;
}

.cutm-btn-call { background: var(--cutm-call-bg, #0f9d58); }
.cutm-btn-zalo { background: var(--cutm-zalo-bg, #0068ff); }
.cutm-btn-messenger { background: var(--cutm-messenger-bg, #0084ff); }

.cutm-item-label {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: rgba(17, 24, 39, .92);
  color: #fff;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(0,0,0,.16);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.cutm-show-labels .cutm-fan-item:hover .cutm-item-label { opacity: 1; }
.cutm-hide-labels .cutm-item-label { display: none; }

.cutm-anchor-bottom-right .cutm-item-label,
.cutm-anchor-top-right .cutm-item-label {
  right: calc(100% + 10px);
}

.cutm-anchor-bottom-left .cutm-item-label,
.cutm-anchor-top-left .cutm-item-label {
  left: calc(100% + 10px);
}

.cutm-floating-wrap.is-open .cutm-fan-items {
  pointer-events: auto;
}

.cutm-floating-wrap.is-open .cutm-fan-item {
  opacity: 1;
  visibility: visible;
  transform:
    translate(
      calc(cos(var(--cutm-angle)) * var(--cutm-radius)),
      calc(sin(var(--cutm-angle)) * var(--cutm-radius))
    )
    scale(1);
}

.cutm-floating-wrap.is-open .cutm-launcher .cutm-icon-fallback {
  transform: rotate(45deg);
}

@media (max-width: 768px) {
  .cutm-launcher {
    padding: 0 14px;
  }

  .cutm-launcher-label {
    font-size: 13px;
  }

  .cutm-item-label {
    display: none;
  }
}

.cutm-hide-launcher-label .cutm-launcher {
  width: var(--cutm-launcher-size);
  min-width: 0;
  padding: 0;
}

.cutm-hide-launcher-label .cutm-launcher-label {
  display: none;
}

.cutm-has-pulse .cutm-launcher::before,
.cutm-has-pulse .cutm-launcher::after {
  content: "";
  position: absolute;
  inset: calc(var(--cutm-pulse-size, 8px) * -1);
  border-radius: inherit;
  border: var(--cutm-pulse-border, 2px) solid var(--cutm-pulse-color, #ffffff);
  opacity: 0;
  pointer-events: none;
  transform: scale(1);
}

.cutm-has-pulse .cutm-launcher::before {
  animation: cutmPulse var(--cutm-pulse-duration, 2.2s) ease-out infinite;
}

.cutm-has-pulse .cutm-launcher::after {
  animation: cutmPulse var(--cutm-pulse-duration, 2.2s) ease-out calc(var(--cutm-pulse-duration, 2.2s) / 2) infinite;
}

.cutm-floating-wrap.is-open .cutm-launcher::before,
.cutm-floating-wrap.is-open .cutm-launcher::after,
.cutm-no-pulse .cutm-launcher::before,
.cutm-no-pulse .cutm-launcher::after {
  display: none;
}

@keyframes cutmPulse {
  0% { opacity: var(--cutm-pulse-opacity, .55); transform: scale(1); }
  70% { opacity: 0; transform: scale(calc((var(--cutm-pulse-scale, 1.6) - 1) * .7 + 1)); }
  100% { opacity: 0; transform: scale(var(--cutm-pulse-scale, 1.6)); }
}

.cutm-has-shake .cutm-launcher-icon {
  transform-origin: 50% 20%;
  animation: cutmShake var(--cutm-shake-duration, 3.2s) ease-in-out infinite;
}

.cutm-floating-wrap.is-open .cutm-launcher-icon,
.cutm-no-shake .cutm-launcher-icon {
  animation: none;
}

@keyframes cutmShake {
  0%, 75%, 100% { transform: rotate(0deg); }
  78% { transform: rotate(calc(var(--cutm-shake-degree, 12deg) * -1)); }
  81% { transform: rotate(var(--cutm-shake-degree, 12deg)); }
  84% { transform: rotate(calc(var(--cutm-shake-degree, 12deg) * -0.7)); }
  87% { transform: rotate(calc(var(--cutm-shake-degree, 12deg) * 0.7)); }
  90% { transform: rotate(calc(var(--cutm-shake-degree, 12deg) * -0.35)); }
  93% { transform: rotate(calc(var(--cutm-shake-degree, 12deg) * 0.35)); }
}
