/* ============================= */
/* RESET                         */
/* ============================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

/* ============================= */
/* LOADER                        */
/* ============================= */
#loader {
  position: fixed;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#loader-icon {
  width: 60px;
  height: 60px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================= */
/* PAGE DETAIL                   */
/* ============================= */
.vehicle-detail {
  padding: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.vehicle-detail h2 {
  margin-top: 2rem;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}

.vehicle-detail h2::after {
  content: "";
  display: block;
  width: 100%;
  height: 4px;
  border-radius: 30px;
  background-color: #f3c306;
  margin-top: 8px;
}

/* Conteneur (2 colonnes) */
.detail-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  align-items: flex-start;
}

/* ============================= */
/* IMAGES                        */
/* ============================= */
.detail-image {
  flex: 1 1 420px;
}

#mainImage {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
  height: auto;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  display: block;
  cursor: pointer;
}

.thumbnails {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.thumbnails .thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,0.2);
  transition: transform 0.18s ease;
}

.thumbnails .thumb:hover {
  transform: scale(1.04);
}

/* ============================= */
/* INFOS                         */
/* ============================= */
.detail-info {
  flex: 1 1 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.detail-brand-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.detail-title span {
  font-size: 1.8rem;
  font-weight: 900;
  color: #111;
  line-height: 1.1;
}

.price {
  font-size: 1.8rem;
  font-weight: 900;
  color: #f3c306;
  margin: 0.25rem 0 0.4rem 0;
}

/* Specs (affiché seulement si contenu) */
.detail-specs {
  background-color: #f9f9f9;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
}

.detail-specs p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-specs strong {
  font-weight: 800;
  color: #555;
  font-size: 0.95rem;
}

.detail-specs span {
  font-size: 1.05rem;
  color: #222;
  font-weight: 600;
}

/* Autres compatibilités (discret) */
.compatibility-secondary {
  margin-top: 0.2rem;
}

.compatibility-secondary-title {
  font-weight: 900;
  color: #333;
  font-size: 0.95rem;
  margin-bottom: 8px;
  opacity: 0.85;
}

.compatibility-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f3f3f3;
  border: 1px solid #e5e5e5;
  color: #222;
  font-weight: 800;
  font-size: 0.9rem;
  opacity: 0.85;
}

.compat-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.compat-chip span {
  white-space: nowrap;
}

/* Description */
.description {
  margin-top: 0.2rem;
  line-height: 1.6;
  font-size: 1rem;
  color: #444;
  background-color: #f9f9f9;
  border-left: 4px solid #f3c306;
  padding: 1rem;
  border-radius: 8px;
}

.description strong {
  font-weight: 900;
}

/* ============================= */
/* ACTIONS                        */
/* ============================= */
.actions {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.return-button {
  background-color: #f3c306;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 900;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.return-button:hover {
  background-color: #000;
  transform: translateY(-1px);
}

.sheet-button{
  background-color: #f3c306;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 900;
  transition: background-color 0.2s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sheet-button:hover{
  background-color: #000;
  transform: translateY(-1px);
}

.sheet-button img{
  width: 20px;
  height: 20px;
  display: block;
  object-fit: contain;
}

.share-copy {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.share-copy img,
.share-whatsapp img {
  width: 30px;
  height: 30px;
  display: block;
}

.copy-confirmation {
  color: green;
  font-weight: 900;
  display: none;
}

/* ============================= */
/* LIGHTBOX                       */
/* ============================= */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.8);

  /* centre le contenu */
  align-items: center;
  justify-content: center;
}


.lightbox-content {
  display: block;
  max-width: 92%;
  max-height: 82vh;
  margin: 0;              /* plus de marge qui colle en haut */
  border-radius: 8px;
  object-fit: contain;
}

.lightbox .close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 3rem;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
}

.lightbox-nav {
  position: absolute;
  width: 100%;
  top: 50%;
  left: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateY(-50%);
  padding: 0 20px;
}

.lightbox-nav .prev,
.lightbox-nav .next {
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
  padding: 0.5rem 1rem;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.lightbox-nav .prev:hover,
.lightbox-nav .next:hover {
  background: rgba(0,0,0,0.6);
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  user-select: none;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

/* ============================= */
/* RESPONSIVE                     */
/* ============================= */
@media (max-width: 768px) {
  .detail-container {
    flex-direction: column;
    padding: 1rem;
  }

  .detail-specs {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .detail-title span {
    font-size: 1.45rem;
  }

  .vehicle-detail h2 {
    font-size: 2rem;
  }

  .detail-brand-logo {
    width: 46px;
    height: 46px;
  }
}
