/* ===== MOBILE-FIRST RESPONSIVE DESIGN ===== */
* {
  box-sizing: border-box;
}

/* ===== BOOKING FORM STYLES ===== */
.cr-booking-search {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.cr-booking-search p {
  margin: 0 0 16px 0;
}

.cr-booking-search label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
}

.cr-booking-search select,
.cr-booking-search input[type="date"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  background: white;
  color: #333;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 20px;
  padding-right: 36px;
}

.cr-booking-search input[type="date"] {
  background-image: none;
}

.cr-booking-search select:focus,
.cr-booking-search input[type="date"]:focus {
  outline: none;
  border-color: #ffa500;
  box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.1);
}

.searchButtonCars {
  width: 100%;
  padding: 14px;
  background: #ffa500;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
  touch-action: manipulation;
}

.searchButtonCars:hover {
  background: #ff8c00;
}

.searchButtonCars:active {
  transform: scale(0.98);
}

.cr-booking-search > p:last-of-type {
  font-size: 13px;
  color: #666;
  margin: 16px 0 0 0;
}

/* ===== CAR GRID & CARDS ===== */
.cr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
  align-items: start;
}

.cr-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition:
    box-shadow 0.3s ease,
    transform 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cr-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.cr-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.cr-card > div {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cr-card h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a3a52;
}

.cr-card p {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  flex-grow: 1;
}

.cr-card .price {
  font-size: 20px;
  font-weight: 700;
  color: #ffa500;
  margin-bottom: 12px;
}

.cr-card .features {
  font-size: 13px;
  color: #888;
  font-style: italic;
  margin-bottom: 12px;
}

.cr-card .thumbs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cr-card .thumbs img {
  height: 50px;
  width: 50px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
  cursor: pointer;
  flex-shrink: 0;
}

.cr-card .book-btn {
  padding: 12px 16px;
  background: #ffa500;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
  width: 100%;
  touch-action: manipulation;
}

.cr-card .book-btn:hover {
  background: #ff8c00;
}

.cr-card .book-btn:active {
  transform: scale(0.98);
}

/* ===== MODAL STYLES ===== */
.cr-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.cr-overlay.active {
  display: flex;
}

.cr-overlay img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
}

.cr-overlay .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 32px;
  padding: 12px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  touch-action: manipulation;
}

.cr-overlay .nav:hover {
  background: rgba(0, 0, 0, 0.7);
}

.cr-overlay .nav.prev {
  left: 12px;
}

.cr-overlay .nav.next {
  right: 12px;
}

.cr-overlay .close {
  position: absolute;
  top: 12px;
  right: 12px;
  color: white;
  font-size: 32px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.cr-overlay .close:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* ===== MODAL FORM ===== */
.cr-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  display: none;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.cr-modal.active {
  display: block;
}

.cr-modal h3 {
  margin: 0 0 20px 0;
  font-size: 20px;
  color: #1a3a52;
  font-weight: 600;
}

.cr-modal .form-group {
  margin-bottom: 16px;
}

.cr-modal label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
  font-size: 14px;
}

.cr-modal input[type="text"],
.cr-modal input[type="email"],
.cr-modal input[type="tel"],
.cr-modal input[type="number"] {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  color: #333;
}

.cr-modal input:focus {
  outline: none;
  border-color: #ffa500;
  box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.1);
}

.cr-modal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cr-modal .form-row input {
  width: 100%;
}

.cr-modal .btn-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.cr-modal button {
  padding: 12px 16px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  touch-action: manipulation;
}

.cr-modal .btn-submit {
  background: #ffa500;
  color: white;
}

.cr-modal .btn-submit:hover {
  background: #ff8c00;
}

.cr-modal .btn-cancel {
  background: #e0e0e0;
  color: #333;
}

.cr-modal .btn-cancel:hover {
  background: #d0d0d0;
}

/* ===== SUCCESS & ERROR MESSAGES ===== */
.cr-success,
.cr-error {
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.6;
}

.cr-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.cr-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ===== TABLET (768px+) ===== */
@media (min-width: 768px) {
  .cr-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .cr-modal .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .cr-booking-search {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
    align-items: end;
  }

  .cr-booking-search p:nth-child(4) {
    grid-column: 1 / -1;
  }

  .searchButtonCars {
    grid-column: 1 / -1;
  }
}

/* ===== MOBILE (phones) adjustments ===== */
@media (max-width: 480px) {
  .cr-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }

  .cr-card {
    min-height: 320px;
  }

  .cr-card img {
    height: 140px;
  }
}

/* ===== DESKTOP (1024px+) ===== */
@media (min-width: 1024px) {
  .cr-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  .cr-card img {
    height: 220px;
  }

  .cr-modal {
    width: 500px;
  }
}
