/* RS Gallery Filter Styles */

:root {
	--rs-filter-color: #333;
	--rs-filter-bg: #f5f5f5;
	--rs-filter-active: #333;
	--rs-filter-active-bg: #000;
	--rs-filter-active-color: #fff;
	--rs-overlay-bg: rgba(0, 0, 0, 0.85);
	--rs-overlay-blur: 8px;
	--rs-cta-color: #0066ff;
	--rs-cta-hover-color: #0052cc;
	--rs-item-gap: 20px;
}

.rs-gallery-wrapper {
	width: 100%;
	padding: 20px 0;
}

/* Filters */
.rs-gallery-filters {
	margin-bottom: 40px;
	text-align: center;
}

.rs-gallery-filter-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	align-items: center;
}

.rs-gallery-filter-btn {
	padding: 10px 20px;
	background-color: var(--rs-filter-bg);
	color: var(--rs-filter-color);
	border: 1px solid transparent;
	border-radius: 20px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.3s ease;
	white-space: nowrap;
	font-family: inherit;
}

.rs-gallery-filter-btn:hover {
	background-color: #e0e0e0;
}

.rs-gallery-filter-btn.active {
	background-color: var(--rs-filter-active-bg);
	color: var(--rs-filter-active-color);
	border-color: var(--rs-filter-active);
}

/* Gallery Container */
.rs-gallery-container {
	display: grid;
	gap: var(--rs-item-gap);
	animation: fadeIn 0.3s ease;
}

/* Grid Layout */
.rs-gallery-grid {
	grid-auto-rows: auto;
	grid-auto-flow: row;
}

.rs-gallery-grid {
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

@media (min-width: 1025px) {
	.rs-gallery-grid[data-columns-desktop="1"] {
		grid-template-columns: 1fr;
	}
	.rs-gallery-grid[data-columns-desktop="2"] {
		grid-template-columns: repeat(2, 1fr);
	}
	.rs-gallery-grid[data-columns-desktop="3"] {
		grid-template-columns: repeat(3, 1fr);
	}
	.rs-gallery-grid[data-columns-desktop="4"] {
		grid-template-columns: repeat(4, 1fr);
	}
	.rs-gallery-grid[data-columns-desktop="5"] {
		grid-template-columns: repeat(5, 1fr);
	}
	.rs-gallery-grid[data-columns-desktop="6"] {
		grid-template-columns: repeat(6, 1fr);
	}
}

/* Masonry Layout */
.rs-gallery-masonry {
	grid-auto-rows: auto;
	grid-auto-flow: dense;
}

.rs-gallery-masonry {
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

@media (min-width: 1025px) {
	.rs-gallery-masonry[data-columns-desktop="1"] {
		grid-template-columns: 1fr;
	}
	.rs-gallery-masonry[data-columns-desktop="2"] {
		grid-template-columns: repeat(2, 1fr);
	}
	.rs-gallery-masonry[data-columns-desktop="3"] {
		grid-template-columns: repeat(3, 1fr);
	}
	.rs-gallery-masonry[data-columns-desktop="4"] {
		grid-template-columns: repeat(4, 1fr);
	}
	.rs-gallery-masonry[data-columns-desktop="5"] {
		grid-template-columns: repeat(5, 1fr);
	}
	.rs-gallery-masonry[data-columns-desktop="6"] {
		grid-template-columns: repeat(6, 1fr);
	}
}

/* Carousel Layout */
.rs-gallery-carousel {
	grid-auto-flow: column;
	grid-auto-columns: minmax(300px, 1fr);
	overflow-x: auto;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x mandatory;
}

.rs-gallery-carousel .rs-gallery-item {
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

/* Tablet */
@media (max-width: 1024px) {
	.rs-gallery-grid,
	.rs-gallery-masonry {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	}

	.rs-gallery-grid[data-columns-tablet="1"] {
		grid-template-columns: 1fr;
	}
	.rs-gallery-grid[data-columns-tablet="2"] {
		grid-template-columns: repeat(2, 1fr);
	}
	.rs-gallery-grid[data-columns-tablet="3"] {
		grid-template-columns: repeat(3, 1fr);
	}
	.rs-gallery-grid[data-columns-tablet="4"] {
		grid-template-columns: repeat(4, 1fr);
	}

	.rs-gallery-masonry[data-columns-tablet="1"] {
		grid-template-columns: 1fr;
	}
	.rs-gallery-masonry[data-columns-tablet="2"] {
		grid-template-columns: repeat(2, 1fr);
	}
	.rs-gallery-masonry[data-columns-tablet="3"] {
		grid-template-columns: repeat(3, 1fr);
	}
	.rs-gallery-masonry[data-columns-tablet="4"] {
		grid-template-columns: repeat(4, 1fr);
	}

	.rs-gallery-carousel {
		grid-auto-columns: minmax(280px, 1fr);
	}
}

/* Mobile */
@media (max-width: 768px) {
	.rs-gallery-filter-list {
		justify-content: flex-start;
		overflow-x: auto;
		padding: 0 0 10px 0;
	}

	.rs-gallery-filter-btn {
		padding: 8px 16px;
		font-size: 13px;
		flex-shrink: 0;
	}

	.rs-gallery-grid,
	.rs-gallery-masonry {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}

	.rs-gallery-grid[data-columns-mobile="1"] {
		grid-template-columns: 1fr;
	}
	.rs-gallery-grid[data-columns-mobile="2"] {
		grid-template-columns: repeat(2, 1fr);
	}

	.rs-gallery-masonry[data-columns-mobile="1"] {
		grid-template-columns: 1fr;
	}
	.rs-gallery-masonry[data-columns-mobile="2"] {
		grid-template-columns: repeat(2, 1fr);
	}

	.rs-gallery-carousel {
		grid-auto-columns: minmax(100vw, 1fr);
	}

	.rs-gallery-item-overlay {
		opacity: 1 !important;
		background-color: var(--rs-overlay-bg) !important;
	}
}

/* Gallery Item */
.rs-gallery-item {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	aspect-ratio: 1;
}

.rs-gallery-item-image {
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
}

.rs-gallery-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
	display: block;
}

.rs-gallery-item:hover .rs-gallery-item-image img {
	transform: scale(1.05);
}

/* Overlay */
.rs-gallery-item-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--rs-overlay-bg);
	backdrop-filter: blur(var(--rs-overlay-blur));
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.3s ease;
	gap: 12px;
}

.rs-gallery-item:hover .rs-gallery-item-overlay {
	opacity: 1;
}

/* Lightbox Trigger Icon */
.rs-gallery-lightbox-trigger {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 48px;
	height: 48px;
	background-color: rgba(255, 255, 255, 0.95);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
	padding: 0;
	z-index: 10;
}

.rs-gallery-lightbox-trigger:hover {
	background-color: #fff;
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rs-gallery-lightbox-trigger svg {
	width: 24px;
	height: 24px;
	color: #333;
}

.rs-gallery-item-description {
	margin: 0;
	color: #fff;
	font-size: 13px;
	line-height: 1.5;
	font-weight: 500;
}

.rs-gallery-item-benefit {
	margin: 0;
	color: #e0e0e0;
	font-size: 12px;
	line-height: 1.4;
	font-style: italic;
}

.rs-gallery-item-cta {
	display: inline-block;
	color: var(--rs-cta-color);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.3s ease;
	padding: 8px 12px;
	background-color: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	border: 1px solid var(--rs-cta-color);
	text-align: center;
	cursor: pointer;
}

.rs-gallery-item-cta:hover {
	color: var(--rs-cta-hover-color);
	border-color: var(--rs-cta-hover-color);
	background-color: rgba(255, 255, 255, 0.15);
}

/* Empty state */
.rs-gallery-empty {
	text-align: center;
	padding: 60px 20px;
	color: #999;
	font-size: 16px;
}

/* Animations */
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.rs-gallery-item {
	animation: fadeIn 0.3s ease;
}

/* Swiper overrides */
.swiper {
	margin: 0;
	padding: 0;
}

/* Touch behavior on mobile */
@media (hover: none) and (pointer: coarse) {
	.rs-gallery-item-overlay {
		opacity: 0;
		background-color: var(--rs-overlay-bg);
	}

	.rs-gallery-item.active .rs-gallery-item-overlay {
		opacity: 1;
	}
}

/* Lightbox Styles */
.rs-gallery-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rs-gallery-lightbox-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.95);
	cursor: pointer;
}

.rs-gallery-lightbox-content {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rs-gallery-lightbox-image-wrapper {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	max-height: 90vh;
}

.rs-gallery-lightbox-image {
	max-width: 100%;
	max-height: 85vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.rs-gallery-lightbox-title {
	display: none;
}

.rs-gallery-lightbox-close {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 50px;
	height: 50px;
	min-width: 50px;
	min-height: 50px;
	background-color: rgba(255, 255, 255, 0.1);
	border: 2px solid #fff;
	border-radius: 50%;
	color: #fff;
	font-size: 32px;
	line-height: 46px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100001;
	font-weight: 300;
	padding: 0;
	aspect-ratio: 1/1;
}

.rs-gallery-lightbox-close:hover {
	background-color: rgba(255, 255, 255, 0.2);
	transform: scale(1.1);
}

.rs-gallery-lightbox-prev,
.rs-gallery-lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 50px;
	height: 50px;
	min-width: 50px;
	min-height: 50px;
	background-color: rgba(255, 255, 255, 0.1);
	border: 2px solid #fff;
	border-radius: 50%;
	color: #fff;
	font-size: 36px;
	line-height: 46px;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100001;
	font-weight: 300;
	padding: 0;
	aspect-ratio: 1/1;
}

.rs-gallery-lightbox-prev {
	left: 30px;
}

.rs-gallery-lightbox-next {
	right: 30px;
}

.rs-gallery-lightbox-prev:hover,
.rs-gallery-lightbox-next:hover {
	background-color: rgba(255, 255, 255, 0.2);
	transform: translateY(-50%) scale(1.1);
}

.rs-gallery-lightbox-prev:disabled,
.rs-gallery-lightbox-next:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

@media (max-width: 768px) {
	.rs-gallery-lightbox-prev,
	.rs-gallery-lightbox-next {
		width: 40px;
		height: 40px;
		min-width: 40px;
		min-height: 40px;
		font-size: 28px;
		line-height: 36px;
	}

	.rs-gallery-lightbox-prev {
		left: 10px;
	}

	.rs-gallery-lightbox-next {
		right: 10px;
	}

	.rs-gallery-lightbox-close {
		top: 10px;
		right: 10px;
		width: 40px;
		height: 40px;
		min-width: 40px;
		min-height: 40px;
		font-size: 28px;
		line-height: 36px;
	}

	.rs-gallery-lightbox-image {
		max-height: 70vh;
	}

	.rs-gallery-lightbox-trigger {
		width: 40px;
		height: 40px;
		top: 15px;
		right: 15px;
	}

	.rs-gallery-lightbox-trigger svg {
		width: 20px;
		height: 20px;
	}
}
