:root{
  --cw-main:#2563eb;
  --cw-zalo:#0068ff;
  --cw-phone:#16a34a;
  --cw-shadow:0 16px 45px rgba(15,23,42,.22);
}

.cw-widget{
  position:fixed;
  left:22px;
  bottom:70px;
  z-index:999999;
  font-family:Arial,Helvetica,sans-serif;
}

.cw-widget *{
  box-sizing:border-box;
}

.cw-toggle{
  width:62px;
  height:62px;
  border:0;
  border-radius:999px;
  background:var(--cw-main);
  color:#fff;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:var(--cw-shadow);
  position:relative;
  transition:.25s ease;
  overflow:visible;
}

.cw-toggle:hover{
  transform:translateY(-2px);
}

.cw-toggle svg{
  width:28px;
  height:28px;
  display:block;
}

.cw-toggle .cw-main-icon,
.cw-toggle .cw-close-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  position:relative;
  z-index:2;
}

.cw-toggle .cw-close-icon{
  display:none;
  width:22px;
  height:22px;
}

.cw-widget.is-open .cw-toggle .cw-main-icon{
  display:none;
}

.cw-widget.is-open .cw-toggle .cw-close-icon{
  display:flex;
}

.cw-main-icon.is-changing{
  animation:cwIconChange .28s ease;
}

@keyframes cwIconChange{
  0%{transform:scale(1) rotate(0);opacity:1}
  45%{transform:scale(.6) rotate(-12deg);opacity:0}
  100%{transform:scale(1) rotate(0);opacity:1}
}

.cw-pulse,
.cw-pulse:before{
  position:absolute;
  inset:0;
  border-radius:999px;
  content:"";
  background:var(--cw-main);
  z-index:-1;
  animation:cwPulse 2s infinite;
  opacity:.35;
}

.cw-pulse:before{
  animation-delay:.45s;
}

@keyframes cwPulse{
  0%{transform:scale(1);opacity:.45}
  70%{transform:scale(1.55);opacity:0}
  100%{opacity:0}
}

/* Popup nằm phía trên và lệch sang phải so với button */
.cw-menu{
  position:absolute;
  left:5px;
  bottom:78px;
  width:200px;
  background:#fff;
  border-radius:18px;
  padding:10px;
  box-shadow:var(--cw-shadow);
  opacity:0;
  visibility:hidden;
  transform:translate(-12px,12px) scale(.96);
  transform-origin:bottom left;
  transition:.25s ease;
}

.cw-widget.is-open .cw-menu{
  opacity:1;
  visibility:visible;
  transform:translate(0,0) scale(1);
}

/* Mũi tên chỉ xuống dưới-trái về phía button */
.cw-menu:after{
  content:"";
  position:absolute;
  left:18px;
  bottom:-8px;
  width:16px;
  height:16px;
  background:#fff;
  transform:rotate(45deg);
}

.cw-header{
  padding:12px 14px 10px;
  border-bottom:1px solid #eef2f7;
  margin-bottom:8px;
}

.cw-title{
  font-size:15px;
  font-weight:700;
  color:#0f172a;
  line-height:1.3;
}

.cw-subtitle{
  font-size:13px;
  color:#64748b;
  margin-top:3px;
  line-height:1.35;
}

.cw-item{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  padding:11px;
  border-radius:14px;
  color:#111827;
  transition:.18s ease;
}

.cw-item:hover{
  background:#f8fafc;
  transform:translateX(2px);
}

.cw-icon{
  width:42px;
  height:42px;
  border-radius:999px;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 42px;
}

.cw-icon svg{
  width:22px;
  height:22px;
  display:block;
}

.cw-icon-phone{
  background:var(--cw-phone);
}

.cw-icon-zalo{
  background:var(--cw-zalo);
  font-size:13px;
  font-weight:800;
  letter-spacing:-.5px;
}

.cw-main-icon .cw-zalo-main{
  font-size:14px;
  font-weight:800;
  letter-spacing:-.5px;
}

.cw-item-title{
  font-size:14px;
  font-weight:700;
  color:#0f172a;
  display:block;
}

.cw-item-desc{
  font-size:14px;
  font-weight:700;
  color:#64748b;
  margin-top:2px;
  display:block;
}

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

  .cw-toggle{
    width:58px;
    height:58px;
  }

  .cw-menu{
    left:0px;
    bottom:72px;
    width:calc(100vw - 100px);
    max-width:300px;
  }

  .cw-menu:after{
    left:16px;
  }
}
