/**
 * 플로팅 메뉴 모듈 스타일 v2.0
 * 수정: 미디어쿼리 제거, User-Agent 기반 분기로 통일
 * 수정2: z-index 조정 (토글/메뉴 10010, 오버레이 9995)
 */

/* ========== 공통 스타일 (PC/모바일 공통) ========== */

/* PC 컨테이너 */
.floating-items {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  z-index: 10010;
}

.floating-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 45px;
  height: 45px;
  border-radius: 50px;
  transition: all 0.25s ease;
  overflow: hidden;
  white-space: nowrap;
  text-decoration: none !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  position: relative;
}

/* 아이콘 영역 공통 */
.floating-item i,
.floating-item img {
  width: 45px;
  height: 45px;
  line-height: 45px;
  text-align: center;
  font-size: 20px;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

/* Font Awesome 아이콘 */
.floating-item i {
  display: inline-block;
}

/* 이미지인 경우 중앙 정렬 */
.floating-item img {
  object-fit: contain;
  padding: 8px;
}

/* 텍스트 영역 공통 */
.floating-item span {
  margin-left: 0px;
  opacity: 0;
  transition: opacity 0.2s ease, margin 0.25s ease;
  font-size: 14px;
  font-weight: 500;
  padding-right: 20px;
}

/* 호버시 확장 */
.floating-item:hover {
  width: auto;
  padding-left: 5px;
}

.floating-item:hover i,
.floating-item:hover img {
  margin-right: 0px;
}

.floating-item:hover span {
  opacity: 1;
  margin-left: 0px;
}

/* ========== PC - 컬러 모드 ========== */
.style-pc-color .floating-item.call { background: #28a745; color: #fff !important; }
.style-pc-color .floating-item.sms { background: #2ecc71; color: #fff !important; }
.style-pc-color .floating-item.kakao { background: #f7e600; color: #000 !important; }
.style-pc-color .floating-item.n_talk { background: #00bf38; color: #fff !important; }
.style-pc-color .floating-item.map { background: #dc3545; color: #fff !important; }
.style-pc-color .floating-item.blog { background: #41b649; color: #fff !important; }
.style-pc-color .floating-item.youtube { background: #ff0000; color: #fff !important; }
.style-pc-color .floating-item.instagram { background: #e1306c; color: #fff !important; }
.style-pc-color .floating-item.top { background: #fff; color: #343a40 !important; border: 1px solid var(--theme-color) !important; }

/* ========== PC - 모노 모드 (테마 색상 사용) ========== */
.style-pc-mono .floating-item {
  background: var(--theme-color);
  color: #fff !important;
}
.style-pc-mono .floating-item.top {
  background: #fff;
  color: var(--theme-color) !important;
  border: 1px solid var(--theme-color) !important;
}
.style-pc-mono .floating-item.kakao {
  color: #fff !important;
}
.style-pc-mono .floating-item.kakao i {
  color: #fff !important;
}

/* ========== 모바일 전용 스타일 (User-Agent 감지 시 적용) ========== */

/* 모바일 오버레이 - 헤더 아래에 위치 */
.floating-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(7px);
  z-index: 9995;
}

.floating-overlay.active {
  display: block;
}

/* 모바일 토글 버튼 - 헤더 위에 위치 */
.floating-toggle {
  display: block;
  position: fixed;
  right: 15px;
  bottom: 25px;
  width: 50px;
  height: 50px;
  background: #fff;
  color: #333;
  border-radius: 50%;
  font-size: 24px;
  text-align: center;
  line-height: 50px;
  cursor: pointer;
  z-index: 10010;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.floating-toggle.open {
  background: var(--theme-color);
  color: #fff;
}

/* 모바일 메뉴 - 헤더 위에 위치 */
.floating-menu {
  display: flex;
  position: fixed;
  right: 15px;
  bottom: 85px;
  flex-direction: column;
  gap: 10px;
  z-index: 10010;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.floating-menu.open {
  opacity: 1;
  visibility: visible;
}

.floating-menu a {
  display: block;
  width: 50px;
  height: 50px;
  background: #fff;
  color: #333 !important;
  font-size: 24px;
  text-align: center;
  line-height: 50px;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.floating-menu a:active {
  transform: scale(0.95);
}

.floating-menu a.blog { padding: 11px; }
.floating-menu a.blog img { width: 28px; height: 28px; }

/* 모바일 - 컬러 모드 */
.style-mobile-color .floating-menu a.call { background: #28a745; color: #fff !important; }
.style-mobile-color .floating-menu a.sms { background: #2ecc71; color: #fff !important; }
.style-mobile-color .floating-menu a.kakao { background: #f7e600; color: #000 !important; }
.style-mobile-color .floating-menu a.n_talk { background: #00bf38; color: #fff !important; }
.style-mobile-color .floating-menu a.map { background: #dc3545; color: #fff !important; }
.style-mobile-color .floating-menu a.blog { background: #41b649; color: #fff !important; }
.style-mobile-color .floating-menu a.youtube { background: #ff0000; color: #fff !important; }
.style-mobile-color .floating-menu a.instagram { background: #e1306c; color: #fff !important; }
.style-mobile-color .floating-menu a.top { background: #fff; color: #333 !important; }

/* 모바일 - 모노 모드 (테마 색상 사용) */
.style-mobile-mono .floating-menu a {
  background: var(--theme-color);
  color: #fff !important;
}
.style-mobile-mono .floating-menu a.kakao {
  color: #fff !important;
}
.style-mobile-mono .floating-menu a.top {
  background: #fff;
  color: var(--theme-color) !important;
}
.style-mobile-mono .floating-toggle.open {
  background: var(--theme-color);
}