/**
 * Contact widget (floating button + popup) — adapted from dwl.group.
 */
.cw-widget * {
  box-sizing: border-box;
}

a.cw-messenger,
button.cw-messenger {
  color: #ffffff;
  font: inherit;
}

.cw-widget {
  --cw-accent: #c8102e;
  --cw-accent-light: #e6455c;
  --cw-accent-dark: #8c0b20;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99990;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cw-button {
  position: relative;
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, var(--cw-accent-light) 0%, var(--cw-accent) 45%, var(--cw-accent-dark) 100%);
  box-shadow: 0 8px 24px rgba(200, 16, 46, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cw-button:hover,
.cw-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(200, 16, 46, 0.6);
}

.cw-button svg {
  width: 26px;
  height: 26px;
  fill: #ffffff;
}

.cw-online-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #35d15a;
  border: 2.5px solid #ffffff;
}

.cw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 10, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99988;
}

.cw-widget.cw-open .cw-overlay {
  opacity: 1;
  pointer-events: auto;
}

.cw-popup {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  background: #100e1c;
  background-image: radial-gradient(circle at 100% 0%, rgba(200, 16, 46, 0.16), transparent 55%);
  border: 1px solid rgba(200, 16, 46, 0.25);
  border-radius: 20px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(200, 16, 46, 0.12);
  color: #ffffff;
  z-index: 99989;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cw-widget.cw-open .cw-popup {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cw-popup-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cw-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a99aa0;
}

.cw-close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #cfc9e6;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.cw-close:hover,
.cw-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.cw-title {
  margin: 10px 0 6px;
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.cw-desc {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #a79fc4;
}

.cw-qr-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 4px auto 10px;
  padding: 10px;
  background: #ffffff;
  border-radius: 14px;
}

.cw-qr-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.cw-qr-wrap::before,
.cw-qr-wrap::after,
.cw-qr-corner-tl,
.cw-qr-corner-br {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--cw-accent);
}

.cw-qr-wrap::before {
  top: -6px;
  left: -6px;
  border-right: none;
  border-bottom: none;
  border-radius: 8px 0 0 0;
}

.cw-qr-wrap::after {
  bottom: -6px;
  right: -6px;
  border-left: none;
  border-top: none;
  border-radius: 0 0 8px 0;
}

.cw-qr-corner-tl {
  top: -6px;
  right: -6px;
  border-left: none;
  border-bottom: none;
  border-radius: 0 8px 0 0;
}

.cw-qr-corner-br {
  bottom: -6px;
  left: -6px;
  border-right: none;
  border-top: none;
  border-radius: 0 0 0 8px;
}

.cw-qr-caption {
  margin: 0 0 18px;
  text-align: center;
  font-size: 12px;
  line-height: 1.45;
  color: #8b83a8;
}

.cw-messengers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.cw-messenger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  text-decoration: none;
  color: #e7e3f4;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.cw-messenger:hover,
.cw-messenger:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.cw-messenger-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cw-messenger-icon svg {
  width: 17px;
  height: 17px;
  fill: #ffffff;
}

.cw-messenger-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.cw-icon-max,
.cw-icon-wechat {
  background: transparent;
}

.cw-icon-telegram {
  background-color: #229ed9;
}

.cw-contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  text-decoration: none;
  color: #ffffff;
  margin-bottom: 8px;
  transition: background 0.15s ease;
}

.cw-contact-row:last-child {
  margin-bottom: 0;
}

.cw-contact-row:hover,
.cw-contact-row:focus-visible {
  background: rgba(255, 255, 255, 0.09);
}

.cw-contact-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cw-accent);
}

.cw-contact-icon svg {
  width: 16px;
  height: 16px;
  fill: #ffffff;
}

.cw-contact-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cw-contact-label {
  font-size: 11px;
  color: #a99aa0;
}

.cw-contact-value {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

/* WeChat nested modal (screenshot 2) */
.cw-wechat[hidden] {
  display: none;
}

.cw-wechat:not([hidden]) {
  display: block;
}

.cw-wechat__overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 10, 0.65);
  z-index: 99991;
}

.cw-wechat__card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 16px;
  padding: 28px 22px 22px;
  z-index: 99992;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.cw-wechat__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 1px solid #c8102e;
  border-radius: 6px;
  background: #ffffff;
  color: #1a73e8;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.cw-wechat__shot {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto 12px;
}

.cw-wechat__hint,
.cw-wechat__or {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #222;
}

.cw-wechat__rule {
  border: none;
  border-top: 2px solid #c8102e;
  width: 72%;
  margin: 14px auto;
}

.cw-wechat__or {
  margin-bottom: 12px;
  color: #444;
}

.cw-wechat__btn {
  display: inline-block;
  line-height: 0;
}

.cw-wechat__btn img {
  width: 229px;
  max-width: 100%;
  height: auto;
}

@media (max-width: 767px) {
  .cw-widget {
    right: 12px;
    bottom: 84px;
  }

  .cw-popup {
    right: 12px;
    bottom: 156px;
    width: calc(100vw - 24px);
    padding: 16px 16px 14px;
  }

  .cw-title,
  .cw-desc,
  .cw-qr-wrap,
  .cw-qr-caption {
    display: none;
  }

  .cw-popup-header {
    margin-bottom: 10px;
  }

  .cw-messengers {
    margin-bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cw-button,
  .cw-overlay,
  .cw-popup,
  .cw-messenger {
    transition: none;
  }
}
