@font-face {
  font-family: "jinhui-contact-icons";
  src: url("../fonts/floating-iconfont.woff2") format("woff2");
  font-display: block;
}

.floating-contact {
  position: fixed;
  z-index: 1000;
  top: 50%;
  right: 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transform: translateY(-50%);
}

.floating-contact__wechat { position: relative; }

.floating-contact .floating-contact__button {
  display: flex;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: #ccc;
  box-shadow: none;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .3s;
}

.floating-contact .floating-contact__button:hover,
.floating-contact .floating-contact__button:focus-visible,
.floating-contact__wechat.is-open .floating-contact__trigger { background: #033680; color: #fff; }
.floating-contact .floating-contact__button:focus-visible { outline: 2px solid #033680; outline-offset: 2px; }

.floating-contact__icon {
  font: normal 24px/1 "jinhui-contact-icons";
  -webkit-font-smoothing: antialiased;
}
.floating-contact__icon--wechat::before { content: "\e7cf"; }
.floating-contact__icon--whatsapp::before { content: "\e7c1"; }
.floating-contact__icon--email::before { content: "\e7c5"; }
.floating-contact__icon--top::before { display: block; transform: rotate(180deg); content: "\e723"; font-size: 18px; }

.floating-contact__panel {
  position: absolute;
  top: -10px;
  right: 100%;
  display: none;
  box-sizing: border-box;
  width: 150px;
  height: 150px;
  align-content: center;
  justify-items: center;
  padding: 0;
  border: 10px solid #0002;
  border-radius: 10px;
  background: #fff;
  color: #333;
  text-align: center;
}

.floating-contact__wechat:hover .floating-contact__panel,
.floating-contact__wechat.is-open .floating-contact__panel { display: grid; }
.floating-contact__panel img { display: block; width: 100%; height: 100%; object-fit: contain; }
.floating-contact__panel span { max-width: 100%; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }

@media (max-width: 1600px) {
  .floating-contact .floating-contact__button { width: 45px; height: 45px; }
  .floating-contact__icon { font-size: 21px; }
  .floating-contact__panel { right: 80px; }
}

@media (max-width: 1333px) {
  .floating-contact__panel { right: 70px; width: 100px; height: 100px; }
}

@media (max-width: 999px) {
  body:has(.floating-contact) { padding-bottom: 50px; }
  .floating-contact {
    z-index: 19;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    flex-direction: row;
    gap: 0;
    width: 100%;
    height: 50px;
    transform: none;
    background: #0005;
  }
  .floating-contact__wechat,
  .floating-contact > .floating-contact__button { flex: 1 1 0; }
  .floating-contact .floating-contact__button {
    width: 100%;
    height: 50px;
    border-radius: 0;
    background: transparent;
  }
  .floating-contact__panel { top: auto; right: auto; bottom: calc(100% + 8px); left: 8px; width: 150px; height: 150px; }
}

@media (max-width: 768px) {
  .floating-contact__panel { width: 135px; height: 135px; }
}

@media (max-width: 450px) {
  .floating-contact__icon { font-size: 18px; }
  .floating-contact__panel { width: 100px; height: 100px; }
}
