/**
 * Elementor Before/After Image Slider CSS
 */

/* Grid System */
.ebas-slider-grid {
	display: grid;
	gap: 30px;
	width: 100%;
}

/* Responsive Grid for Columns */
/* Desktop */
@media (min-width: 1025px) {
	.ebas-cols-desktop-1 { grid-template-columns: repeat(1, 1fr); }
	.ebas-cols-desktop-2 { grid-template-columns: repeat(2, 1fr); }
	.ebas-cols-desktop-3 { grid-template-columns: repeat(3, 1fr); }
	.ebas-cols-desktop-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 768px) {
	.ebas-cols-tablet-1 { grid-template-columns: repeat(1, 1fr); }
	.ebas-cols-tablet-2 { grid-template-columns: repeat(2, 1fr); }
	.ebas-cols-tablet-3 { grid-template-columns: repeat(3, 1fr); }
	.ebas-cols-tablet-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Mobile */
@media (max-width: 767px) {
	.ebas-cols-mobile-1 { grid-template-columns: repeat(1, 1fr); }
	.ebas-cols-mobile-2 { grid-template-columns: repeat(2, 1fr); }
	.ebas-cols-mobile-3 { grid-template-columns: repeat(3, 1fr); }
	.ebas-cols-mobile-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Slider Card Container */
.ebas-slider-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Slider Frame */
.ebas-slider-container {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	background-color: #f5f5f5;
	user-select: none;
	-webkit-user-select: none;
	touch-action: pan-y;
}

/* Image Wrappers */
.ebas-image-after,
.ebas-image-before {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	pointer-events: none;
}

.ebas-image-after {
	z-index: 1;
}

.ebas-image-before {
	z-index: 2;
	clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
	-webkit-clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
}

.ebas-image-after img,
.ebas-image-before img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

/* Badges */
.ebas-badge {
	position: absolute;
	top: 15px;
	padding: 6px 14px;
	border-radius: 50px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.5px;
	z-index: 10;
	pointer-events: none;
	user-select: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ebas-badge-before {
	left: 15px;
	background-color: rgba(22, 22, 22, 0.85);
	color: #ffffff;
}

.ebas-badge-after {
	right: 15px;
	background-color: #e2a319;
	color: #ffffff;
}

/* Slider Handle Line */
.ebas-slider-handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 3px;
	background-color: #ffffff;
	z-index: 5;
	cursor: ew-resize;
	transform: translateX(-50%);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* Slider Handle Drag Button */
.ebas-slider-handle-button {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 44px;
	height: 44px;
	background-color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #333333;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
	cursor: ew-resize;
	z-index: 6;
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.ebas-slider-handle-button svg {
	width: 20px;
	height: 20px;
	display: block;
	pointer-events: none;
}

.ebas-slider-container:hover .ebas-slider-handle-button {
	transform: translate(-50%, -50%) scale(1.05);
}

/* Active Drag State Styling */
.ebas-dragging .ebas-slider-handle {
	background-color: #e2a319;
}

.ebas-dragging .ebas-slider-handle-button {
	background-color: #e2a319;
	color: #ffffff;
	transform: translate(-50%, -50%) scale(1.1);
}

/* Caption underneath */
.ebas-slider-caption {
	padding: 15px 0 5px;
	text-align: center;
}

.ebas-slider-caption h3 {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 18px;
	font-weight: 700;
	color: #222222;
}

/* Fallback for aspect-ratio on legacy browsers */
@supports not (aspect-ratio: 4 / 3) {
	.ebas-slider-container {
		padding-top: 75%; /* 4:3 Ratio */
		height: 0;
	}
	.ebas-image-after,
	.ebas-image-before {
		height: 100%;
	}
}
