/* Vehicles Page Styles */

main {
  margin-bottom: 40px;
  margin-top: 40px;
}

/* Mobile Filter Toggle */
.mobile-filter-toggle {
  display: none;
  margin-bottom: 20px;
}

.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #d74500;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  justify-content: center;
  position: relative;
}

.filter-toggle-btn:hover {
  background: #b83a00;
}

.active-filters-count {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Results Header */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background: #faf9f8;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.results-info span {
  font-weight: 600;
  color: #333;
  font-size: 1.1rem;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-controls label {
  font-weight: 500;
  color: #666;
  white-space: nowrap;
}

.sort-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 150px;
}

.sort-select:focus {
  outline: none;
  border-color: #d74500;
}

/* Main Layout */
.vehicles-list {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

/* Filters Sidebar */
.vehicles-filter {
  flex: 0 0 320px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.filter-container {
  padding: 25px;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f1f3f4;
}

.filter-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1c1c1c;
  margin: 0;
}

.clear-filters-btn {
  background: none;
  border: 1px solid #d74500;
  color: #d74500;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-filters-btn:hover {
  background: #d74500;
  color: white;
}

/* Filter Groups */
.filter-group {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f1f3f4;
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.filter-title {
  margin-bottom: 15px;
}

.filter-title h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-title svg {
  color: #d74500;
}

/* Search Input */
.search-wrapper {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e1e5e9;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: #fafbfc;
}

.search-input:focus {
  outline: none;
  border-color: #d74500;
  background: white;
  box-shadow: 0 0 0 3px rgba(215, 69, 0, 0.1);
}

/* Input Groups */
.input-group {
  display: flex;
  gap: 12px;
}

.input-wrapper {
  position: relative;
  flex: 1;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 12px 0px 12px;
  font-size: 0.9rem;
  line-height: 2;
  color: #333;
  background-color: #fafbfc;
  border: 1.5px solid #e1e5e9;
  border-radius: 8px;
  outline: none;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

.input-wrapper label {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: #757575;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: transparent;
  white-space: nowrap;
}

.input-wrapper input:focus + label,
.input-wrapper input:not(:placeholder-shown) + label {
  top: 2px;
  left: 8px;
  transform: translateY(0);
  font-size: 0.75rem;
  color: #d74500;
  background-color: #fafbfc;
  padding: 0 4px;
}

.input-wrapper input:focus {
  border-color: #d74500;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(215, 69, 0, 0.1);
}

.input-wrapper input::placeholder {
  color: transparent;
}

/* Remove number input arrows */
.input-wrapper input[type="number"]::-webkit-outer-spin-button,
.input-wrapper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-wrapper input[type="number"] {
  -moz-appearance: textfield;
}

/* Checkbox Groups */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 8px 0;
  transition: all 0.2s ease;
  border-radius: 6px;
  padding: 8px 12px;
}

.checkbox-item:hover {
  background: #faf9f8;
}

.checkbox-item input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.checkbox-item input[type="checkbox"]:checked + .checkmark {
  background: #d74500;
  border-color: #d74500;
}

.checkbox-item input[type="checkbox"]:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-item span:not(.checkmark) {
  font-size: 0.9rem;
  color: #333;
  font-weight: 500;
}

/* Vehicles Grid */
.cars-gallery-container {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.car-card {
    width: 100%;
}

/* No Results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
}

.no-results-content {
  max-width: 400px;
  margin: 0 auto;
}

.no-results svg {
  color: #ccc;
  margin-bottom: 20px;
}

.no-results h3 {
  font-size: 1.5rem;
  color: #666;
  margin-bottom: 10px;
}

.no-results p {
  color: #999;
  margin-bottom: 25px;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .vehicles-list {
    gap: 20px;
  }

  .vehicles-filter {
    flex: 0 0 280px;
  }

  .cars-gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 992px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }

  .results-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .sort-controls {
    justify-content: space-between;
  }

  .vehicles-list {
    flex-direction: column;
  }

  .vehicles-filter {
    flex: none;
    position: static;
    max-height: none;
  }

  .cars-gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .vehicles-hero {
    padding: 100px 0 40px 0;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .mobile-filter-toggle {
    display: block;
  }

  .vehicles-filter {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1000;
    overflow-y: auto;
    border-radius: 0;
    box-shadow: none;
  }

  .vehicles-filter.active {
    display: block;
  }

  .filter-container {
    padding: 20px;
    padding-top: 60px;
  }

  .filter-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    z-index: 1001;
  }

  .filter-header::after {
    content: "×";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
  }

  .results-header {
    padding: 15px;
  }

  .results-info span {
    font-size: 1rem;
  }

  .sort-select {
    min-width: 120px;
    font-size: 0.85rem;
  }

  .cars-gallery-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
  }

  .input-group {
    flex-direction: column;
    gap: 15px;
  }

  .checkbox-group {
    max-height: 200px;
    overflow-y: auto;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.8rem;
  }

  .results-header {
    padding: 12px;
  }

  .cars-gallery-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .car-card-details {
    padding: 15px;
  }

  .car-card-details h3 {
    font-size: 1rem;
  }

  .car-card-details .price {
    font-size: 1.2rem;
  }

  .filter-container {
    padding: 15px;
    padding-top: 60px;
  }

  .filter-group {
    margin-bottom: 20px;
  }
}

/* Loading Animation */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Smooth Transitions */
.cars-gallery-container {
  transition: all 0.3s ease;
}

.car-card {
  animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Custom Scrollbar for Filters */
.vehicles-filter::-webkit-scrollbar {
  width: 6px;
}

.vehicles-filter::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.vehicles-filter::-webkit-scrollbar-thumb {
  background: #d74500;
  border-radius: 3px;
}

.vehicles-filter::-webkit-scrollbar-thumb:hover {
  background: #b83a00;
}
