/**
 * testimonials-carousel.css — Carrousel Horizontal & Visionneuse de Captures WhatsApp
 * 
 * - Cartes smartphone réalistes (ratio 1:2) avec bordures polies et ombres douces profondes
 * - Responsive : 1 capture sur mobile, 2 sur tablette, 3 sur desktop
 * - Effet de profondeur : échelle 1.0 (carte centrale) vs 0.94 (cartes adjacentes)
 * - Lightbox plein écran accessible pour lecture agrandie et zoom
 * - Respect strict de prefers-reduced-motion
 */

/* ==========================================================================
   1. SECTION & EN-TÊTE
   ========================================================================== */
.testimonials-section {
  position: relative;
  padding: clamp(48px, 6vw, 76px) 0;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  border-bottom: 1px solid #E2E8F0;
  overflow: hidden;
}

.testimonials-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto clamp(28px, 4vw, 44px) auto;
  padding: 0 16px;
}

.testimonials-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.12);
  color: #B45309;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.testimonials-title {
  font-family: var(--font-family-heading);
  font-size: clamp(1.45rem, 3.2vw, 2.15rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 10px;
}

.testimonials-subtitle {
  font-size: clamp(0.92rem, 1.8vw, 1.05rem);
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

/* ==========================================================================
   2. CONTENEUR & PISTE DU CARROUSEL
   ========================================================================== */
.testimonials-carousel-wrap {
  position: relative;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 0 24px 0;
}

.testimonials-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 24px 0 32px 0;
  cursor: grab;
  user-select: none;
  touch-action: pan-y pinch-zoom;
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.testimonials-viewport:active {
  cursor: grabbing;
}

.testimonials-track {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
  will-change: transform;
  width: max-content;
  transition: none;
}

.testimonials-track.is-animated-jump {
  transition: transform 0.4s var(--ease-out-smooth) !important;
}

/* ==========================================================================
   3. CARTES SMARTPHONE (CAPTURES WHATSAPP)
   ========================================================================== */
.testimonial-card-item {
  flex: 0 0 clamp(260px, 75vw, 310px);
  width: clamp(260px, 75vw, 310px);
  position: relative;
  border-radius: 20px;
  padding: 6px;
  background: #FFFFFF;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow-device);
  transform: scale(0.98);
  opacity: 0.95;
  transition: transform 0.3s var(--ease-out-smooth),
              box-shadow 0.3s var(--ease-out-smooth),
              border-color 0.3s ease,
              opacity 0.3s ease;
  cursor: pointer;
  outline: none;
}

.testimonial-card-item:focus-visible {
  border-color: var(--color-word);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25), var(--shadow-device);
}

/* Carte en survol / active */
.testimonial-card-item:hover,
.testimonial-card-item.is-active {
  transform: scale(1.02) translateY(-4px);
  opacity: 1;
  box-shadow: var(--shadow-device-active);
  border-color: rgba(37, 99, 235, 0.35);
}

/* Châssis écran mobile intérieur */
.testimonial-screen-frame {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #0B141A; /* Fond sombre WhatsApp */
  aspect-ratio: 512 / 1024;
}

.testimonial-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.35s ease;
}

.testimonial-card-item:hover .testimonial-img {
  transform: scale(1.015);
}

/* Badge d'aide à l'agrandissement (discret) */
.testimonial-zoom-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.78);
  color: #FFFFFF;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
  backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.testimonial-card-item:hover .testimonial-zoom-hint {
  opacity: 1;
  background: rgba(15, 23, 42, 0.9);
}

/* ==========================================================================
   4. CONTRÔLES : FLÈCHES DESKTOP & PUCES DE NAVIGATION
   ========================================================================== */
.testimonials-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.testimonials-nav-btn:hover {
  background: var(--bg-surface);
  color: var(--color-word);
  border-color: var(--border-word);
  box-shadow: var(--shadow-lg);
  transform: translateY(-50%) scale(1.06);
}

.testimonials-nav-btn:active {
  transform: translateY(-50%) scale(0.96);
}

.testimonials-nav-btn:focus-visible {
  outline: 2px solid var(--color-word);
  outline-offset: 2px;
}

.testimonials-prev {
  left: 12px;
}

.testimonials-next {
  right: 12px;
}

/* Masquer les flèches sur petits mobiles pour laisser la place au swipe */
@media (max-width: 640px) {
  .testimonials-nav-btn {
    display: none;
  }
}

/* Puces de position (Dots) */
.testimonials-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.testimonials-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  background: #CBD5E1;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-smooth);
}

.testimonials-dot:hover {
  background: #94A3B8;
}

.testimonials-dot.is-active {
  width: 26px;
  background: var(--color-word);
  border-radius: 5px;
}

.testimonials-dot:focus-visible {
  outline: 2px solid var(--color-word);
  outline-offset: 2px;
}

/* ==========================================================================
   5. MODALE LIGHTBOX (AGRANDISSEMENT DES CAPTURES)
   ========================================================================== */
.testimonial-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.testimonial-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content-wrap {
  position: relative;
  max-width: min(92vw, 440px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.92);
  transition: transform 0.28s var(--ease-out-smooth);
}

.testimonial-lightbox.is-open .lightbox-content-wrap {
  transform: scale(1);
}

.lightbox-image-container {
  width: 100%;
  max-height: 86vh;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.5);
  background: #000000;
}

.lightbox-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 86vh;
  object-fit: contain;
}

.lightbox-close-btn {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #FFFFFF;
  color: #0F172A;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.lightbox-close-btn:hover {
  background: #F1F5F9;
  transform: scale(1.1);
}

.lightbox-close-btn:active {
  transform: scale(0.95);
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #0F172A;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: all 0.2s ease;
}

.lightbox-nav-btn:hover {
  background: #FFFFFF;
  transform: translateY(-50%) scale(1.08);
}

.lightbox-prev-btn {
  left: -56px;
}

.lightbox-next-btn {
  right: -56px;
}

@media (max-width: 600px) {
  .lightbox-prev-btn {
    left: 8px;
  }
  .lightbox-next-btn {
    right: 8px;
  }
  .lightbox-close-btn {
    top: 8px;
    right: 8px;
  }
}

/* ==========================================================================
   6. RESPECT DE PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .testimonials-track,
  .testimonial-card-item,
  .testimonial-img,
  .testimonials-nav-btn,
  .testimonials-dot,
  .testimonial-lightbox,
  .lightbox-content-wrap {
    transition: none !important;
    transform: none !important;
  }
  
  .testimonial-card-item {
    opacity: 1 !important;
  }
}
