/* ===================================
   GALERIE AVANT / APRÈS
   Section de transformations patients
   =================================== */

/* ========== SECTION ========== */
.before-after-gallery {
  background: #FFFFFF;
  padding: 48px 8% 48px !important;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.before-after-gallery .container-width {
  padding: 0 !important;
}

/* ========== GRID LAYOUT ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin: 50px 0 40px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ========== GALLERY CARD ========== */
.gallery-card {
  position: relative;
  background: #F9F4ED;
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.1);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.06),
    0 16px 40px rgba(0, 0, 0, 0.14);
}

/* ========== BEST OFFER RIBBON (FOMO) ========== */
.best-offer-ribbon {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 20;
  background: linear-gradient(135deg, #ff0844 0%, #ff4545 100%);
  color: #FFFFFF;
  padding: 8px 30px 8px 15px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 
    0 4px 15px rgba(255, 8, 68, 0.5),
    0 2px 8px rgba(0, 0, 0, 0.3);
  transform-origin: top right;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 15px 100%);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 
      0 4px 15px rgba(255, 8, 68, 0.5),
      0 2px 8px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 
      0 6px 25px rgba(255, 8, 68, 0.7),
      0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

/* ========== TREATMENT BADGE ========== */
.treatment-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  color: #B89051;
  background: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(184, 144, 81, 0.2);
  border: 1px solid rgba(184, 144, 81, 0.3);
}

/* Tous les badges ont le même style maintenant */
.invisalign-badge,
.veneers-badge,
.whitening-badge,
.implants-badge,
.smile-badge,
.complete-badge,
.diastema-badge,
.filling-badge,
.prevention-badge,
.emergency-badge {
  background: #FFFFFF;
  color: #B89051;
}

/* ========== RESULT CONTAINER (RÉSULTAT FINAL UNIQUEMENT) ========== */
.result-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #F9F4ED;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
}

/* Service Icon SVG Styles */
.service-icon {
  width: 65%;
  height: 65%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Premium Service Images Styling - GOLD TINT */
.service-image-premium {
  width: 60%;
  height: 60%;
  object-fit: contain;
  filter:
    sepia(0.35)
    saturate(1.4)
    brightness(1.12)
    contrast(1.15)
    hue-rotate(-8deg)
    drop-shadow(0 8px 24px rgba(184, 144, 81, 0.4));
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0;
}

/* Classe spéciale pour le logo Invisalign - plus petit pour voir tout le texte */
.invisalign-logo {
  width: auto !important;
  height: auto !important;
  max-width: 50% !important;
  max-height: 50% !important;
  filter: none !important;
  object-fit: contain !important;
}

.gallery-card:hover .invisalign-logo {
  filter: none !important;
  transform: scale(1.05);
}

.gallery-card:hover .service-image-premium {
  filter:
    sepia(0.45)
    saturate(1.5)
    brightness(1.15)
    contrast(1.18)
    hue-rotate(-10deg)
    drop-shadow(0 12px 36px rgba(184, 144, 81, 0.6));
  transform: scale(1.08);
}

/* Effet hover - zoom léger (sauf pour les images premium qui ont leur propre style) */
.gallery-card:hover .result-container img:not(.service-image-premium) {
  transform: scale(1.08);
}

.gallery-card:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Overlay doré subtil au hover */
.result-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(184, 144, 81, 0.15) 0%, rgba(184, 144, 81, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gallery-card:hover .result-container::after {
  opacity: 1;
}

/* Overlay doré plus intense pour les images premium */
.result-container:has(.service-image-premium)::after {
  background: linear-gradient(135deg, rgba(184, 144, 81, 0.25) 0%, rgba(184, 144, 81, 0.12) 50%, rgba(249, 244, 237, 0.1) 100%);
}

.gallery-card:hover .result-container:has(.service-image-premium)::after {
  opacity: 0.85;
}

/* ========== GALLERY CAPTION ========== */
.gallery-caption {
  padding: 20px;
  text-align: center;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.gallery-caption p {
  margin: 0 0 14px 0;
  font-size: 0.9375rem;
  color: #4a5568;
  line-height: 1.6;
  flex-grow: 1;
}

.gallery-caption strong {
  color: #1a1a1a;
  font-weight: 600;
}

/* ========== RESULT CTA BUTTON ========== */
.result-cta {
  display: inline-block;
  padding: 10px 22px;
  background: #FFFFFF;
  color: #B89051;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(184, 144, 81, 0.15);
  letter-spacing: 0.3px;
  border: 2px solid #B89051;
}

.result-cta:hover {
  background: #B89051;
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(184, 144, 81, 0.3);
  transform: translateY(-2px);
}

/* ========== DISCLAIMER ========== */
.gallery-disclaimer {
  max-width: 800px;
  margin: 30px auto 30px;
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
  font-style: italic;
  line-height: 1.6;
}

/* ========== GALLERY CTA ========== */
.gallery-cta {
  text-align: center;
  margin-top: 40px;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-card {
  animation: fadeInUp 0.6s ease-out both;
}

.gallery-card:nth-child(1) { animation-delay: 0.1s; }
.gallery-card:nth-child(2) { animation-delay: 0.2s; }
.gallery-card:nth-child(3) { animation-delay: 0.3s; }
.gallery-card:nth-child(4) { animation-delay: 0.4s; }
.gallery-card:nth-child(5) { animation-delay: 0.5s; }
.gallery-card:nth-child(6) { animation-delay: 0.6s; }

/* ========== RESPONSIVE TABLET ========== */
@media (max-width: 1024px) {
  .before-after-gallery {
    padding: 40px 6% 40px !important;
  }
  
  .before-after-gallery .container-width {
    padding: 0 !important;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .gallery-card:nth-child(5),
  .gallery-card:nth-child(6) {
    animation-delay: 0.4s;
  }
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 768px) {
  .before-after-gallery {
    padding: 32px 5% 32px !important;
  }
  
  .before-after-gallery .container-width {
    padding: 0 !important;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 30px 0 20px;
  }

  .gallery-card {
    border-radius: 16px;
  }

  .treatment-badge {
    top: 12px;
    left: 12px;
    padding: 6px 14px;
    font-size: 0.8125rem;
  }

  .result-container {
    aspect-ratio: 4/3;
  }

  .service-icon {
    width: 60%;
    height: 60%;
  }

  .gallery-caption {
    padding: 16px;
  }

  .gallery-caption p {
    font-size: 0.875rem;
  }

  .gallery-disclaimer {
    font-size: 0.8125rem;
    margin: 20px auto 20px;
  }

  .gallery-cta {
    margin-top: 30px;
  }

  /* Simplify animations on mobile */
  .gallery-card {
    animation-delay: 0s !important;
  }
}

/* ========== HOVER EFFECTS (DESKTOP ONLY) ========== */
@media (min-width: 769px) {
  .gallery-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(184, 144, 81, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
    border-radius: 20px;
  }

  .gallery-card:hover::before {
    opacity: 1;
  }
}
