/* Styles pour les images du carrousel MAX */

/* ========================================
   IMAGES DU CARROUSEL
   ======================================== */

/* Styles pour les images du carrousel */
.max-tile-image {
  width: 100%;
  height: 300px; /* Hauteur unifiée à 300px */
  min-height: 300px;
  max-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--max-space-3);
  border-radius: var(--max-border-radius-md);
  overflow: hidden;
  background: none;
  border: 2px solid rgba(255, 255, 255, 0.2);
  position: relative;
}

/* Images en mode responsive - exactement comme l'image */
.max-responsive-mode .max-tile-image {
  height: 240px;
  min-height: 240px;
  max-height: 240px;
  margin: 10px 0 15px 0;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Amélioration de l'uniformité des images */
.max-tile-image img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.max-tile-image.max-tile-no-image {
  background: none;
  border: none;
}

.max-product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform var(--max-transition-normal);
  /* Amélioration de l'uniformité des images */
  background: transparent;
  border-radius: inherit;
}

/* Images de produits en mode responsive */
.max-responsive-mode .max-product-img {
  width: auto;
  height: 100%;
  max-width: 90%;
  object-fit: contain;
}

.max-tile:hover .max-product-img {
  transform: scale(1.05);
}

.max-placeholder-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  opacity: 0.6;
}

.max-placeholder-icon svg {
  width: 80px;
  height: 80px;
}

/* Placeholder en mode responsive */
.max-responsive-mode .max-placeholder-icon {
  color: rgba(212, 175, 55, 0.7);
  opacity: 0.8;
}

.max-responsive-mode .max-placeholder-icon svg {
  width: 70px;
  height: 70px;
}

/* ========================================
   ANIMATION FADE AVERS/REVERS DES IMAGES
   ======================================== */

/* Conteneur pour l'animation de fade */
.max-tile-flip-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Face des pièces (avers et revers) */
.max-coin-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.8s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Avers (face visible par défaut) */
.max-coin-obverse {
  opacity: 1;
  z-index: 2;
}

/* Revers (face cachée par défaut) */
.max-coin-reverse {
  opacity: 0;
  z-index: 1;
}

/* Animation de fade au survol */
.max-tile-flip-container:hover .max-coin-obverse {
  opacity: 0;
}

.max-tile-flip-container:hover .max-coin-reverse {
  opacity: 1;
}

/* Animation de fade automatique (si activée) */
.max-tile-flip-container.max-auto-flip .max-coin-obverse {
  animation: fadeToReverse 8s ease-in-out infinite;
}

.max-tile-flip-container.max-auto-flip .max-coin-reverse {
  animation: fadeToObverse 8s ease-in-out infinite;
}

/* Keyframes pour l'animation automatique de fade */
@keyframes fadeToReverse {
  0%, 40% {
    opacity: 1;
  }
  50%, 90% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fadeToObverse {
  0%, 40% {
    opacity: 0;
  }
  50%, 90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Animation de fade pour les images sans flip */
.max-tile-image:not(.max-tile-flip-container) .max-product-img {
  opacity: 1;
  transition: opacity var(--max-transition-normal);
}

.max-tile-image:not(.max-tile-flip-container):hover .max-product-img {
  opacity: 0.8;
}

/* Styles pour les images dans les faces */
.max-coin-face .max-product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform var(--max-transition-normal);
  /* Amélioration de l'uniformité des images */
  background: transparent;
  border-radius: inherit;
}

.max-coin-face:hover .max-product-img {
  transform: scale(1.05);
}

/* Responsive pour les images */
@media (max-width: 1200px) {
  .max-tile-image {
    height: 220px; /* Hauteur pour tablettes */
    min-height: 220px;
    max-height: 220px;
  }
}

@media (max-width: 768px) {
  .max-tile-image {
    height: 180px; /* Hauteur responsive ajustée proportionnellement */
    min-height: 180px;
    max-height: 180px;
  }
  
  .max-placeholder-icon {
    font-size: 36px;
  }
}

@media (max-width: 480px) {
  .max-tile-image {
    height: 150px; /* Hauteur pour petits écrans */
    min-height: 150px;
    max-height: 150px;
  }
  
  .max-placeholder-icon {
    font-size: 28px;
  }
}

/* Thème dark par défaut - styles appliqués directement */
.max-tile-image {
  background: none;
  border-color: rgba(255, 255, 255, 0.1);
}

.max-tile-image.max-tile-no-image {
  background: none;
  border-color: rgba(255, 255, 255, 0.2);
}

.max-placeholder-icon {
  color: #bdc3c7;
}

/* Responsive pour les animations de flip */
@media (max-width: 768px) {
  .max-tile-flip-container {
    perspective: 800px;
  }
  
  .max-coin-face {
    transition: transform 0.4s ease-in-out;
  }
}

