/* Back to Inventory */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #9e002e;
    text-decoration: none;
    margin: 2rem 0;
    font-weight: 500;
}

.back-link:hover {
    color: #b71c1c;
}

/* Vehicle Details Section */
.vehicle-details {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.vehicle-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.vehicle-images {
    display: grid;
    gap: 1rem;
}

.main-image {
    width: 100%;
    height: 350px;
    object-fit: contain;
    border-radius: 8px;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.thumbnail {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s;
}

.thumbnail:hover {
    transform: scale(1.05);
}

.vehicle-info h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.price {
    font-size: 2.5rem;
    font-weight: 600;
    color: #9e002e;
    margin-bottom: 2rem;
}

.drive-away {
    font-size: 1rem;
    color: #666;
    margin-left: 0.5rem;
}

.vehicle-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.spec-icon {
    color: #9e002e;
    font-size: 1.2rem;
}

.spec-label {
    color: #666;
    font-size: 0.9rem;
}

.spec-value {
    font-weight: 600;
    color: #333;
}

.key-features {
    margin-bottom: 2rem;
}

.key-features h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
}

.feature-item::before {
    content: "✓";
    color: #4caf50;
    font-weight: bold;
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.btn-enquire {
    background: #9e002e;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.3s;
}

.btn-enquire:hover {
    background: #b71c1c;
}

.btn-test-drive {
    background: transparent;
    color: #9e002e;
    border: 2px solid #9e002e;
    padding: 1rem 2rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-test-drive:hover {
    background: #9e002e;
    color: white;
}

/* Vehicle Description */
.vehicle-description {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

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

.vehicle-description p {
    margin-bottom: 1rem;
    color: #666;
    line-height: 1.8;
}

* Recommendations Section */
.recommendations {
    margin-top: 3rem;
}

.recommendations h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 600;
    color: #1a1a1a;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px; /* Limit the maximum width */
    margin-bottom: 3rem;
}

.recommendation-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 380px; /* Set a maximum width for each card */
    width: 100%;
}

.recommendation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.recommendation-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.recommendation-info {
    padding: 1.5rem;
}

.recommendation-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    height: 100px;
}

.recommendation-price {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.recommendation-specs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.recommendation-specs span {
    background: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #666;
}

.btn-view-details {
    display: inline-block;
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: #9e002e;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-view-details:hover {
    background: #b71c1c;
    text-decoration: none;
    color: white;
}

.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-content {
  background: white;
  border-radius: 10px;
  max-width: 600px;
  width: 100%;
  padding: 2rem;
  position: relative;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
}

.modal-close:hover {
  color: #333;
}

/* Form inputs inside modal */
.modal-content .form-group {
  margin-bottom: 1rem;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
}

.modal-content textarea {
  min-height: 100px;
  resize: vertical;
}

.btn-send {
  background: #9e002e;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-send:hover {
  background: #b71c1c;
}

.image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.spinner {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0; left: 0;
  z-index: 1;
}

.spinner::after {
  content: "";
  width: 30px;
  height: 30px;
  border: 4px solid #9e002e;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.lazy-image.hidden {
  visibility: hidden;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/* Responsive Design */
@media (max-width: 768px) {

    nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    .vehicle-header {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-enquire {
      width: fit-content;
    }

    .recommendations-grid {
        gap: 1.5rem;
    }

    .recommendation-card {
        max-width: 100%;
    }

    .recommendation-specs {
        gap: 0.5rem;
    }

    .recommendation-specs span {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }

    .modal-content {
      padding: 1.5rem;
    }
}


@media (max-width: 480px) {

    .price{
      font-size: 1.5rem;
    }

    .recommendations h2 {
        font-size: 1.5rem;
    }

    .recommendation-title {
        font-size: 1.1rem;
    }

    .recommendation-price {
        font-size: 1.3rem;
    }

    .recommendation-info {
        padding: 1rem;
    }
}
