/* ==========================================
   MOBILE PRODUCT PAGE STYLES
   ========================================== */

/* Container sans padding-top (pas de sticky header personnalisé) */
.mobile-product-container {
  padding-top: 0;
}

/* Rendre le header principal sticky sur mobile */
.single-product header.container-fluid {
  position: sticky !important;
  top: 0;
  z-index: 9999;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 1. IMAGE PRODUIT avec wishlist */
.mobile-product-image {
  background-color: #fff;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  margin-top: 15px; /* Petit espace en haut */
  position: relative; /* Pour positionner la wishlist */
}

.mobile-product-image .woocommerce-product-gallery {
  width: 100% !important;
}

.mobile-product-image .onsale {
  position: absolute;
  top: 30px;
  left: 30px;
  background-color: #e62ca1 !important;
  color: #fff !important;
  padding: 15px 32px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1.15rem;
  z-index: 10;
}

/* Wishlist en bas à droite dans l'image */
.mobile-product-image .image-wishlist {
  position: absolute;
  bottom: 15px;
  right: 15px;
  z-index: 10;
}

.mobile-product-image .image-wishlist .yith-add-to-wishlist-button-block {
  margin: 0;
}

.mobile-product-image .image-wishlist .yith-add-to-wishlist-button-block a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s;
}

.mobile-product-image
  .image-wishlist
  .yith-add-to-wishlist-button-block
  a:hover {
  background-color: var(--wp--preset--color--color-1);
  transform: scale(1.05);
}

.mobile-product-image
  .image-wishlist
  .yith-add-to-wishlist-button-block
  a:hover
  svg {
  color: #fff !important;
}

.mobile-product-image .image-wishlist .yith-add-to-wishlist-button-block svg {
  width: 22px !important;
  height: 22px !important;
  color: var(--wp--preset--color--color-1) !important;
  transition: color 0.2s;
}

.mobile-product-image .image-wishlist .yith-add-to-wishlist-button-block span {
  display: none; /* Masquer le texte */
}

/* FIX IMAGES MOBILE/TABLETTE - HAUTEUR LIMITÉE ET CENTRÉE */
.mobile-product-image img,
.mobile-product-image .woocommerce-product-gallery__image img {
  max-height: 400px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
}

/* 2. HEADER (Titre + Badges) */
.mobile-product-header {
  margin-bottom: 15px; /* Réduit de 20px à 15px */
}

.mobile-product-header .product-badges {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.mobile-product-header .brand-badge,
.mobile-product-header .gamme-badge {
  background-color: #e6f2f0;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--wp--preset--color--color-2);
  font-weight: 500;
}

.mobile-product-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--wp--preset--color--color-8);
}

.mobile-product-header .woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.mobile-product-header .star-rating {
  font-size: 14px;
}

.mobile-product-header .star-rating:before,
.mobile-product-header .star-rating span:before {
  color: var(--wp--preset--color--color-2);
}

/* Description courte */
.mobile-product-header .woocommerce-product-details__short-description {
  font-size: 0.9rem;
  color: var(--wp--preset--color--color-text);
  margin-bottom: 10px;
  line-height: 1.5;
}

.mobile-product-header .woocommerce-product-details__short-description p {
  margin-bottom: 8px;
}

/* 3. PRIX */
.mobile-product-price {
  background-color: #fff;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
}

.mobile-product-price .offre-speciale {
  background-color: var(--wp--preset--color--color-6);
  color: var(--wp--preset--color--color-1);
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 0.875rem;
}

/* 4. RÉASSURANCE EN 3 LIGNES (une par élément) */
.mobile-reassurance {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.mobile-reassurance .reassurance-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  background-color: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  transition: border-color 0.2s;
}

.mobile-reassurance .reassurance-item:hover {
  border-color: var(--wp--preset--color--color-2);
}

.mobile-reassurance .reassurance-item i {
  font-size: 1.5rem;
  color: var(--wp--preset--color--color-2);
  flex-shrink: 0;
}

.mobile-reassurance .reassurance-item span {
  font-size: 0.875rem;
  color: var(--wp--preset--color--color-text);
  font-weight: 500;
  line-height: 1.3;
  flex: 1;
}

/* 5. ONGLETS SANS ICÔNES */
.mobile-product-tabs {
  margin-bottom: 10px;
}

.mobile-product-tabs .woocommerce-tabs ul.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.mobile-product-tabs .woocommerce-tabs ul.tabs:before {
  display: none !important;
}

.mobile-product-tabs .woocommerce-tabs ul.tabs li {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
}

.mobile-product-tabs .woocommerce-tabs ul.tabs li:before {
  display: none !important;
}

.mobile-product-tabs .woocommerce-tabs ul.tabs li:after {
  display: none !important;
}

.mobile-product-tabs .woocommerce-tabs ul.tabs li a {
  color: var(--wp--preset--color--color-text);
  font-size: 0.875rem;
  padding: 5px 10px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* PAS d'icônes dans les onglets */
.mobile-product-tabs .woocommerce-tabs ul.tabs li a:before {
  display: none !important;
}

.mobile-product-tabs .woocommerce-tabs ul.tabs li.active a {
  color: var(--wp--preset--color--color-1);
  font-weight: 600;
  border-bottom: 2px solid var(--wp--preset--color--color-1);
}

.mobile-product-tabs .woocommerce-Tabs-panel {
  padding: 15px;
  background-color: #fff;
  border-radius: 10px;
}

/* Réduire l'espace après les onglets */
.mobile-product-tabs .woocommerce-Tabs-panel {
  margin-bottom: 0;
}

/* 6. PRODUITS LIÉS - Carrousel mobile */
.mobile-related-products {
  margin-top: 20px;
  margin-bottom: 15px;
  padding: 0 15px;
}

.mobile-related-products .related-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 15px;
}

/* Transformer la liste WooCommerce en carrousel */
.mobile-related-products .products,
.mobile-related-products ul.products {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 15px !important;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important;
}

/* Masquer la scrollbar */
.mobile-related-products .products::-webkit-scrollbar,
.mobile-related-products ul.products::-webkit-scrollbar {
  display: none;
}

/* Chaque produit dans le carrousel */
.mobile-related-products .product,
.mobile-related-products li.product {
  min-width: 160px !important;
  max-width: 160px !important;
  flex-shrink: 0 !important;
  display: block !important;
}

/* Réduire la taille des titres et prix */
.mobile-related-products .woocommerce-loop-product__title {
  font-size: 0.875rem !important;
  line-height: 1.3 !important;
  margin-bottom: 8px !important;
}

.mobile-related-products .price {
  font-size: 0.95rem !important;
}

.mobile-related-products .woocommerce-loop-product__link {
  display: block;
}

/* Image produit */
.mobile-related-products .attachment-woocommerce_thumbnail {
  width: 100%;
  height: auto;
}

/* 7. SECTION PHARMACIE - Réduire les espaces */
.mobile-pharmacy-info {
  background-color: #fdf3f9;
  padding: 20px 0 15px 0;
  margin-top: -5px;
  margin-bottom: 70px;
}

.mobile-pharmacy-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--wp--preset--color--color-8);
}

.mobile-pharmacy-info p {
  margin-bottom: 20px;
  color: var(--wp--preset--color--color-text);
}

.mobile-pharmacy-info .pharmacy-reassurance {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 20px;
}

.mobile-pharmacy-info .reassurance-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  background-color: #fff;
  padding: 15px 10px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.mobile-pharmacy-info .reassurance-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.mobile-pharmacy-info .reassurance-item i {
  font-size: 2rem;
  color: var(--wp--preset--color--color-2);
  flex-shrink: 0;
}

.mobile-pharmacy-info .reassurance-item span {
  font-size: 0.75rem;
  color: var(--wp--preset--color--color-text);
  font-weight: 500;
  line-height: 1.3;
}

/* ==========================================
   STICKY BAR COMPACT - NOUVELLE VERSION
   ========================================== */

.mobile-sticky-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  padding: 10px 15px;
  z-index: 9998;
}

.mobile-sticky-bar .sticky-bar-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

.mobile-sticky-bar form.cart,
.mobile-sticky-bar form.sticky-cart {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 0 !important;
}

/* Ligne 1 : Prix + Stock (sur une ligne) */
.mobile-sticky-bar .sticky-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.mobile-sticky-bar .sticky-price-wrapper {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 700;
}

.mobile-sticky-bar .sticky-price-wrapper del {
  font-size: 0.85rem;
  font-weight: 400;
  color: #999;
  text-decoration: line-through;
}

.mobile-sticky-bar .sticky-price-wrapper ins {
  text-decoration: none;
  font-size: 1.25rem;
  color: var(--wp--preset--color--color-1, #e91e63);
}

.mobile-sticky-bar .sticky-price-wrapper .single-price {
  font-size: 1.25rem;
  color: var(--wp--preset--color--color-1, #e91e63);
}

.mobile-sticky-bar .sticky-stock-wrapper {
  font-size: 0.8rem;
  font-weight: 600;
}

.mobile-sticky-bar .sticky-stock-wrapper .in-stock {
  color: var(--wp--preset--color--color-2, #00a896);
  display: flex;
  align-items: center;
  gap: 4px;
}

.mobile-sticky-bar .sticky-stock-wrapper .in-stock i {
  font-size: 0.9rem;
}

.mobile-sticky-bar .sticky-stock-wrapper .out-of-stock {
  color: #dc3545;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Ligne 2 : Quantité + Bouton (sur une ligne) */
.mobile-sticky-bar .sticky-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Compteur de quantité compact */
.mobile-sticky-bar .sticky-quantity-compact {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f8f8f8;
  height: 44px;
}

.mobile-sticky-bar .sticky-quantity-compact .qty-btn {
  background-color: transparent;
  border: none;
  padding: 0 12px;
  font-size: 1.1rem;
  color: var(--wp--preset--color--color-2, #00a896);
  cursor: pointer;
  font-weight: 600;
  height: 100%;
  transition: background-color 0.2s;
}

.mobile-sticky-bar .sticky-quantity-compact .qty-btn:active {
  background-color: rgba(0, 0, 0, 0.05);
}

.mobile-sticky-bar .sticky-quantity-compact input.qty {
  border: none;
  width: 50px;
  text-align: center;
  padding: 0 8px;
  font-weight: 600;
  font-size: 1rem;
  background-color: transparent;
  height: 100%;
}

/* Bouton ajouter au panier */
.mobile-sticky-bar .sticky-add-btn {
  flex: 1;
  padding: 12px 20px !important;
  font-size: 0.95rem !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  border: none;
  font-weight: 600;
  white-space: nowrap;
  height: 44px;
}

/* Message pour produits variables */
.mobile-sticky-bar .sticky-variable-message {
  width: 100%;
}

.mobile-sticky-bar .sticky-variable-message a {
  display: block;
  width: 100%;
  padding: 12px 20px;
  font-size: 0.95rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  text-decoration: none;
}

/* Responsive pour très petits écrans */
@media screen and (max-width: 375px) {
  .mobile-sticky-bar {
    padding: 8px 10px;
  }

  .mobile-sticky-bar .sticky-price-wrapper del {
    font-size: 0.75rem;
  }

  .mobile-sticky-bar .sticky-price-wrapper ins,
  .mobile-sticky-bar .sticky-price-wrapper .single-price {
    font-size: 1.1rem;
  }

  .mobile-sticky-bar .sticky-stock-wrapper {
    font-size: 0.75rem;
  }

  .mobile-sticky-bar .sticky-add-btn {
    font-size: 0.85rem !important;
    padding: 10px 15px !important;
  }

  .mobile-sticky-bar .sticky-quantity-compact input.qty {
    width: 45px;
  }
}

/* Masquer le formulaire complet du summary sur mobile */
.mobile-product-layout .summary.entry-summary {
  display: none;
}

/* RESPONSIVE ADJUSTMENTS */
@media screen and (max-width: 375px) {
  .mobile-reassurance .reassurance-item span {
    font-size: 0.65rem;
  }

  .mobile-sticky-bar .sticky-price {
    font-size: 1.25rem;
  }
}

@media screen and (min-width: 576px) {
  .mobile-pharmacy-info .pharmacy-reassurance {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Masquer le menu sticky du footer sur les pages produit */
.single-product #app-menu-container {
  display: none !important;
}

/* Hide desktop on mobile, show mobile on mobile */
@media screen and (max-width: 991px) {
  .desktop-product-layout {
    display: none !important;
  }

  .mobile-product-layout {
    display: block !important;
  }
}

/* Hide mobile on desktop, show desktop on desktop */
@media screen and (min-width: 992px) {
  .mobile-product-layout {
    display: none !important;
  }

  .desktop-product-layout {
    display: block !important;
  }

  .mobile-sticky-bar {
    display: none !important;
  }

  /* Header reste sticky sur desktop aussi */
  .single-product header.container-fluid {
    position: sticky !important;
    top: 0 !important;
    z-index: 99999 !important;
    background-color: #fff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  }
}

/* ==========================================
   GALERIE DESKTOP PERSONNALISÉE - CORRIGÉE
   ========================================== */

.desktop-custom-gallery {
  position: relative;
  width: 100%;
  /* CORRECTION: Centrage avec flexbox */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Badge promo */
.desktop-sale-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: var(--wp--preset--color--color-6, #e91e63);
  color: var(--wp--preset--color--color-1, #fff);
  padding: 8px 20px;
  border-radius: 25px;
  font-weight: 700;
  font-size: 0.9rem;
  z-index: 10;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Wrapper de l'image principale */
.desktop-main-image-wrapper {
  position: relative;
  width: 100%;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 15px;
  /* CORRECTION: Centrage parfait avec Flexbox */
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  max-height: 600px;
}

/* CORRECTION: Le lien qui entoure l'image */
.desktop-main-image-link {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100%;
  min-height: 500px;
  max-height: 600px;
  cursor: zoom-in;
  padding: 20px;
  box-sizing: border-box;
}

/* CORRECTION: L'image principale - CENTRÉE ET RESPONSIVE */
.desktop-main-image,
#desktop-main-product-image {
  max-width: 100% !important;
  max-height: 560px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  /* Centrage de l'image elle-même */
  display: block !important;
  margin: 0 auto !important;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

/* Effet hover sur le wrapper */
.desktop-main-image-wrapper:hover .desktop-main-image,
.desktop-main-image-wrapper:hover #desktop-main-product-image {
  transform: scale(1.02);
}

/* Animation de changement d'image */
.desktop-main-image.changing {
  opacity: 0.5;
}

/* Wrapper des thumbnails */
.desktop-thumbnails-wrapper {
  width: 100%;
  padding: 10px 0;
}

/* CORRECTION: Thumbnails centrées */
.desktop-thumbnails-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
  /* CORRECTION: Centrer les thumbnails */
  justify-content: center !important;
}

/* Chaque thumbnail */
.desktop-thumb-item {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  box-sizing: border-box;
}

.desktop-thumb-item img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 0.2s;
}

.desktop-thumb-item:hover {
  border-color: var(--wp--preset--color--color-2, #00a896);
  box-shadow: 0 2px 8px rgba(0, 168, 150, 0.2);
}

.desktop-thumb-item.active {
  border-color: var(--wp--preset--color--color-1, #e91e63);
  box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

.desktop-thumb-item:not(.active):hover img {
  opacity: 0.85;
}

/* Placeholder si pas d'image */
.desktop-no-image {
  width: 100%;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  border-radius: 12px;
}

.desktop-no-image img {
  max-width: 100%;
  height: auto;
}

/* CORRECTION: Override pour forcer le centrage du wrapper parent */
.desktop-gallery-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ========================================
   RESPONSIVE POUR LA GALERIE DESKTOP
   ======================================== */

@media screen and (min-width: 992px) and (max-width: 1199px) {
  .desktop-main-image-wrapper {
    min-height: 400px;
    max-height: 500px;
  }

  .desktop-main-image-link {
    min-height: 400px;
    max-height: 500px;
    padding: 15px;
  }

  .desktop-main-image,
  #desktop-main-product-image {
    max-height: 460px !important;
  }

  .desktop-thumb-item {
    width: 70px;
    height: 70px;
  }
}

@media screen and (min-width: 1200px) and (max-width: 1399px) {
  .desktop-main-image-wrapper {
    min-height: 480px;
    max-height: 580px;
  }

  .desktop-main-image-link {
    min-height: 480px;
    max-height: 580px;
  }

  .desktop-main-image,
  #desktop-main-product-image {
    max-height: 540px !important;
  }

  .desktop-thumb-item {
    width: 85px;
    height: 85px;
  }
}

@media screen and (min-width: 1400px) {
  .desktop-main-image-wrapper {
    min-height: 550px;
    max-height: 650px;
  }

  .desktop-main-image-link {
    min-height: 550px;
    max-height: 650px;
  }

  .desktop-main-image,
  #desktop-main-product-image {
    max-height: 610px !important;
  }

  .desktop-thumb-item {
    width: 95px;
    height: 95px;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.desktop-main-image,
#desktop-main-product-image {
  animation: fadeIn 0.3s ease;
}

/* ========================================
   ICÔNE DE ZOOM (optionnel)
   ======================================== */

.desktop-main-image-wrapper::after {
  content: "\f00e"; /* FontAwesome search-plus */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  bottom: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--wp--preset--color--color-2, #00a896);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.desktop-main-image-wrapper:hover::after {
  opacity: 1;
}

/* ========================================
   CORRECTION Z-INDEX PHOTOSWIPE
   Pour que la lightbox passe au-dessus du header
   ======================================== */

.pswp {
  z-index: 999999 !important;
}
