/* ========================================
   GALERIE PRODUIT
   ======================================== */

/* TEST DIAGNOSTIC POUR LE TEXTE */
/*
.woocommerce-mini-cart-item.mini_cart_item a:not([href*="remove_item"]):not(:first-child) {
    background: yellow !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
    display: block !important;
    line-height: 1.4 !important;
}

.woocommerce-mini-cart-item.mini_cart_item .quantity {
    background: pink !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}
*/

/* FIn TEST*/

/**
 * Correction du problème d'opacité de la galerie
 */
.woocommerce-product-gallery {
    opacity: 1 !important;
}

/* ========================================
   DÉSACTIVATION DU ZOOM AU SURVOL
   ======================================== */

/* Désactiver l'effet de zoom au survol */
.woocommerce-product-gallery__image:hover .wp-post-image {
    transform: none !important;
}

/* Désactiver l'effet de zoom par défaut de WooCommerce */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:hover img {
    transform: none !important;
}

/* Supprimer le zoom automatique */
.woocommerce-product-gallery__wrapper .zoomImg {
    display: none !important;
}

/* ========================================
   DÉSACTIVER LE ZOOM DANS PHOTOSWIPE
   ======================================== */

/* Désactiver le curseur de zoom dans le lightbox */
.pswp--zoom-allowed .pswp__img,
.pswp__img {
    cursor: default !important;
}

/* Empêcher le zoom sur double-clic */
.pswp__zoom-wrap {
    transform: none !important;
    -webkit-transform: none !important;
}

/* Empêcher le zoom avec la molette */
.pswp__container,
.pswp__zoom-wrap {
    transform-origin: center center !important;
    transform: translate3d(0,0,0) !important;
    -webkit-transform: translate3d(0,0,0) !important;
}

/* Désactiver les contrôles de zoom */
.pswp__button--zoom {
    display: none !important;
}

/* Empêcher le pinch-to-zoom sur mobile */
.pswp__item {
    touch-action: pan-x pan-y !important;
}

/* Forcer la taille normale de l'image */
.pswp--zoomed-in .pswp__img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
}


/* ========================================
   UNIFORMISATION DES IMAGES PRODUITS
   ======================================== */

/* Conteneur principal de la galerie */
.woocommerce-product-gallery__wrapper {
    position: relative !important;
}

/* Conteneur de l'image */
.woocommerce-product-gallery__image {
    position: relative !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
}

/* Uniformiser la hauteur des images principales */
.woocommerce-product-gallery__image img,
.woocommerce-product-gallery__wrapper img {
    height: auto !important;
    max-height: 400px !important;
    width: auto !important;
    object-fit: contain !important;
    max-width: 100% !important;
}

/* Pour les vignettes */
.woocommerce-product-gallery ol.flex-control-nav li img {
    height: 100px !important;
    width: auto !important;
    object-fit: contain !important;
}

/* ========================================
   LIGHTBOX (POPUP)
   ======================================== */

/* Style pour le modal de zoom (lightbox) */
.pswp__img {
    max-height: 90vh !important;
    max-width: 90vw !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Conteneur du lightbox pour permettre le scroll si nécessaire */
.pswp__scroll-wrap {
    overflow: auto !important;
}

/* Assurer que le conteneur principal permet le scroll */
.pswp__container {
    overflow: auto !important;
}

/* Limiter la taille totale du lightbox */
.pswp {
    max-width: 100vw !important;
    max-height: 100vh !important;
}

/* Styles supplémentaires pour améliorer l'apparence de la galerie */
.woocommerce div.product div.images img {
    display: block;
    width: 100%;
    height: auto;
    box-shadow: none;
}

.woocommerce-product-gallery__wrapper {
    margin: 0;
    padding: 0;
}

/* Amélioration de l'affichage des vignettes */
.woocommerce div.product div.images .flex-control-thumbs {
    display: flex;
    flex-wrap: wrap;
    margin-top: var(--product-margin-bottom);
}

.woocommerce div.product div.images .flex-control-thumbs li {
    width: var(--gallery-thumb-width);
    margin-right: var(--gallery-thumb-margin);
    margin-bottom: var(--gallery-thumb-margin-bottom);
}

.woocommerce div.product div.images .flex-control-thumbs li:nth-child(4n) {
    margin-right: 0;
}

/* Contrôle de la taille des images de produit */
.woocommerce-product-gallery__image {
    max-width: var(--product-gallery-max-width);
    margin: 0 auto;
}

.woocommerce-product-gallery__image a {
    display: block;
    width: 100%;
}

.woocommerce div.product div.images img {
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Style spécial pour la page produit unique */
.single-product .woocommerce-product-gallery img {
    object-fit: contain;
    max-height: var(--product-gallery-max-height);
    width: auto;
    margin: 0 auto;
}

/* Empêcher les duplications */
.woocommerce-product-gallery + .woocommerce-product-gallery {
    display: none !important;
}

/* Éviter les duplications d'images */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:not(:first-child) {
    display: inline-block;
    width: var(--gallery-thumb-width);
    margin-right: 1%;
}

/* ========================================
   CENTRER L'IMAGE DANS LE LIGHTBOX
   ======================================== */

/* Centrer l'image dans PhotoSwipe */
.pswp__img {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    -webkit-transform: translate(-50%, -50%) !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* S'assurer que le conteneur est bien centré */
.pswp__zoom-wrap {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Conteneur principal */
.pswp__container {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
}

/* Item du carousel */
.pswp__item {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Reset des transformations qui pourraient décaler l'image */
.pswp--animate_opacity .pswp__zoom-wrap,
.pswp--open .pswp__zoom-wrap {
    transform: none !important;
    -webkit-transform: none !important;
}


/* ========================================
   IMAGES PRODUITS EN LISTE
   ======================================== */

/* Alignement vertical des produits WooCommerce */
.woocommerce ul.products li.product {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Hauteur fixe pour les catégories */
.woocommerce ul.products li.product .ast-woo-product-category {
    min-height: var(--product-category-min-height);
    margin-bottom: var(--product-category-margin-bottom);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hauteur fixe pour les titres de produits */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    min-height: var(--product-title-min-height);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--product-margin-bottom);
}

/* Hauteur fixe pour les évaluations */
.woocommerce ul.products li.product .star-rating {
    margin: var(--product-rating-margin);
    min-height: var(--product-rating-min-height);
}

/* Hauteur fixe pour les prix */
.woocommerce ul.products li.product .price {
    min-height: var(--product-price-min-height);
    margin-bottom: var(--product-margin-bottom);
}

/* Pousser les boutons vers le bas */
.woocommerce ul.products li.product .button {
    margin-top: auto;
}

/* Fixer la hauteur exacte de l'image et son conteneur pour les produits en catégorie et similaires */
.woocommerce ul.products li.product a img,
.related.products ul.products li.product a img,
.upsells.products ul.products li.product a img,
.cross-sells ul.products li.product a img,
section.products ul.products li.product a img {
    height: var(--product-image-height) !important;
    max-height: var(--product-image-height) !important;
    width: var(--product-image-width) !important;
    margin: 0 auto !important;
    display: block !important;
    object-fit: contain !important;
}

/* Créer un conteneur de hauteur fixe pour l'image */
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
.related.products ul.products li.product a.woocommerce-LoopProduct-link,
.upsells.products ul.products li.product a.woocommerce-LoopProduct-link,
.cross-sells ul.products li.product a.woocommerce-LoopProduct-link,
section.products ul.products li.product a.woocommerce-LoopProduct-link {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Conteneur spécifique pour l'image avec hauteur fixe */
.woocommerce ul.products li.product .image-wrapper,
.related.products ul.products li.product .image-wrapper,
.upsells.products ul.products li.product .image-wrapper,
.cross-sells ul.products li.product .image-wrapper,
section.products ul.products li.product .image-wrapper {
    height: var(--product-image-height) !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Assurer que tous les produits ont la même structure */
.woocommerce ul.products li.product,
.related.products ul.products li.product,
.upsells.products ul.products li.product,
.cross-sells ul.products li.product,
section.products ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
}

/* ========================================
   PRODUITS SIMILAIRES
   ======================================== */

/* Styles pour les produits similaires */
.related.products ul.products li.product img,
.upsells.products ul.products li.product img {
    width: var(--product-image-height);
    height: auto;
    margin: 0 auto;
    display: block;
}

/* Centrer les images et les textes */
.related.products ul.products li.product,
.upsells.products ul.products li.product {
    text-align: center;
}

/* Assurer que les images ne débordent pas */
.related.products ul.products li.product a img,
.upsells.products ul.products li.product a img {
    max-width: 100%;
    height: auto;
}

/* Ciblage précis pour les produits similaires */
.woocommerce .related.products ul.products li.product img,
.woocommerce .up-sells.products ul.products li.product img,
.woocommerce section.products.similaires ul.products li.product img,
.woocommerce .products.similaires ul.products li.product img {
    height: var(--product-image-height) !important;
    max-height: var(--product-image-height) !important;
    width: var(--product-image-width) !important;
    object-fit: contain !important;
}




/* ========================================
   FIX URGENT - PRODUITS RÉCEMMENT VUS
   ======================================== */

/* Section Recently Viewed - format spécifique avec conservation des proportions */
.widget_recently_viewed_products img,
.widget_recently_viewed_products .product_list_widget img,
.woocommerce ul.product_list_widget li img,
section.recently-viewed-products img,
.recently-viewed ul.products li.product img {
    /* Taille avec conservation des proportions */
    height: auto !important; /* Hauteur automatique pour conserver les proportions */
    width: auto !important; /* Largeur automatique */
    max-width: 80px !important; /* Largeur maximale limitée */
    max-height: 80px !important; /* Hauteur maximale limitée */
    object-fit: contain !important; /* Contient l'image entière sans couper */
    margin: 0 10px 0 0 !important; /* Marge à droite seulement */
    flex-shrink: 0 !important; /* Empêche la réduction */
    border-radius: 4px !important; /* Coins arrondis pour l'esthétique */
    display: block !important;
}

/* Conteneur pour les produits récemment vus - contrôle plus strict */
.widget_recently_viewed_products li,
.woocommerce ul.product_list_widget li,
section.recently-viewed-products li,
.recently-viewed ul.products li.product {
    display: flex !important;
    align-items: flex-start !important; /* Alignement en haut au lieu du centre */
    margin-bottom: 15px !important; /* Réduit de 20px à 15px */
    padding-bottom: 15px !important; /* Réduit de 20px à 15px */
    border-bottom: 1px solid #e0e0e0 !important;
    min-height: 90px !important; /* Réduit de 170px à 90px */
    overflow: hidden !important; /* Empêche tout débordement */
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Conteneur image avec taille flexible pour conserver les proportions */
.widget_recently_viewed_products li a:first-child,
.woocommerce ul.product_list_widget li a:first-child,
section.recently-viewed-products li .product-image,
.recently-viewed ul.products li.product > a:first-child {
    flex-shrink: 0 !important;
    width: 80px !important; /* Largeur du conteneur */
    height: 80px !important; /* Hauteur du conteneur */
    margin-right: 10px !important;
    overflow: visible !important; /* Permet à l'image d'être visible même si plus petite */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: transparent !important; /* Pas de fond pour ne pas voir les espaces vides */
    border-radius: 4px !important;
}

/* Contenu texte */
.widget_recently_viewed_products li .product-info,
.widget_recently_viewed_products li a:not(:first-child),
.woocommerce ul.product_list_widget li a:not(:first-child),
section.recently-viewed-products li .product-title,
.recently-viewed ul.products li.product .woocommerce-loop-product__title {
    flex: 1 !important;
    font-size: 14px !important;
    line-height: 1.3 !important;
    margin-bottom: 5px !important;
    padding-left: 0 !important; /* Supprime le padding-left de 10px */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

/* Prix pour les produits récemment vus */
.widget_recently_viewed_products li .amount,
.woocommerce ul.product_list_widget li .amount,
section.recently-viewed-products li .amount,
.recently-viewed ul.products li.product .price {
    font-size: 14px !important;
    font-weight: bold !important;
    color: #333 !important;
    margin-top: 5px !important;
    display: block !important;
}

/* Titre de section "Recently Viewed" */
.recently-viewed-title,
.widget_recently_viewed_products h2,
h2.recently-viewed-heading {
    font-size: 18px !important;
    margin-bottom: 15px !important;
    padding-bottom: 8px !important;
    border-bottom: 2px solid #333 !important;
    font-weight: 600 !important;
}

/* Container principal */
.recently-viewed,
.widget_recently_viewed_products {
    background: #f9f9f9;
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

/* Liste des produits */
.recently-viewed ul.products,
.widget_recently_viewed_products ul {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Chaque élément de produit */
.recently-viewed ul.products li.product {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 10px !important;
    margin-bottom: 15px !important;
    padding-bottom: 15px !important;
    border-bottom: 1px solid #ddd !important;
}

.recently-viewed ul.products li.product:last-child {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .widget_recently_viewed_products img,
    .widget_recently_viewed_products .product_list_widget img,
    .woocommerce ul.product_list_widget li img,
    section.recently-viewed-products img,
    .recently-viewed ul.products li.product img {
        max-height: 60px !important;
        max-width: 60px !important;
        height: auto !important;
        width: auto !important;
    }

    .widget_recently_viewed_products li a:first-child,
    .woocommerce ul.product_list_widget li a:first-child,
    .recently-viewed ul.products li.product > a:first-child {
        width: 60px !important;
        height: 60px !important;
    }

    .widget_recently_viewed_products li,
    .woocommerce ul.product_list_widget li,
    .recently-viewed ul.products li.product {
        min-height: 70px !important;
        gap: 8px !important;
    }
}



/* ========================================
   NETTOYAGE DE L'AFFICHAGE DE LA LOUPE (SANS BORDURE)
   ======================================== */

/* Loupe sans bordure */
.woocommerce-product-gallery__trigger {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: 45px !important;
    height: 45px !important;
    background: transparent !important; /* Fond transparent */
    border: none !important; /* Pas de bordure */
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 50 !important;
    text-decoration: none !important;
    font-size: 28px !important; /* Un peu plus grand pour compenser l'absence de fond */
    color: #333 !important;
    box-shadow: none !important; /* Pas d'ombre */
    transition: all 0.3s ease !important;
    overflow: hidden !important;
    text-indent: -9999px !important;
}

/* Supprimer le contenu :before */
.woocommerce-product-gallery__trigger:before {
    display: none !important;
}

/* Afficher uniquement l'emoji loupe avec :after */
.woocommerce-product-gallery__trigger:after {
    content: "🔍" !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 28px !important;
    text-indent: 0 !important;
    display: block !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)) !important; /* Ombre portée sur l'emoji */
}

/* Hover effect - juste agrandir l'emoji */
.woocommerce-product-gallery__trigger:hover {
    background: transparent !important;
    transform: none !important;
}

.woocommerce-product-gallery__trigger:hover:after {
    transform: translate(-50%, -50%) scale(1.2) !important;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4)) !important;
}

/* Les conteneurs restent identiques */
.woocommerce-product-gallery {
    position: relative !important;
    display: block !important;
}

.woocommerce-product-gallery__wrapper {
    position: relative !important;
}

.woocommerce-product-gallery__image {
    position: relative !important;
    overflow: visible !important;
}

/* ========================================
   LOUPE AVEC IMAGE PNG SUR L'IMAGE
   ======================================== */

/* S'assurer que le conteneur d'image est en position relative */
.woocommerce-product-gallery__image {
    position: relative !important;
}

/* Positionner la loupe sur l'image */
.woocommerce-product-gallery__image .woocommerce-product-gallery__trigger {
    position: absolute !important;
    top: 10px !important; /* Réduit pour être plus proche du bord */
    right: 10px !important; /* Réduit pour être plus proche du bord */
    width: 40px !important;
    height: 40px !important;
    background: rgba(255, 255, 255, 0.8) !important; /* Fond blanc semi-transparent pour visibilité */
    border: none !important;
    border-radius: 4px !important; /* Coins légèrement arrondis au lieu de cercle */
    cursor: pointer !important;
    z-index: 10 !important; /* Réduit car maintenant dans l'image */
    text-indent: -9999px !important;
    overflow: hidden !important;
    display: block !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Image de loupe */
.woocommerce-product-gallery__trigger:after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 24px !important;
    height: 24px !important;
    background-image: url('/wp-content/uploads/loupe.png') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* Supprimer le :before */
.woocommerce-product-gallery__trigger:before {
    display: none !important;
}

/* Hover */
.woocommerce-product-gallery__trigger:hover {
    background: rgba(255, 255, 255, 1) !important; /* Fond blanc opaque au hover */
    transform: scale(1.1) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
}

/* Si vous voulez la loupe sans fond blanc */
.woocommerce-product-gallery__trigger.transparent {
    background: transparent !important;
    box-shadow: none !important;
}

.woocommerce-product-gallery__trigger.transparent:after {
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5)) !important; /* Ombre pour visibilité */
}

.woocommerce-product-gallery__trigger.transparent:hover {
    background: transparent !important;
    transform: scale(1.2) !important;
}



/* ========================================
   IMAGES DU PANIER (MINI-CART) - VERSION FINALE FONCTIONNELLE
   ======================================== */

/* Conteneur en flexbox */
.woocommerce-mini-cart-item.mini_cart_item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 25px !important;
    padding: 12px !important;
    border-bottom: 1px solid #eee !important;
    min-height: auto !important;
    overflow: visible !important;
}

/* L'image à gauche */
.woocommerce-mini-cart-item.mini_cart_item a[href*="/produit/"] {
    flex: 0 0 60px !important;
    width: 60px !important;
    height: 60px !important;
    display: block !important;
    order: 1 !important;
}

.woocommerce-mini-cart-item.mini_cart_item a[href*="/produit/"] img {
    width: 60px !important;
    height: auto !important;
    max-height: 60px !important;
    object-fit: contain !important;
    border-radius: 4px !important;
}

/* Zone de texte - SANS LIMITATIONS */
.woocommerce-mini-cart-item.mini_cart_item > *:not(a[href*="/produit/"]):not(.remove) {
    flex: 1 !important;
    order: 2 !important;
    min-width: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

/* Nom du produit - SANS LIMITATIONS */
.woocommerce-mini-cart-item.mini_cart_item a:not([href*="remove_item"]):not(:first-child) {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
    display: block !important;
    line-height: 1.4 !important;
}

/* Prix et quantité - SANS LIMITATIONS */
.woocommerce-mini-cart-item.mini_cart_item .quantity {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Bouton supprimer */
.woocommerce-mini-cart-item.mini_cart_item .remove.remove_from_cart_button {
    flex: 0 0 auto !important;
    order: 3 !important;
    width: 20px !important;
    height: 20px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid #ddd !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-left: auto !important;
    align-self: flex-start !important;
}

.woocommerce-mini-cart-item.mini_cart_item .remove.remove_from_cart_button svg {
    width: 10px !important;
    height: 10px !important;
}

/* Message livraison gratuite */
.free-shipping-notice {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.free-shipping-notice p {
    margin: 0;
    font-size: 16px;
}

.free-shipping-notice strong {
    font-size: 18px;
}



/* ========================================
   CLASSES POUR LE JAVASCRIPT
   ======================================== */

/* Aucune classe JavaScript n'est utilisée actuellement */
/* Les classes pourront être ajoutées ici si nécessaire */
