/* WM Popups – frontend */

.wmp-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: var(--wmp-z, 999999);
	display: none;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 28px;
	background: var(--wmp-ov, rgba(0, 0, 0, .7));
	opacity: 0;
	transition: opacity .25s ease;
	-webkit-overflow-scrolling: touch;
}

.wmp-overlay.wmp-visible {
	display: flex;
}

.wmp-overlay.wmp-open {
	opacity: 1;
}

.wmp-overlay.wmp-pos-top {
	align-items: flex-start;
}

.wmp-overlay.wmp-pos-bottom {
	align-items: flex-end;
}

.wmp-box {
	position: relative;
	box-sizing: border-box;
	width: var(--wmp-w, 600px);
	max-width: 100%;
	line-height: 0;
}

.wmp-overlay .wmp-link {
	display: block;
	line-height: 0;
	border: 0;
	box-shadow: none;
}

.wmp-overlay .wmp-img {
	display: block;
	width: 100%;
	height: auto;
	max-height: var(--wmp-maxh, 85vh);
	object-fit: contain;
	border-radius: var(--wmp-radius, 8px);
	margin: 0;
	padding: 0;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.wmp-overlay .wmp-img-mobile {
	display: none;
}

/* כפתור סגירה */
.wmp-overlay .wmp-close {
	position: absolute;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--wmp-close-s, 34px);
	height: var(--wmp-close-s, 34px);
	margin: 0;
	padding: 0;
	border: 0;
	line-height: 0;
	color: var(--wmp-close-c, #fff);
	background: var(--wmp-close-bg, rgba(0, 0, 0, .45));
	cursor: pointer;
	box-shadow: none;
	transition: transform .15s ease, opacity .15s ease;
}

.wmp-overlay .wmp-close:hover {
	transform: scale(1.08);
	color: var(--wmp-close-c, #fff);
	background: var(--wmp-close-bg, rgba(0, 0, 0, .45));
}

.wmp-overlay .wmp-close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.wmp-close-shape-circle { border-radius: 50%; }
.wmp-close-shape-square { border-radius: 6px; }
.wmp-close-shape-plain  { background: transparent !important; }

/* בתוך התמונה */
.wmp-close-inside.wmp-close-top-right    { top: 10px;    right: 10px; }
.wmp-close-inside.wmp-close-top-left     { top: 10px;    left: 10px; }
.wmp-close-inside.wmp-close-bottom-right { bottom: 10px; right: 10px; }
.wmp-close-inside.wmp-close-bottom-left  { bottom: 10px; left: 10px; }

/* מחוץ לתמונה */
.wmp-close-outside.wmp-close-top-right    { top: calc(-8px - var(--wmp-close-s, 34px));    right: 0; }
.wmp-close-outside.wmp-close-top-left     { top: calc(-8px - var(--wmp-close-s, 34px));    left: 0; }
.wmp-close-outside.wmp-close-bottom-right { bottom: calc(-8px - var(--wmp-close-s, 34px)); right: 0; }
.wmp-close-outside.wmp-close-bottom-left  { bottom: calc(-8px - var(--wmp-close-s, 34px)); left: 0; }

/* אנימציות */
.wmp-overlay.wmp-open.wmp-anim-fade .wmp-box  { animation: wmpFade .3s ease both; }
.wmp-overlay.wmp-open.wmp-anim-zoom .wmp-box  { animation: wmpZoom .3s cubic-bezier(.2, .8, .3, 1) both; }
.wmp-overlay.wmp-open.wmp-anim-slide .wmp-box { animation: wmpSlide .35s cubic-bezier(.2, .8, .3, 1) both; }

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

@keyframes wmpZoom {
	from { opacity: 0; transform: scale(.9); }
	to   { opacity: 1; transform: none; }
}

@keyframes wmpSlide {
	from { opacity: 0; transform: translateY(40px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.wmp-overlay,
	.wmp-overlay .wmp-box,
	.wmp-overlay .wmp-close {
		animation: none !important;
		transition: none !important;
	}
}

/* נעילת גלילה ברקע */
html.wmp-lock,
body.wmp-lock {
	overflow: hidden !important;
}

/* מובייל */
@media (max-width: 768px) {
	.wmp-overlay {
		padding: 18px;
	}

	.wmp-box {
		width: var(--wmp-wm, 92%);
	}

	.wmp-overlay.wmp-has-mobile .wmp-img-desktop {
		display: none;
	}

	.wmp-overlay.wmp-has-mobile .wmp-img-mobile {
		display: block;
	}
}
