/* Stage */
.gs-stage {
  --gs-bg: #EFECE5;
  --gs-fg: #0b0b0b;
  --gs-perspective: 1800px;
  --gs-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  width: 100%;
  height: 75vh;
  max-height: 700px;
  margin-bottom: 9rem;
  background: var(--gs-bg);
  color: var(--gs-fg);
  overflow: hidden;
  perspective: var(--gs-perspective);
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
@media (max-width: 900px) {
  .gs-stage {
    height: calc(52vw * 5 / 4 + 20px) !important;
    max-height: none !important;
    margin-bottom: 5rem;
    overflow: visible;
  }
  .gs-card {
    width: 52vw !important;
    contain: none !important;
  }
}
@media (max-width: 500px) {
  .gs-stage {
    height: calc(60vw * 5 / 4 + 20px) !important;
    max-height: none !important;
    margin-bottom: 5rem;
    overflow: visible;
  }
  .gs-card {
    width: 60vw !important;
    contain: none !important;
  }
}

/* Loader overlay */
.gs-loader {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #EFECE5;
  transition: opacity 0.2s var(--gs-ease), visibility 0.2s linear;
}
.gs-loader--hide {
  opacity: 0;
  visibility: hidden;
}
.gs-loader__content {
  display: grid;
  gap: 12px;
  justify-items: center;
  min-width: 220px;
}
.gs-loader__ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #ddd;
  border-top-color: #333;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Background canvas — masqué, fond uni creme */
#gs-bg {
  display: none;
}

/* Only block native scrolling/gestures in carousel mode */
.gs-stage.carousel-mode {
  touch-action: none;
  cursor: grab;
}
.gs-stage.carousel-mode.dragging {
  cursor: grabbing;
}

/* Cards container */
.gs-cards {
  position: absolute;
  inset: 0;
  z-index: 10;
  transform-style: preserve-3d;
}

/* Card */
.gs-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(26vw, 360px);
  aspect-ratio: 4/5;
  isolation: isolate;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, filter;
  transform-origin: 90% center;
  contain: layout paint;
  border-radius: 15px;
  overflow: hidden; /* force le respect du border-radius avec les transforms GPU */
}

.gs-card__img {
  border-radius: 0;
  opacity: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  transition: transform .5s cubic-bezier(0.22, 1, 0.36, 1);
}
.gs-card--active {
  box-shadow: 0 30px 80px rgba(0,0,0,.18), 0 8px 24px rgba(0,0,0,.10);
}
.gs-card--active .gs-card__img {
  transform: translateZ(0) scale(1.03);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .gs-card {
    transition: none !important;
    animation: none !important;
  }
}
