/**
 * SAS Gallery - Public Styles (Grid, Masonry, Slideshow, List, Lightbox)
 *
 * @package SAS_Gallery
 * @license GPL-2.0-or-later
 * @link    https://www.gnu.org/licenses/gpl-2.0.html
 */

/* ================================================================
   SAS Gallery - Public Styles
   Grid, Masonry, Slideshow, List layouts + Lightbox
   ================================================================ */

/* ---- Base ---- */
.sas-gallery {
	margin: 1.5em 0;
	--sas-theme-text: #333;
	--sas-theme-bg: transparent;
	--sas-theme-caption-bg: rgba(0, 0, 0, 0.6);
	--sas-theme-caption-color: #fff;
	--sas-theme-border: transparent;
	--sas-theme-hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sas-gallery *,
.sas-gallery *::before,
.sas-gallery *::after {
	box-sizing: border-box;
}

.sas-gallery-image {
	display: block;
	max-width: 100%;
	height: auto;
}

.sas-gallery-link {
	text-decoration: none;
	display: block;
}

/* ---- Grid Layout ---- */
.sas-gallery-grid {
	display: grid;
	grid-template-columns: repeat(var(--sas-columns, 4), 1fr);
	gap: var(--sas-gap, 10px);
}

.sas-gallery--grid .sas-gallery-item {
	position: relative;
	overflow: hidden;
	margin: 0;
}

.sas-gallery--grid .sas-gallery-image {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.sas-gallery--grid .sas-gallery-link:hover .sas-gallery-image,
.sas-gallery--grid .sas-gallery-video-thumb:hover .sas-gallery-image {
	transform: scale(1.05);
}

.sas-gallery--grid .sas-gallery-caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 8px 12px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
	color: #fff;
	font-size: 0.85em;
	opacity: 0;
	transition: opacity 0.3s ease;
	margin: 0;
}

.sas-gallery--grid .sas-gallery-item:hover .sas-gallery-caption {
	opacity: 1;
}

/* ---- Masonry Layout ---- */
.sas-gallery-masonry {
	columns: var(--sas-columns, 4);
	column-gap: var(--sas-gap, 10px);
}

.sas-gallery--masonry .sas-gallery-item {
	break-inside: avoid;
	margin: 0 0 var(--sas-gap, 10px) 0;
	position: relative;
	overflow: hidden;
}

.sas-gallery--masonry .sas-gallery-image {
	width: 100%;
	height: auto;
	display: block;
	transition: transform 0.3s ease;
}

.sas-gallery--masonry .sas-gallery-link:hover .sas-gallery-image,
.sas-gallery--masonry .sas-gallery-video-thumb:hover .sas-gallery-image {
	transform: scale(1.03);
}

.sas-gallery--masonry .sas-gallery-caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 8px 12px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
	color: #fff;
	font-size: 0.85em;
	opacity: 0;
	transition: opacity 0.3s ease;
	margin: 0;
}

.sas-gallery--masonry .sas-gallery-item:hover .sas-gallery-caption {
	opacity: 1;
}

/* ---- Mosaic (Justified) Layout ---- */
.sas-gallery-mosaic {
	display: flex;
	flex-direction: column;
	gap: var(--sas-gap, 10px);
}

.sas-gallery--mosaic .sas-gallery-item {
	position: relative;
	overflow: hidden;
	margin: 0;
	line-height: 0;
}

.sas-gallery--mosaic .sas-gallery-image {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.sas-gallery--mosaic .sas-gallery-link:hover .sas-gallery-image,
.sas-gallery--mosaic .sas-gallery-video-thumb:hover .sas-gallery-image {
	transform: scale(1.03);
}

.sas-gallery--mosaic .sas-gallery-caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 8px 12px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
	color: #fff;
	font-size: 0.85em;
	opacity: 0;
	transition: opacity 0.3s ease;
	margin: 0;
	line-height: 1.4;
}

.sas-gallery--mosaic .sas-gallery-item:hover .sas-gallery-caption {
	opacity: 1;
}

/* ---- Tile Layout ---- */
.sas-gallery-tile {
	display: grid;
	grid-template-columns: repeat(var(--sas-columns, 4), 1fr);
	grid-auto-rows: var(--sas-tile-row-height, 200px);
	grid-auto-flow: dense;
	gap: var(--sas-gap, 10px);
}

.sas-gallery--tile .sas-gallery-item {
	position: relative;
	overflow: hidden;
	margin: 0;
	line-height: 0;
}

.sas-gallery--tile .sas-gallery-image {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.sas-gallery--tile .sas-gallery-link:hover .sas-gallery-image,
.sas-gallery--tile .sas-gallery-video-thumb:hover .sas-gallery-image {
	transform: scale(1.03);
}

.sas-gallery--tile .sas-gallery-caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 8px 12px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
	color: #fff;
	font-size: 0.85em;
	opacity: 0;
	transition: opacity 0.3s ease;
	margin: 0;
	line-height: 1.4;
}

.sas-gallery--tile .sas-gallery-item:hover .sas-gallery-caption {
	opacity: 1;
}

/* ---- Slider (Horizontal Scroll) Layout ---- */
.sas-gallery--slider {
	position: relative;
}

.sas-gallery-slider {
	display: flex;
	gap: var(--sas-gap, 10px);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
	height: var(--sas-slider-height, 300px);
}

.sas-gallery-slider::-webkit-scrollbar {
	display: none;
}

.sas-gallery--slider .sas-gallery-item {
	position: relative;
	height: 100%;
	margin: 0;
	border-radius: 4px;
	line-height: 0;
	flex: 0 0 auto;
}

.sas-gallery--slider .sas-gallery-link,
.sas-gallery--slider .sas-gallery-video-thumb {
	display: block;
	height: 100%;
}

.sas-gallery--slider .sas-gallery-image {
	height: 100%;
	width: auto;
	display: block;
	transition: transform 0.3s ease;
}

.sas-gallery--slider .sas-gallery-link:hover .sas-gallery-image,
.sas-gallery--slider .sas-gallery-video-thumb:hover .sas-gallery-image {
	transform: scale(1.03);
}

.sas-gallery--slider .sas-gallery-caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 8px 12px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
	color: #fff;
	font-size: 0.85em;
	opacity: 0;
	transition: opacity 0.3s ease;
	margin: 0;
	line-height: 1.4;
}

.sas-gallery--slider .sas-gallery-item:hover .sas-gallery-caption {
	opacity: 1;
}

.sas-slider-prev,
.sas-slider-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(0,0,0,0.5);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	padding: 0;
}

.sas-slider-prev { left: 10px; }
.sas-slider-next { right: 10px; }

.sas-slider-prev:hover,
.sas-slider-next:hover {
	background: rgba(0,0,0,0.75);
}

.sas-slider-prev svg,
.sas-slider-next svg {
	width: 18px;
	height: 18px;
	stroke: #fff;
	fill: none;
}

@media (max-width: 768px) {
	.sas-gallery--slider {
		--sas-slider-height: var(--sas-slider-height-mobile, 200px);
	}
	.sas-slider-prev,
	.sas-slider-next {
		width: 44px;
		height: 44px;
	}
}

/* ---- Slideshow Layout ---- */
.sas-gallery-slideshow {
	position: relative;
	overflow: hidden;
	background: #000;
	width: 100%;
}

.sas-gallery--slideshow {
	width: 100%;
}

.sas-gallery-slideshow-track {
	position: relative;
	width: 100%;
	height: var(--sas-slideshow-height, 400px);
}

.sas-gallery-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity var(--sas-slideshow-duration, 600ms) ease;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
	will-change: opacity, transform;
}

.sas-gallery-slide--active {
	opacity: 1;
	pointer-events: auto;
}

/* Slide transition */
.sas-gallery--slideshow-slide .sas-gallery-slide {
	opacity: 1;
	transform: translateX(100%);
	transition: transform var(--sas-slideshow-duration, 600ms) ease;
}

.sas-gallery--slideshow-slide .sas-gallery-slide--active {
	transform: translateX(0);
}

.sas-gallery--slideshow-slide .sas-gallery-slide--exit-left {
	transform: translateX(-100%);
}

/* Zoom transition */
.sas-gallery--slideshow-zoom .sas-gallery-slide {
	opacity: 0;
	transform: scale(0.85);
	transition: opacity var(--sas-slideshow-duration, 600ms) ease, transform var(--sas-slideshow-duration, 600ms) ease;
}

.sas-gallery--slideshow-zoom .sas-gallery-slide--active {
	opacity: 1;
	transform: scale(1);
}

/* None transition */
.sas-gallery--slideshow-none .sas-gallery-slide {
	transition: none;
}

.sas-gallery--slideshow-none .sas-gallery-slide--active {
	opacity: 1;
}

.sas-gallery-slide .sas-gallery-link,
.sas-gallery-slide.sas-gallery-item--video {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.sas-gallery-slide .sas-gallery-image {
	max-width: calc(100% - var(--sas-slideshow-padding, 0px) * 2);
	max-height: calc(100% - var(--sas-slideshow-padding, 0px) * 2);
	object-fit: contain;
}

.sas-gallery-slide .sas-gallery-caption {
	padding: 10px 20px;
	color: #ccc;
	font-size: 0.9em;
	margin: 0;
}

.sas-gallery-slideshow-prev,
.sas-gallery-slideshow-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border: none;
	padding: 12px;
	cursor: pointer;
	z-index: 10;
	border-radius: 50%;
	transition: background 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sas-gallery-slideshow-prev:hover,
.sas-gallery-slideshow-next:hover {
	background: rgba(0, 0, 0, 0.8);
}

.sas-gallery-slideshow-prev {
	left: 10px;
}

.sas-gallery-slideshow-next {
	right: 10px;
}

.sas-gallery-slideshow-prev svg,
.sas-gallery-slideshow-next svg {
	width: 24px;
	height: 24px;
}

/* Indicators: shared */
.sas-gallery-slideshow-indicators {
	text-align: center;
	padding: 10px;
}

/* Dots style */
.sas-gallery-slideshow-indicators--dots .sas-gallery-slideshow-indicator {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.5);
	background: transparent;
	background-clip: content-box;
	margin: 0 2px;
	cursor: pointer;
	padding: 8px;
	transition: background 0.2s;
}

.sas-gallery-slideshow-indicators--dots .sas-gallery-slideshow-indicator--active,
.sas-gallery-slideshow-indicators--dots .sas-gallery-slideshow-indicator:hover {
	background: #fff;
	border-color: #fff;
}

/* Bars style */
.sas-gallery-slideshow-indicators--bars .sas-gallery-slideshow-indicator {
	width: 24px;
	height: 3px;
	border: none;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.35);
	background-clip: content-box;
	margin: 0 2px;
	cursor: pointer;
	padding: 10px 2px;
	transition: background 0.2s;
}

.sas-gallery-slideshow-indicators--bars .sas-gallery-slideshow-indicator--active,
.sas-gallery-slideshow-indicators--bars .sas-gallery-slideshow-indicator:hover {
	background: #fff;
}

/* Numbers style */
.sas-gallery-slideshow-indicators--numbers {
	display: block;
	width: 100%;
}

.sas-gallery-slideshow-number {
	color: rgba(255, 255, 255, 0.9);
	font-size: 14px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---- List Layout ---- */
.sas-gallery-list {
	display: flex;
	flex-direction: column;
	gap: var(--sas-gap, 40px);
}

.sas-gallery-list-item {
	display: flex;
	gap: 20px;
	margin: 0;
	align-items: flex-start;
}

.sas-gallery-list-image {
	flex: 0 0 60%;
	max-width: 60%;
	overflow: hidden;
}

.sas-gallery-list-image .sas-gallery-image {
	width: 100%;
	height: auto;
	transition: transform 0.3s ease;
}

.sas-gallery-list-image .sas-gallery-link:hover .sas-gallery-image,
.sas-gallery-list-image .sas-gallery-video-thumb:hover .sas-gallery-image {
	transform: scale(1.02);
}

.sas-gallery-list-content {
	flex: 1;
	padding: 16px 0;
}

.sas-gallery-list-title {
	margin: 0 0 12px;
	font-size: 1.2em;
}

.sas-gallery--list .sas-gallery-caption {
	margin: 0;
	color: #444;
	line-height: 1.6;
}

/* ---- Password Form ---- */
.sas-gallery-password-form {
	text-align: center;
	padding: 40px 20px;
	background: #f8f9fa;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.sas-gallery-password-form input[type="password"] {
	padding: 8px 12px;
	font-size: 14px;
	margin: 0 8px;
}

.sas-gallery-password-form button {
	padding: 8px 20px;
	cursor: pointer;
}

.sas-gallery-login-required {
	text-align: center;
	padding: 40px;
	color: #444;
}

/* ================================================================
   Lightbox
   ================================================================ */

.sas-lightbox-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0, 0, 0, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.sas-lightbox-overlay--visible {
	opacity: 1;
	pointer-events: auto;
}

.sas-lightbox-overlay--slide .sas-lightbox-image-wrapper {
	transition: transform 0.3s ease;
}

.sas-lightbox-close {
	position: absolute;
	top: 15px;
	right: 20px;
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 0;
	z-index: 10;
	opacity: 0.7;
	transition: opacity 0.2s;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
}

.sas-lightbox-close:hover {
	opacity: 1;
}

.sas-lightbox-image-wrapper {
	position: relative;
	max-width: 90vw;
	max-height: 85vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sas-lightbox-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top-color: #fff;
	border-radius: 50%;
	animation: sas-spin 0.8s linear infinite;
}

@keyframes sas-spin {
	to { transform: rotate(360deg); }
}

.sas-lightbox-image {
	max-width: 90vw;
	max-height: 80vh;
	object-fit: contain;
	-webkit-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
}

.sas-lightbox-prev,
.sas-lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.25);
	border: none;
	color: #fff;
	font-size: 28px;
	padding: 15px;
	cursor: pointer;
	z-index: 10;
	opacity: 0.85;
	transition: opacity 0.2s, background 0.2s;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sas-lightbox-prev:hover,
.sas-lightbox-next:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.35);
}

.sas-lightbox-prev {
	left: 15px;
}

.sas-lightbox-next {
	right: 15px;
}

.sas-lightbox-prev svg,
.sas-lightbox-next svg {
	width: 28px;
	height: 28px;
}

.sas-lightbox-caption {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	text-align: center;
	padding: 12px 20px;
	color: #e0e0e0;
	font-size: 0.9em;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

.sas-lightbox-caption-title {
	display: block;
	font-weight: 600;
	font-size: 0.95em;
	margin-bottom: 2px;
}

.sas-lightbox-caption-desc {
	display: block;
	font-weight: 400;
	font-size: 0.85em;
	opacity: 0.8;
}

.sas-lightbox-counter {
	position: absolute;
	top: 20px;
	left: 20px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.85em;
	z-index: 10;
}

/* ---- Pro: Lightbox Toolbar ---- */
.sas-lightbox-toolbar {
	position: absolute;
	top: 15px;
	right: 60px;
	display: flex;
	gap: 8px;
	z-index: 10;
}

.sas-lightbox-toolbar-btn {
	background: rgba(255, 255, 255, 0.1);
	border: none;
	color: #fff;
	padding: 8px;
	border-radius: 50%;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s, background 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.sas-lightbox-toolbar-btn:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.2);
}

/* ---- Pro: EXIF Panel ---- */
.sas-lightbox-exif-panel {
	position: absolute;
	bottom: 50px;
	right: 20px;
	background: rgba(0, 0, 0, 0.8);
	color: #ccc;
	padding: 12px 16px;
	border-radius: 6px;
	font-size: 0.8em;
	z-index: 10;
	max-width: 300px;
}

.sas-exif-item {
	display: block;
	margin-bottom: 4px;
	line-height: 1.4;
}

.sas-exif-item strong {
	color: #fff;
	margin-right: 4px;
}

/* ---- Pro: Share Dropdown ---- */
.sas-lightbox-share-dropdown {
	position: absolute;
	top: 50px;
	right: 60px;
	background: rgba(0, 0, 0, 0.9);
	border-radius: 6px;
	padding: 8px 0;
	z-index: 10;
	flex-direction: column;
	min-width: 140px;
}

.sas-lightbox-share-dropdown a,
.sas-lightbox-share-dropdown button {
	display: block;
	padding: 8px 16px;
	color: #ccc;
	text-decoration: none;
	border: none;
	background: none;
	text-align: left;
	cursor: pointer;
	font-size: 0.85em;
	width: 100%;
}

.sas-lightbox-share-dropdown a:hover,
.sas-lightbox-share-dropdown button:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

/* ---- Pro: Tag Filter ---- */
.sas-gallery-tag-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 15px;
}

.sas-gallery-tag-btn {
	padding: 6px 14px;
	border: 1px solid #ddd;
	background: #f8f9fa;
	color: #333;
	border-radius: 20px;
	cursor: pointer;
	font-size: 0.85em;
	transition: all 0.2s;
}

.sas-gallery-tag-btn:hover {
	border-color: #999;
	color: #333;
}

.sas-gallery-tag-btn--active {
	background: #333;
	color: #fff;
	border-color: #333;
}

/* ---- Pro: Blur Placeholder ---- */
.sas-gallery-image--blur {
	filter: blur(20px);
	transition: filter 0.5s ease;
}

/* ---- Video Items ---- */
.sas-gallery-item--video {
	position: relative;
	cursor: pointer;
}

.sas-gallery-item--video .sas-gallery-video-thumb {
	position: relative;
	cursor: pointer;
}

.sas-gallery-video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
	opacity: 0.9;
	transition: opacity 0.2s, transform 0.2s;
}

.sas-gallery-item--video:hover .sas-gallery-video-play {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.1);
}

.sas-lightbox-video {
	width: 90vw;
	height: 70vh;
	max-width: 1200px;
	border: none;
}

/* ---- Before/After Comparison Slider ---- */
.sas-compare {
	position: relative;
	margin: 1.5em auto;
	overflow: hidden;
	user-select: none;
	-webkit-user-select: none;
}

.sas-compare-container {
	position: relative;
	overflow: hidden;
	cursor: ew-resize;
}

.sas-compare--vertical .sas-compare-container {
	cursor: ns-resize;
}

.sas-compare-before,
.sas-compare-after {
	position: relative;
}

.sas-compare-before {
	position: absolute;
	top: 0;
	left: 0;
	width: 50%;
	height: 100%;
	overflow: hidden;
	z-index: 2;
}

.sas-compare--vertical .sas-compare-before {
	width: 100%;
	height: 50%;
}

.sas-compare-after {
	display: block;
}

.sas-compare-before img,
.sas-compare-after img {
	display: block;
	width: 100%;
	height: auto;
	pointer-events: none;
}

.sas-compare-before img {
	width: auto;
	min-width: 100%;
	max-width: none;
}

.sas-compare-label {
	position: absolute;
	padding: 4px 12px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 0.8em;
	border-radius: 3px;
	z-index: 5;
}

.sas-compare-label--before {
	top: 10px;
	left: 10px;
}

.sas-compare-label--after {
	top: 10px;
	right: 10px;
}

.sas-compare-handle {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 4px;
	margin-left: -2px;
	z-index: 10;
	cursor: ew-resize;
}

.sas-compare--vertical .sas-compare-handle {
	top: 50%;
	left: 0;
	right: 0;
	bottom: auto;
	width: 100%;
	height: 4px;
	margin-left: 0;
	margin-top: -2px;
	cursor: ns-resize;
}

.sas-compare-handle-line {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	margin-left: -1px;
	background: #fff;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
}

.sas-compare--vertical .sas-compare-handle-line {
	top: 50%;
	left: 0;
	right: 0;
	bottom: auto;
	width: 100%;
	height: 2px;
	margin-left: 0;
	margin-top: -1px;
}

.sas-compare-handle-circle {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #333;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
	.sas-gallery-grid {
		grid-template-columns: repeat(var(--sas-columns-tablet, 3), 1fr);
	}

	.sas-gallery-masonry {
		columns: var(--sas-columns-tablet, 3);
	}

	.sas-gallery-tile {
		grid-template-columns: repeat(var(--sas-columns-tablet, 3), 1fr);
	}
}

@media (max-width: 768px) {
	.sas-gallery-grid {
		grid-template-columns: repeat(var(--sas-columns-mobile, 2), 1fr);
	}

	.sas-gallery-masonry {
		columns: var(--sas-columns-mobile, 2);
	}

	.sas-gallery-tile {
		grid-template-columns: repeat(var(--sas-columns-mobile, 2), 1fr);
	}

	.sas-gallery--tile .sas-gallery-item {
		grid-column: span 1 !important;
		grid-row: span 1 !important;
	}

	.sas-gallery--slideshow {
		--sas-slideshow-height: var(--sas-slider-height-mobile, 250px);
	}

	.sas-gallery--slideshow .sas-gallery-slideshow-track {
		max-height: 60vh;
	}

	.sas-gallery-slider {
		--sas-slider-height: var(--sas-slider-height-mobile, 200px);
		height: auto;
		max-height: var(--sas-slider-height-mobile, 200px);
		gap: 0;
		scroll-snap-type: x mandatory;
	}

	.sas-gallery--slider .sas-gallery-item {
		height: auto;
		flex: 0 0 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		scroll-snap-align: center;
	}

	.sas-gallery--slider .sas-gallery-image {
		height: auto;
		width: auto;
		max-width: 100%;
		max-height: var(--sas-slider-height-mobile, 200px);
	}

	.sas-gallery--slider .sas-gallery-link,
	.sas-gallery--slider .sas-gallery-video-thumb {
		height: auto;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.sas-gallery-list-item {
		flex-direction: column;
	}

	.sas-gallery-list-image {
		flex: none;
		max-width: 100%;
	}

	.sas-lightbox-prev,
	.sas-lightbox-next {
		padding: 10px;
		font-size: 22px;
		min-width: 44px;
		min-height: 44px;
	}
}

/* ---- Slideshow Pause Button ---- */
.sas-gallery-slideshow-pause {
	position: absolute;
	bottom: 12px;
	right: 12px;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	font-size: 16px;
	cursor: pointer;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.7;
	transition: opacity 0.2s;
}

.sas-gallery-slideshow-pause:hover {
	opacity: 1;
}

/* ================================================================
   Accessibility: Focus Styles
   ================================================================ */

.sas-lightbox-close:focus-visible,
.sas-lightbox-prev:focus-visible,
.sas-lightbox-next:focus-visible,
.sas-lightbox-toolbar-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
	opacity: 1;
}

.sas-gallery-tag-btn:focus-visible,
.sas-gallery-slideshow-indicator:focus-visible,
.sas-gallery-slideshow-prev:focus-visible,
.sas-gallery-slideshow-next:focus-visible,
.sas-gallery-slideshow-pause:focus-visible {
	outline: 2px solid #005fcc;
	outline-offset: 2px;
}

.sas-gallery-link:focus-visible {
	outline: 2px solid #005fcc;
	outline-offset: 2px;
}

.sas-compare-handle:focus-visible {
	outline: 2px solid #005fcc;
	outline-offset: 2px;
}

/* Screen reader only utility */
.sas-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.sas-sr-only--focusable:focus {
	position: static;
	width: auto;
	height: auto;
	padding: 0.5em 1em;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
	background: #005fcc;
	color: #fff;
	text-decoration: none;
	z-index: 100000;
}

/* ---- Touch devices: always-visible captions ---- */
@media (hover: none) {
	.sas-gallery--grid .sas-gallery-caption,
	.sas-gallery--masonry .sas-gallery-caption,
	.sas-gallery--tile .sas-gallery-caption {
		opacity: 1;
	}
}

/* ---- Skeleton Loading Animation ---- */
.sas-gallery-image[loading="lazy"]:not([src]) {
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: sas-skeleton-shimmer 1.5s infinite;
	min-height: 150px;
}

@keyframes sas-skeleton-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* ---- Compare Handle Active State ---- */
.sas-compare-handle-circle:active,
.sas-compare-handle:active .sas-compare-handle-circle {
	transform: translate(-50%, -50%) scale(1.1);
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
	.sas-gallery-image,
	.sas-lightbox-overlay,
	.sas-lightbox-image-wrapper,
	.sas-gallery-slide,
	.sas-gallery--grid .sas-gallery-image,
	.sas-gallery--masonry .sas-gallery-image,
	.sas-gallery-caption,
	.sas-compare-handle,
	.sas-compare-before {
		transition: none !important;
		animation: none !important;
	}
}

/* ---- Print Order Modal ---- */
.sas-print-modal {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 100;
}

.sas-print-modal-inner {
	background: #fff;
	color: #333;
	padding: 25px;
	border-radius: 8px;
	width: 340px;
	max-height: 80vh;
	overflow-y: auto;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.sas-print-modal label {
	display: block;
	margin-bottom: 10px;
	font-size: 13px;
	font-weight: 600;
}

.sas-print-modal input,
.sas-print-modal select {
	width: 100%;
	padding: 6px 8px;
	border: 1px solid #ccc;
	border-radius: 4px;
	margin-top: 4px;
	font-size: 14px;
	box-sizing: border-box;
}
