/* Container */
.car-details {
 /* max-width: 900px;*/
  margin: auto;
  padding: 20px;
  font-family: system-ui, sans-serif;
  line-height: 1.6;
  background-color: #f3f3f3;
}

/* Heading */
.car-details h2 {
  margin: 16px 0;
  font-size: 1.8rem;
  color: black;
  line-height: 1.1;
}

/* Info text */
.car-details p {
  margin: 6px 0;
  font-size: 0.9rem;
  color: black;
  padding-bottom: 0.5em!important;
}

/* Gallery */
.car-gallery {
  margin-top: 20px;
  text-align: center;
}

/* Main image */
.car-gallery .main-image {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(194, 190, 190, 0.1);
  margin-bottom: 15px;
}

/* Thumbnails */
.car-gallery .thumbnails {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.car-gallery .thumbnail {
  width: 100px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, border 0.2s;
  border: 2px solid transparent;
}

.car-gallery .thumbnail:hover {
  transform: scale(1.05);
  border-color: black;
}

.car-info p strong{
  text-transform: capitalize;
}

/* gallery arrows */
.img-wrap { position: relative; }
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  width: 33px;
  height: 33px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  font-size: 17px;
  line-height: 1;
}
.gallery-arrow:hover { background: rgba(0,0,0,0.6); }
.gallery-arrow-left { left: 12px; }
.gallery-arrow-right { right: 12px; }

/* thumbnail active state */
.thumbnail.active-thumb { outline: 3px solid #111827; transform: scale(1.03); }

/* hide thumbnails on small screens */
@media (max-width: 767px) {
  .thumbnails { display: none!important; }
  .gallery-arrow { width: 24px; height: 24px; font-size: 14px; }
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483650;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
}
.lightbox-content {
  position: relative;
  max-width: 95%;
  max-height: 95%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-image {
  max-width: 80%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.lightbox-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #111;
  font-size: 20px;
  cursor: pointer;
  z-index: 12;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.9);
  border: none;
  width: 18px;
  height: 18px;
  font-size: 20px;
  border-radius: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 12;
}
.lightbox-nav.prev { left: -56px; }
.lightbox-nav.next { right: -56px; }

@media (max-width: 480px) {
  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }
  .lightbox-close { top: 8px; right: 8px; }
}

/* thumbnail scroller */
.thumbnails-wrapper { display:flex; align-items:center; gap:8px; margin-top:12px; }
.thumbs-track { display:flex; gap:8px; overflow-x:auto; scrollbar-width:none; -ms-overflow-style:none; padding:6px 4px; }
.thumbs-track::-webkit-scrollbar{ display:none; }
.thumbnail { width:72px; height:54px; object-fit:cover; border-radius:6px; cursor:pointer; flex:0 0 auto; }
.thumb-nav { background: rgba(0,0,0,0.45); color:#fff; border:none; width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.thumb-nav:disabled { opacity:0.4; cursor:default; }

@media (max-width: 767px) {
  .thumbnails-wrapper { display:none; }
}

/* Mobile: reduce padding for the details container */
@media (max-width: 767px) {
  .car-details {
    padding: 10px;
  }
}

/* Mobile-only: limit lightbox image width to 80% on small screens */
@media (max-width: 480px) {
  .lightbox-image { max-width: 100%; }
  .lightbox-nav{
    font-size: 15px;
  }
}
