/* product.css - Styles spécifiques à la page produits */

/* Hero Section */
.hero-section {  
  margin-top: 50px;   
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-color);
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--hero-image);
  background-size: cover;
  background-position: center;
  filter: grayscale(30%);
  transition: transform 0.3s ease;
}

.hero-section:hover .hero-background {
  transform: scale(1.05);
}


.hero-content {
  position: relative;
  z-index: 2;
  margin-left: auto;
  text-align: center;
  max-width: 800px;
  padding: 0 160px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 20px;
  letter-spacing: 2px;
  color: #C90C0F;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s ease forwards;
}


@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Filtres sidebar */
.filtres-sidebar {
  background-color: var(--secondary-color);
  width: 400px !important;
  flex-shrink: 0 !important;
}

.filter-card {
  background-color: var(--tertiary-color);
  overflow: hidden;
  margin-bottom: 15px;
}

.filter-header {
  background-color: var(--quarternaire-color);
  padding: 18px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-header h4 {
  color: var(--text-color);
  font-size: 14px;
  margin: 0;
  text-transform: uppercase;
}

.filter-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(1);
}

.filter-content {
  padding: 40px 50px;
}

.filter-content .row {
  margin: 0;
}

.filter-content .col-6 {
  padding: 0 5px;
  margin-bottom: 10px;
}

.filter-list {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

.filter-list span {
  display: none;
}

.filter-list span.active {
  display: inline-block;
}

.filter-list span.active i {
  font-size: 20px;
  color: var(--primary-color);
}

.filter-list li {
  font-size: 15px;
  margin-bottom: 10px;
  cursor: pointer;
}

.filter-list li.active a {
  color: var(--primary-color) !important;
}

.col-6 {
  min-width: 0 !important; /* Permet à la colonne de rétrécir si nécessaire */
  flex: 1 2 auto !important; /* Si c'est dans un système de grille flexible */
}

.form-check {
  margin-bottom: 10px;
  display: flex !important;
  align-items: flex-start !important; /* Changé de center à flex-start */
  gap: 15px !important;
  padding-left: 0 !important;
  min-height: auto !important;
  width: 100% !important;
}

.form-check-input {
  margin-top: 2px !important;
  flex-shrink: 0 !important;
  float: none !important;
  margin-left: 0 !important;
}

.form-check-label {
  color: var(--text-color);
  font-size: 11px;
  margin-left: 0 !important;
  line-height: 1.4;
  word-wrap: break-word;
  flex: 1;
  padding-left: 0 !important;
  overflow-wrap: break-word;
  word-break: keep-all;
  text-align: left;
  white-space: nowrap; /* Ajouté pour empêcher le retour à la ligne */
  overflow: hidden; /* Ajouté pour gérer le débordement */
  text-overflow: ellipsis; /* Ajouté pour afficher "..." si le texte est trop long */
}

/* style du placeholder par code d'identitification du produit */
.search-code { 
  flex-grow: 1;
  margin-right: 10px;
}

.search-code input {
  background-color: #555555;
  border: none;
  outline: none;
  width: 100%;
  color: var(--text-color);
  font-size: 14px;
}

.search-code input::placeholder {
  color: var(--text-color);
  font-size: 13px;
  font-weight: 500;
  opacity: 1; /* Assure que le placeholder est bien visible */
}

.filter-header a {
  display: flex;
  align-items: center;
}

.filter-search-icon {
  fill: var(--primary-color);
  width: 20px;
  height: 20px;
  min-width: 20px; /* Empêche l'icône de rétrécir */
  cursor: pointer;
}


/* Mis en forme personnalisé du checkbox-input */
.form-check-input {
  appearance: none;
  width: 20px;
  height: 20px;
  background-color: #555555;
  border: 1px solid #ffffff;
  border-radius: 0 !important;
  cursor: pointer;
  position: relative;
}

.form-check-input:checked {
  background-color: var(--quarternaire-color);
}

.form-check-input:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 16.2L4.8 12l-1.4 1.4L9 19l12-12-1.4-1.4L9 16.2z" fill="white" /><path d="M11 14L8 17L9 18L12 15L14 17L15 16L12 13L11 14Z" fill="white" /></svg>')
    no-repeat center;
  background-size: contain;
}

/* Produit card */
.produit-card {
  height: 550px;
  background-color: var(--tertiary-color);
  overflow: hidden;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.produit-card .produit-image img {
  transition: transform 0.3s ease;
}

.produit-card:hover .produit-image img {
  transform: scale(1.2);
}

.produit-card:hover .produit-info {
  background: var(--primary-color);
}

.produit-card .produit-info {
  transition: background 0.3s ease;
}

.produit-image {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  padding: 20px;
}

.produit-image img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.produit-info {
  background-color: var(--background-color);
  padding: 15px;
  height: 150px;
}

.produit-info h3 {
  text-align: center;
  color: var(--text-color);
  font-size: 15px;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.produit-info p {
  position: relative;
  text-align: center;
  color: var(--text-color);
  font-size: 15px;
  margin-bottom: 5px;
  padding-bottom: 7px;
  padding-right: 5px;
}

.produit-info p::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 3px;
  right: 4px;
  height: 1px;
  width: 100%;
  background: var(--text-color);
}

.produit-info h4 {
  text-align: center;
  color: var(--text-color);
  font-size: 16px;
  margin-bottom: 0;
  padding-top: 10px;
  text-transform: uppercase;
}

/* Ajustements pour l'alignement */
.container-fluid {
  display: flex;
  flex-wrap: wrap;
}

.row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start; /* Aligne les éléments en haut */
}

.col-lg-9 {
  display: flex;
  flex-direction: column;
  flex: 1 !important;
  min-width: 0 !important;
}

.col-lg-9 > .row {
  flex-grow: 1;
}

/* Media queries pour mobile */
@media (max-width: 767px) {
  .filtres-sidebar {
    display: none !important;
  }
  .produit-card {
    height: auto;
    padding: 0;
    margin: 0 auto 5px auto; /* Centre la carte et ajoute un espacement vertical */
    max-width: 280px; /* Limite la largeur maximale */
    width: 100%; /* Prend toute la largeur disponible jusqu'à max-width */
  }

  .produit-image {
    height: 200px;
  }

  .produit-info {
    height: auto;
  }

  /* Assure-toi que les colonnes Bootstrap sont bien centrées */
  .col-12, .col-sm-6, .col-md-4, .col-lg-3 {
    display: flex !important;
    justify-content: center !important;
    padding: 10px !important; /* Réduit le padding Bootstrap par défaut */
  }

  /* Conteneur de la grille de produits */
  .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    justify-content: center !important;
  }
}

@media (max-width: 575px) {
  .filtres-sidebar {
    display: none !important;
  }

  .hero-title {
    font-size: 1.2rem;
  }
  
  .produit-card {
    height: auto;
    margin: 0 auto 5px auto; /* Centre la carte */
    max-width: 550px; /* Légèrement plus petite sur très petits écrans */
    width: 100%; /* Laisse un peu d'espace sur les côtés */
  }

  .produit-image {
    height: 150px;
  }

  /* Force le centrage des colonnes */
  [class*="col-"] {
    padding-left: 10px !important;
    padding-right: 10px !important;
    display: flex !important;
    justify-content: center !important;
  }
}

/* Style supplémentaire pour s'assurer que le conteneur principal n'a pas de padding excessif */
@media (max-width: 767px) {
  .filtres-sidebar {
    display: none !important;
  }

  .container-fluid {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
  
  /* Si vous utilisez Bootstrap, ces classes peuvent aider */
  .no-gutters {
    margin-right: 0;
    margin-left: 0;
  }
  
  .no-gutters > .col,
  .no-gutters > [class*="col-"] {
    padding-right: 0;
    padding-left: 0;
  }
}