/* Nút liên hệ nổi. Mọi class đều bắt đầu bằng nlhn- để không đụng CSS của theme. */

.nlhn {
  position: fixed;
  z-index: 9999;
  left: 20px;
  bottom: calc(var(--nlhn-day, 20px) + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
  /* Khung chứa phủ cả khoảng trống giữa các nút; chỉ các nút nhận click. */
  pointer-events: none;
}

.nlhn--phai {
  left: auto;
  right: 20px;
  align-items: flex-end;
}

.nlhn,
.nlhn *,
.nlhn *::before,
.nlhn *::after {
  box-sizing: border-box;
}

.nlhn a {
  pointer-events: auto;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.nlhn svg {
  display: block;
  max-width: none;
  flex: none;
}

.nlhn > * + .nlhn-zalo {
  margin-top: 30px;
}

.nlhn > * + .nlhn-hotline {
  margin-top: 26px;
}

/* ---- Nút tròn: Zalo, Telegram ---- */

.nlhn .nlhn-tron {
  position: relative;
  display: block;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--nlhn-mau, #0068ff);
  color: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .06), 0 2px 32px rgba(0, 0, 0, .16);
}

/* Hai vòng sóng lan ra quanh nút */
.nlhn .nlhn-tron::before,
.nlhn .nlhn-tron::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -20px;
  right: -20px;
  bottom: -20px;
  left: -20px;
  border: 1px solid var(--nlhn-mau, #0068ff);
  border-radius: 50%;
  background: var(--nlhn-vong, rgba(0, 104, 255, .5));
  opacity: 0;
  pointer-events: none;
}

.nlhn .nlhn-tron__icon,
.nlhn .nlhn-tron__chu {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.nlhn .nlhn-tron__icon {
  transition: opacity 1s;
}

.nlhn .nlhn-tron__chu {
  padding: 0 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  transform: scaleX(-1);
  transition: opacity .5s, transform .5s;
}

.nlhn .nlhn-telegram .nlhn-tron__chu {
  font-size: 10px;
  text-transform: capitalize;
}

.nlhn .nlhn-tron:hover,
.nlhn .nlhn-tron:focus {
  color: #fff;
}

.nlhn .nlhn-tron:hover .nlhn-tron__icon,
.nlhn .nlhn-tron:focus-visible .nlhn-tron__icon {
  opacity: 0;
}

.nlhn .nlhn-tron:hover .nlhn-tron__chu,
.nlhn .nlhn-tron:focus-visible .nlhn-tron__chu {
  opacity: 1;
  transform: scaleX(1);
}

/* ---- Nút gọi hotline ---- */

.nlhn .nlhn-hotline {
  position: relative;
  display: block;
  margin-left: -15px;
  padding: 4px 15px 4px 46px;
  border-radius: 22px;
  background: var(--nlhn-mau, #fcb600);
  color: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .2);
}

.nlhn--phai .nlhn-hotline {
  margin-left: 0;
  margin-right: -15px;
}

.nlhn .nlhn-hotline:hover,
.nlhn .nlhn-hotline:focus {
  color: #fff;
}

.nlhn .nlhn-hotline__icon {
  position: absolute;
  top: 6px;
  left: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  transform-origin: center bottom;
}

.nlhn .nlhn-hotline__chu,
.nlhn .nlhn-hotline__so {
  color: inherit;
}

.nlhn .nlhn-hotline__chu {
  display: block;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 3px;
  line-height: 12px;
}

.nlhn .nlhn-hotline__so {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: normal;
  line-height: 24px;
}

.nlhn a:focus-visible {
  outline: 2px solid var(--nlhn-mau);
  outline-offset: 3px;
}

/* ---- Chuyển động: tắt khi người dùng bật "giảm chuyển động" trong hệ điều hành ---- */

@media (prefers-reduced-motion: no-preference) {
  .nlhn .nlhn-tron::before,
  .nlhn .nlhn-tron::after {
    animation: nlhn-song 1.9s linear infinite;
  }

  .nlhn .nlhn-tron::after {
    animation-delay: .4s;
  }

  .nlhn .nlhn-hotline__icon {
    animation: nlhn-nay 1s both;
  }
}

@keyframes nlhn-song {
  0% {
    opacity: 0;
    transform: scale(.5);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes nlhn-nay {
  0%, 20%, 53%, 80%, 100% {
    animation-timing-function: cubic-bezier(.215, .61, .355, 1);
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(.755, .05, .855, .06);
    transform: translate3d(0, -30px, 0);
  }
  70% {
    animation-timing-function: cubic-bezier(.755, .05, .855, .06);
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

/* ---- Màn hình nhỏ ---- */

@media (max-width: 767px) {
  .nlhn .nlhn-an-dt {
    display: none;
  }
}

@media (min-width: 768px) {
  .nlhn .nlhn-an-mt {
    display: none;
  }
}

@media (max-width: 549px) {
  .nlhn .nlhn-hotline {
    padding: 4px 10px 4px 42px;
  }

  .nlhn .nlhn-hotline__icon {
    top: 9px;
    width: 28px;
    height: 28px;
  }

  .nlhn .nlhn-hotline__chu {
    font-size: 10px;
  }

  .nlhn .nlhn-hotline__so {
    font-size: 16px;
    line-height: 20px;
  }
}

@media print {
  .nlhn {
    display: none;
  }
}
