/**
 * Clinic Skin — Floating Action Button (FAB / 빠른 메뉴)
 *
 * 콘솔 "네비게이션" 에서 설정한 플로팅 버튼을 모든 프론트 페이지 우측에 표시.
 * 세란 스니펫을 클리닉 팔레트(올리브 --brand-primary)로 이식하고, 헤더 메뉴의
 * .nav-item / .nav-list 와 충돌하지 않도록 전부 .pfab- 로 네임스페이스했다.
 *
 * z-index 999 — 예약 팝업(.cr-popup / .cr-popup-overlay)보다 낮게.
 */

.pfab {
	position: fixed;
	z-index: 999;
}

/* 예약 팝업이 항상 FAB 위로. */
.cr-popup-overlay { z-index: 9998 !important; }
.cr-popup         { z-index: 9999 !important; }

/* ---------------------------------------------------------------- 토글 버튼 */
.pfab-toggle {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 62px;
	height: 62px;
	padding: 0;
	border: none;
	border-radius: 50%;
	color: #fff;
	background: linear-gradient(135deg,
		var(--brand-primary, #444C38),
		color-mix(in srgb, var(--brand-primary, #444C38) 62%, var(--brand-secondary, #f0e9d5)));
	box-shadow: 0 6px 16px rgba(30, 34, 24, 0.28);
	cursor: pointer;
	transition: transform .3s ease, box-shadow .3s ease;
}
.pfab-toggle:hover { transform: scale(1.05); box-shadow: 0 8px 22px rgba(30, 34, 24, 0.34); }

/* + / × 아이콘 */
.pfab-plus { position: relative; width: 28px; height: 28px; }
.pfab-plus::before,
.pfab-plus::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 0;
	width: 100%;
	height: 3.5px;
	margin-top: -1.75px;
	background: #fff;
	border-radius: 2px;
	transition: transform .3s ease;
}
.pfab-plus::after { transform: rotate(90deg); }
.pfab-open .pfab-plus::before { transform: rotate(45deg); }
.pfab-open .pfab-plus::after  { transform: rotate(-45deg); }

/* ---------------------------------------------------------------- 항목 리스트 */
.pfab-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.pfab-item {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #fff;
	color: var(--brand-primary, #444C38);
	box-shadow: 0 4px 14px rgba(30, 34, 24, 0.20);
	text-decoration: none;
	transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
}
.pfab-item:hover {
	transform: scale(1.08);
	background: var(--brand-primary, #444C38);
	color: #fff;
	box-shadow: 0 6px 18px rgba(30, 34, 24, 0.30);
}

.pfab-icon { display: flex; align-items: center; justify-content: center; }
.pfab-svg  { width: 26px; height: 26px; display: block; }

/* 업로드한 이미지 아이콘: 여백 없이 원을 꽉 채우고 원형 테두리만 남긴다.
   (아이콘 이미지는 대개 그 자체가 완성된 원형 아트워크라, 안쪽 패딩을 주면
   실제 그림이 작아 보인다.) */
.pfab-item:has(.pfab-img) {
	overflow: hidden;
	border: 1px solid rgba(30, 34, 24, 0.12);
	background: #fff;
}
.pfab-item:has(.pfab-img) .pfab-icon { width: 100%; height: 100%; }
.pfab-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
	display: block;
}
/* 이미지 아이콘은 색 반전이 어색하므로 hover 시에도 흰 배경 유지(확대만). */
.pfab-item:has(.pfab-img):hover { background: #fff; color: var(--brand-primary, #444C38); }

/* 라벨 — 데스크톱 hover 시 왼쪽 툴팁으로. */
.pfab-item-label {
	position: absolute;
	right: calc(100% + 12px);
	top: 50%;
	transform: translateY(-50%) translateX(6px);
	white-space: nowrap;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	padding: 7px 11px;
	border-radius: 6px;
	color: #fff;
	background: rgba(30, 34, 24, 0.88);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}
.pfab-item:hover .pfab-item-label { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ---------------------------------------------------------------- 데스크톱 */
@media (min-width: 768px) {
	.pfab {
		top: 50%;
		right: 34px;
		transform: translateY(-50%);
	}
	/* 데스크톱은 토글 없이 항상 세로 스택 노출. */
	.pfab-toggle { display: none; }
	.pfab-list   { display: flex !important; }
}

/* ---------------------------------------------------------------- 모바일 */
@media (max-width: 767px) {
	.pfab {
		bottom: 26px;
		right: 20px;
		display: flex;
		flex-direction: column-reverse;
		align-items: center;
		gap: 14px;
	}
	.pfab-list {
		gap: 12px;
		transition: opacity .25s ease, transform .25s ease;
	}
	/* 닫힘 상태: 항목 숨김, 토글만. */
	.pfab-list.is-hidden {
		opacity: 0;
		transform: translateY(10px) scale(.9);
		pointer-events: none;
		visibility: hidden;
	}
	.pfab-item { width: 50px; height: 50px; }
	.pfab-svg  { width: 23px; height: 23px; }
	.pfab-img  { width: 100%; height: 100%; }
	/* 모바일에선 라벨 툴팁 숨김(공간/터치). */
	.pfab-item-label { display: none; }
}

/* ============================================================
   이미지 모달 (type=modal) — 위챗 QR 등 안내 이미지를 띄운다
============================================================ */
.pfab-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.pfab-modal[hidden] { display: none; }
.pfab-modal__inner {
	position: relative;
	max-width: min(92vw, 420px);
	max-height: 88vh;
	display: flex;
}
/* 세로로 긴 안내 이미지(QR 배너)도 잘리거나 여백 없이 딱 맞게 */
.pfab-modal__inner img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 88vh;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.pfab-modal__close {
	position: absolute;
	top: -14px;
	right: -14px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 0;
	background: #fff;
	color: #2b2b2b;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}
@media (max-width: 480px) {
	.pfab-modal__close { top: 6px; right: 6px; }
}
/* 모달 트리거 버튼도 링크 항목과 같은 모양으로 */
.pfab-item--modal { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
