/* car booking  */

.car-container {
  max-width: 1400px;
  margin: auto;
  margin-right: 32px;
  padding: 0 1rem;
}

.carbanner-img {
  max-width: 100%;
}
.car-desc {
  max-width: 95%;
}

.car-img {
  height: 188.2px;
  width: 100%;
  display: block;
  border-radius: 10px;
}

.car-container h4 {
  color: #1e977f;
  margin: 23px;
}

.car-view {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  text-align: center;
  max-width: 1310px;
  gap: 50px;
  margin-top: 30px;
}

.car-view div {
  flex: 1 1 20%;
  margin: 10px;
  height: 50%;
  padding: 0 4px;
  position: relative;
  width: 100%;
  overflow: hidden;
  color: #000;
}

.carbooking-btn {
  padding: 8px 16px;
  font-size: 14px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.carbooking-btn:hover {
  background: #e65c00;
}

/* overlay2 */
.car-view div .overlay2 {
  position: absolute;
  top: -10px;
  left: -10px;
  height: 245px;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0; /* hidden by default */
  transition: opacity 0.4s ease;
  border-radius: 10px;
}

.car-view div:hover .overlay2 {
  opacity: 1;
}
.overlay2 h3 {
  margin: 10px 0;
}

.overlay2 p {
  margin: 5px 0;
  font-size: 13px;
}

.carbooking-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: #1e977f;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.carbooking-btn:hover {
  background: #2cd3b1;
  color: #000;
  font-weight: 500;
}

/* car features  */
.car-details {
  margin: 20px 0;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
  line-height: 1.6;
}

.car-details h3 {
  color: #1e977f;
  margin-bottom: 8px;
}

.car-details p {
  color: black;
  font-weight: 400;
}
.car-details ul {
  list-style-type: disc;
  padding-left: 20px;
}

.car-details ul li {
  font-weight: 400;
  color: black;
}

/* rightside form  */
/* ---------- Main Booking Form (Right Form) ---------- */
.right-form {
  background: linear-gradient(135deg, #1e977f, #2cd3b1);
  display: flex;
  justify-content: center;
  margin: 30px auto;
  padding: 30px 40px;
  border-radius: 12px;
  width: 70%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.car-form form {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 1fr;
  gap: 18px 40px;
}

.right-form label {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  display: block;
  padding: 0;
  margin-bottom: 6px;
  width: 100%;
}

.right-form input,
.right-form textarea,
.right-form select {
  width: 400px;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
}

.right-form input:focus,
.right-form textarea:focus,
.right-form select:focus {
  box-shadow: 0 0 0 2px #007bff55;
}

.carbooking-btn2 {
  grid-column: span 2;
  justify-self: center;
  padding: 12px 28px;
  background: #fff;
  color: #1e977f;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: 0.3s;
}

.carbooking-btn2:hover {
  background: #2cd3b1;
  color: #000;
}

/* ---------- Popup Modal ---------- */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7); /* darker overlay */
  backdrop-filter: blur(2px); /* optional nice effect */
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #fff;
  padding: 25px 30px;
  border-radius: 12px;
  position: relative;
  max-height: 90vh; /* Prevent overflowing */
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  max-width: 700px;
  width: 90%;
  animation: fadeIn 0.3s ease;
}

/* Optional smooth fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-content h2 {
  color: #1e977f;
  margin-bottom: 15px;
  font-weight: 700;
  text-align: center;
}

.close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 22px;
  cursor: pointer;
  color: #444;
}

.modal-form {
  width: 100%;
  margin-bottom: 15px;
}

.modal-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.modal-form input,
.modal-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  outline: none;
  transition: 0.3s;
}

.modal-form input:focus,
.modal-form textarea:focus {
  border-color: #1e977f;
  box-shadow: 0 0 0 2px #1e977f33;
}

.modal-form textarea {
  min-height: 80px;
  resize: vertical;
}

.form-btn {
  display: block;
  margin: 15px auto 0;
  padding: 12px 28px;
  background: #1e977f;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: 0.3s;
}

.form-btn:hover {
  background: #2cd3b1;
  color: #000;
}

.car4 {
  height: 188.2px;
  width: 100%;
}

/* ===================== Responsive Styles ===================== */

/* Tablets (≤ 1024px) */
@media (max-width: 1024px) {
  .car-view {
    gap: 30px;
  }
  .car-view div {
    flex: 1 1 45%; /* 2 per row */
  }

  .right-form {
    width: 90%;
    padding: 25px;
  }
  .car-form form {
    grid-template-columns: 1fr 1fr; /* still 2 columns */
    gap: 15px 20px;
  }
  .right-form input,
  .right-form textarea,
  .right-form select {
    width: 100%; /* fix overflow */
  }
}

/* Mobiles (≤ 768px) */
@media (max-width: 768px) {
  .car-container {
    margin-right: 0;
    padding: 0 10px;
  }

  .car-view div {
    flex: 1 1 100%; /* 1 per row */
  }

  .right-form {
    width: 100%;
    border-radius: 0; /* full width section */
    padding: 20px;
    margin: 20px 0;
  }
  .car-form form {
    grid-template-columns: 1fr; /* stack into single column */
  }
  .carbooking-btn2 {
    grid-column: span 1; /* center button */
    justify-self: center;
  }
}

/* Small Mobiles (≤ 480px) */
@media (max-width: 480px) {
  .car-img,
  .car4 {
    height: auto; /* allow natural scaling */
  }
  .overlay2 {
    font-size: 12px;
    padding: 10px;
  }
  .modal-content {
    width: 95%;
    padding: 15px 20px;
  }
  .modal-form label {
    font-size: 12px;
  }
  .form-btn {
    width: 100%;
  }
}
