/* ============================================================
   details.css — Vehicle Detail Page Styles
   ============================================================ */

/* ── Base Layout ── */

/* ── Header ── */
.vehicle-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
}
.vehicle-header h1 {
  font-size: 2rem;
  margin: 0;
}
.vehicle-price {
  font-size: 1.75rem;
  color: #2e73f5;
  font-weight: bold;
  margin: 0;
}

/* ── Meta, Description, Features ── */
.vehicle-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1rem 0;
}
.vehicle-meta > div {
  flex: 1 1 200px;
}
/* .vehicle-description,
.vehicle-features {
  margin-bottom: 1.5rem;
} */
.vehicle-description h3,
.vehicle-features h3,
.vehicle-gallery h3 {
  margin-bottom: 0.5rem;
}
.vehicle-features ul {
  padding: 0;
}
.vehicle-features li {
  list-style: none;
}

/* ── Carousel ── */
.vehicle-gallery {
  margin-bottom: 1.5rem;
}
.gallery-carousel {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
}
.gallery-carousel .thumb {
  flex: 0 0 auto;
  width: 150px;
  height: 100px;
  overflow: hidden;
  border-radius: 4px;
  scroll-snap-align: start;
  position: relative;
}
.gallery-carousel .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.gallery-carousel .thumb:hover img {
  transform: scale(1.1);
}

/* ── Lightbox Modal via :target ── */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}
.lightbox:target {
  display: flex;
}
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 4px;
  width: 90%;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: white;
  text-decoration: none;
  line-height: 1;
  background: transparent;
}

.vehicle-price--container {
  text-align: right;
  width: 100%;
  min-width: 280px;

  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1rem;
  /* margin-left: -1rem; */
  /* margin-right: -1rem; */
}
/* ============================================================
   Responsive Breakpoints
   ============================================================ */

/* ── Mobile-first base ── */
.vehicle-detail > * {
  padding-bottom: 1.5rem;
}

.tabs--container {
  margin-top: 30px;
}

.vehicle-tabs {
  display: flex;
  flex-direction: row;
  overflow: auto;
}

.vehicle-tabs li {
  list-style: none;
  padding-left: 5px;
  padding-right: 5px;
}
.vehicle-tabs li a {
  text-decoration: none;
}

.card-info {
  padding: 1rem;
  padding-bottom: 1rem;
  background: var(--bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.card-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  border-bottom: 1px solid var(--muted);
  line-height: 30px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}
.badge.good {
  background: #e6fff3;
  color: #065f46;
}
.badge.info {
  background: #eef4ff;
  color: #0b3aa6;
}
.badge.danger {
  background: #fff1f0;
  color: #991b1b;
}
/* ── Tablet & up (≥768px): two-column grid ── */
@media (min-width: 768px) {
  .vehicle-header {
    grid-area: header;
  }
  .vehicle-meta {
    grid-area: meta;
    background: #f9faff;
    padding: 1rem;
    border-radius: 6px;
  }
  .vehicle-description {
    grid-area: description;
  }
  .vehicle-features {
    grid-area: features;
  }
  .vehicle-gallery {
    display: grid;
  }
  .vehicle-row-container {
    display: flex;
    flex-direction: row;
    gap: 5px;
  }
  .vehicle-price--container {
    text-align: right;
    width: auto;
    height: 260px;
    margin-left: 10px;
  }
  .card-info {
    max-width: 700px;
  }
}
.gray-background {
  background-color: #f1f4f9;
}

/* ── Desktop & up (≥992px): fine-tune spacing ── */
@media (min-width: 992px) {
  .gallery-carousel {
    gap: 1rem;
    padding-bottom: 1rem;
  }
  .vehicle-meta > div {
    flex: none;
    display: flex;
    justify-content: space-between;
  }
  /* .vehicle-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      'header header'
      'gallery meta'
      'description description'
      'features features';
    gap: 1.5rem;
  } */
}

/* ── Large desktop (≥1200px): widen and polish ── */
@media (min-width: 1200px) {
  .vehicle-detail {
    gap: 2rem;
  }
  .vehicle-description p {
    font-size: 1.1rem;
    line-height: 1.6;
  }
  .vehicle-features ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .vehicle-features li {
    background: #eef4ff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
  }
}

/* ===============================
   Detail page: 2-column layout @>=768px
   Images left | Meta right
   =============================== */

/* Base - mobile: gallery stacked above meta (no cambios necesarios) */

/* Ensure swiper blocks behave */
.vehicle-swiper-main,
.vehicle-swiper-thumbs {
  width: 100%;
  box-sizing: border-box;
}

/* Main images responsive - do not force parent's height on mobile */
.vehicle-swiper-main .swiper-slide img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* Thumbs: horizontal default (mobile) */
.vehicle-swiper-thumbs {
  margin-top: 12px;
  overflow-x: auto;
  display: flex;
  gap: 8px;
}
.vehicle-swiper-thumbs .swiper-slide {
  width: 110px;
  height: 70px;
  flex: 0 0 auto;
  opacity: 0.7;
  border-radius: 6px;
  overflow: hidden;
}
.vehicle-swiper-thumbs .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vehicle-swiper-thumbs .swiper-slide-thumb-active {
  opacity: 1;
  transform: scale(1.03);
  outline: 2px solid var(--primary-accent);
}

/* =========================
   Two-column layout at >=768px
   ========================= */
@media (min-width: 768px) {
  /* Cap height of the gallery so it fits next to meta column */
  .vehicle-swiper-main {
    max-height: 520px;
    overflow: hidden;
  }
  .vehicle-swiper-main .swiper-slide img {
    height: 100%;
    max-height: 520px; /* ensure it fills slider but won't overflow layout */
    object-fit: cover;
  }

  /* Thumbs remain horizontal below main slider (you can move them to vertical if you prefer) */
  .vehicle-swiper-thumbs {
    margin-top: 12px;
    overflow-x: auto;
  }

  /* Prevent meta column from shrinking too much */
  .vehicle-meta {
    min-width: 300px;
    background: #f9faff;
    padding: 1rem;
    border-radius: 6px;
  }
}

/* Desktop polish >= 992px */
@media (min-width: 992px) {
  .vehicle-swiper-main .swiper-slide img {
    max-height: 520px;
  }
  .vehicle-swiper-thumbs .swiper-slide {
    width: 120px;
    height: 80px;
  }
}

/* Hover zoom but no layout break */
.vehicle-swiper-main .swiper-slide img {
  transition: transform 0.28s ease;
}
.vehicle-swiper-main .swiper-slide img:hover {
  transform: scale(1.02);
}

/* Ensure fallback gallery (gallery-carousel) hidden when using Swiper */
.vehicle-gallery .gallery-carousel {
  display: none;
}

.badge-presale {
  background: orange;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
  margin-left: 10px;
}

.badge-sold {
  background: red;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
  margin-left: 10px;
}
