/* ==========================================================================
   WeChat QR popover
   Footer contact block and the contact page.
   Hover or click the trigger to show the QR card.
   ========================================================================== */

.wc-pop-wrap {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
}

.wc-pop-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.wc-pop-trigger:hover,
.wc-pop-trigger:focus {
  color: inherit;
  text-decoration: none;
  outline: none;
}

/* inline icons: no webfont dependency */
.wc-ico {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -.16em;
  fill: currentColor;
  flex: 0 0 auto;
}

.wc-pop-trigger .wc-ico { fill: #07c160; }
.wc-pop-trigger:hover .wc-ico,
.wc-pop-trigger:focus .wc-ico { fill: #06ad56; }

/* clickable text without an icon (contact list already carries one) */
.wc-pop-trigger--text {
  border-bottom: 1px dotted currentColor;
  padding-bottom: 1px;
}

.wc-pop-trigger--text:hover,
.wc-pop-trigger--text:focus {
  border-bottom-style: solid;
}

/* the card ---------------------------------------------------------------- */

.wc-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  width: 232px;
  max-width: calc(100vw - 40px);
  padding: 8px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .3), 0 0 0 1px rgba(0, 0, 0, .06);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  z-index: 9500;
}

.wc-pop img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
}

.wc-pop::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .04);
}

.wc-pop-wrap:hover > .wc-pop,
.wc-pop-wrap:focus-within > .wc-pop,
.wc-pop-wrap.is-open > .wc-pop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

/* contact page: opens below the trigger until there is room on the right --- */

.wc-pop-wrap--right > .wc-pop {
  left: 0;
  bottom: auto;
  top: calc(100% + 12px);
  transform: translateY(-6px);
}

.wc-pop-wrap--right > .wc-pop::after {
  left: 18px;
  bottom: auto;
  top: -6px;
  margin-left: 0;
}

.wc-pop-wrap--right:hover > .wc-pop,
.wc-pop-wrap--right:focus-within > .wc-pop,
.wc-pop-wrap--right.is-open > .wc-pop {
  transform: translateY(0);
}

@media (min-width: 993px) {
  /* full-width trigger box so the card clears the 300px list, not just the text */
  .wc-pop-wrap--right {
    display: block;
  }

  .wc-pop-wrap--right > .wc-pop {
    left: calc(100% + 14px);
    bottom: auto;
    top: 50%;
    transform: translate(-6px, -50%);
  }

  .wc-pop-wrap--right > .wc-pop::after {
    left: -6px;
    top: 50%;
    margin-top: -6px;
  }

  .wc-pop-wrap--right:hover > .wc-pop,
  .wc-pop-wrap--right:focus-within > .wc-pop,
  .wc-pop-wrap--right.is-open > .wc-pop {
    transform: translate(0, -50%);
  }
}

/* small screens: keep the footer card inside the viewport ------------------ */

@media (max-width: 767px) {
  .wc-pop { width: 200px; }

  .wc-pop-wrap:not(.wc-pop-wrap--right) > .wc-pop {
    left: 0;
    transform: translateY(6px);
  }

  .wc-pop-wrap:not(.wc-pop-wrap--right) > .wc-pop::after {
    left: 18px;
    margin-left: 0;
  }

  .wc-pop-wrap:not(.wc-pop-wrap--right):hover > .wc-pop,
  .wc-pop-wrap:not(.wc-pop-wrap--right):focus-within > .wc-pop,
  .wc-pop-wrap:not(.wc-pop-wrap--right).is-open > .wc-pop {
    transform: translateY(0);
  }
}

/* contact page: the third row is WeChat now, not fax ----------------------- */

.contactus_mes li:nth-of-type(3) {
  background-image: url(../image/wechat.png);
  background-size: 24px auto;
  background-position: 0 center;
  background-repeat: no-repeat;
}

/* the theme hides every <br> below 768px (theme.css) — the footer address and
   contact rows need theirs back, or the WeChat row and the email line collapse
   into a single sentence on phones ---------------------------------------- */

@media (max-width: 767px) {
  .footer p br,
  .footer_info p br {
    display: inline !important;
  }
}
