/**
 * Two Column Elementor Slider Styles
 * 
 * @package TCES
 * @version 1.0.0
 */

/* ========================================
   Core Layout
   ======================================== */

.tces-widget {
	position: relative;
	width: 100%;
}

.tces-swiper {
	position: relative;
	overflow: hidden;
}

.tces-slide {
	display: flex;
	align-items: var(--tces-va, center);
	gap: var(--tces-gap, 24px);
	min-height: 1px;
}

/* Text column */
.tces-col.tces-text {
	flex: 0 0 var(--tces-text-width, 50%);
	max-width: var(--tces-text-width, 50%);
}

/* Media column */
.tces-col.tces-media {
	flex: 1 1 auto;
	min-width: 0;
}

.tces-media img {
	max-width: 100%;
	height: auto;
	display: block;
	width: 100%;
	object-fit: cover;
}

/* ========================================
   Content Alignment
   ======================================== */

.tces-align-left .tces-text {
	text-align: left;
}

.tces-align-center .tces-text {
	text-align: center;
}

/* ========================================
   Image Position
   ======================================== */

.tces-image-left .tces-slide {
	flex-direction: row-reverse;
}

.tces-image-right .tces-slide {
	flex-direction: row;
}

/* ========================================
   Vertical Alignment
   ======================================== */

.tces-va-top {
	--tces-va: flex-start;
}

.tces-va-center {
	--tces-va: center;
}

.tces-va-bottom {
	--tces-va: flex-end;
}

/* ========================================
   Equal Height
   ======================================== */

.tces-equal-height .tces-slide {
	align-items: stretch;
}

.tces-equal-height .tces-col {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* ========================================
   Content Elements
   ======================================== */

.tces-title {
	margin: 0 0 1rem 0;
	font-weight: 700;
	line-height: 1.2;
}

.tces-content {
	margin: 0 0 1.5rem 0;
	line-height: 1.6;
}

.tces-content p:last-child {
	margin-bottom: 0;
}

.tces-button {
	display: inline-block;
	padding: 12px 24px;
	text-decoration: none;
	transition: all 0.3s ease;
	cursor: pointer;
	border: none;
	font-size: 16px;
	line-height: 1.5;
}

.tces-caption {
	margin-top: 0.5rem;
	font-size: 0.9em;
	opacity: 0.8;
	font-style: italic;
}

/* ========================================
   Navigation
   ======================================== */

.tces-nav {
	position: absolute;
	right: var(--tces-nav-right, 16px);
	bottom: var(--tces-nav-bottom, 16px);
	display: flex;
	gap: var(--tces-nav-space, 10px);
	z-index: 10;
}

.tces-nav button {
	width: var(--tces-nav-size, 44px);
	height: var(--tces-nav-size, 44px);
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba(255, 255, 255, 0.9);
	border: none;
	cursor: pointer;
	transition: all 0.3s ease;
	padding: 0;
	border-radius: 4px;
	color: #333;
}

.tces-nav button:hover {
	background-color: rgba(255, 255, 255, 1);
	transform: scale(1.05);
}

.tces-nav button:focus {
	outline: 2px solid #007bff;
	outline-offset: 2px;
}

.tces-nav button:focus:not(:focus-visible) {
	outline: none;
}

.tces-nav button svg {
	width: 24px;
	height: 24px;
	pointer-events: none;
}

.tces-nav button.swiper-button-disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ========================================
   Pagination
   ======================================== */

.tces-pagination {
	position: relative;
	text-align: center;
	padding: 16px 0 0 0;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
}

.tces-pagination .swiper-pagination-bullet {
	width: 10px;
	height: 10px;
	background-color: #ccc;
	border-radius: 50%;
	opacity: 1;
	cursor: pointer;
	transition: all 0.3s ease;
	margin: 0;
}

.tces-pagination .swiper-pagination-bullet:hover {
	background-color: #999;
}

.tces-pagination .swiper-pagination-bullet-active {
	background-color: #007bff;
	transform: scale(1.2);
}

/* ========================================
   Responsive: Stack at 1024px
   ======================================== */

@media (max-width: 1024px) {
	.tces-stack-1024 .tces-slide {
		flex-direction: column;
	}

	.tces-stack-1024 .tces-col.tces-text {
		flex-basis: auto;
		max-width: 100%;
		width: 100%;
	}

	.tces-stack-1024 .tces-col.tces-media {
		width: 100%;
	}

	/* Reset image position on mobile */
	.tces-stack-1024.tces-image-left .tces-slide {
		flex-direction: column;
	}
}

/* ========================================
   Responsive: Stack at 768px
   ======================================== */

@media (max-width: 768px) {
	.tces-stack-768 .tces-slide {
		flex-direction: column;
	}

	.tces-stack-768 .tces-col.tces-text {
		flex-basis: auto;
		max-width: 100%;
		width: 100%;
	}

	.tces-stack-768 .tces-col.tces-media {
		width: 100%;
	}

	/* Reset image position on mobile */
	.tces-stack-768.tces-image-left .tces-slide {
		flex-direction: column;
	}

	/* Adjust navigation for smaller screens */
	.tces-nav {
		--tces-nav-size: 36px;
	}

	.tces-nav button svg {
		width: 20px;
		height: 20px;
	}
}

/* ========================================
   Responsive: Stack at 600px
   ======================================== */

@media (max-width: 600px) {
	.tces-stack-600 .tces-slide {
		flex-direction: column;
	}

	.tces-stack-600 .tces-col.tces-text {
		flex-basis: auto;
		max-width: 100%;
		width: 100%;
	}

	.tces-stack-600 .tces-col.tces-media {
		width: 100%;
	}

	/* Reset image position on mobile */
	.tces-stack-600.tces-image-left .tces-slide {
		flex-direction: column;
	}

	/* Adjust navigation for smaller screens */
	.tces-nav {
		--tces-nav-size: 32px;
	}

	.tces-nav button svg {
		width: 18px;
		height: 18px;
	}
}

/* ========================================
   Swiper Core Styles
   ======================================== */

.tces-swiper .swiper-wrapper {
	display: flex;
}

.tces-swiper .swiper-slide {
	flex-shrink: 0;
	width: 100%;
	height: 100%;
	position: relative;
	transition-property: transform;
}

/* ========================================
   RTL Support
   ======================================== */

[dir="rtl"] .tces-nav {
	right: auto;
	left: var(--tces-nav-right, 16px);
}

[dir="rtl"] .tces-image-left .tces-slide {
	flex-direction: row;
}

[dir="rtl"] .tces-image-right .tces-slide {
	flex-direction: row-reverse;
}

/* ========================================
   Accessibility
   ======================================== */

.tces-nav button:focus-visible {
	outline: 2px solid #007bff;
	outline-offset: 2px;
}

/* Screen reader only */
.tces-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* ========================================
   Elementor Editor Adjustments
   ======================================== */

.elementor-editor-active .tces-swiper {
	/* Ensure slider is visible and editable in editor */
	min-height: 200px;
}
