/**
 * Styles pour le rendu serveur des véhicules (SEO)
 * Ces styles s'appliquent au contenu HTML généré côté serveur
 * avant que le JavaScript ne prenne le relais
 */

/* Fiche véhicule détail */
.vehicle-detail-ssr {
  min-height: 400px;
}

.vehicle-title {
  font-size: 2rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 1.5rem;
}

.vehicle-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.vehicle-info-item {
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 4px;
}

.vehicle-info-item strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #666;
  font-size: 0.875rem;
  font-weight: 600;
}

.vehicle-description {
  margin-bottom: 2rem;
}

.vehicle-description h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.vehicle-equipements {
  margin-bottom: 2rem;
}

.vehicle-equipements h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.vehicle-equipements ul {
  list-style: disc;
  padding-left: 1.5rem;
}

.vehicle-equipements li {
  margin-bottom: 0.5rem;
}

.vehicle-cta {
  margin-top: 2rem;
}

/* Liste de véhicules */
.vehicles-ssr-list {
  margin-top: 2rem;
}

.vehicle-card-ssr {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.vehicle-card-ssr:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.vehicle-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.vehicle-card-content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.vehicle-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.vehicle-card-title a {
  color: #000;
  text-decoration: none;
}

.vehicle-card-title a:hover {
  color: #bb0a30;
}

.vehicle-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #bb0a30;
  margin-bottom: 0.5rem;
}

.vehicle-card-info {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.vehicle-card-content .btn {
  margin-top: auto;
}

/* ========================================
   SKELETON LOADERS (Placeholders)
   ======================================== */

/* Animation de shimmer */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite ease-in-out;
  border-radius: 4px;
}

/* Liste skeleton - prend toute la largeur */
.vehicles-skeleton-list {
  width: 100%;
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 0;
}

/* Responsive - 2 colonnes sur tablette */
@media (min-width: 768px) {
  .vehicles-skeleton-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 3 colonnes sur desktop */
@media (min-width: 992px) {
  .vehicles-skeleton-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.vehicles-skeleton-list > .col-12 {
  width: 100%;
  padding: 0;
}

/* Carte skeleton */
.vehicle-card-skeleton {
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  height: 480px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  width: 100%;
}

.skeleton-image {
  width: 100%;
  height: 260px;
  min-height: 260px;
  flex-shrink: 0;
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e0e0e0 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite ease-in-out;
  position: relative;
}

/* Badge skeleton sur l'image */
.skeleton-image::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  width: 80px;
  height: 24px;
  background: rgba(255,255,255,0.7);
  border-radius: 4px;
}

.skeleton-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 220px;
}

.skeleton-title {
  height: 22px;
  width: 90%;
  border-radius: 4px;
}

.skeleton-subtitle {
  height: 18px;
  width: 70%;
  border-radius: 4px;
}

.skeleton-price {
  height: 32px;
  width: 50%;
  border-radius: 4px;
  margin-top: 0.5rem;
}

.skeleton-specs {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.skeleton-spec {
  height: 16px;
  width: 60px;
  border-radius: 4px;
}

.skeleton-info {
  height: 16px;
  width: 65%;
  border-radius: 4px;
}

.skeleton-button {
  height: 44px;
  width: 100%;
  margin-top: auto;
  border-radius: 6px;
}

/* Masquer les skeletons quand le contenu est chargé */
.vehicles-loaded .vehicle-card-skeleton {
  display: none;
}

/* Fiche détail skeleton */
.vehicle-detail-skeleton {
  padding: 2rem;
}

.skeleton-detail-image {
  width: 100%;
  height: 400px;
  margin-bottom: 2rem;
  border-radius: 8px;
}

.skeleton-detail-title {
  height: 40px;
  width: 60%;
  margin-bottom: 1.5rem;
}

.skeleton-detail-price {
  height: 32px;
  width: 30%;
  margin-bottom: 2rem;
}

.skeleton-detail-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.skeleton-spec-item {
  height: 60px;
  border-radius: 4px;
}

.skeleton-detail-desc {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skeleton-line {
  height: 16px;
  border-radius: 4px;
}

.skeleton-line:nth-child(1) { width: 100%; }
.skeleton-line:nth-child(2) { width: 95%; }
.skeleton-line:nth-child(3) { width: 88%; }
.skeleton-line:nth-child(4) { width: 70%; }

/* Responsive */
@media (max-width: 768px) {
  .vehicle-title {
    font-size: 1.5rem;
  }
  
  .vehicle-info-grid {
    grid-template-columns: 1fr;
  }
  
  .vehicle-card-image {
    height: 180px;
  }
  
  /* Skeleton responsive */
  .vehicle-card-skeleton {
    height: 420px;
    min-height: 420px;
  }
  
  .skeleton-image {
    height: 200px;
    min-height: 200px;
  }
  
  .skeleton-content {
    padding: 1rem;
    gap: 0.75rem;
  }
  
  .skeleton-title {
    height: 20px;
  }
  
  .skeleton-price {
    height: 28px;
  }
  
  .skeleton-button {
    height: 40px;
  }
}

/* Sidebar filtres - espace réservé */
.audi-filters:empty {
  min-height: 400px;
  background: linear-gradient(
    90deg,
    #f8f8f8 25%,
    #f0f0f0 50%,
    #f8f8f8 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite ease-in-out;
  border-radius: 8px;
}

/* Skeleton animation delay pour effet cascade */
.vehicles-skeleton-list .col-12:nth-child(1) .skeleton { animation-delay: 0s; }
.vehicles-skeleton-list .col-12:nth-child(2) .skeleton { animation-delay: 0.1s; }
.vehicles-skeleton-list .col-12:nth-child(3) .skeleton { animation-delay: 0.2s; }
.vehicles-skeleton-list .col-12:nth-child(4) .skeleton { animation-delay: 0.3s; }
.vehicles-skeleton-list .col-12:nth-child(5) .skeleton { animation-delay: 0.4s; }
.vehicles-skeleton-list .col-12:nth-child(6) .skeleton { animation-delay: 0.5s; }
.vehicles-skeleton-list .col-12:nth-child(7) .skeleton { animation-delay: 0.6s; }
.vehicles-skeleton-list .col-12:nth-child(8) .skeleton { animation-delay: 0.7s; }
.vehicles-skeleton-list .col-12:nth-child(9) .skeleton { animation-delay: 0.8s; }

/* Skeleton image animation delay */
.vehicles-skeleton-list .col-12:nth-child(1) .skeleton-image { animation-delay: 0s; }
.vehicles-skeleton-list .col-12:nth-child(2) .skeleton-image { animation-delay: 0.15s; }
.vehicles-skeleton-list .col-12:nth-child(3) .skeleton-image { animation-delay: 0.3s; }
.vehicles-skeleton-list .col-12:nth-child(4) .skeleton-image { animation-delay: 0.45s; }
.vehicles-skeleton-list .col-12:nth-child(5) .skeleton-image { animation-delay: 0.6s; }
.vehicles-skeleton-list .col-12:nth-child(6) .skeleton-image { animation-delay: 0.75s; }
.vehicles-skeleton-list .col-12:nth-child(7) .skeleton-image { animation-delay: 0.9s; }
.vehicles-skeleton-list .col-12:nth-child(8) .skeleton-image { animation-delay: 1.05s; }
.vehicles-skeleton-list .col-12:nth-child(9) .skeleton-image { animation-delay: 1.2s; }
