/* Existing vehicle-grid-container and vehicle-card styles */
.vehicle-grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: flex-start;
    padding: 20px;
    max-width: 1395px; /* 기존 최대 너비 제한 유지 */
    margin: 0 auto;

    /* ▼▼▼ 이 두 줄을 추가합니다 ▼▼▼ */
    width: fit-content;    /* 컨테이너의 너비를 내부 콘텐츠에 딱 맞게 설정 */
    /* ▲▲▲ ▲▲▲ */
}

.vehicle-card {
    width: 320px;
    background: #fdfdfd;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.vehicle-card:hover {
    transform: translateY(-4px);
}
.vehicle-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.vehicle-info {
    padding: 10px 15px;
}
.vehicle-title {
    font-size: 20px;
    font-weight: bold;
    color: #222;
    margin-bottom: 12px;
}

.vehicle-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding-top: 10px;
    padding-bottom: 10px;
}

.vehicle-badges .badge {
    background-color: #f8f0e5;           /* 연한 회베이지 색상 */
    border: 1px solid #d4dee8;           /* 약간 진한 회색 테두리 */
    padding: 4px 10px;                   /* 충분한 여백 */
    border-radius: 50px;                 /* pill 모양 */
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;                      /* 어두운 회색 텍스트 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* 약한 그림자 */
    display: inline-flex;                /* 텍스트 정렬용 */
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;    /* 부드러운 효과 */
}

.vehicle-price {
    font-size: 22px;
    font-weight: 900;
    color: #614a0e;
    text-align: center;
}

/* Filter & Pagination Styles */
.filter-toggle-container {
    text-align: center;
    margin-bottom: 20px;
    max-width: 1000px;
    margin: 20px auto 10px auto; /* Adjust margin to create space below it */
}

.toggle-filter-button {
  background-color: #daa520;
  color: white;
  border: none;
  padding: 8px 16px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  box-shadow: 0 2px 0 rgba(237, 213, 176, 0.75);
}

.toggle-filter-button:hover {
  background-color: #c1921f; /* 약간 어두운 골드로 호버 효과 */
}




.vehicle-filter-form {
  background-color: rgba(255, 251, 248, 0.6);;
  padding: 16px;
  margin: 8px auto 16px auto;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center; /* Search 버튼도 가운데 */
  gap: 16px;
}

.vehicle-filter-form .form-group-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* 폼 항목들을 가운데 정렬 */
  gap: 12px 16px;
  width: 100%;
}

.vehicle-filter-form .form-group {
  flex: 0 1 160px;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.vehicle-filter-form .form-group:nth-child(2),
.vehicle-filter-form .form-group:nth-child(3),
.vehicle-filter-form .form-group:nth-child(4) {
  flex: 0 1 180px;
}

.vehicle-filter-form .form-group:nth-child(5),
.vehicle-filter-form .form-group:nth-child(6) {
  flex: 0 1 80px;
}

.vehicle-filter-form .filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vehicle-filter-form label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 4px;
}

.vehicle-filter-form input[type="text"],
.vehicle-filter-form input[type="number"],
.vehicle-filter-form select {
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid #ddd;
  border-radius: 4px;
  height: 30px;
  box-sizing: border-box;
  width: 100%;
  background-color: white;
}

.vehicle-filter-form button[type="submit"] {
  background-color: #daa520;
  color: white;
  padding: 10px 20px;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  box-shadow: 0 2px 0 rgba(237, 213, 176, 0.75);
}

.vehicle-filter-form button[type="submit"]:hover {
  background-color: #c1921f;
}

/* 반응형 */
@media (max-width: 768px) {
  .vehicle-filter-form .form-group {
    flex: 1 1 100%;
  }
}






.vehicle-filter-form button[type="submit"] {
    grid-column: 1 / -1;
    background-color: #daa520; /* 골드색으로 변경 */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 2px 0 rgba(237, 213, 176, 0.75); /* 기존 버튼에 어울리는 그림자 추가 */
}

.vehicle-filter-form button[type="submit"]:hover {
    background-color: #c1921f; /* 약간 어두운 골드 */
}

/* Pagination Styles */
.vehicle-pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    padding-bottom: 30px;
    /* Ensure no overflow or cutoff */
    overflow-x: auto; /* Allow horizontal scrolling if necessary on small screens */
    white-space: nowrap; /* Prevent page numbers from wrapping */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}
.vehicle-pagination .page-numbers {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
    flex-wrap: nowrap; /* Ensure items stay in one line */
    justify-content: center; /* Center items within the flexible container */
}
.vehicle-pagination .page-numbers li {
    flex-shrink: 0; /* Prevent list items from shrinking */
}
.vehicle-pagination .page-numbers li a,
.vehicle-pagination .page-numbers li span {
    display: block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: #007bff;
    background-color: #fff;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.vehicle-pagination .page-numbers li a:hover {
    background-color: #e9ecef;
}
.vehicle-pagination .page-numbers li span.current {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    cursor: default;
}
.vehicle-pagination .page-numbers li .dots {
    border: none;
    background: none;
    padding: 8px 5px;
}

/* Loading overlay for UX */
#vehicle-listings-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 10;
    /* display: flex; Removed to prevent spinner from inheriting flex properties */
    /* justify-content: center; */
    /* align-items: center; */
    font-size: 1.5em;
    color: #007bff;
}
#vehicle-listings-container {
    position: relative; /* Required for loading overlay positioning */
    min-height: 200px; /* Prevent container from collapsing during loading */
}

/* Simple Spinner (optional, could use a Font Awesome spinner instead) */
#vehicle-listings-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .vehicle-grid-container {
        justify-content: center;
    }
    .vehicle-filter-form {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    .vehicle-filter-form .filter-group {
        flex-direction: column;
        align-items: flex-start;
    }
    .vehicle-filter-form button[type="submit"] {
        width: 100%;
    }
    .vehicle-card {
        width: 100%;
        max-width: 320px;
    }
}

.vehicle-filter-form select { /* Existing input style definition */
    /* ... existing styles preserved ... */
    opacity: 1 !important;
    visibility: visible !important;
}

.vehicle-filter-form.filter-form-collapsed {
    display: none;
}

/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}



/* 페이지네이션 바: 중앙 정렬 */
#new-vehicle-pagination-container {
  display: flex !important;
  justify-content: center;
  margin-top: 32px;
  margin-bottom: 24px;
}

/* 페이지 리스트 */
#new-vehicle-pagination-container .new-page-numbers {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 6px;
}

/* 공통 스타일 */
#new-vehicle-pagination-container .new-page-numbers li a,
#new-vehicle-pagination-container .new-page-numbers li span.current {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  color: #333;
  font-size: 14px;
  text-decoration: none;
  line-height: 1.4;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ✅ 현재 페이지 스타일: 금색 (#daa520) */
#new-vehicle-pagination-container .new-page-numbers li span.current {
  background-color: #daa520;
  color: #fff;
  border-color: #daa520;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(218, 165, 32, 0.25);
}

/* 호버 시 효과 */
#new-vehicle-pagination-container .new-page-numbers li a:hover {
  background-color: #fdf6e3;
  border-color: #daa520;
  color: #daa520;
}


.filter-toggle-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 1000px;
  margin: 20px auto 10px auto;
}

.sort-dropdown {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #daa520;
  color: white;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700; /* 현재 선택된 값은 굵게 */
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(237, 213, 176, 0.75);
  transition: background-color 0.3s ease;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1.41 0L6 4.59 10.59 0 12 1.41 6 7.41 0 1.41 1.41 0z' fill='%23fff'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 36px;
}

/* 호버 시 버튼 배경 */
.sort-dropdown:hover {
  background-color: #c1921f;
}

/* 셀렉트 내부 리스트 배경 흰색으로 (브라우저마다 제한적이나 기본 적용) */
.sort-dropdown option {
  background-color: white;
  color: #333;
}
