.toolbar-whatsapp {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
}

.toolbar-whatsapp > .toolbar-item {
  border-radius: 9px 9px 0 0;
}

.toolbar-whatsapp > .toolbar-item:hover,
.toolbar-whatsapp > .toolbar-item[aria-expanded="true"] {
  background: #edf9f2;
}

.toolbar-whatsapp > .toolbar-item:focus-visible {
  outline: 2px solid #12924f;
  outline-offset: 3px;
}

.whatsapp-qr {
  position: absolute;
  z-index: 2;
  top: 0;
  right: calc(100% + 14px);
  width: min(220px, calc(100vw - 32px));
  padding: 17px;
  border: 1px solid #e3ebe7;
  border-radius: 12px;
  color: #102746;
  background: #fff;
  box-shadow: 0 12px 38px rgb(12 48 92 / 18%);
  text-align: center;
}

/* 透明过渡区域使鼠标可以从图标移动到二维码上。 */
.whatsapp-qr::before {
  position: absolute;
  top: 0;
  right: -16px;
  width: 16px;
  height: 100%;
  content: "";
}

.whatsapp-qr::after {
  position: absolute;
  top: 25px;
  right: -7px;
  width: 12px;
  height: 12px;
  border-top: 1px solid #e3ebe7;
  border-right: 1px solid #e3ebe7;
  background: #fff;
  content: "";
  transform: rotate(45deg);
}

.whatsapp-qr strong {
  display: block;
  color: #128c4d;
  font: 700 18px/26px Arial, sans-serif;
}

.whatsapp-qr-image {
  margin-top: 10px;
  padding: 12px;
  background: #fff;
}

.whatsapp-qr-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  image-rendering: pixelated;
}

.whatsapp-qr p {
  margin: 8px 0 0;
  color: #526580;
  font-size: 14px;
  line-height: 22px;
}

.inquiry-email-link {
  display: inline-block;
  margin-top: 8px;
  color: #0060ff;
  font-size: 14px;
  line-height: 24px;
  overflow-wrap: anywhere;
}

.inquiry-email-link:hover {
  text-decoration: underline;
}

.inquiry-email-link:focus-visible {
  outline: 2px solid #0060ff;
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .toolbar-whatsapp {
    width: 48px;
  }

  .toolbar-whatsapp > .toolbar-item {
    border-radius: 9px 0 0 9px;
  }

  .whatsapp-qr {
    top: auto;
    right: -144px;
    bottom: calc(100% + 14px);
  }

  .whatsapp-qr::before {
    top: 100%;
    right: 0;
    width: 100%;
    height: 16px;
  }

  .whatsapp-qr::after {
    top: auto;
    right: auto;
    bottom: -7px;
    left: 45px;
    border-top: 0;
    border-bottom: 1px solid #e3ebe7;
  }
}
