/* Styles pour la page Nouvel Arrivage */

.page-title {
  background-color: #f0f8ff;
  padding: 3rem 1rem;
  text-align: center;
  margin-bottom: 1.5rem 1rem;
}

.page-title h1 {
  color: #333;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  animation: fadeInUp 0.8s ease forwards;
}

/* Couleur distinctive pour une partie du titre */
.title-highlight {
  color: #4285f4; /* Bleu Google (pour rester dans les couleurs du site) */
  font-weight: 700;
  position: relative;
  display: inline-block;
  animation: highlightIn 1.2s ease forwards;
  animation-delay: 0.3s;
  opacity: 0; /* État initial avant l'animation */
}

/* Effet de soulignement stylisé */
.title-highlight::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0; /* Commence à 0 pour l'animation */
  height: 3px;
  background: linear-gradient(90deg, #4285f4, #34a853, #fbbc05, #ea4335);
  border-radius: 3px;
  animation: lineGrow 1s ease forwards;
  animation-delay: 0.8s;
}

@keyframes lineGrow {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.page-title p {
  color: #666;
  max-width: 800px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.5s;
  opacity: 0; /* État initial avant l'animation */
}

/* Animations pour le titre et la description */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes highlightIn {
  0% {
    transform: scale(0.95);
    opacity: 0;
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.new-products {
  padding: 1.5rem  1rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(256px, 1fr)); /* Aligné avec les produits de la page principale */
  gap: 1.5rem; /* Aligné avec l'espacement de la page principale */
}

.new-product-card {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-color: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  /* Dimensions alignées avec les cartes de produits standards */
  width: 100%;
  height: 100%;
  z-index: 1; /* Ajouté pour s'assurer que la carte est au-dessus de l'arrière-plan */
}

.new-product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.new-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #e74c3c;
  color: white;
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: 4px;
  z-index: 10; /* Valeur plus élevée pour être au-dessus de l'image */
}

.new-product-image {
  position: relative;
  cursor: pointer;
}

/* Supprimer l'icône de zoom */
.new-product-image::after {
  display: none; /* Désactiver l'affichage de l'icône de zoom */
}

.new-product-image img {
  width: 100%;
 
  object-fit: contain;
  transition: transform 0.5s ease;
  pointer-events: auto; /* S'assurer que les événements de souris sont captés */
  z-index: 1; /* Assurer que l'image est au-dessus de l'arrière-plan de la carte */
}

.new-product-info {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  position: relative; /* Pour bien positionner le bouton */
  text-align: center; /* Centrer tout le texte dans l'info du produit */
}

.new-product-info h3 {
  font-size: 1.1rem; /* Même taille de texte que les cartes de produits standards */
  margin: 0 0 0.8rem;
  color: #333;
  font-weight: 600;
  line-height: 1.5;
  
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-align: center; /* Centrer le titre */
}

.new-product-price {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  justify-content: center; /* Centrer les éléments de prix */
  flex-wrap: wrap; /* Permettre aux prix de passer à la ligne si nécessaire */
  gap: 10px; /* Espacement uniforme entre les éléments */
}

.old-price {
  color: #999;
  text-decoration: line-through;
  font-size: 0.9rem;
  margin-right: 0; /* Enlever la marge droite car on utilise gap */
  padding-right: 0; /* Enlever le padding droit */
}

.current-price {
  color: #e74c3c;
  font-size: 1.2rem;
  font-weight: 700;
  padding-left: 0; /* Enlever le padding gauche */
}

.new-product-features {
  display: flex;
  justify-content: center;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
  flex-wrap: nowrap; /* Forcer l'affichage horizontal */
  gap: 12px;
  width: 100%;
}

.new-product-features span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #666;
  white-space: nowrap; /* Empêcher le texte de passer à la ligne */
}

.new-product-features i {
  color: #0F7CB3;
  font-size: 0.9rem;
  min-width: 12px;
}

/* Ajustements pour les petits écrans mais toujours en horizontal */
@media (max-width: 479px) {
  .new-product-features {
    gap: 8px;
    font-size: 1rem; /* Réduire davantage la taille de police */
    justify-content: space-around; /* Mieux distribuer l'espace disponible */
  }
  
  .new-product-features i {
    font-size: 0.8rem; /* Réduire la taille de l'icône */
  }
  
  .new-product-features span {
    padding: 0; /* Supprimer le padding pour gagner de l'espace */
  }
}

/* Ne passer en mode vertical que sur les très petits écrans */
@media (max-width: 320px) {
  .new-product-features {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
}

.buy-now-btn {
  background-color: #0F7CB3;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 13px 15px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  width: 100%;
  text-decoration: none;
  position: relative; /* Pour s'assurer qu'il est au-dessus des autres éléments */
  z-index: 2; /* Plus élevé que l'image mais moins que le badge */
  pointer-events: auto; /* S'assurer que les événements de clic sont captés */
}

.buy-now-btn:hover {
  background-color: #02496c;
}

/* Style pour l'image par défaut */
.modal-product-image img[src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"] {
  background-color: #f5f5f5;
  min-height: 100px;
  min-width: 100px;
  position: relative;
}

.modal-product-image img[src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"]::before {
  content: "Image non disponible";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #888;
}

/* Supprimer les styles de modal qui ne sont plus nécessaires */
#quick-purchase-modal, .image-preview-modal {
  display: none !important;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  overflow: auto;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  background-color: #fff;
  max-width: 600px;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  padding: 0;
  position: relative;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.close-modal {
  position: absolute;
  top: 1px;       
  right: 18px;
  font-size: 50px; 
  color: #666;
  cursor: pointer;
  z-index: 10;
  transition: color 0.2s;
}



.close-modal:hover {
  color: #e74c3c;
}

.modal-header {
  background-color: #4285f4;
  padding: 20px 25px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.modal-header h2 {
  color: white;
  font-size: 1.5rem;
  margin: 0;
}

.modal-body {
  padding: 25px;
}

.modal-product-info {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 20px;
}

.modal-product-image {
  width: 100px;
  height: 100px;
  overflow: hidden;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  border-radius: 4px;
}

.modal-product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-product-details h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.modal-price {
  font-size: 1.4rem;
  color: #e74c3c;
  font-weight: bold;
}

.quick-order-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 1.1rem;
}

.form-group input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.quantity-selector {
  display: flex;
  align-items: center;
}

.quantity-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #eee;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background-color 0.2s;
}

.quantity-btn:hover {
  background-color: #ddd;
}

#quick-quantity {
  width: 60px;
  text-align: center;
  border: 1px solid #ddd;
  height: 36px;
  margin: 0 5px;
}

#quick-quantity::-webkit-inner-spin-button,
#quick-quantity::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none; 
  margin: 0;
}

#quick-quantity {
  -moz-appearance: textfield;
  appearance: textfield; 
}


.whatsapp-order-btn {
  background-color: #25d366;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.whatsapp-order-btn:hover {
  background-color: #128C7E;
}

.required {
  color: #e74c3c;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
  }
  
  .modal-content {
    width: 95%;
  }
  
  .modal-product-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .modal-product-image {
    margin-right: 0;
    margin-bottom: 15px;
  }
}

@media (max-width: 320px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .page-title h1 {
    font-size: 2rem;
  }
  
  .new-product-features {
    flex-direction: column;
    gap: 8px;
  }
}

/* Styles complètement revus pour la modal d'image */
#lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

#lightbox-image {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  z-index: 10000;
}

/* Styles pour les produits en rupture de stock */
.new-product-card.out-of-stock {
  opacity: 0.85;
  position: relative;
}

.new-product-card.out-of-stock::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.new-badge.out-of-stock {
  background-color: #777;
}

.buy-now-btn.disabled {
  background-color: #aaa;
  cursor: not-allowed;
}

.buy-now-btn.disabled:hover {
  background-color: #999;
}


/* Styles pour la section de partage */
.share-section {
  padding: 1.5rem 0;
  background-color: #f9f9f9;
  border-top: 1px solid #e8e8e8;
}

.share-section h3 {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 1rem;
  color: #333;
}

.share-section h3 i {
  margin-right: 0.5rem;
  color: #666;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 0 auto;
  max-width: 600px;
}

.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  color: white;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 1.2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background-color: #777;
}

.share-button i {
  margin-right: 0;
  font-size: 1.3rem;
}

.share-button span {
  display: none; /* Hide text labels */
}

.share-button.facebook,
.share-button.twitter,
.share-button.whatsapp,
.share-button.copy {
  background-color: #777;
}

.share-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  background-color: #0F7CB3;
}

.share-button.copied {
  background-color: #888;
}

/* Responsive styles */
@media (max-width: 768px) {
  .share-buttons {
    gap: 1rem;
  }
  
  .share-button {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .share-buttons {
    width: 100%;
  }
  .share-section h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
}
