/* ==============================================
   WCGS Custom Popup Modal
   ============================================== */

#wcgs-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999999;
	background: rgba(0, 0, 0, 0.78);
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
}

#wcgs-modal.wcgs-modal--open {
	display: flex;
	animation: wcgs-modal-in 0.2s ease forwards;
}

@keyframes wcgs-modal-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

#wcgs-modal-card {
	position: relative;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 32px 80px rgba(0, 0, 0, 0.32), 0 8px 24px rgba(0, 0, 0, 0.16);
	max-width: 860px;
	width: 100%;
	max-height: calc(100vh - 48px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 64px;
	box-sizing: border-box;
	animation: wcgs-card-in 0.26s cubic-bezier(0.34, 1.32, 0.64, 1) forwards;
}

@keyframes wcgs-card-in {
	from { opacity: 0; transform: scale(0.94) translateY(6px); }
	to   { opacity: 1; transform: scale(1) translateY(0); }
}

#wcgs-modal-img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 160px);
	object-fit: contain;
	border-radius: 4px;
	transition: opacity 0.15s ease;
	user-select: none;
}

#wcgs-modal-img.wcgs-modal-loading {
	opacity: 0;
}

#wcgs-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	background: #f4f4f4;
	border: none;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #555;
	padding: 0;
	z-index: 2;
	transition: background 0.15s, color 0.15s;
}

#wcgs-modal-close:hover {
	background: #e0e0e0;
	color: #111;
}

.wcgs-modal-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 40px;
	height: 40px;
	background: #fff;
	border: 1.5px solid #e0e0e0;
	border-radius: 50%;
	font-size: 24px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #333;
	padding: 0;
	z-index: 2;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}

.wcgs-modal-arrow:hover {
	background: #111;
	border-color: #111;
	color: #fff;
	transform: translateY(-50%) scale(1.08);
}

.wcgs-modal-arrow--hidden {
	opacity: 0;
	pointer-events: none;
}

#wcgs-modal-prev { left: 12px; }
#wcgs-modal-next { right: 12px; }

@media (max-width: 600px) {
	#wcgs-modal      { padding: 0; }
	#wcgs-modal-card { border-radius: 0; height: 100dvh; max-height: 100dvh; padding: 56px 16px; }
	#wcgs-modal-img  { max-height: calc(100dvh - 120px); }
}
