/* ===================== */
/*     INDEX.CSS V3     */
/*   TEST 5 AUTO-COLOR  */
/* ===================== */

.index-main {
  font-family: 'Segoe UI', sans-serif;
  background: #f7f7f7;
  color: #222;
  padding: 2rem;
}

.slider {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.slider .slide {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.slider img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.slider .overlay {
  position: absolute;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  color: white;
  width: 100%;
  padding: 1rem;
}

.intro {
  max-width: 900px;
  margin: 2rem auto;
  text-align: center;
}

.nouveautes {
  max-width: 1200px;
  margin: 2rem auto;
}

.grid-produits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.produit-card {
  background: #fff;
  border: 1px solid #ccc;
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.produit-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0 25px rgba(0, 185, 243, 0.5);
}

.produit-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  margin-bottom: 1rem;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

.produit-card:hover img {
  transform: scale(1.05);
}

.produit-card h3 {
  font-size: 1.1rem;
  color: #222;
  margin-bottom: 0.5rem;
}

/* Ligne brand/model/year -> 1 ligne max */
.produit-card .meta {
  margin: 0.25rem 0 0.5rem 0;
  color: #333;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

/* Prix */
.produit-card .prix {
  font-size: 1.2rem;
  font-weight: bold;
  color: #007bff;
  margin: 0.25rem 0 0.35rem 0;
}

/* Caption -> 3 lignes max + ... */
.produit-card .caption {
  font-size: 0.9rem;
  color: #666;
  margin: 0.5rem 0;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;

  /* (optionnel) garde les cartes égales */
  min-height: 3.6em;
}

.produit-card .btn {
  display: inline-block;
  background: #007bff;
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  margin-top: 0.35rem;
}

.carousel-container {
  position: relative;
  overflow: hidden;
  height: 420px;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.15);
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 100%;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: all 1.2s ease-in-out;
}

.carousel-slide.active {
  left: 0;
  opacity: 1;
  z-index: 2;
  animation: slideInImg 1.4s ease;
}

@keyframes slideInImg {
  0% { transform: translateX(-100%) scale(1.05); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  transition: filter 0.4s ease, transform 0.4s ease;
}

.carousel-slide:hover img {
  filter: brightness(1.2) contrast(1.15);
  transform: scale(1.04);
}

.carousel-slide::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
  transform: rotate(25deg);
  animation: shimmer 2.8s infinite;
  z-index: 6;
  pointer-events: none;
}

@keyframes shimmer {
  0% { transform: translate(-100%, -100%) rotate(25deg); }
  100% { transform: translate(100%, 100%) rotate(25deg); }
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.6rem;
  text-align: center;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  animation: dropBounceText 1.4s ease-out 0.7s both;
}

@keyframes dropBounceText {
  0% { transform: translateY(-200px); opacity: 0; }
  60% { transform: translateY(30px); opacity: 1; }
  80% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

.carousel-caption h2 {
  font-size: 2.6rem;
  font-weight: bold;
  color: white;
  text-shadow: 0 0 12px rgba(255,255,255,0.6), 0 0 20px rgba(255,255,255,0.4);
  background: linear-gradient(90deg, #ff0000, #ffcc00, #00ff00, #00ccff, #ff00ff);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: colorShift 6s ease-in-out infinite;
}

@keyframes colorShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
