/* ============================================================
   全局悬浮联系组件（原生 CSS/JS，无弹窗/图标插件）
   ============================================================ */
#shopifyrate-widget,
#shopifyrate-badge,
.shopifyrate-widget,
.shopifyrate-badge,
.shopifyrate-float,
[data-shopifyrate-widget] {
  display: none !important;
}

.cw-trigger {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 9002;
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 圆形 + WhatsApp 品牌绿，白色描边与绿色光晕提升辨识度 */
  background: #25d366;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 26px rgba(37, 211, 102, .45);
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.cw-trigger:hover {
  background: #1ebe5b;
  border-color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(37, 211, 102, .55);
}
.cw-trigger.is-open { background: #1ebe5b; border-color: #fff; }
.cw-trigger.is-open:hover { background: #25d366; border-color: #fff; }
.cw-trigger:active { transform: translateY(0); }
.cw-trigger:focus-visible { outline: 2px solid #25d366; outline-offset: 3px; }
.cw-trigger svg { width: 26px; height: 26px; }
.cw-trigger-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 9px;
  height: 9px;
  background: #fff;
  border: 2px solid #25d366;
  border-radius: 50%;
}

.cw-overlay {
  position: fixed;
  inset: 0;
  z-index: 9001;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 24px 92px;
  background: rgba(20, 36, 62, .55);
  opacity: 0;
  transition: opacity .18s ease;
}
.cw-overlay.is-open { opacity: 1; }
.cw-overlay[hidden] { display: none !important; }

.cw-panel {
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid var(--c-line);
  border-top: 3px solid var(--c-sky);
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(20, 36, 62, .28);
  opacity: 0;
  transform: translateY(10px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}
.cw-overlay.is-open .cw-panel { opacity: 1; transform: none; }

.cw-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: #fff;
  border-bottom: 1px solid var(--c-line);
}
.cw-head-text { min-width: 0; }
.cw-kicker {
  display: block;
  margin-bottom: 3px;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-sky);
}
.cw-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 1.05rem;
  line-height: 1.25;
  font-weight: 800;
  color: var(--c-navy);
}
.cw-close {
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--c-line);
  background: #fff;
  color: var(--c-navy);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 0;
}
.cw-close:hover { border-color: var(--c-sky); color: var(--c-sky); background: #f8fbff; }
.cw-close:focus-visible { outline: 2px solid var(--c-sky); outline-offset: 2px; }

.cw-body { padding: 16px 18px 18px; }
.cw-qr-block { text-align: center; }
.cw-qr-block h3 {
  margin: 0 0 4px;
  font-family: var(--font-head);
  font-size: .95rem;
  font-weight: 800;
  color: var(--c-navy);
}
.cw-qr-hint { margin: 0; font-size: .76rem; color: var(--c-muted); }
.cw-qr-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 12px auto 0;
  padding: 10px;
  border: 1px solid var(--c-line);
  background: #fff;
}
.cw-qr-img {
  display: block;
  width: 220px;
  height: 220px;
  object-fit: contain;
}
.cw-qr-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
  border: 1px dashed var(--c-line);
  background: var(--c-bg-soft);
  color: var(--c-muted);
  font-size: .78rem;
}
.cw-qr-empty[hidden] { display: none !important; }

.cw-contacts { margin-top: 14px; border-top: 1px solid var(--c-line); }
.cw-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--c-line);
  text-decoration: none;
  color: inherit;
}
.cw-contact:last-child { border-bottom: 0; }
a.cw-contact:hover { background: #f8fbff; }
.cw-contact.is-disabled { opacity: .6; }
.cw-person { min-width: 0; }
.cw-name {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  color: var(--c-navy);
  line-height: 1.3;
}
.cw-name em { font-style: normal; font-weight: 600; font-size: .8em; color: var(--c-muted); }
.cw-role { display: block; margin-top: 2px; font-size: .72rem; color: var(--c-muted); }
.cw-action {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: #25d366;
  color: #073b1a;
  font-size: .73rem;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  border-radius: 0;
}
a.cw-contact:hover .cw-action { background: #1ebe5b; }
.cw-action svg { flex: none; }
.cw-contact.is-disabled .cw-action { background: #f3f4f6; color: #9ca3af; }

.cw-note { margin: 12px 0 0; font-size: .72rem; color: var(--c-muted); line-height: 1.5; }

@media (max-width: 640px) {
  .cw-trigger {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }
  .cw-overlay {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
  }
  .cw-panel {
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    padding-bottom: 64px;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 4px 4px 0 0;
    transform: translateY(100%);
  }
  .cw-overlay.is-open .cw-panel { transform: translateY(0); }
  .cw-qr-img,
  .cw-qr-empty { width: min(220px, 62vw); height: auto; }
  .cw-qr-empty { height: min(220px, 62vw); }
}

@media print {
  .cw-trigger,
  .cw-overlay { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .cw-trigger,
  .cw-overlay,
  .cw-panel { transition: none !important; }
}
