/* =============================================================================
   Centerpoint Trailers — Gallery Widget
   ============================================================================= */

/* Main slider */
.cp-gallery__main {
	position: relative;
	margin-bottom: 8px;
}

.cp-gallery__main .swiper-slide {
	height: 450px;
	overflow: hidden;
	background: #f0f0f0;
	outline: none;        /* prevent blue focus highlight on click */
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}

.cp-gallery__main .swiper-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Navigation arrows */
.cp-gallery__prev,
.cp-gallery__next {
	color: #ffffff;
}

.cp-gallery__prev::after,
.cp-gallery__next::after {
	font-size: 18px;
}

/* Counter */
.cp-gallery__counter {
	position: absolute;
	bottom: 12px;
	right: 14px;
	background: rgba(0,0,0,.55);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 3px;
	z-index: 10;
	line-height: 1.4;
}

/* Thumbnails */
.cp-gallery__thumbs {
	margin-top: 8px;
}

.cp-gallery__thumbs .swiper-slide {
	height: 80px;
	overflow: hidden;
	opacity: .55;
	cursor: pointer;
	transition: opacity .2s;
	background: #f0f0f0;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}

.cp-gallery__thumbs .swiper-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cp-gallery__thumbs .swiper-slide-thumb-active {
	opacity: 1;
	outline: 2px solid #cc0000;
	outline-offset: -2px;
}

/* Empty state */
.cp-gallery__empty {
	padding: 40px;
	text-align: center;
	color: #999;
	background: #f8f8f8;
	border-radius: 4px;
}

/* =============================================================================
   Lightbox
   ============================================================================= */
.cp-gallery__lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	align-items: center;
	justify-content: center;
}

.cp-gallery__lightbox.is-open {
	display: flex;
}

.cp-gallery__lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.92);
}

.cp-gallery__lightbox-inner {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: 90vw;
	max-height: 90vh;
	padding: 0 16px;
	opacity: 0;
	transition: opacity .25s ease;
}

.cp-gallery__lightbox.is-ready .cp-gallery__lightbox-inner {
	opacity: 1;
}

.cp-gallery__lightbox-img {
	max-width: 80vw;
	max-height: 85vh;
	object-fit: contain;
	display: block;
	border-radius: 3px;
}

/* Lightbox buttons */
.cp-gallery__lightbox-close,
.cp-gallery__lightbox-prev,
.cp-gallery__lightbox-next {
	background: rgba(255,255,255,.15);
	border: none;
	color: #ffffff;
	cursor: pointer;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	line-height: 1;
	transition: background .2s;
	flex-shrink: 0;
}

.cp-gallery__lightbox-close:hover,
.cp-gallery__lightbox-prev:hover,
.cp-gallery__lightbox-next:hover {
	background: rgba(255,255,255,.3);
}

.cp-gallery__lightbox-close {
	position: absolute;
	top: -50px;
	right: 0;
	font-size: 24px;
}

.cp-gallery__lightbox-counter {
	position: absolute;
	bottom: -36px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255,255,255,.7);
	font-size: 13px;
}

/* Mobile lightbox */
@media ( max-width: 768px ) {
	.cp-gallery__lightbox-inner {
		gap: 8px;
		padding: 0 8px;
	}

	.cp-gallery__lightbox-img {
		max-width: 75vw;
	}

	.cp-gallery__lightbox-prev,
	.cp-gallery__lightbox-next {
		width: 36px;
		height: 36px;
		font-size: 16px;
	}
}
