/* ======================================
   팝업 공통 스타일
   ====================================== */

/* 팝업 컨테이너 */
.popup-container {
	position: fixed;
	z-index: 99999;
}

.popup-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99998;
}

.popup-type-m .popup-content {
	position: relative;
	z-index: 99999;
	box-shadow: 0 4px 20px rgba(0,0,0,0.3);
	border-radius: 4px;
	overflow: hidden;
}

/* 팝업 콘텐츠 */
.popup-content {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0,0,0,0.2);
	border-radius: 4px;
	overflow: hidden;
}

.popup-body {
	flex: 1;
	padding: 0;
	overflow: auto;
}

/* 우측 상단 X 닫기 버튼 */
.popup-close-x {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
	border-radius: 50%;
	color: #fff;
	font-size: 22px;
	font-weight: normal;
	font-family: Arial, sans-serif;
	line-height: 28px;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	z-index: 10;
	transition: background 0.2s;
	padding: 0;
	margin: 0;
	box-sizing: border-box;
}

.popup-close-x:hover {
	background: rgba(0, 0, 0, 0.7);
	text-decoration: none;
	color: #fff;
}

.popup-body img {
	display: block;
	max-width: 100%;
	height: auto;
}

.popup-link {
	padding: 10px;
	text-align: center;
}

.popup-link a {
	color: #2196F3;
	text-decoration: none;
}

.popup-link a:hover {
	text-decoration: underline;
}

/* 팝업 하단 (닫기 버튼 영역) */
.popup-footer {
	flex-shrink: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	padding: 6px 12px;
	background: #333;
	color: #fff;
	font-size: 12px;
	gap: 6px;
}

.popup-hide-options {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 15px;
}

.popup-hide-option {
	cursor: pointer;
	color: #fff;
	display: flex;
	align-items: center;
	white-space: nowrap;
}

/* 팝업 너비 400px 이하일 때 레이아웃 */
.popup-footer.narrow {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
}

.popup-footer.narrow .popup-hide-options {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

.popup-footer.narrow .popup-close-btn {
	align-self: center;  /* 상하 중앙 */
	flex-shrink: 0;
}

.popup-hide-option input[type="checkbox"] {
	margin-right: 5px;
	vertical-align: middle;
}

.popup-close-btn {
	display: inline-block;
	padding: 4px 12px;
	background: rgba(255,255,255,0.2);
	border-radius: 3px;
	color: #fff;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s;
	font-size: 12px;
}

.popup-close-btn:hover {
	background: rgba(255,255,255,0.3);
	text-decoration: none;
}

/* ======================================
   상단 팝업 스타일
   ====================================== */
.popup-type-t {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	width: 100% !important;
	z-index: 99999;
	margin: 0 !important;
	padding: 0 !important;
}

.popup-type-t:not(.fixed) {
	position: relative !important;
	top: auto !important;
}

/* 상단팝업 - 가로 전체, 여백 없음 */
.popup-type-t .popup-content {
	width: 100% !important;
	max-width: 100% !important;
	border-radius: 0;
	border: none;
	box-shadow: none;
	margin: 0;
	padding: 0;
}

/* 상단팝업 HTML 콘텐츠 - 배경색은 인라인 스타일로 적용 */
.popup-type-t.content-html .popup-body {
	color: #fff;
	padding: 12px 20px;
	text-align: center;
}

/* 상단팝업 이미지 콘텐츠 - 배경 없음 */
.popup-type-t.content-image .popup-body {
	background: transparent;
	padding: 0;
	text-align: center;
}

/* 상단팝업 이미지 - 좌우 중앙 정렬, 원본 사이즈 */
.popup-type-t .popup-body img {
	display: block;
	margin: 0 auto;
}

/* 상단팝업 기본 링크 스타일 */
.popup-type-t .popup-body a {
	color: #90CAF9;
}

.popup-type-t .popup-body a:hover {
	color: #BBDEFB;
}

/* ======================================
   반응형 스타일
   ====================================== */
@media screen and (max-width: 768px) {
	.popup-content {
		max-width: 95vw !important;
		max-height: 80vh !important;
	}
	
	.popup-body {
		max-height: calc(80vh - 50px);
		overflow-y: auto;
	}
	
	.popup-footer {
		padding: 6px 10px;
		font-size: 11px;
	}
	
	.popup-hide-option {
		margin-right: 10px;
	}
}

/* ======================================
   iOS Safe Area 대응
   ====================================== */
@supports (padding-top: env(safe-area-inset-top)) {
	.popup-type-t.fixed {
		padding-top: env(safe-area-inset-top);
	}
	
	.popup-container.safe-area {
		padding-bottom: env(safe-area-inset-bottom);
	}
}

/* ======================================
   애니메이션
   ====================================== */
.popup-container {
	animation: popupFadeIn 0.3s ease-out;
}

@keyframes popupFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.popup-modal-overlay {
	animation: overlayFadeIn 0.3s ease-out;
}

@keyframes overlayFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.popup-type-m .popup-content {
	animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* ======================================
   목록팝업 스타일 (PC 전용)
   ====================================== */

/* 목록팝업 배경 오버레이 */
.panel-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	z-index: 99998;
	cursor: pointer;
}

/* 목록팝업 컨테이너 */
.panel-popup-container {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 99999;
	background: #fff;
	box-shadow: 0 4px 20px rgba(0,0,0,0.3);
	animation: popupFadeIn 0.3s ease-out;
}

/* 목록팝업 콘텐츠 영역 */
.panel-popup-content {
	display: flex;
	flex-direction: row;
}

/* 좌측 이미지 영역 */
.panel-popup-image {
	position: relative;
	overflow: hidden;
	background: #f5f5f5;
}

.panel-image-item {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: none;
}

.panel-image-item.active {
	display: block;
}

.panel-image-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.panel-image-item a {
	display: block;
	width: 100%;
	height: 100%;
}

/* 우측 목록 영역 */
.panel-popup-list {
	width: 200px;
	overflow-y: auto;
	border-left: 1px solid #ddd;
	background: #fff;
}

.panel-list-item {
	padding: 18px 15px;
	border-bottom: 1px solid #ddd;
	font-size: 14px;
	font-weight: 400;
	color: #444;
	line-height: 1.4;
	cursor: pointer;
	transition: all 0.2s ease;
	word-break: keep-all;
}

.panel-list-item:hover {
	background: #f8f8f8;
}

.panel-list-item.active {
	background: #222;
	color: #fff;
	font-weight: 500;
}

.panel-list-item:last-child {
	border-bottom: none;
}

/* 목록팝업 하단 버튼 영역 */
.panel-popup-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 15px;
	background: #333;
	color: #fff;
}

.panel-hide-option {
	font-size: 13px;
	cursor: pointer;
	display: flex;
	align-items: center;
}

.panel-hide-option input[type="checkbox"] {
	margin-right: 6px;
	cursor: pointer;
}

.panel-close-btn {
	display: inline-block;
	padding: 6px 20px;
	background: rgba(255,255,255,0.2);
	color: #fff;
	font-size: 13px;
	text-decoration: none;
	border-radius: 3px;
	transition: background 0.2s;
}

.panel-close-btn:hover {
	background: rgba(255,255,255,0.3);
	text-decoration: none;
	color: #fff;
}

/* 목록팝업 반응형 (800px 이하에서는 숨김) */
@media screen and (max-width: 800px) {
	.panel-popup-overlay,
	.panel-popup-container {
		display: none !important;
	}
}

