/* Atomic Pro — Gallery Slider
 * Kept intentionally small and dependency-free. Colors fall back through
 * Elementor's global CSS variables where available, then to a sane default,
 * so the slider inherits your theme's primary color automatically.
 */
.atomicpro-gallery-slider {
	--atomicpro-primary: var(--e-a-color-primary, var(--e-global-color-primary, #6d28d9));
	--atomicpro-border: rgba(0, 0, 0, 0.08);
	--atomicpro-bg: #fff;

	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	min-width: 240px;
	box-sizing: border-box;
}

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

.atomicpro-gallery-slider__main {
	position: relative;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	min-height: 0;
	max-height: 80vh;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 8px;
	background: var(--atomicpro-bg);
	border: 1px solid var(--atomicpro-border);
}

/* "Viewport" — fills the screen height rather than deriving height from a
   fixed ratio. Uses svh (small viewport height) where supported, which
   avoids the classic mobile "100vh taller than the visible area" jank
   caused by the address bar showing/hiding; falls back to vh everywhere
   else. This intentionally overrides the 80vh safety cap above, since a
   full-height hero slider is meant to reach the actual screen edge. */
.atomicpro-gallery-slider[data-ratio="viewport"] .atomicpro-gallery-slider__main {
	aspect-ratio: unset !important;
	height: 100vh !important;
	height: 100svh !important;
	max-height: 100vh !important;
	max-height: 100svh !important;
}

/* Image ratio presets. "auto" is handled separately further down, since it
   needs the slide/image rules to change too, not just the ratio. */
.atomicpro-gallery-slider[data-ratio="1x1"] .atomicpro-gallery-slider__main { aspect-ratio: 1 / 1 !important; }
.atomicpro-gallery-slider[data-ratio="4x3"] .atomicpro-gallery-slider__main { aspect-ratio: 4 / 3 !important; }
.atomicpro-gallery-slider[data-ratio="3x4"] .atomicpro-gallery-slider__main { aspect-ratio: 3 / 4 !important; }
.atomicpro-gallery-slider[data-ratio="16x9"] .atomicpro-gallery-slider__main { aspect-ratio: 16 / 9 !important; }
.atomicpro-gallery-slider[data-ratio="9x16"] .atomicpro-gallery-slider__main { aspect-ratio: 9 / 16 !important; }
.atomicpro-gallery-slider[data-ratio="3x2"] .atomicpro-gallery-slider__main { aspect-ratio: 3 / 2 !important; }
.atomicpro-gallery-slider[data-ratio="2x3"] .atomicpro-gallery-slider__main { aspect-ratio: 2 / 3 !important; }

.atomicpro-gallery-slider__slide {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease;
}

.atomicpro-gallery-slider__slide.is-active {
	opacity: 1;
	visibility: visible;
}

.atomicpro-gallery-slider__link,
.atomicpro-gallery-slider__image {
	display: block;
	width: 100%;
	height: 100%;
}

/* Image fit — cover/contain/fill, independent of ratio. */
.atomicpro-gallery-slider[data-fit="cover"] .atomicpro-gallery-slider__image { object-fit: cover !important; }
.atomicpro-gallery-slider[data-fit="contain"] .atomicpro-gallery-slider__image { object-fit: contain !important; }
.atomicpro-gallery-slider[data-fit="fill"] .atomicpro-gallery-slider__image { object-fit: fill !important; }

/* "Auto" ratio = show each image at its own natural size (no forced crop,
   no letterboxing). This needs a different layout strategy: instead of
   stacking all slides absolutely (which requires a fixed-height container),
   only the active slide is in the flow at all, so the container's height
   naturally follows whichever image is showing. The `data-fit` setting is
   irrelevant in this mode since there's no fixed box to fit into. */
.atomicpro-gallery-slider[data-ratio="auto"] .atomicpro-gallery-slider__main {
	aspect-ratio: auto !important;
}

.atomicpro-gallery-slider[data-ratio="auto"] .atomicpro-gallery-slider__slide {
	position: static !important;
	opacity: 1 !important;
	visibility: visible !important;
	display: none !important;
	transition: none !important;
}

.atomicpro-gallery-slider[data-ratio="auto"] .atomicpro-gallery-slider__slide.is-active {
	display: block !important;
}

.atomicpro-gallery-slider[data-ratio="auto"] .atomicpro-gallery-slider__image {
	height: auto !important;
	object-fit: initial !important;
}

.atomicpro-gallery-slider__image {
	cursor: default;
}

.atomicpro-gallery-slider[data-lightbox="1"] .atomicpro-gallery-slider__image {
	cursor: zoom-in;
}

.atomicpro-gallery-slider__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: var(--atomicpro-bg);
	color: var(--atomicpro-primary);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	line-height: 1;
	padding: 0;
}

.atomicpro-gallery-slider__arrow:hover {
	background: var(--atomicpro-primary);
	color: #fff;
}

.atomicpro-gallery-slider__arrow--prev {
	left: 10px;
}

.atomicpro-gallery-slider__arrow--next {
	right: 10px;
}

/* Thumbnails — the "grid-to-slider" hybrid strip */
.atomicpro-gallery-slider__thumbs {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 64px;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: thin;
	padding-bottom: 2px;
}

.atomicpro-gallery-slider__thumb {
	width: 64px;
	height: 64px;
	padding: 0;
	border-radius: 6px;
	border: 2px solid transparent;
	background: var(--atomicpro-bg);
	overflow: hidden;
	cursor: pointer;
	flex-shrink: 0;
}

.atomicpro-gallery-slider__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.atomicpro-gallery-slider__thumb.is-active,
.atomicpro-gallery-slider__thumb:hover {
	border-color: var(--atomicpro-primary);
}

/*
 * Thumbnail position — desktop / tablet / mobile, fully independent.
 * Breakpoints match common defaults: mobile ≤767px, tablet 768–1024px,
 * desktop ≥1025px. Server-side, "inherit" is already resolved to a concrete
 * value before this HTML is rendered, so every data-thumbs-* attribute
 * below always holds one of: bottom, left, right, none — never "inherit" —
 * which is what makes these plain, unambiguous overrides.
 */

/* Desktop is the base — applies at all widths unless a narrower breakpoint
   below explicitly overrides it. */
.atomicpro-gallery-slider[data-thumbs-desktop="left"],
.atomicpro-gallery-slider[data-thumbs-desktop="right"] {
	flex-direction: row !important;
	align-items: stretch !important;
}

.atomicpro-gallery-slider[data-thumbs-desktop="left"] .atomicpro-gallery-slider__main {
	order: 2 !important;
}

.atomicpro-gallery-slider[data-thumbs-desktop="left"] .atomicpro-gallery-slider__thumbs,
.atomicpro-gallery-slider[data-thumbs-desktop="right"] .atomicpro-gallery-slider__thumbs {
	grid-auto-flow: row !important;
	grid-auto-columns: unset !important;
	grid-auto-rows: 64px !important;
	min-height: 0 !important;
	overflow-y: auto !important;
	overflow-x: hidden !important;
	flex: 0 0 76px !important;
}

.atomicpro-gallery-slider[data-thumbs-desktop="left"] .atomicpro-gallery-slider__main,
.atomicpro-gallery-slider[data-thumbs-desktop="right"] .atomicpro-gallery-slider__main {
	flex: 1 1 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	align-self: flex-start !important;
}

.atomicpro-gallery-slider[data-thumbs-desktop="none"] .atomicpro-gallery-slider__thumbs {
	display: none !important;
}

/* Tablet override — only kicks in at ≤1024px, and fully resets whatever
   the desktop rules above did (row/column, order, display) rather than
   just adding to it, so any desktop value can be overridden cleanly. */
@media (max-width: 1024px) {
	.atomicpro-gallery-slider[data-thumbs-tablet="bottom"] {
		flex-direction: column !important;
	}
	.atomicpro-gallery-slider[data-thumbs-tablet="bottom"] .atomicpro-gallery-slider__main {
		order: initial !important;
	}
	.atomicpro-gallery-slider[data-thumbs-tablet="bottom"] .atomicpro-gallery-slider__thumbs {
		display: grid !important;
		grid-auto-flow: column !important;
		grid-auto-columns: 64px !important;
		grid-auto-rows: unset !important;
		max-height: none !important;
		overflow-y: visible !important;
		overflow-x: auto !important;
		flex: initial !important;
	}

	.atomicpro-gallery-slider[data-thumbs-tablet="left"],
	.atomicpro-gallery-slider[data-thumbs-tablet="right"] {
		flex-direction: row !important;
		align-items: stretch !important;
	}
	.atomicpro-gallery-slider[data-thumbs-tablet="left"] .atomicpro-gallery-slider__main {
		order: 2 !important;
	}
	.atomicpro-gallery-slider[data-thumbs-tablet="right"] .atomicpro-gallery-slider__main {
		order: initial !important;
	}
	.atomicpro-gallery-slider[data-thumbs-tablet="left"] .atomicpro-gallery-slider__thumbs,
	.atomicpro-gallery-slider[data-thumbs-tablet="right"] .atomicpro-gallery-slider__thumbs {
		display: grid !important;
		grid-auto-flow: row !important;
		grid-auto-columns: unset !important;
		grid-auto-rows: 64px !important;
		min-height: 0 !important;
		overflow-y: auto !important;
		overflow-x: hidden !important;
		flex: 0 0 76px !important;
	}
	.atomicpro-gallery-slider[data-thumbs-tablet="left"] .atomicpro-gallery-slider__main,
	.atomicpro-gallery-slider[data-thumbs-tablet="right"] .atomicpro-gallery-slider__main {
		flex: 1 1 0 !important;
		min-width: 0 !important;
		min-height: 0 !important;
		align-self: flex-start !important;
	}

	.atomicpro-gallery-slider[data-thumbs-tablet="none"] .atomicpro-gallery-slider__thumbs {
		display: none !important;
	}
}

/* Mobile override — ≤767px, same full-reset pattern as tablet above. */
@media (max-width: 767px) {
	.atomicpro-gallery-slider[data-thumbs-mobile="bottom"] {
		flex-direction: column !important;
	}
	.atomicpro-gallery-slider[data-thumbs-mobile="bottom"] .atomicpro-gallery-slider__main {
		order: initial !important;
	}
	.atomicpro-gallery-slider[data-thumbs-mobile="bottom"] .atomicpro-gallery-slider__thumbs {
		display: grid !important;
		grid-auto-flow: column !important;
		grid-auto-columns: 64px !important;
		grid-auto-rows: unset !important;
		max-height: none !important;
		overflow-y: visible !important;
		overflow-x: auto !important;
		flex: initial !important;
	}

	.atomicpro-gallery-slider[data-thumbs-mobile="left"],
	.atomicpro-gallery-slider[data-thumbs-mobile="right"] {
		flex-direction: row !important;
		align-items: stretch !important;
	}
	.atomicpro-gallery-slider[data-thumbs-mobile="left"] .atomicpro-gallery-slider__main {
		order: 2 !important;
	}
	.atomicpro-gallery-slider[data-thumbs-mobile="right"] .atomicpro-gallery-slider__main {
		order: initial !important;
	}
	.atomicpro-gallery-slider[data-thumbs-mobile="left"] .atomicpro-gallery-slider__thumbs,
	.atomicpro-gallery-slider[data-thumbs-mobile="right"] .atomicpro-gallery-slider__thumbs {
		display: grid !important;
		grid-auto-flow: row !important;
		grid-auto-columns: unset !important;
		grid-auto-rows: 64px !important;
		min-height: 0 !important;
		overflow-y: auto !important;
		overflow-x: hidden !important;
		flex: 0 0 76px !important;
	}
	.atomicpro-gallery-slider[data-thumbs-mobile="left"] .atomicpro-gallery-slider__main,
	.atomicpro-gallery-slider[data-thumbs-mobile="right"] .atomicpro-gallery-slider__main {
		flex: 1 1 0 !important;
		min-width: 0 !important;
		min-height: 0 !important;
		align-self: flex-start !important;
	}

	.atomicpro-gallery-slider[data-thumbs-mobile="none"] .atomicpro-gallery-slider__thumbs {
		display: none !important;
	}
}

.atomicpro-gallery-slider__empty {
	padding: 24px;
	text-align: center;
	border: 1px dashed var(--atomicpro-border);
	border-radius: 8px;
	color: #666;
	margin: 0;
}

/* Lightbox */
.atomicpro-gallery-slider__lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(0, 0, 0, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.atomicpro-gallery-slider__lightbox[hidden] {
	display: none;
}

.atomicpro-gallery-slider__lightbox-image {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	cursor: zoom-out;
}

.atomicpro-gallery-slider__lightbox-close {
	position: absolute;
	top: 16px;
	right: 24px;
	background: transparent;
	border: none;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
	.atomicpro-gallery-slider__slide {
		transition: none;
	}
}