/**
 * Popup Display – עיצוב צד לקוח
 */

.spd-overlay {
	position: fixed;
	inset: 0;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999999;
	display: none;
	box-sizing: border-box;
	padding: 20px;
}

.spd-overlay * {
	box-sizing: border-box;
}

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

/* שכבת רקע כהה */
.spd-overlay.spd-has-overlay {
	background: rgba( 0, 0, 0, var( --spd-overlay-alpha, 0.6 ) );
}

/* בלי שכבת רקע – משאירים את הדף לחיץ */
.spd-overlay:not( .spd-has-overlay ) {
	pointer-events: none;
	background: transparent;
}

.spd-overlay:not( .spd-has-overlay ) .spd-popup {
	pointer-events: auto;
}

/* מיקומים */
.spd-overlay.spd-pos-center {
	align-items: center;
	justify-content: center;
}

.spd-overlay.spd-pos-bottom-right {
	align-items: flex-end;
	justify-content: flex-end;
}

.spd-overlay.spd-pos-bottom-left {
	align-items: flex-end;
	justify-content: flex-start;
}

/* תיבת הפופאפ */
.spd-popup {
	position: relative;
	width: 100%;
	max-width: var( --spd-max-width, 500px );
	background: var( --spd-bg, #ffffff );
	color: var( --spd-text, #333333 );
	box-shadow: 0 12px 48px rgba( 0, 0, 0, 0.28 );
	overflow: hidden;
	direction: rtl;
	text-align: right;
	animation: spd-pop-in 0.32s cubic-bezier( 0.2, 0.8, 0.3, 1 );
	max-height: calc( 100vh - 40px );
	overflow-y: auto;
}

.spd-overlay.spd-rounded .spd-popup {
	border-radius: 14px;
}

/* בפינות – תיבה מעט צרה יותר */
.spd-overlay.spd-pos-bottom-right .spd-popup,
.spd-overlay.spd-pos-bottom-left .spd-popup {
	max-width: min( var( --spd-max-width, 500px ), 380px );
}

/* אזור הלחיצה (עוטף תמונה + טקסט) */
.spd-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.spd-link.spd-clickable {
	cursor: pointer;
}

.spd-image {
	display: block;
	width: 100%;
	height: auto;
}

.spd-content {
	padding: 26px 24px;
	font-size: 16px;
	line-height: 1.6;
	word-wrap: break-word;
}

.spd-content p:first-child {
	margin-top: 0;
}

.spd-content p:last-child {
	margin-bottom: 0;
}

.spd-content img {
	max-width: 100%;
	height: auto;
}

/* כפתור סגירה (X) */
.spd-close {
	position: absolute;
	top: 10px;
	left: 10px;
	width: 34px;
	height: 34px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background: rgba( 0, 0, 0, 0.5 );
	color: #ffffff;
	font-size: 24px;
	line-height: 1;
	font-weight: 400;
	cursor: pointer;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
}

.spd-close:hover,
.spd-close:focus {
	background: rgba( 0, 0, 0, 0.8 );
	transform: scale( 1.08 );
	outline: none;
}

/* נעילת גלילה כשמוצג פופאפ עם שכבת רקע */
body.spd-open {
	overflow: hidden;
}

@keyframes spd-pop-in {
	from {
		opacity: 0;
		transform: translateY( 24px ) scale( 0.97 );
	}
	to {
		opacity: 1;
		transform: translateY( 0 ) scale( 1 );
	}
}

/* רספונסיביות – מסכים קטנים */
@media ( max-width: 600px ) {
	.spd-overlay {
		padding: 12px;
	}
	.spd-overlay.spd-pos-bottom-right,
	.spd-overlay.spd-pos-bottom-left {
		align-items: flex-end;
		justify-content: center;
	}
	.spd-overlay.spd-pos-bottom-right .spd-popup,
	.spd-overlay.spd-pos-bottom-left .spd-popup {
		max-width: 100%;
	}
	.spd-content {
		padding: 22px 18px;
		font-size: 15px;
	}
}
