/* =============================================
   Elementor Coverflow Carousel
   ============================================= */

/* ── Outer wrapper — must NOT have overflow:hidden (breaks 3D coverflow) ── */
.ecaru-coverflow-wrapper {
	position: relative;
	width: 100%;
	padding: 20px 60px 60px;
	box-sizing: border-box;
}

/* Horizontal clip without breaking 3D stacking context */
.ecaru-swiper-clip {
	overflow: hidden;
	overflow: clip; /* modern browsers — doesn't create stacking context */
}

/* ── Fix: Swiper sets .swiper-slide { height: 100% } which collapses if
        the .swiper container has no height. Override to auto so the card's
        explicit height (380px) bubbles up and sizes the container. ── */
.ecaru-coverflow-wrapper .swiper-slide {
	height: auto !important;
}

/* ── Swiper container ── */
.ecaru-swiper {
	padding: 20px 0 !important;
	box-sizing: border-box;
	min-height: 200px; /* safety net before JS measures slides */
}

/* In coverflow mode we MUST allow overflow (3D rotation extends beyond bounds) */
.ecaru-mode-coverflow .ecaru-swiper {
	overflow: visible !important;
}

.ecaru-swiper .swiper-wrapper {
	align-items: center;
}

/* ═══════════════════════════════════════════════
   CARD BASE
   ═══════════════════════════════════════════════ */

.ecaru-slide {
	position: relative;
	width: 100%;
	height: 380px;
	border-radius: 20px;
	background-color: #1a3a8f;
	background-size: cover;
	background-position: center;
	overflow: hidden;
	display: block;
	text-decoration: none;
	color: inherit;
	box-sizing: border-box;
	/* Transition shared by both modes */
	transition:
		box-shadow .4s ease,
		filter     .4s ease;
}

/* ── Overlay ── */
.ecaru-slide-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		rgba(15,40,100,.08) 0%,
		rgba(15,40,100,.55) 55%,
		rgba(10,25,70,.88) 100%
	);
	z-index: 1;
	pointer-events: none;
}

/* ── Badge ── */
.ecaru-badge {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .03em;
	white-space: nowrap;
}

[dir="ltr"] .ecaru-badge { right: auto; left: 14px; }

/* ── Content area ── */
.ecaru-slide-content {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 22px 22px 26px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 7px;
}

[dir="rtl"] .ecaru-slide-content { text-align: right; }

/* ── Icon bubble ── */
.ecaru-slide-icon {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: rgba(255,255,255,.2);
	backdrop-filter: blur(6px);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 2px;
	border: 1px solid rgba(255,255,255,.25);
	flex-shrink: 0;
}

.ecaru-slide-icon i,
.ecaru-slide-icon svg {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* ── Title ── */
.ecaru-slide-title {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 700;
	color: #fff;
	line-height: 1.3;
	text-shadow: 0 1px 5px rgba(0,0,0,.5);
}

/* ── Description ── */
.ecaru-slide-desc {
	margin: 0;
	font-size: .83rem;
	color: rgba(255,255,255,.85);
	line-height: 1.55;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ── Custom fields ── */
.ecaru-custom-fields {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ecaru-field-item {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: .78rem;
}

.ecaru-field-icon { display: flex; align-items: center; opacity: .8; }
.ecaru-field-icon i,
.ecaru-field-icon svg { font-size: 12px; width: 12px; height: 12px; color: rgba(255,255,255,.75); }
.ecaru-field-label { color: rgba(255,255,255,.6); }
.ecaru-field-value { color: rgba(255,255,255,.9); font-weight: 600; }

/* ── Fade in desc / fields / btn on active slide only ── */
.swiper-slide:not(.swiper-slide-active) .ecaru-slide-desc,
.swiper-slide:not(.swiper-slide-active) .ecaru-custom-fields,
.swiper-slide:not(.swiper-slide-active) .ecaru-slide-btn {
	opacity: 0;
	pointer-events: none;
	transform: translateY(6px);
	transition: opacity .2s ease, transform .2s ease;
}

.swiper-slide-active .ecaru-slide-desc,
.swiper-slide-active .ecaru-custom-fields,
.swiper-slide-active .ecaru-slide-btn {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
	transition: opacity .4s ease .1s, transform .4s ease .1s;
}

/* ── Button ── */
.ecaru-slide-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 4px;
	padding: 8px 20px;
	border-radius: 25px;
	background: #fff;
	color: #1a3a8f;
	font-size: .82rem;
	font-weight: 600;
	text-decoration: none;
	transition: background .2s ease, color .2s ease, transform .2s ease;
	white-space: nowrap;
	cursor: pointer;
	border: none;
}

.ecaru-slide-btn:hover {
	background: #1a3a8f;
	color: #fff;
	transform: translateY(-2px);
}

.ecaru-btn-arrow {
	font-size: 1.1rem;
	line-height: 1;
	display: inline-block;
	transition: transform .2s ease;
}

[dir="ltr"] .ecaru-btn-arrow { transform: rotate(180deg); }
.ecaru-slide-btn:hover .ecaru-btn-arrow { transform: translateX(-3px); }
[dir="ltr"] .ecaru-slide-btn:hover .ecaru-btn-arrow { transform: rotate(180deg) translateX(-3px); }

.ecaru-btn-icon { display: flex; align-items: center; }
.ecaru-btn-icon i,
.ecaru-btn-icon svg { font-size: 14px; width: 14px; height: 14px; }

/* ═══════════════════════════════════════════════
   MODE: COVERFLOW (מוטה תלת-מימד)
   ═══════════════════════════════════════════════ */

.ecaru-mode-coverflow .swiper-slide:not(.swiper-slide-active) .ecaru-slide {
	filter: brightness(.7) saturate(.8);
}

.ecaru-mode-coverflow .swiper-slide-active .ecaru-slide {
	box-shadow:
		0 28px 60px rgba(26,58,143,.45),
		0 10px 30px rgba(0,0,0,.3);
}

/* ═══════════════════════════════════════════════
   MODE: SCALE-FADE (ישר + גודל מדורג)
   JS sets --ecaru-scale / --ecaru-opacity / --ecaru-blur on .ecaru-slide
   ═══════════════════════════════════════════════ */

.ecaru-mode-scale-fade .ecaru-swiper {
	overflow: hidden; /* safe to clip — no 3D in this mode */
}

/* JS-driven scale / opacity / blur */
.ecaru-mode-scale-fade .swiper-slide .ecaru-slide {
	transform-origin: center center;
	transform:  scale(var(--ecaru-scale,   1));
	opacity:         var(--ecaru-opacity, 1);
	filter:    blur(var(--ecaru-blur,    0px));
	transition:
		transform .45s cubic-bezier(.25,.8,.25,1),
		opacity   .45s ease,
		filter    .45s ease,
		box-shadow .45s ease;
}

.ecaru-mode-scale-fade .swiper-slide-active .ecaru-slide {
	box-shadow:
		0 25px 55px rgba(26,58,143,.4),
		0 8px 25px rgba(0,0,0,.25);
}

/* ═══════════════════════════════════════════════
   NAVIGATION ARROWS
   ═══════════════════════════════════════════════ */

.ecaru-nav-btn {
	position: absolute;
	top: calc(50% - 30px); /* visually center against card, not dots */
	transform: translateY(-50%);
	z-index: 10;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 2px solid #1a3a8f;
	background: #fff;
	color: #1a3a8f;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	box-shadow: 0 2px 12px rgba(0,0,0,.14);
	transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}

.ecaru-nav-btn:hover {
	background: #1a3a8f;
	color: #fff;
	box-shadow: 0 4px 20px rgba(26,58,143,.38);
}

.ecaru-prev { left: 8px; }
.ecaru-next { right: 8px; }

[dir="rtl"] .ecaru-prev { left: auto; right: 8px; }
[dir="rtl"] .ecaru-next { right: auto; left: 8px; }

/* ═══════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════ */

.ecaru-pagination {
	position: relative;
	bottom: auto;
	margin-top: 18px;
	text-align: center;
}

.ecaru-pagination .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	background: rgba(26,58,143,.3);
	opacity: 1;
	transition: width .3s ease, background .3s ease, border-radius .3s ease;
}

.ecaru-pagination .swiper-pagination-bullet-active {
	width: 26px;
	border-radius: 4px;
	background: #1a3a8f;
}

/* ═══════════════════════════════════════════════
   LOOP TEMPLATE SLIDES
   ═══════════════════════════════════════════════ */

.ecaru-loop-slide .ecaru-slide { background: #f0f4ff; overflow: auto; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
	.ecaru-coverflow-wrapper { padding: 10px 44px 50px; }
	.ecaru-slide { height: 300px; }
	.ecaru-slide-title { font-size: 1.05rem; }
	.ecaru-nav-btn { width: 34px; height: 34px; }
}

@media (max-width: 480px) {
	.ecaru-coverflow-wrapper { padding: 10px 20px 50px; }
	.ecaru-slide { height: 260px; }
}
