/* Tawk.to 상담 위젯 공용 스타일 — _components/tawk_widget.php 가 모든 페이지에 넣는다 */

/* 런처 — Tawk 가 런처 iframe 엔 위치를 넣지 않아 고정한다(창은 customStyle 같은 오프셋으로 그 위).
   iframe 순서(:nth-child)로 잡으면 열린 창까지 잡히고, 창보다 낮은 z-index 면 열린 창에 가려진다 */
html body #min-widget iframe {
  position: fixed;
  right: 30px;
  bottom: 110px;
  width: 64px;
  height: 60px;
  border: 0;
  /* 창 iframe(1000003)·창 아래 안내 iframe 위 */
  z-index: 1000004;
}

/* 전체 화면 창(모바일)은 자체 최소화 버튼이 있어 런처를 숨긴다 */
html body.tawk-window-fullscreen #min-widget iframe {
  display: none;
}

/* PC 창 닫기 버튼 — 위치는 _components/tawk_widget.php 가 창 iframe 을 따라 지정 */
.tawk-close-btn {
  position: fixed;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-8, 8px);
  background: transparent;
  color: var(--color-content-inverse, #fff);
  cursor: pointer;
  /* Tawk 최상위 컨테이너(z-index 2000000000)가 창을 감싸 쌓임 맥락을 만든다 — 그보다 위 */
  z-index: 2000000001;
}

.tawk-close-btn:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tawk-close-btn:hover {
  background: var(--color-overlay-hover, rgba(0, 0, 0, 0.2));
}

@media (max-width: 800px) {
  html body #min-widget iframe {
    right: 6px;
    bottom: 80px;
    transform: scale(0.85);
  }
}
