/**
 * 스크롤 탑 버튼 스타일 - 단일 소스
 * #scrollTopBtn, .scroll-top-btn (footer.inc.php)
 * head.sub.php에서 로드됨
 * UX 권장: 모바일 터치 타겟 42~72px, 56~60px 권장
 */

/* 스크롤 탑 버튼 - 공통 */
button#scrollTopBtn,
.scroll-top-btn {
	position: fixed;
	width: 72px;
	height: 72px;
	min-width: 72px;
	min-height: 72px;
	bottom: 22%;
	right: 30px;
	border-radius: 50%;
	border: 2px solid #fff;
	background: #ff7f2a;
	color: #fff;
	font-size: 1.5rem;
	font-weight: 600;
	z-index: 999;
	display: none;
	opacity: 0;
	transform: translateY(30px) scale(0.8);
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(255, 127, 42, 0.3);
}

button#scrollTopBtn img,
.scroll-top-btn img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.scroll-top-btn i {
	font-size: 28px;
	line-height: 1;
}

button#scrollTopBtn:hover,
.scroll-top-btn:hover {
	transform: translateY(-5px) scale(1.05);
	box-shadow: 0 6px 20px rgba(255, 127, 42, 0.4);
}

button#scrollTopBtn.show,
.scroll-top-btn.show {
	opacity: 1;
	transform: translateY(0) scale(1);
}

/* 페이드 인/아웃 애니메이션 */
@keyframes scrollTopFadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px) scale(0.8);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes scrollTopFadeOutDown {
	from {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
	to {
		opacity: 0;
		transform: translateY(30px) scale(0.8);
	}
}

button#scrollTopBtn.fade-in,
.scroll-top-btn.fade-in {
	animation: scrollTopFadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

button#scrollTopBtn.fade-out,
.scroll-top-btn.fade-out {
	animation: scrollTopFadeOutDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 클릭 애니메이션 */
button#scrollTopBtn:active,
.scroll-top-btn:active {
	animation: scrollTopBounce 0.3s ease;
}

@keyframes scrollTopBounce {
	0%, 100% { transform: translateY(0) scale(1); }
	50% { transform: translateY(-5px) scale(1.02); }
}

/* 모바일 768px 이하 */
@media (max-width: 768px) {
	button#scrollTopBtn,
	.scroll-top-btn {
		width: 64px;
		height: 64px;
		min-width: 64px;
		min-height: 64px;
		bottom: 80px;
		right: 20px;
		border-width: 2px;
		font-size: 1.35rem;
	}
	.scroll-top-btn i {
		font-size: 24px;
	}
}

/* 소형 모바일 480px 이하 */
@media (max-width: 480px) {
	button#scrollTopBtn,
	.scroll-top-btn {
		width: 58px;
		height: 58px;
		min-width: 58px;
		min-height: 58px;
		bottom: 20px;
		right: 16px;
		font-size: 1.2rem;
	}
	.scroll-top-btn i {
		font-size: 22px;
	}
}

/* 태블릿 769~1024px */
@media (min-width: 769px) and (max-width: 1024px) {
	button#scrollTopBtn,
	.scroll-top-btn {
		width: 68px;
		height: 68px;
		min-width: 68px;
		min-height: 68px;
		bottom: 25px;
		right: 25px;
		font-size: 1.4rem;
	}
	.scroll-top-btn i {
		font-size: 26px;
	}
}

/* 데스크톱 1025px 이상 */
@media (min-width: 1025px) {
	button#scrollTopBtn,
	.scroll-top-btn {
		width: 100px;
		height: 100px;
		min-width: 100px;
		min-height: 100px;
		bottom: 25%;
		right: 30px;
		font-size: 1.5rem;
	}
	.scroll-top-btn i {
		font-size: 32px;
	}
}
