/**
 * Services Grid/Carousel — styles frontend
 * Design fidèle à la maquette : cartes claires, média lavande, flèche bas-gauche, nav bas-droite.
 */

.sgc-wrapper {
	--sgc-gap: 20px;
	position: relative;
	width: 100%;
	box-sizing: border-box;
	background-color: #ffffff;
}

.sgc-wrapper *,
.sgc-wrapper *::before,
.sgc-wrapper *::after {
	box-sizing: border-box;
}

/* -------------------------------------------------------------------------
   Grille statique (items <= colonnes visibles)
   ------------------------------------------------------------------------- */
.sgc-grid {
	display: grid;
	grid-template-columns: repeat(var(--sgc-cols, 5), minmax(0, 1fr));
	gap: var(--sgc-gap, 20px);
	width: 100%;
}

.sgc-wrapper.is-carousel .sgc-grid {
	display: none;
}

.sgc-wrapper:not(.is-carousel) .sgc-nav {
	display: none !important;
}

@media (max-width: 1024px) {
	.sgc-grid {
		grid-template-columns: repeat(var(--sgc-cols-tablet, 3), minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.sgc-grid {
		grid-template-columns: repeat(var(--sgc-cols-mobile, 1), minmax(0, 1fr));
	}
}

/* -------------------------------------------------------------------------
   Carousel Swiper
   ------------------------------------------------------------------------- */
.sgc-swiper {
	display: block;
	width: 100%;
	overflow: hidden;
}

.sgc-swiper .swiper-slide {
	height: auto;
	display: flex;
}

.sgc-swiper .swiper-slide .sgc-card {
	width: 100%;
}

/* Gap simulé via padding des slides (Swiper spaceBetween gère aussi) */
.sgc-swiper {
	--sgc-gap: 20px;
}

/* -------------------------------------------------------------------------
   Carte service
   ------------------------------------------------------------------------- */
.sgc-card {
	display: flex;
	flex-direction: column;
	background-color: #ffffff;
	border: 1px solid #e5e5e5;
	border-radius: 20px;
	padding: 16px 16px 20px;
	height: 100%;
	min-width: 0;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sgc-card:hover {
	transform: translateY(-2px);
}

/* Zone image — conteneur de superposition (principale + hover) */
.sgc-card__media {
	position: relative;
	display: block;
	width: 100%;
	height: 220px;
	background-color: #f4f1fa;
	background-image: linear-gradient(145deg, #e4e0f5 0%, #f0ecf8 50%, #ede8f5 100%);
	border-radius: 14px;
	margin-bottom: 18px;
	overflow: hidden;
	flex-shrink: 0;
}

/* Les deux images occupent exactement le même espace (empilées, contain) */
.sgc-card__media > .sgc-card__image {
	position: absolute !important;
	top: 50% !important;
	left: 50% !important;
	right: auto !important;
	bottom: auto !important;
	display: block !important;
	width: 92% !important;
	height: 92% !important;
	max-width: 92% !important;
	max-height: 92% !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	transform: translate(-50%, -50%) !important;
	object-fit: contain !important;
	object-position: center center !important;
	transition: opacity 0.28s ease;
	pointer-events: none;
	visibility: visible !important;
}

.sgc-card__media > .sgc-card__image--main {
	opacity: 1 !important;
	z-index: 1;
}

.sgc-card__media > .sgc-card__image--hover {
	opacity: 0 !important;
	z-index: 2;
}

/* Crossfade au survol de la box (desktop uniquement) */
.sgc-card:hover .sgc-card__media--has-hover > .sgc-card__image--main,
.sgc-card:focus-within .sgc-card__media--has-hover > .sgc-card__image--main {
	opacity: 0 !important;
}

.sgc-card:hover .sgc-card__media--has-hover > .sgc-card__image--hover,
.sgc-card:focus-within .sgc-card__media--has-hover > .sgc-card__image--hover {
	opacity: 1 !important;
}

/* Pas de swap d'image sur tactile / coarse pointer */
@media (hover: none), (pointer: coarse) {
	.sgc-card__media > .sgc-card__image--main {
		opacity: 1 !important;
	}

	.sgc-card__media > .sgc-card__image--hover {
		opacity: 0 !important;
	}
}

.sgc-card__title {
	margin: 0 0 10px;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: #111111;
	letter-spacing: -0.01em;
}

.sgc-card__desc {
	margin: 0 0 16px;
	padding: 0;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.55;
	color: #666666;
	flex-grow: 1;
}

.sgc-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
	padding-top: 4px;
}

.sgc-card__arrow-shell {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	min-width: 88px;
	height: 46px;
	padding: 0 14px;
	background-color: #f3f3f3;
	border-radius: 0 999px 0 16px;
	transition: background-color 0.25s ease;
}

.sgc-card:hover .sgc-card__arrow-shell,
.sgc-card:focus-within .sgc-card__arrow-shell {
	background-color: #ececec;
}

.sgc-card__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #111111;
	text-decoration: none;
	line-height: 0;
	transition: color 0.2s ease, transform 0.2s ease, background-color 0.25s ease;
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	border-radius: 999px;
	background-color: #e8e8e8;
}

.sgc-card__arrow:hover {
	color: #555555;
	transform: translateX(3px);
	background-color: #e5e5e5;
}

.sgc-card__arrow--static {
	pointer-events: none;
}

/* Icônes CSS (indépendantes des SVG thème/Elementor) */
.sgc-icon {
	display: block !important;
	box-sizing: border-box;
	flex-shrink: 0;
	pointer-events: none;
	opacity: 1 !important;
	visibility: visible !important;
}

.sgc-icon--chevron-left,
.sgc-icon--chevron-right {
	width: 10px;
	height: 10px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	background: transparent !important;
}

.sgc-icon--chevron-left {
	transform: rotate(-135deg);
	margin-left: 3px;
}

.sgc-icon--chevron-right {
	transform: rotate(45deg);
	margin-right: 3px;
}

.sgc-icon--arrow {
	position: relative;
	width: 14px;
	height: 2px;
	background-color: currentColor;
	border: 0;
}

.sgc-icon--arrow::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 0;
	width: 7px;
	height: 7px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: translateY(-50%) rotate(45deg);
	box-sizing: border-box;
}

.sgc-card__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	background-color: #111111;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	border-radius: 6px;
	border: 1px solid transparent;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	white-space: nowrap;
}

.sgc-card__btn:hover {
	background-color: #333333;
	color: #ffffff;
}

/* -------------------------------------------------------------------------
   Navigation (dots + flèches) — alignée bas, flèches à droite comme maquette
   ------------------------------------------------------------------------- */
.sgc-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 28px;
	min-height: 40px;
}

.sgc-pagination {
	position: relative !important;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	width: auto !important;
	bottom: auto !important;
	left: auto !important;
	transform: none !important;
	flex: 1;
}

.sgc-pagination .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	margin: 0 !important;
	background-color: #cccccc;
	opacity: 1;
	border-radius: 50%;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.sgc-pagination .swiper-pagination-bullet-active {
	background-color: #333333;
	transform: scale(1.15);
}

.sgc-nav__arrows {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

.sgc-nav__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	background-color: #ffffff;
	border: 1px solid #dddddd;
	border-radius: 50%;
	color: #333333;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
	line-height: 0;
}

.sgc-nav__btn:hover {
	background-color: #f5f5f5;
	border-color: #bbbbbb;
}

.sgc-nav__btn:focus-visible {
	outline: 2px solid #333333;
	outline-offset: 2px;
}

.sgc-nav__btn.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

/* Éditeur Elementor : éviter les glitches de hauteur */
.elementor-editor-active .sgc-card {
	min-height: 0;
}
