/* Styles pour la galerie WooCommerce avec disposition verticale des miniatures */

/* Container principal de la galerie */
.woocommerce-product-gallery {
  display: flex !important;
  flex-direction: row !important;
  gap: 15px !important;
  align-items: flex-start !important;
}

/* Zone des miniatures (thumbnails) */
.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
  order: -1 !important;
  display: flex !important;
  flex-direction: column !important;
  width: 80px !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 8px !important;
  max-height: 500px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 5px !important;
}

/* Supprimer complètement la scrollbar */
.woocommerce-product-gallery
  .flex-control-nav.flex-control-thumbs::-webkit-scrollbar {
  display: none !important;
}

.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

/* Style des miniatures individuelles */
.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
  width: 80px !important;
  height: 80px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  border: 2px solid transparent !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
}

/* Miniature active */
.woocommerce-product-gallery
  .flex-control-nav.flex-control-thumbs
  li.flex-active-slide {
  border-color: #007cba !important;
  box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3) !important;
}

/* Images des miniatures */
.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 6px !important;
}

/* Effet hover sur les miniatures */
.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li:hover {
  border-color: #005a87 !important;
  transform: scale(1.05) !important;
}

/* Zone de l'image principale */
.woocommerce-product-gallery .flex-viewport {
  flex: 1 !important;
  order: 1 !important;
  height: 500px !important;
  min-height: 500px !important;
  max-height: 500px !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Wrapper des images principales */
.woocommerce-product-gallery__wrapper {
  width: 100% !important;
  height: 500px !important;
  transform: none !important;
  transition: none !important;
  position: relative !important;
}

/* Images principales */
.woocommerce-product-gallery__image {
  width: 100% !important;
  height: 500px !important;
  margin: 0 !important;
  float: none !important;
  display: block !important;
  position: relative !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Images dans la zone principale */
.woocommerce-product-gallery__image img {
  width: 100% !important;
  height: 500px !important;
  max-height: 500px !important;
  object-fit: contain !important;
  border-radius: 10px !important;
}

/* Bouton de zoom */
.woocommerce-product-gallery__trigger {
  position: absolute !important;
  top: 15px !important;
  right: 15px !important;
  z-index: 10 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  border-radius: 50% !important;
  width: 40px !important;
  height: 40px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.3s ease !important;
}

.woocommerce-product-gallery__trigger:hover {
  background: rgba(255, 255, 255, 1) !important;
  transform: scale(1.1) !important;
}

/* Responsive Design */

/* Tablettes */
@media (max-width: 768px) {
  .woocommerce-product-gallery {
    flex-direction: column !important;
    gap: 10px !important;
  }

  .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
    order: 1 !important;
    flex-direction: row !important;
    width: 100% !important;
    justify-content: center !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 10px 0 !important;
    max-height: none !important;
  }

  .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
    width: 60px !important;
    height: 60px !important;
    flex-shrink: 0 !important;
  }

  .woocommerce-product-gallery .flex-viewport {
    order: 0 !important;
    height: 400px !important;
    min-height: 400px !important;
    max-height: 400px !important;
  }

  .woocommerce-product-gallery__image img {
    height: 400px !important;
    max-height: 400px !important;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
    width: 50px !important;
    height: 50px !important;
  }

  .woocommerce-product-gallery .flex-viewport {
    height: 300px !important;
    min-height: 300px !important;
    max-height: 300px !important;
  }

  .woocommerce-product-gallery__image img {
    height: 300px !important;
    max-height: 300px !important;
  }

  .woocommerce-product-gallery__trigger {
    width: 35px !important;
    height: 35px !important;
    top: 10px !important;
    right: 10px !important;
  }
}

/* Améliorations visuelles */
.woocommerce-product-gallery__image {
  opacity: 0 !important;
  transform: scale(0.95) !important;
  transition: all 0.3s ease !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
}

.woocommerce-product-gallery__image.flex-active-slide {
  opacity: 1 !important;
  transform: scale(1) !important;
  position: relative !important;
}

/* Style pour les images de zoom */
.zoomImg {
  border-radius: 10px !important;
}

/* Amélioration de l'accessibilité */
.woocommerce-product-gallery__trigger:focus {
  outline: 2px solid #007cba !important;
  outline-offset: 2px !important;
}

.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li:focus {
  outline: 2px solid #007cba !important;
  outline-offset: 2px !important;
}
