/* vehicle-detail.css - Advanced Modern Redesign */

:root {
  --navy: #001F3F;
  --aqua: #00D4FF;
  --white: #FFFFFF;
  --bg-color: #f8f9fa;
  --border-color: #e9ecef;
  --text-dark: #1a1a1a;
  --text-gray: #6c757d;
}

body {
  background-color: var(--bg-color);
}

img {
  max-width: 100%;
  height: auto;
}

.vehicle-detail-container {
  width: 100%;
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 20px 120px; /* Extended bottom padding for mobile sticky CTA */
  box-sizing: border-box;
}

/* Breadcrumb */
.breadcrumb-nav {
  margin: 20px 0 30px;
  font-size: 0.9rem;
}

.breadcrumb-nav ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.breadcrumb-nav li {
  display: flex;
  align-items: center;
}

.breadcrumb-nav li:not(:last-child)::after {
  content: '>';
  margin-left: 8px;
  color: var(--text-gray);
  font-size: 0.8rem;
}

.breadcrumb-nav a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.breadcrumb-nav a:hover {
  color: var(--aqua);
}

.breadcrumb-nav li[aria-current="page"] {
  color: var(--text-gray);
}

/* Header (Title & Price) */
.vehicle-header-wrapper {
  background: var(--white);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 20px;
}

.title-area h1 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--navy);
  margin: 0 0 10px 0;
  line-height: 1.3;
  word-break: break-all;
  overflow-wrap: break-word;
  white-space: normal;
  display: block;
}

.ai-tags-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-tag {
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 800;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.tag-low-mileage { background: #007bff; }
.tag-high-year { background: #ffc107; color: #333; }
.tag-long-inspect { background: #28a745; }

.price-area {
  text-align: right;
}

.price-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-gray);
  font-weight: bold;
  margin-bottom: 4px;
}

.price-value {
  font-size: 3.2rem;
  font-weight: 900;
  color: #e63946;
  font-family: 'Inter', sans-serif;
  line-height: 1;
}

.price-unit {
  font-size: 1.2rem;
  font-weight: bold;
  color: #e63946;
  margin-left: 4px;
}

/* Grid Layout */
.vehicle-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 7.5fr) minmax(0, 2.5fr);
  gap: 30px;
  align-items: start;
}

/* Gallery inside main content */
.gallery-wrapper {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  margin-bottom: 30px;
}

.main-image-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
  cursor: zoom-in;
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 31, 63, 0.95);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-modal.show {
  opacity: 1;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox-content.is-dragging {
  transition: none;
}

.lightbox-modal.show .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: var(--white);
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
  z-index: 10000;
}

.lightbox-close:hover {
  color: var(--aqua);
}

/* Thumbnail slider */
.thumbnails-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.thumb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 18px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.thumb-nav:hover {
  background: var(--navy);
  color: var(--aqua);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.thumb-prev {
  left: 10px;
}

.thumb-next {
  right: 10px;
}

.thumbnails-scroll {
  display: flex;
  gap: 10px;
  padding: 15px 50px 5px 50px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  width: 100%;
}
.thumbnails-scroll::-webkit-scrollbar {
  height: 6px;
}
.thumbnails-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.thumbnails-scroll::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 10px;
}

.thumbnail-wrapper {
  flex: 0 0 100px;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  opacity: 0.5;
  transition: all 0.2s ease;
  background-color: #f9f9f9;
}

.thumbnail-wrapper:hover {
  opacity: 1;
}

.thumbnail-wrapper.active {
  opacity: 1;
  border-color: var(--aqua);
}

.thumbnail-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Sections Base */
.detail-section {
  background: var(--white);
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  margin-bottom: 30px;
}

.detail-section h2 {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--navy);
  margin-top: 0;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Spec Board Grid */
.spec-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.spec-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-color);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.spec-label {
  font-size: 0.85rem;
  color: var(--text-gray);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.spec-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* Equipment List */
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
}

.equip-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: bold;
}

.equip-active {
  color: var(--navy);
}

.equip-icon {
  width: 28px;
  height: 28px;
  background: var(--aqua);
  color: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* Description */
.desc-content {
  line-height: 1.8;
  color: var(--text-dark);
  font-size: 1rem;
}

/* Contact Aside */
.contact-aside {
  background: var(--navy);
  color: var(--white);
  padding: 30px;
  border-radius: 16px;
  position: sticky;
  top: 100px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 31, 63, 0.2);
}

.contact-aside h3 {
  color: var(--aqua);
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.contact-aside p {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 25px;
}

.contact-info {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 25px;
}

.contact-info p {
  margin: 5px 0;
  font-size: 1.1rem;
  opacity: 1;
}

.contact-info p strong {
  color: var(--aqua);
}

.btn-contact {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--aqua);
  color: var(--navy);
  font-weight: 900;
  text-align: center;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: none;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 212, 255, 0.2);
}

.btn-contact:hover {
  transform: translateY(-2px);
  background: #33ddff;
  box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
}

.line-contact {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.line-qr {
  max-width: 140px;
  border-radius: 10px;
}

/* Mobile Sticky CTA */
.mobile-sticky-cta {
  display: none;
}

/* Responsive Overrides */
@media (max-width: 992px) {
  .vehicle-content-grid {
    grid-template-columns: 1fr;
  }
  .contact-aside {
    position: static;
  }
}

@media (max-width: 768px) {
  .vehicle-header-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }
  .price-area {
    text-align: left;
    width: 100%;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    margin-top: 10px;
  }
  .spec-board {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .thumb-nav {
    display: none;
  }
  
  .thumbnails-scroll {
    padding: 15px 15px 5px 15px;
  }

  /* Mobile Sticky CTA Trigger */
  .mobile-sticky-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: var(--white);
    padding: 15px 20px;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    box-sizing: border-box;
  }
  .sticky-price {
    display: flex;
    flex-direction: column;
  }
  .sticky-price .label {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: bold;
  }
  .sticky-price .val {
    color: #e63946;
    font-weight: 900;
    font-size: 1.6rem;
    font-family: 'Inter', sans-serif;
    line-height: 1;
  }
  .sticky-price .unit {
    font-size: 0.9rem;
    font-weight: bold;
    color: #e63946;
  }
  .mobile-sticky-cta .btn-contact {
    width: auto;
    padding: 12px 30px;
    font-size: 1rem;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .spec-board {
    grid-template-columns: 1fr;
  }
}