.vns-gallery-thumbnail-img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	cursor: pointer;
	border-radius: 8px;
	display: block;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.vns-gallery-grid-img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	cursor: pointer;
	border-radius: 8px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Hover effects - only active when hoverEffect option is enabled */
.vns-gallery-hover-enabled .vns-gallery-thumbnail-img:hover,
.vns-gallery-hover-enabled .vns-gallery-grid-img:hover {
	transform: scale(1.03);
	opacity: 0.9;
}

.modal-backdrop {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	min-height: 100vh !important;
	z-index: 1040 !important;
	opacity: 0.9 !important;
	background-color: #000;
}

#lightboxModal,
.vns-gallery-modal {
	z-index: 1050 !important;
}

#lightboxModal .modal-content,
.vns-gallery-modal .modal-content {
	background-color: rgba(0, 0, 0, 0.85);
	border-radius: 8px;
	border: none;
}

/* Custom Modal Styles */
.vns-gallery-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.9);
	z-index: 1050;
	overflow-y: auto;
	opacity: 0;
	transition: opacity 0.15s linear;
}

.vns-gallery-modal.vns-gallery-open {
	display: block;
	opacity: 1;
}

.vns-gallery-modal-dialog {
	max-width: 95vw;
	width: fit-content;
	min-width: 300px;
	margin: 1.75rem auto;
	position: relative;
	transition: width 0.2s ease;
}

.vns-gallery-modal-content {
	position: relative;
	background-color: rgba(30, 30, 30, 0.95);
	border-radius: 12px;
	padding: 1.5rem;
}

.vns-gallery-modal-body {
	padding: 0;
	background-color: transparent;
	width: fit-content;
	min-width: 300px;
	margin: 0 auto;
}

.vns-gallery-modal-close {
	position: absolute;
	top: -20px;
	right: -10px;
	background: rgba(0, 0, 0, 0.5);
	border: none;
	color: white;
	font-size: 20px;
	cursor: pointer;
	width: 40px;
	height: 40px;
	border-radius: 40px;
	opacity: 0.5;
	padding-left: 2px !important;
	transition: all 0.2s;
	z-index: 10;
	display: flex;
	text-align: center;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 0;
	font-family: Arial, sans-serif;
}

.vns-gallery-modal-close:hover {
	opacity: 1;
	background: rgba(0, 0, 0, 0.8);
	transform: scale(1.05);
}

body.vns-gallery-no-scroll {
	overflow: hidden;
}

@media (max-width: 1023px) and (min-width: 768px) {
	.vns-gallery-modal-dialog {
		max-width: calc(100vw - 2rem);
		margin: 1rem auto;
	}
}

@media (max-width: 767px) {
	.vns-gallery-modal-dialog {
		max-width: calc(100vw - 1rem);
		margin: 0.5rem auto;
	}

	.vns-gallery-modal-body {
		padding: 0.5rem;
	}

	.vns-gallery-modal-close {
		top: -8px;
		font-size: 35px;
	}
}

#lightboxGrid,
.vns-gallery-grid {
	justify-content: center;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	width: fit-content;
}

#lightboxGrid .col-auto,
.vns-gallery-grid .col-auto {
	padding: 0;
	margin: 0;
}

/* Dynamic grid columns - gap is 12px between items */
/* Formula: (100% - (gap * (columns - 1))) / columns */
.vns-gallery-grid[data-columns="2"] .col-auto { flex: 0 0 calc((100% - 12px) / 2); max-width: calc((100% - 12px) / 2); }
.vns-gallery-grid[data-columns="3"] .col-auto { flex: 0 0 calc((100% - 24px) / 3); max-width: calc((100% - 24px) / 3); }
.vns-gallery-grid[data-columns="4"] .col-auto { flex: 0 0 calc((100% - 36px) / 4); max-width: calc((100% - 36px) / 4); }
.vns-gallery-grid[data-columns="5"] .col-auto { flex: 0 0 calc((100% - 48px) / 5); max-width: calc((100% - 48px) / 5); }
.vns-gallery-grid[data-columns="6"] .col-auto { flex: 0 0 calc((100% - 60px) / 6); max-width: calc((100% - 60px) / 6); }
.vns-gallery-grid[data-columns="7"] .col-auto { flex: 0 0 calc((100% - 72px) / 7); max-width: calc((100% - 72px) / 7); }
.vns-gallery-grid[data-columns="8"] .col-auto { flex: 0 0 calc((100% - 84px) / 8); max-width: calc((100% - 84px) / 8); }
.vns-gallery-grid[data-columns="9"] .col-auto { flex: 0 0 calc((100% - 96px) / 9); max-width: calc((100% - 96px) / 9); }
.vns-gallery-grid[data-columns="10"] .col-auto { flex: 0 0 calc((100% - 108px) / 10); max-width: calc((100% - 108px) / 10); }
.vns-gallery-grid[data-columns="12"] .col-auto { flex: 0 0 calc((100% - 132px) / 12); max-width: calc((100% - 132px) / 12); }

@media (max-width: 1023px) and (min-width: 768px) {
	.vns-gallery-grid[data-columns] .col-auto {
		flex: 0 0 calc((100% - 24px) / 3);
		max-width: calc((100% - 24px) / 3);
	}
}

@media (max-width: 767px) {
	.vns-gallery-grid[data-columns] .col-auto {
		flex: 0 0 calc((100% - 12px) / 2);
		max-width: calc((100% - 12px) / 2);
	}
}

.vns-gallery-thumbnail-carousel-container {
	position: relative;
}

.vns-gallery-thumbnail-header {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	margin-bottom: 15px;
}

.vns-gallery-thumbnail-nav-controls {
	display: flex;
	gap: 10px;
}

.vns-gallery-thumbnail-carousel-wrapper {
	position: relative;
	overflow: hidden;
	margin: 0 -0.25rem;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

.vns-gallery-thumbnail-carousel-wrapper.vns-gallery-dragging {
	cursor: grabbing;
}

.vns-gallery-thumbnail-carousel {
	display: flex;
	transition: transform 0.3s ease;
}

.vns-gallery-dragging .vns-gallery-thumbnail-carousel {
	transition: none;
}

/* Default responsive columns when data-columns is not specified */
.vns-gallery-thumbnail-carousel-container:not([data-columns]) .vns-gallery-thumbnail-item {
	flex: 0 0 50%;
	padding: 0 0.25rem;
	aspect-ratio: 1 / 1;
	box-sizing: border-box;
}

@media (min-width: 768px) and (max-width: 1023px) {
	.vns-gallery-thumbnail-carousel-container:not([data-columns]) .vns-gallery-thumbnail-item {
		flex: 0 0 33.333%;
		padding: 0 0.25rem;
		box-sizing: border-box;
		aspect-ratio: 1 / 1;
	}
}

@media (min-width: 1024px) {
	.vns-gallery-thumbnail-carousel-container:not([data-columns]) .vns-gallery-thumbnail-item {
		flex: 0 0 25%;
		padding: 0 0.25rem;
		box-sizing: border-box;
		aspect-ratio: 1 / 1;
	}
}

/* Fixed column sizes when data-columns is specified */
.vns-gallery-thumbnail-carousel-container[data-columns] .vns-gallery-thumbnail-item {
	aspect-ratio: 1 / 1;
}
.vns-gallery-thumbnail-carousel-container[data-columns="1"] .vns-gallery-thumbnail-item { flex: 0 0 100%; padding: 0 0.25rem; box-sizing: border-box; }
.vns-gallery-thumbnail-carousel-container[data-columns="2"] .vns-gallery-thumbnail-item { flex: 0 0 50%; padding: 0 0.25rem; box-sizing: border-box; }
.vns-gallery-thumbnail-carousel-container[data-columns="3"] .vns-gallery-thumbnail-item { flex: 0 0 33.333%; padding: 0 0.25rem; box-sizing: border-box; }
.vns-gallery-thumbnail-carousel-container[data-columns="4"] .vns-gallery-thumbnail-item { flex: 0 0 25%; padding: 0 0.25rem; box-sizing: border-box; }
.vns-gallery-thumbnail-carousel-container[data-columns="5"] .vns-gallery-thumbnail-item { flex: 0 0 20%; padding: 0 0.25rem; box-sizing: border-box; }
.vns-gallery-thumbnail-carousel-container[data-columns="6"] .vns-gallery-thumbnail-item { flex: 0 0 16.666%; padding: 0 0.25rem; box-sizing: border-box; }
.vns-gallery-thumbnail-carousel-container[data-columns="7"] .vns-gallery-thumbnail-item { flex: 0 0 14.285%; padding: 0 0.25rem; box-sizing: border-box; }
.vns-gallery-thumbnail-carousel-container[data-columns="8"] .vns-gallery-thumbnail-item { flex: 0 0 12.5%; padding: 0 0.25rem; box-sizing: border-box; }
.vns-gallery-thumbnail-carousel-container[data-columns="9"] .vns-gallery-thumbnail-item { flex: 0 0 11.111%; padding: 0 0.25rem; box-sizing: border-box; }
.vns-gallery-thumbnail-carousel-container[data-columns="10"] .vns-gallery-thumbnail-item { flex: 0 0 10%; padding: 0 0.25rem; box-sizing: border-box; }
.vns-gallery-thumbnail-carousel-container[data-columns="11"] .vns-gallery-thumbnail-item { flex: 0 0 9.09%; padding: 0 0.25rem; box-sizing: border-box; }
.vns-gallery-thumbnail-carousel-container[data-columns="12"] .vns-gallery-thumbnail-item { flex: 0 0 8.333%; padding: 0 0.25rem; box-sizing: border-box; }

.vns-gallery-carousel-nav,
.vns-gallery-see-all-btn {
	background-color: rgba(0, 0, 0, 0.6);
	color: white;
	border: 1px solid rgba(255, 255, 255, 0.3);
	padding: 8px 12px;
	cursor: pointer;
	font-size: 16px;
	opacity: 0.9;
	border-radius: 8px;
}

.vns-gallery-carousel-nav:hover,
.vns-gallery-see-all-btn:hover {
	opacity: 1;
	background-color: rgba(0, 0, 0, 0.8);
}

.vns-gallery-carousel-nav:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

/* Static Grid Styles */
.vns-gallery-static-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

.vns-gallery-static-item {
	flex: 0 0 calc(25% - 0.375rem);
	max-width: calc(25% - 0.375rem);
	aspect-ratio: 1 / 1;
	position: relative;
}

.vns-gallery-static-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 8px;
}

.vns-gallery-more-indicator {
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 8px;
	cursor: pointer;
	transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

/* Hover effect for more indicator - only active when hoverEffect option is enabled */
.vns-gallery-hover-enabled .vns-gallery-more-indicator:hover {
	background: rgba(0, 0, 0, 0.8);
	transform: scale(1.03);
	opacity: 0.9;
}

.vns-gallery-more-indicator-content {
	color: white;
	font-size: 48px;
	font-weight: bold;
	user-select: none;
}

/* Responsive static grid */
@media (max-width: 1023px) and (min-width: 768px) {
	.vns-gallery-static-item {
		flex: 0 0 calc(33.333% - 0.34rem);
		max-width: calc(33.333% - 0.34rem);
	}
}

@media (max-width: 767px) {
	.vns-gallery-static-item {
		flex: 0 0 calc(50% - 0.25rem);
		max-width: calc(50% - 0.25rem);
	}
}

/* Static grid with custom columns - gap is 12px */
.vns-gallery-static-grid[data-columns="2"] .vns-gallery-static-item { flex: 0 0 calc((100% - 12px) / 2); max-width: calc((100% - 12px) / 2); }
.vns-gallery-static-grid[data-columns="3"] .vns-gallery-static-item { flex: 0 0 calc((100% - 24px) / 3); max-width: calc((100% - 24px) / 3); }
.vns-gallery-static-grid[data-columns="4"] .vns-gallery-static-item { flex: 0 0 calc((100% - 36px) / 4); max-width: calc((100% - 36px) / 4); }
.vns-gallery-static-grid[data-columns="5"] .vns-gallery-static-item { flex: 0 0 calc((100% - 48px) / 5); max-width: calc((100% - 48px) / 5); }
.vns-gallery-static-grid[data-columns="6"] .vns-gallery-static-item { flex: 0 0 calc((100% - 60px) / 6); max-width: calc((100% - 60px) / 6); }
.vns-gallery-static-grid[data-columns="7"] .vns-gallery-static-item { flex: 0 0 calc((100% - 72px) / 7); max-width: calc((100% - 72px) / 7); }
.vns-gallery-static-grid[data-columns="8"] .vns-gallery-static-item { flex: 0 0 calc((100% - 84px) / 8); max-width: calc((100% - 84px) / 8); }
.vns-gallery-static-grid[data-columns="9"] .vns-gallery-static-item { flex: 0 0 calc((100% - 96px) / 9); max-width: calc((100% - 96px) / 9); }
.vns-gallery-static-grid[data-columns="10"] .vns-gallery-static-item { flex: 0 0 calc((100% - 108px) / 10); max-width: calc((100% - 108px) / 10); }
.vns-gallery-static-grid[data-columns="12"] .vns-gallery-static-item { flex: 0 0 calc((100% - 132px) / 12); max-width: calc((100% - 132px) / 12); }

#lightboxSingle,
.vns-gallery-single {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* Fixed width for single view to prevent button jumping */
/* Width is set inline via modalWidth option, default 80vw */
.vns-gallery-single-container {
	max-width: 1200px;
	min-width: 400px;
}

@media (max-width: 767px) {
	.vns-gallery-single-container {
		width: 100% !important;
		max-width: 100% !important;
		min-width: auto;
	}

	.vns-gallery-modal-dialog {
		max-width: 100%;
		margin: 0.5rem;
	}

	.vns-gallery-modal-content {
		padding: 0.5rem;
		border-radius: 8px;
	}

	.vns-gallery-single-img {
		max-height: 70vh;
	}
}

.vns-gallery-single-img {
	width: 100%;
	height: auto;
	max-height: 75vh;
	object-fit: contain;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
}

.vns-gallery-single-container.vns-gallery-dragging .vns-gallery-single-img {
	cursor: grabbing;
}

.vns-gallery-lightbox-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	margin-bottom: 15px;
	padding: 0 10px;
}

.vns-gallery-lightbox-controls {
	display: flex;
	gap: 10px;
}

.vns-gallery-lightbox-counter {
	background-color: rgba(0, 0, 0, 0.6);
	color: white;
	padding: 8px 15px;
	border-radius: 8px;
	font-size: 14px;
}

#prevBtn,
#nextBtn,
#showAllBtn,
.vns-gallery-prev-btn,
.vns-gallery-next-btn,
.vns-gallery-show-all-btn {
	opacity: 0.9;
	font-size: 16px;
	padding: 8px 12px;
	background-color: rgba(0, 0, 0, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: white;
	border-radius: 8px;
	cursor: pointer;
}

#prevBtn:hover,
#nextBtn:hover,
#showAllBtn:hover,
.vns-gallery-prev-btn:hover,
.vns-gallery-next-btn:hover,
.vns-gallery-show-all-btn:hover {
	opacity: 1;
	background-color: rgba(0, 0, 0, 0.8);
}

#prevBtn:disabled,
#nextBtn:disabled,
.vns-gallery-prev-btn:disabled,
.vns-gallery-next-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
	background-color: rgba(0, 0, 0, 0.3);
}

#prevBtn:disabled:hover,
#nextBtn:disabled:hover,
.vns-gallery-prev-btn:disabled:hover,
.vns-gallery-next-btn:disabled:hover {
	opacity: 0.3;
	background-color: rgba(0, 0, 0, 0.3);
}

.vns-gallery-container {
	max-width: 1240px;
}

/* Loading Spinner */
.vns-gallery-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 10;
	display: none;
}

.vns-gallery-loading.vns-gallery-active {
	display: block;
}

.vns-gallery-spinner {
	width: 50px;
	height: 50px;
	border: 4px solid rgba(255, 255, 255, 0.3);
	border-top: 4px solid #fff;
	border-radius: 50%;
	animation: vns-gallery-spin 0.8s linear infinite;
}

@keyframes vns-gallery-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.vns-gallery-single-container {
	position: relative;
	min-height: 200px;
}

.vns-gallery-image-wrapper {
	position: relative;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.vns-gallery-single-img {
	transition: opacity 0.2s ease;
	position: relative;
	z-index: 1;
}

.vns-gallery-single-img.vns-gallery-loading-img {
	opacity: 0.3;
}

/* Caption Styles */
.vns-gallery-caption {
	color: #fff;
	font-size: 14px;
	line-height: 1.6;
	transition: opacity 0.3s ease;
}

/* Caption top overlays */
.vns-gallery-caption-top-left,
.vns-gallery-caption-top-center,
.vns-gallery-caption-top-right {
	position: absolute;
	top: 0;
	background: rgba(0, 0, 0, 0.75);
	padding: 12px 20px;
	z-index: 10;
	max-width: 80%;
}

.vns-gallery-caption-top-left {
	left: 0;
	text-align: left;
	border-radius: 8px 0 0 0;
}

.vns-gallery-caption-top-center {
	left: 50%;
	transform: translateX(-50%);
	text-align: center;
	border-radius: 0;
}

.vns-gallery-caption-top-right {
	right: 0;
	text-align: right;
	border-radius: 0 8px 0 0;
}

/* Caption bottom overlays */
.vns-gallery-caption-bottom-left,
.vns-gallery-caption-bottom-center,
.vns-gallery-caption-bottom-right {
	position: absolute;
	bottom: 0;
	background: rgba(0, 0, 0, 0.75);
	padding: 12px 20px;
	z-index: 10;
	max-width: 80%;
}

.vns-gallery-caption-bottom-left {
	left: 0;
	text-align: left;
	border-radius: 0 0 0 8px;
}

.vns-gallery-caption-bottom-center {
	left: 50%;
	transform: translateX(-50%);
	text-align: center;
	border-radius: 0;
}

.vns-gallery-caption-bottom-right {
	right: 0;
	text-align: right;
	border-radius: 0 0 8px 0;
}

/* Caption outside - below image wrapper without box */
.vns-gallery-caption-outside-left,
.vns-gallery-caption-outside-center,
.vns-gallery-caption-outside-right {
	margin-top: 12px;
	padding: 0;
	background: transparent;
	width: 100%;
	display: block;
}

.vns-gallery-caption-outside-left {
	text-align: left;
}

.vns-gallery-caption-outside-center {
	text-align: center;
}

.vns-gallery-caption-outside-right {
	text-align: right;
}
