/* QUICK_floating/free - 프리(위젯 그대로 띄우기) 스킨
   위치만 잡고 위젯 원본 디자인은 손대지 않는다.
   실제 fixed 위치(가로/세로/오프셋)는 렌더러(quick_floating.php)가
   .quick_floating.{위젯ID} 에 인라인으로 부여한다. */

.quick_floating.free {
  z-index: 2147483646; /* 모달 바로 아래, 그 외 요소 위 */
  /* 톱니 '위젯 폭'(--qf-free-width). 비우면 auto = 콘텐츠 크기만큼.
     COM/grid_free 등 본문용 위젯은 width:100% 라, auto 여도 내부에서
     100% 를 잡지 못하도록 아래에서 콘텐츠 폭을 통제한다. */
  width: var(--qf-free-width, auto);
  max-width: 92vw;      /* 화면 밖으로 안 나가게 */
  box-sizing: border-box;
  /* 컨테이너 안에서 콘텐츠(자식)를 오른쪽으로 정렬 */
  display: flex;
  justify-content: flex-end;
}

/* 프리 껍데기 */
.quick_floating.free .qf_free {
  display: block;
  width: 100%;
  text-align: right; /* 인라인/블록 콘텐츠 오른쪽 정렬 */
  /* 톱니 '비율'(--qf-free-scale) — 디자인 그대로 크기만 조절.
     위치 이동(translateY)은 바깥 .quick_floating 이 담당하므로 서로 독립.
     기준점은 오른쪽 위 = 오른쪽/상단 정렬을 유지하며 축소/확대.
     PC 기본값 = --qf-free-scale (없으면 1) */
  transform: scale(var(--qf-free-scale, 1));
  transform-origin: right top;
}

/* 태블릿 (≤1024px): --qf-free-scale-t 있으면 사용, 없으면 PC값 상속 */
@media screen and (max-width: 1024px) {
  .quick_floating.free .qf_free {
    transform: scale(var(--qf-free-scale-t, var(--qf-free-scale, 1)));
  }
}
/* 모바일 (≤768px): --qf-free-scale-m 있으면 사용, 없으면 PC값 상속 */
@media screen and (max-width: 768px) {
  .quick_floating.free .qf_free {
    transform: scale(var(--qf-free-scale-m, var(--qf-free-scale, 1)));
  }
}

/* 프리 껍데기(qf_free) 자신의 contents-container 여백/폭 초기화 */
.quick_floating.free .qf_free.contents-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* 내부에서 재렌더된 위젯(COM/grid_free 등)의 본문용 100%/float 무력화
   → 플로팅 폭(360px 등) 안에서 콘텐츠는 자기 크기(auto)로, 오른쪽 정렬 */
.quick_floating.free .qf_free .contents-container {
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 0 0 auto !important; /* 오른쪽 붙임 */
  padding: 0 !important;
  float: none !important;
  display: inline-block;
}
.quick_floating.free .qf_free .wg_side {
  width: 100% !important;
  float: none !important;
}
/* 그리드가 남는 폭으로 퍼지지 않게 — 콘텐츠 실제 크기 존중 */
.quick_floating.free .qf_free .wg_box {
  width: auto !important;
  float: none !important;
  justify-content: flex-end;
}

/* 스크롤 3구간 위치 이동은 widget_body.php 의 JS 가
   .quick_floating 의 margin-top 으로 처리한다 (렌더러가 준 top/transform 은 그대로 유지). */
