/**
 * Cottages on the Coast - Image Carousel
 * Optimized to prevent CLS (Cumulative Layout Shift)
 */

/* Base reset */
.cotc-carousel-container *,
.cotc-carousel-container *::before,
.cotc-carousel-container *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* Main container with max-width constraint */
.cotc-carousel-container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto 30px;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* Carousel structure with consistent border radius */
.cotc-carousel {
	position: relative;
	overflow: hidden;
	width: 100%;
	border-radius: 8px; /* Consistent rounded corners */
	min-height: 300px; /* Minimum height to prevent collapse */
}

.carousel-track-container {
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: 8px; /* Consistent rounded corners */
}

.carousel-track {
	display: flex;
	transition: transform 0.3s ease-in-out; /* Faster transition */
	width: 100%;
	height: 100%;
}

/* Individual slides */
.carousel-slide {
	flex: 0 0 100%;
	width: 100%;
	height: 100%;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Image container with consistent border radius and updated max heights */
.carousel-slide-image-container {
	width: 100%;
	height: 100%;
	max-width: 735px;
	max-height: 490px; /* Updated max height for large screens */
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
	border-radius: 8px; /* Match parent container */
}

.carousel-slide img {
	display: block;
	width: 100%;
	height: 100%;
	margin-bottom: 0 !important;
	object-fit: cover; /* Maintain aspect ratio */
	transition: transform 0.3s ease;
	border-radius: 8px; /* Match container radius */
}

/* Navigation buttons */
.carousel-button {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 45px;
	height: 45px;
	background-color: rgba(136, 201, 181, 0.85);
	color: white;
	border: none;
	border-radius: 50%;
	font-size: 18px;
	cursor: pointer;
	z-index: 10;
	display: flex;
	justify-content: center;
	align-items: center;
	transition: all 0.2s ease;
	padding: 0;
	line-height: 0;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.carousel-button:hover,
.carousel-button:focus {
	background-color: rgba(136, 201, 181, 1);
	transform: translateY(-50%) scale(1.05);
}

.carousel-button.prev {
	left: 15px;
}

.carousel-button.next {
	right: 15px;
}

/* Caption styling */
.carousel-caption {
	position: absolute;
	bottom: 0;
	width: 100%;
	background-color: rgba(0, 0, 0, 0.7);
	color: white;
	text-align: center;
	padding: 10px;
	font-size: 14px;
}

/* Dot navigation - fixed position */
.carousel-dots {
	position: relative;
	height: 24px; /* Fixed height to prevent CLS */
	margin-top: 15px;
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	column-gap: 14px;
	row-gap: 10px;
}

@media (max-width: 768px) {
	.carousel-dots {
		column-gap: 12px;
		row-gap: 10px;
	}
}

.carousel-dot {
	display: flex;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background-color: rgba(136, 201, 181, 0.5);
	margin: 0;
	cursor: pointer;
	transition: all 0.2s ease;
	flex: 0 0 auto;
}

.carousel-dot:hover {
	transform: scale(1.1);
}

.carousel-dot.active {
	background-color: #88c9b5;
	transform: scale(1.2);
}

/* FooBox link styling with matching border radius */
.carousel-slide a.foobox {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 8px; /* Match parent container */
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.cotc-carousel {
		height: 300px; /* Smaller fixed height for mobile */
	}

	.carousel-slide-image-container {
		max-height: 490px; /* Updated max height for medium screens */
	}

	.carousel-button {
		width: 35px;
		height: 35px;
		font-size: 14px;
	}

	.carousel-dot {
		width: 8px;
		height: 8px;
	}
}

@media (max-width: 480px) {
	.cotc-carousel {
		height: 250px; /* Even smaller for very small screens */
	}

	.carousel-slide-image-container {
		max-height: 300px; /* Kept the same for small screens */
	}
}
