/* ë©”ì¸ íŒì—… ëª¨ë‹¬/ë ˆì´ì–´ (CSP: unsafe-inline ì œê±°ìš© ì™¸ë¶€ CSS) */

#popupTypeSelectorContainer {
	position: fixed;
	top: 10px;
	left: 10px;
	z-index: 100000;
	background: rgba(255, 255, 255, 0.9);
	padding: 10px;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#popupTypeSelectorContainer.is-hidden {
	display: none !important;
}

#popupTypeSelectorContainer label {
	font-size: 12px;
	color: #666;
	margin-right: 10px;
}

#popupTypeSelector {
	padding: 4px 8px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 12px;
}

#popupModal {
	position: fixed;
	left: 0;
	top: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(20, 18, 16, 0.48);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	/* Swiper ì´ˆê¸°í™” ì „ ë ˆì´ì•„ì›ƒ ì í”„ ë°©ì§€ */
	visibility: hidden;
	opacity: 0;
	isolation: isolate;
	transform: translateZ(0);
}

#popupModal.is-ready {
	visibility: visible !important;
	opacity: 1 !important;
}

#popupModal.is-resizing,
#popupModal.is-resizing .modal-inner {
	transition: none !important;
}

body.popup-modal-open {
	overflow: hidden;
}

#popupModal.is-hidden,
#popupModal.hidden {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
}

#popupModal .modal-inner {
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.72);
	border-radius: 24px;
	padding: 24px 28px 28px;
	width: 80%;
	max-width: 1280px;
	position: relative;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
	max-height: 90vh;
	overflow-x: hidden;
	overflow-y: auto;
	box-sizing: border-box;
	contain: layout style paint;
}

/* 활성 팝업 개수에 따른 모달 폭
   - 1개: 이미지에 맞게 좁게 (슬라이드 조작 UI는 미출력 → toolbar 한 줄 유지) */
@media (min-width: 768px) and (max-width: 1023px) {
	#popupModal.popup-count-1 .modal-inner {
		width: auto;
		max-width: 520px;
	}
	#popupModal.popup-count-2 .modal-inner {
		width: 90%;
		max-width: 960px;
	}
	#popupModal .swiper-wrapper {
		justify-content: center;
	}
}
@media (min-width: 1024px) {
	#popupModal.popup-count-1 .modal-inner {
		width: auto;
		max-width: 560px;
	}
	#popupModal.popup-count-2 .modal-inner {
		width: 80%;
		max-width: 1100px;
	}
	#popupModal .swiper-wrapper {
		justify-content: center;
	}
}

/* 팝업 1개: 제목(POPUP)은 유지, 슬라이드 조작만 숨김 → toolbar 한 줄 유지 */
#popupModal.popup-count-1 .popup-header {
	flex-wrap: nowrap;
	align-items: center;
}
#popupModal.popup-count-1 .popup-controls {
	display: none !important;
}
#popupModal.popup-count-1 .popup-toolbar {
	flex: 0 1 auto;
	width: auto;
	margin: 0 0 0 auto;
	justify-content: flex-end;
	flex-wrap: nowrap;
}

/* 팝업 1개: 이미지가 세로로 과도하게 커져 footer가 가려지지 않도록 */
#popupModal.popup-count-1 .popup-slide .popup-img {
	max-height: min(58vh, 620px);
	width: auto;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
	object-fit: contain;
}
/* 팝업 1개: Swiper spaceBetween(margin-right) 잔여 공백 제거 */
#popupModal.popup-count-1 .popup-slide .swiper-slide {
	margin-right: 0 !important;
}

#popupModal .sr-only,
#popupModal .popup-toolbar .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;
}

/* popup-header: pc one-line */
#popupModal .popup-header {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 12px 16px;
	margin-bottom: 16px;
}

#popupModal .popup-heading {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
	min-width: 0;
}

#popupModal .popup-controls {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	gap: 6px;
	margin: 0;
}

#popupModal .popup-toolbar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: nowrap;
	gap: 8px 12px;
	margin: 0 0 0 auto;
	min-width: 0;
	width: auto;
	flex: 0 0 auto;
}
#popupModal .popup-toolbar .close-chk-12h {
	padding: 8px 16px;
	border: 1px solid #a5a5a5;
	border-radius: 30px;
	background: rgba(0, 0, 0, 0.3);
}
#popupModal .popup-toolbar .close-chk-12h:hover {
	background: rgba(51, 121, 231, 0.92);
	color: #fff;
}
#popupModal .popup-toolbar .close-chk-12h:focus,
#popupModal .popup-toolbar .close-chk-12h:focus-visible {
	outline: 2px solid #256ef4;
	outline-offset: 2px;
}
#popupModal .popup-modal-title {
	margin: 0;
	line-height: 1;
}

#popupModal .popup-modal-title .tit-en {
	display: block;
	font-family: 'Paperlogy', 'Montserrat', sans-serif;
	font-size: 28px;
	font-weight: 600;
	letter-spacing: 0.06em;
	color: #ffffff;
}

#popupModal .popup-autoplay {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

#popupModal .popup-autoplay button,
#popupModal .popup-controls button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	/* border: 1px solid #e5e5e5; */
	border-radius: 50%;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	color: #e5e5e5;
	cursor: pointer;
	line-height: 1;
	font-size: 0;
	transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

#popupModal .popup-autoplay button svg,
#popupModal .popup-controls button svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

#popupModal .popup-autoplay button.play svg {
	margin-left: 1px;
}

#popupModal .popup-autoplay button:hover,
#popupModal .popup-autoplay button:focus-visible,
#popupModal .popup-controls button:hover,
#popupModal .popup-controls button:focus-visible {
	color: var(--mainColor, #3379e7);
	border-color: var(--mainColor, #3379e7);
	background: transparent;
}

#popupModal .popup-controls .popup-nav-prev,
#popupModal .popup-controls .popup-nav-next {
	position: static !important;
	left: auto !important;
	right: auto !important;
	top: auto !important;
	margin: 0 !important;
	display: inline-flex !important;
	visibility: visible !important;
	opacity: 1 !important;
	transform: none !important;
}

#popupModal .popup-controls .popup-nav-prev:disabled,
#popupModal .popup-controls .popup-nav-next:disabled,
#popupModal .popup-controls .popup-nav-prev[aria-disabled="true"],
#popupModal .popup-controls .popup-nav-next[aria-disabled="true"] {
	border-color: #8d8682;
	color: #e5e5e5;
	cursor: not-allowed;
	opacity: 1 !important;
	box-shadow: none;
	pointer-events: none;
}

#popupModal .popup-controls .popup-nav-prev:disabled:hover,
#popupModal .popup-controls .popup-nav-next:disabled:hover {
	color: #8d8682;
	border-color: #8d8682;
	background: rgba(255, 255, 255, 0.55);
}

/* ìž¬ìƒâ†”ì¼ì‹œì •ì§€ í† ê¸€ ì „ìš©. ì´ì „/ë‹¤ìŒ(.popup-nav-*)ì—ëŠ” ì ìš©ë˜ì§€ ì•ŠìŒ */
#popupModal .popup-autoplay button.is-hidden {
	display: none;
}

#popupModal .popup-toolbar .krds-form-check {
	--krds-form-check--button-size-medium: 18px;
	--krds-form-check--checkbox-check-size-medium: 12px;
	--krds-form-check--button-margin-top: 0;
	--krds-form-check--gap: 8px;
	--krds-form-check--pc-font-size-medium: 14px;
	--krds-form-check--mobile-font-size-medium: 13px;
	position: relative;
	display: inline-flex;
	align-items: center;
	margin: 0;
	min-width: 0;
}

#popupModal .popup-toolbar .krds-form-check > input[type="checkbox"] {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

#popupModal .popup-toolbar .krds-form-check input[type="checkbox"] ~ label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	font-size: 1.4rem;
	font-weight: 200;
	line-height: 1.35;
	color: #ffffff;
	cursor: pointer;
	word-break: keep-all;
}

#popupModal .popup-toolbar .krds-form-check input[type="checkbox"] ~ label::before {
	margin-top: 0;
	align-self: center;
	height: 2rem;
	width: 2rem;
}

#popupModal .popup-toolbar .krds-form-check input[type="checkbox"] ~ label span {
	display: inline;
}

#popupModal .close-all {
	cursor: pointer;
	background: rgba(51, 121, 231, 0.92);
	color: #fff;
	padding: 8px 16px;
	border-radius: 25px;
	font-size: 14px;
	font-weight: 500;
	/* border: 1px solid rgba(255, 255, 255, 0.35); */
	transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
	box-shadow: 0 8px 20px rgba(51, 121, 231, 0.28);
}

#popupModal .close-all:hover {
	transform: translateY(-2px);
	background: rgba(51, 121, 231, 1);
	box-shadow: 0 10px 24px rgba(51, 121, 231, 0.38);
}

#popupModal .close-all:focus,
#popupModal .close-all:focus-visible,
#popupModal .popup-controls button:focus,
#popupModal .popup-controls button:focus-visible,
#popupModal .popup-autoplay button:focus,
#popupModal .popup-autoplay button:focus-visible,
.popup-slide .close-popup:focus,
.popup-slide .close-popup:focus-visible,
#popupTypeSelector:focus,
#popupTypeSelector:focus-visible,
.layer-popup .layer-close:focus,
.layer-popup .layer-close:focus-visible {
	outline: 2px solid #256ef4;
	outline-offset: 2px;
}

.popup-slide {
	width: 100%;
	overflow: hidden;
}

/* Swiper ì´ˆê¸°í™” ì „: ìŠ¬ë¼ì´ë“œê°€ ì„¸ë¡œë¡œ ìŒ“ì—¬ ëª¨ë‹¬ì´ ì»¤ì§€ëŠ” í˜„ìƒ ë°©ì§€ */
.popup-slide:not(.swiper-initialized) .swiper-wrapper {
	display: flex;
	width: 100%;
}
.popup-slide:not(.swiper-initialized) .swiper-slide {
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}
.popup-slide:not(.swiper-initialized) .swiper-slide:not(:first-child) {
	display: none;
}

.popup-slide .swiper-slide {
	height: auto;
	box-sizing: border-box;
}

#popupModal.is-ready .popup-slide .swiper-wrapper {
	will-change: transform;
}

.popup-slide .popup-content {
	position: relative;
	padding: 20px;
	border: 1px solid rgba(255, 255, 255, 0.8);
	border-radius: 16px;
	margin: 5px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
	box-sizing: border-box;
	max-width: 100%;
}

.popup-slide .close-popup {
	cursor: pointer;
	background: #aaa;
	color: #fff;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
	border: none;
}

.popup-slide .close-popup:hover {
	background: #888;
}

.popup-slide .popup-title {
	font-weight: 600;
	margin-bottom: 15px;
	font-size: 18px;
	color: #2c3e50;
}

.popup-slide .popup-img {
	display: block;
	max-width: 100%;
	width: 100%;
	height: auto;
	border-radius: 8px;
}

.popup-slide .popup-img-link {
	display: block;
	position: relative;
}

.popup-slide .popup-img-link:hover {
	outline: 2px dashed #667eea;
	outline-offset: 2px;
	border-radius: 8px;
}

.popup-slide .popup-img-link:focus {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

.popup-slide .popup-img-link::after {
	content: "ðŸ”—";
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.popup-slide .popup-img-link:hover::after,
.popup-slide .popup-img-link:focus::after {
	opacity: 1;
}

.popup-slide .popup-html {
	max-width: 100%;
}

.popup-slide .popup-html img {
	height: unset !important;
}

.popup-slide .popup-footer {
	margin-top: 15px;
	justify-content: flex-end;
}

.popup-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin-top: 20px;
}

.popup-footer .krds-form-check {
	position: relative;
}

.popup-footer .krds-form-check input[type="checkbox"] ~ label {
	font-size: 14px;
	color: #666;
}

.popup-footer .sr-only,
.layer-popup .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;
}

/* 큰 이미지 보기 (모달·레이어 공용) */
.view-large-image {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border: 1px solid #d1d5db;
	border-radius: 20px;
	background: #fff;
	color: #1f2937;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.view-large-image:hover,
.view-large-image:focus {
	background-color: #f3f4f6;
	border-color: #6b7280;
	color: #111827;
	text-decoration: none;
}
.view-large-image:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.view-large-image__icon {
	flex-shrink: 0;
	display: inline-block;
}

.layer-popup .layer-footer .view-large-image {
	padding: 4px 12px;
	font-size: 12px;
}
.layer-popup .layer-footer .view-large-image__icon {
	width: 12px;
	height: 12px;
}

@media (max-width: 640px) {
	.view-large-image {
		padding: 5px 10px;
		font-size: 12px;
	}
}
@media (prefers-reduced-motion: reduce) {
	.view-large-image {
		transition: none;
	}
}

/* ë ˆì´ì–´íŒì—…: ê¸°ë³¸ ìˆ¨ê¹€(ëª¨ë‹¬ ì‚¬ìš© ì‹œ ë³¸ë¬¸ íë¦„ì— ë¼ì–´ë“¤ì§€ ì•Šë„ë¡) */
#layerPopupContainer {
	display: none;
}

#layerPopupContainer:not(.is-hidden):not(.hidden) {
	display: block;
}

#layerPopupContainer.is-hidden,
#layerPopupContainer.hidden {
	display: none !important;
}

.layer-popup {
	position: fixed;
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
	z-index: 99998;
	overflow: hidden;
	max-height: 90vh;
	box-sizing: border-box;
}

.layer-popup.is-hidden {
	display: none !important;
}

.layer-popup .layer-header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	padding: 10px 15px;
	font-weight: 600;
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: move;
	user-select: none;
}

.layer-popup .layer-title {
	margin: 0;
	padding: 0;
	font-size: inherit;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
}

.layer-popup .layer-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 14px;
	cursor: pointer;
	padding: 0 6px;
	min-width: 44px;
	min-height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.layer-popup .layer-content {
	flex: 1 1 auto;
	min-height: 0;
	padding: 10px;
	overflow-y: auto;
}

.layer-popup .layer-content img {
	max-width: 100%;
	height: auto;
	height: unset !important;
}

.layer-popup .layer-img-link {
	display: block;
	position: relative;
}

.layer-popup .layer-img-link:hover {
	outline: 2px dashed #667eea;
	outline-offset: 2px;
	border-radius: 8px;
}

.layer-popup .layer-img-link:focus {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

.layer-popup .layer-img-link::after {
	content: "ðŸ”—";
	position: absolute;
	top: 10px;
	right: 10px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 12px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.layer-popup .layer-img-link:hover::after,
.layer-popup .layer-img-link:focus::after {
	opacity: 1;
}

.layer-popup .layer-footer {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	padding: 10px 20px;
	border-top: 1px solid #eee;
	background: #fff;
	box-sizing: border-box;
}
.layer-popup .layer-footer .krds-form-check {
	position: relative;
}
.layer-popup .layer-footer .krds-form-check input[type="checkbox"] ~ label {
	font-size: 12px;
	color: #666;
}
.layer-popup .layer-footer .layer-close-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	height: auto;
	margin-left: 0;
	padding: 4px 12px;
	border: none;
	border-radius: 20px;
	background: #aaa;
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	vertical-align: middle;
	transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.layer-popup .layer-footer .layer-close-btn:hover {
	transform: scale(1.05);
	box-shadow: 0 4px 12px rgba(255, 107, 107, 0.5);
}

.layer-popup .layer-footer .layer-close-desc {
	flex-basis: 100%;
	margin: 0;
	font-size: 11px;
	color: #888;
	text-align: right;
}

#popupModal .modal-inner::-webkit-scrollbar {
	width: 8px;
}

#popupModal .modal-inner::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.35);
	border-radius: 0 16px 16px 0;
}

#popupModal .modal-inner::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 4px;
}

#popupModal .modal-inner::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

@media (min-width: 769px) {
	#popupModal .popup-header {
		margin-bottom: 20px;
	}

	#popupModal .popup-heading {
		gap: 30px;
	}

	#popupModal .popup-modal-title .tit-en {
		font-size: clamp(26px, 2.4vw, 36px);
	}

	#popupModal .popup-autoplay button,
	#popupModal .popup-controls button {
		width: 40px;
		height: 40px;
	}

	#popupModal .popup-autoplay button svg,
	#popupModal .popup-controls button svg {
		width: 30px;
		height: 30px;
	}

	#popupModal .popup-controls {
		gap: 8px;
	}

	#popupModal .popup-toolbar .krds-form-check input[type="checkbox"] ~ label {
		white-space: nowrap;
	}

	#popupModal .close-all {
		flex-shrink: 0;
	}
}

@media (prefers-reduced-transparency: reduce), (prefers-reduced-motion: reduce) {
	#popupModal {
		background: rgba(20, 18, 16, 0.55);
	}

	#popupModal .modal-inner {
		background: #fff;
	}
}

@media (max-width: 768px) {
	#popupModal .modal-inner {
		padding: 16px 12px 12px;
		width: 90% !important;
		border-radius: 18px;
	}

	#popupModal .popup-header {
		flex-wrap: wrap;
		flex-direction: column;
		gap: 10px;
	}

	#popupModal .popup-heading {
		flex: 1 1 100%;
		width: 100%;
		gap: 20px;
	}

	#popupModal .popup-modal-title .tit-en {
		font-size: 22px;
	}

	#popupModal .popup-autoplay button,
	#popupModal .popup-controls button {
		width: 28px;
		height: 28px;
	}

	#popupModal .popup-autoplay button svg,
	#popupModal .popup-controls button svg {
		width: 30px;
		height: 30px;
	}

	#popupModal .modal-inner .popup-content {
		padding: 10px;
	}

	#popupModal .modal-inner .popup-title {
		font-size: 14px;
	}

	#popupModal .modal-inner .popup-img,
	#popupModal .modal-inner .popup-html {
		max-width: 100%;
	}

	#popupModal .modal-inner .popup-footer {
		margin-top: 10px;
	}

	#popupModal .modal-inner .popup-footer .krds-form-check input[type="checkbox"] ~ label {
		font-size: 12px;
	}

	#popupModal .popup-toolbar {
		flex: 1 1 100%;
		width: 100%;
		margin-left: 0;
		justify-content: space-between;
		align-items: center;
		flex-wrap: nowrap;
		gap: 8px;
	}

	#popupModal .popup-toolbar .krds-form-check {
		--krds-form-check--button-size-medium: 16px;
		--krds-form-check--checkbox-check-size-medium: 11px;
		flex: 1 1 auto;
		min-width: 0;
	}

	#popupModal .popup-toolbar .krds-form-check input[type="checkbox"] ~ label {
		font-size: 1.6rem;
		white-space: normal;
		align-items: flex-start;
		word-spacing : -2px;
	}

	#popupModal .close-all {
		flex-shrink: 0;
		padding: 8px 12px;
		border-radius: 25px;
		font-size: 16px;
		white-space: nowrap;
	}

	.popup-slide .popup-img-link::after,
	.layer-popup .layer-img-link::after {
		font-size: 10px;
		padding: 3px 6px;
	}
}
