/* =============================
   공통 헤더 (데스크톱 기본 80px)
   ============================= */
.topnav {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 80px;
	background-color: #fff;
	-webkit-animation-name: slideDown;
	-webkit-animation-duration: 0.5s;
	z-index: 9999;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
}

.nav-pad {
	height: 80px;
}

/* 로고 영역 */
.topnav .top-logo {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	z-index: 2;
}

.topnav .top-logo div {
	box-sizing: border-box;
	height: 100%;
	display: flex;
	align-items: center;
	padding-left: 10px;
}

.topnav .top-logo img {
	height: 40px;
}

/* 가운데 컨테이너 + 메뉴 래퍼 */
.topnav .container {
	position: relative;
	height: 100%;
	margin: 0 auto;
	text-align: center;
	z-index: 1;
}

/* 상단 메뉴 래퍼 (데스크톱: 가운데 정렬용 inline-block) */
.topnav .menus {
	display: inline-block;
	height: 100%;
	vertical-align: top;
}

/* 각 메뉴 아이템 (데스크톱 기본) */
.topnav .menu {
	position: relative;
	display: inline-block;
	height: 100%;
	width: 90px;
	font-weight: 500;
	font-size: 1.1rem;
	vertical-align: top;
}

.topnav .menu div {
	display: flex;
	height: 100%;
	width: 100%;
	align-items: center;
	justify-content: center;
}

/* 활성 메뉴 밑줄 (데스크톱 전용) */
.topnav .menu.active::after {
	position: absolute;
	content: '';
	left: 0;
	top: 100%;
	width: 100%;
	height: 3px;
	background-color: #ff8500;
}

/* 스크린리더 전용 텍스트 */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* =============================
   우측 사용자 영역
   ============================= */
.current-user {
	position: absolute;
	right: 0;
	top: 0;
	height: 100%;
	display: flex;
	align-items: center;
	padding: 0 20px;
	z-index: 2;
}

.user-dropdown {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
}

/* 포인트 pill */
.nav-point-pill {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	border-radius: 6px;
	/*background: #f2faf8;*/
	border: 1px solid var(--brand-orange);
	font-size: 14px;
	color: var(--brand-orange);
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}

.nav-point-pill .label {
	margin-right: 6px;
	letter-spacing: 0.06em;
	font-size: 13px;
	/*color: #66b7a8;*/
	color: #333;
}

.nav-point-pill .value {
	font-size: 14px;
}

.nav-point-pill .unit {
	font-size: 13px;
	margin-left: 2px;
	/*color: #99c8be;*/
}

/* 유저 칩 버튼 */
.user-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 10px 4px 6px;
	border-radius: 999px;
	border: 1px solid #e1e7ef;
	background: #ffffff;
	cursor: pointer;
	font-size: 13px;
	color: #222;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
	transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.user-btn .avatar {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #008f7b;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 700;
}

.user-btn .user-name {
	max-width: 90px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.user-btn .caret {
	font-size: 9px;
	color: #999;
}

.user-btn:hover {
	background: #f9fbfd;
	border-color: #cdd7e5;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05);
}

/* 비로그인 버튼들 */
.nav-guest-buttons {
	display: flex;
	align-items: center;
	gap: 8px;
}

.nav-guest-buttons a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 30px;
	padding: 0 12px;
	border-radius: 999px;
	font-size: 13px;
	text-decoration: none;
	white-space: nowrap;
}

.nav-guest-buttons .btn-ghost {
	color: #333;
	border: 1px solid #dde2ea;
	background: #fff;
}

.nav-guest-buttons .btn-solid {
	color: #fff;
	border: none;
	background: linear-gradient(135deg, #ff8500, #ff9e32);
}

/* 드롭다운 메뉴 */
.user-menu {
	position: absolute;
	right: 0;
	top: 100%;
	margin-top: 8px;
	min-width: 210px;
	background: #fff;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
	border-radius: 12px;
	overflow: hidden;
	display: none;
	flex-direction: column;
	z-index: 10000;
	border: 1px solid #e1e7ef;
}

.user-dropdown.open .user-menu {
	display: flex;
}

/* 드롭다운 헤더 */
.user-menu-header {
	display: flex;
	align-items: center;
	padding: 10px 14px 10px;
	/*border-bottom: 1px solid #edf1f7;*/
}

.user-menu-header .avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #008f7b;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 700;
	margin-right: 10px;
}

.user-menu-header .info .nickname {
	font-size: 14px;
	font-weight: 600;
	color: #222;
	margin-bottom: 2px;
}

.user-menu-header .info .points {
	font-size: 12px;
	color: #888;
}

.user-menu-header .info .points strong {
	margin-left: 4px;
	color: #008f7b;
}

/* 드롭다운 링크들 */
.user-menu a {
	display: block;
	padding: 9px 14px;
	font-size: 0.9rem;
	color: #333;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}

.user-menu a i {
	margin-right: 6px;
}

.user-menu a:hover {
	background: #f7f8fa;
	color: #0ea5e9;
}

.user-menu svg {
	width: 18px;
	height: 18px;
	margin-right: 6px;
}

.user-menu .divider {
	height: 1px;
	background: #e5e7eb;
	margin: 4px 0;
}

/* 모바일 햄버거 버튼 기본 숨김 */
.menu-toggle {
	display: none;
}

/* =============================
   모바일 (max-width: 768px)
   ============================= */
@media (max-width: 768px) {
	.topnav {
		height: 60px;
	}

	.nav-pad {
		height: 60px;
	}

	.topnav .container {
		position: relative;
	}

	/* 로고 크기 조정 */
	.topnav .top-logo div {
		height: 100%;
		width: 100%;
		padding-top: 5px;
		padding-left: 13px;
		text-align: left;
		box-sizing: border-box;
	}

	.topnav .top-logo img {
		height: 24px;
	}

	/* 햄버거 버튼 표시 */
	.menu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		right: 12px;
		top: 50%;
		transform: translateY(-50%);
		width: 44px;
		height: 44px;
		font-size: 22px;
		background: transparent;
		border: 0;
		cursor: pointer;
		z-index: 10000;
	}

	/* 모바일 메뉴 (드롭다운) */
	.topnav .menus {
		position: absolute;
		left: 0;
		right: 0;
		top: 60px;
		background: #fff;
		border-top: 1px solid #eee;
		box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
		overflow: hidden;
		will-change: max-height, opacity, transform;

		max-height: 0;
		height: auto;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transform: translateY(-8px);

		transition:
				max-height 0.35s ease,
				opacity 0.3s ease,
				transform 0.35s ease,
				visibility 0s linear 0.35s;
	}

	/* 열림 상태: JS에서 .topnav.open 토글 */
	.topnav.open .menus {
		max-height: calc(100dvh - 60px);
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateY(0);
		transition:
				max-height 0.35s ease,
				opacity 0.3s ease,
				transform 0.35s ease,
				visibility 0s;
	}

	/* 모바일 메뉴 항목 세로 리스트 */
	.topnav .menu {
		display: block;
		width: 100%;
		font-size: 1rem;
		border-bottom: 1px solid #f2f2f2;
		background: #fff;
	}

	.topnav .menu div {
		height: auto;
		padding: 14px 16px;
		justify-content: flex-start;
	}

	/* 모바일에서는 밑줄 대신 배경색 */
	you
	.topnav .menu.active::after {
		display: none;
	}

	.topnav .menu.active {
		background: #fff6e9;
	}

	/* 우측 사용자 영역 위치 조정 */
	.current-user {
		right: 0;
		padding-right: 0;
	}

	/* 사용자 드롭다운을 햄버거 왼쪽에 배치 */
	.user-dropdown {
		position: absolute;
		right: 60px; /* 햄버거 바로 왼쪽 */
		top: 50%;
		transform: translateY(-50%);
		gap: 6px;
	}

	/* 모바일에서 포인트 pill 축소 */
	.nav-point-pill {
		padding: 3px 8px;
	}

	.nav-point-pill .label {
		display: none; /* POINT 글자는 숨기고 숫자만 */
	}

	.nav-point-pill .value {
		font-size: 12px;
	}

	/* 모바일에서는 이름 숨기고 아바타만 */
	.user-btn {
		padding: 4px 6px;
	}

	.user-btn .user-name {
		display: none;
	}

	/* 모바일에서 드롭다운 위치 약간 위로 */
	.user-menu {
		top: 46px;
		right: 0;
		min-width: 180px;
		box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
	}

	.nav-point-pill {
		display: none;
	}
}
