/**
 * Services Gallery — Elementor widget (desktop + mobile).
 *
 * @package UPIX
 */

.services-gallery {
	--sg-text: #f5f5f5;
	--sg-muted: rgba(245, 245, 245, 0.55);
	--sg-accent: #ffffff;
	--sg-radius: 4px;
	position: relative;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
	color: var(--sg-text);
	font-family: "Satoshi", "Helvetica Neue", Helvetica, Arial, sans-serif;
	border-radius: 35px;

}

.services-gallery__inner {
	position: relative;
	min-height: min(72vh, 820px);
}

.sg-slide {
	position: absolute;
	inset: 0;
	box-sizing: border-box;
	padding: clamp(1.75rem, 5vw, 4.5rem) clamp(1.25rem, 4vw, 4rem);
	background-color: var(--sg-slide-color, #0a0a0a);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.6s ease;
	will-change: opacity;
	border-radius: 35px;
}

.sg-slide.is-active {
	opacity: 1;
	pointer-events: auto;
	z-index: 1;
}

.sg-slide__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	grid-template-rows: auto 1fr;
	gap: clamp(1.25rem, 3vw, 2.5rem) clamp(1.5rem, 4vw, 3rem);
	align-items: start;
	height: 100%;
}

.sg-slide__top {
    grid-column: 1;
    grid-row: 1;
    padding: 50px 50px 10px;
}

.sg-slide__bottom {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    padding: 0 50px 50px;
}

.sg-slide__right {
	grid-column: 2;
	grid-row: 1 / span 2;
	align-self: stretch;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
}

.sg-title {
	margin: 0 0 0.75rem;
	font-family: "Clash Display", "Satoshi", Georgia, serif;
	font-size: clamp(2rem, 4.5vw, 3.75rem);
	font-weight: 600;
	line-height: 1.05;
	letter-spacing: -0.02em;
	color: var(--sg-accent);
}

.sg-subtitle {
	margin: 0;
	max-width: 36ch;
	font-size: clamp(0.95rem, 1.35vw, 1.125rem);
	line-height: 1.55;
	color: var(--sg-muted);
}

.sg-services {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sg-service {
	box-sizing: border-box;
	border-style: solid;
	border-color: rgba(255, 255, 255, 0.12);
	border-width: 0 0 1px 0;
}

.sg-service:last-child {
	border-bottom-width: 0;
}

.sg-service__trigger {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	padding: 1.1rem 0;
	margin: 0;
	border: none;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: inherit;
	cursor: pointer;
	transition: color 0.25s ease, opacity 0.25s ease;
	cursor: pointer !important;
}

.sg-service-name {
	font-size: clamp(1.05rem, 1.6vw, 1.35rem);
	font-weight: 500;
	letter-spacing: 0.01em;
}

.sg-service.is-active .sg-service-name {
	color: var(--sg-accent);
}

.sg-service:not(.is-active) .sg-service__trigger {
	color: var(--sg-muted);
}

.sg-service:not(.is-active) .sg-service__trigger:hover,
.sg-service:not(.is-active) .sg-service__trigger:focus-visible {
	color: var(--sg-text);
}

/* Text block under each service name (visible on desktop + inside mobile accordion) */
.sg-service-detail {
	box-sizing: border-box;
}

.sg-desc {
	margin: 0;
	padding: 0;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--sg-muted);
}

.sg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.65rem 1.35rem;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: var(--sg-radius);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--sg-accent);
	transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.sg-btn:hover,
.sg-btn:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.55);
}

.sg-image-wrap {
    position: relative;
    width: 100%;
    height: 100%;
	padding-top: 50px;
    margin-inline: auto;
    overflow: hidden;
    border-radius: 2px;
}

.sg-image {
    display: block;
    width: 100%;
    height: 100% !important;
    object-fit: contain;
    object-position: bottom center;
    transition: opacity 0.45s ease;
    will-change: opacity;
}

.sg-image.is-fading {
	opacity: 0;
}

.sg-image--placeholder {
	background: rgba(255, 255, 255, 0.06);
	min-height: 280px;
}

/* Desktop: show description under each service; CTA hidden (navigation = row click) */
@media (min-width: 769px) {
	.sg-service-detail {
		display: block;
		padding: 0 0 10px;
	}

	.sg-service-detail .sg-btn {
		display: none;
	}

	.sg-service.is-active .sg-service__trigger {
		cursor: default;
	}
}

/* Mobile: accordion + image stack */
@media (max-width: 768px) {
	.services-gallery__inner {
		min-height:  unset !important;

	}

	.sg-slide {
		position: relative;
		inset: auto;
		opacity: 1;
		pointer-events: auto;
		padding: 1.5rem 1.25rem 5.5rem;
		border-radius: 15px;
	}

	.sg-slide:not(.is-active) {
		display: none;
	}

	.sg-slide__grid {
		grid-template-columns: 1fr;
		grid-template-rows: auto auto auto;
		gap: 1.25rem;
	}

	.sg-slide__top {
		grid-column: 1;
		grid-row: 1;
		padding: 45px 30px 0px;
	}

	.sg-slide__right {
		grid-column: 1;
		grid-row: 2;
	}

	.sg-slide__bottom {
		grid-column: 1;
		grid-row: 3;
		padding: 0 30px 40px;
	}

	.sg-title {
		text-align: center;
	}

	.sg-subtitle {
		text-align: center;
	}

	.sg-image-wrap {
		max-width: 100%;
		height: 250px;
		margin-bottom: 0px;
		padding-top: 0;
	}

	.sg-service-detail {
		display: none;
		padding: 0;
	}

	.sg-service.open .sg-service-detail {
		display: block;
	}

	.sg-service-detail .sg-btn {
		display: inline-flex;
        margin-bottom: 20px;
	}

	.sg-service.is-active .sg-service-name {
		color: var(--sg-accent);
	}
}

/* Pagination: arrows | dots | counter */
.sg-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 20px;
	margin-top: 0;
	box-sizing: border-box;
}

.sg-pagination__arrows {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.sg-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 50%;
	background: transparent;
	color: var(--sg-accent);
	cursor: pointer;
	transition: background 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

.sg-arrow:hover,
.sg-arrow:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.45);
}

.sg-arrow:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.sg-arrow__icon {
	display: block;
	width: 0.55rem;
	height: 0.55rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
}

.sg-arrow--prev .sg-arrow__icon {
	transform: rotate(135deg);
}

.sg-pagination__dots {
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
}

.sg-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.25);
	cursor: pointer;
	transition: background 0.25s ease, transform 0.25s ease;
}

.sg-dot:hover,
.sg-dot:focus-visible {
	background: rgba(255, 255, 255, 0.5);
}

.sg-dot.is-active {
	background: var(--sg-accent);
	transform: scale(1.15);
}

.sg-pagination__counter {
	font-variant-numeric: tabular-nums;
	font-size: 0.8125rem;
	letter-spacing: 0.08em;
	color: var(--sg-muted);
	white-space: nowrap;
}

.sg-counter-sep {
	margin: 0 0.2em;
	opacity: 0.6;
}

/* RTL: keep arrow glyphs logical */
[dir="rtl"] .sg-arrow--prev .sg-arrow__icon {
	transform: rotate(-45deg);
}

[dir="rtl"] .sg-arrow--next .sg-arrow__icon {
	transform: rotate(135deg);
}


@media (max-width: 768px) {

	.services-gallery {
		position: relative;
		padding-bottom: 0;
		border-radius: 15px;
	}
}
