/* Projets Section */
.projets-section {
  padding: clamp(60px, 8vw, 100px) clamp(24px, 5vw, 80px);
  background: #ffffff;
}

.projets-container {
  max-width: 1400px;
  margin: 0 auto;
}

.projets-heading {
  font-family: 'Poppins', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  margin: 0 0 60px 0;
  color: #1f2937;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.projets-carousel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 40px;
}

.projets-wrapper {
  overflow: hidden;
  width: 100%;
  padding: 50px 20px; /* Padding pour laisser place aux ombres partout */
  margin: -50px -20px; /* Compenser pour ne pas décaler le layout */
  touch-action: pan-y pinch-zoom;
}

.projets-track {
  display: flex;
  gap: 24px;
  width: 100%;
  transition: transform 0.4s ease;
  touch-action: pan-x pan-y;
}

.projets-track.centered {
  width: 100%;
  justify-content: center;
}

.projet-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  flex: 0 0 calc((100% - 48px) / 3);
  min-width: 0;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.1));
}

/* Ajuster la largeur des cartes quand peu de cartes */
.projets-track.centered .projet-card {
  flex: 0 0 calc((100% - 48px) / 3);
}

.projet-card:hover {
  transform: translateY(-8px);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.15));
}

.projet-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.projet-card:hover .projet-image {
  transform: scale(1.05);
}

.projet-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.projet-card:hover .projet-overlay {
  transform: translateY(0);
}

.projet-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.projet-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  font-weight: 400;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8163d1 100%);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  pointer-events: auto;
}

.carousel-btn:hover {
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.carousel-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-btn-prev {
  left: -60px;
}

.carousel-btn-next {
  right: -60px;
}

.carousel-btn svg {
  width: 24px;
  height: 24px;
}

.carousel-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-btn:disabled:hover {
  transform: translateY(-50%) scale(1);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  min-height: 20px;
  align-items: center;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carousel-dot.active {
  background: linear-gradient(135deg, #3b82f6 0%, #8163d1 100%);
  width: 32px;
  border-radius: 6px;
}

.carousel-dot:hover {
  background: #9ca3af;
}

.carousel-dot.active:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #8163d1 100%);
}

/* Boutons mobiles */
.carousel-btn-mobile {
  display: none;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8163d1 100%);
  color: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.carousel-btn-mobile:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.carousel-btn-mobile:active {
  transform: scale(0.95);
}

.carousel-btn-mobile svg {
  width: 24px;
  height: 24px;
}

.carousel-btn-mobile:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.carousel-btn-mobile:disabled:hover {
  transform: scale(1);
}

.carousel-mobile-controls {
  display: none;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

/* Responsive */
@media (max-width: 1200px) {
  .carousel-btn-prev {
    left: -24px;
  }
  
  .carousel-btn-next {
    right: -24px;
  }
}

@media (max-width: 1024px) {
  .projet-card {
    flex: 0 0 calc((100% - 20px) / 2);
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
  }

  .carousel-btn svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 768px) {
  .projets-section {
    padding: clamp(40px, 6vw, 60px) clamp(16px, 4vw, 24px);
  }

  .projets-heading {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 40px;
  }

  .projets-carousel {
    padding: 0;
    gap: 0;
  }
  
  /* Masquer les boutons et dots desktop */
  .carousel-btn {
    display: none !important;
  }
  
  .carousel-dots {
    display: none !important;
  }
  
  /* Afficher les boutons mobiles */
  .carousel-btn-mobile {
    display: flex;
  }
  
  .carousel-mobile-controls {
    display: flex;
  }

  .projets-wrapper {
    overflow: hidden;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 25px 16px;
  }

  .projets-track {
    gap: 16px;
  }

  .projet-card {
    flex: 0 0 calc(100vw - 32px);
  }

  .projet-overlay {
    padding: 20px;
  }

  .projet-title {
    font-size: 1.1rem;
  }

  .projet-subtitle {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .projets-section {
    padding: 32px 16px;
  }

  .projets-heading {
    font-size: 1.6rem;
    margin-bottom: 55px;
  }

  .projets-carousel {
    padding: 0 0px;
  }

  .carousel-btn {
    width: 36px;
    height: 36px;
  }

  .carousel-btn svg {
    width: 18px;
    height: 18px;
  }

  .projet-overlay {
    padding: 16px;
  }

  .projet-title {
    font-size: 1rem;
  }

  .projet-subtitle {
    font-size: 0.85rem;
  }
}
