body {
  margin: 0;
  padding: 70px 0 0 0;
  font-family: 'Kanit', sans-serif;
  font-size: 18px;

  background-image: url('/img/BG-UsedCar.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  }
/* สำหรับ breadcrumb */
.custom-breadcrumb {
  padding: 10px 250px;
  border-radius: 5px;
  margin-top: 30px; /* เพิ่มระยะห่างจาก navbar ที่ fixed ไว้ */
  z-index: 1;
  position: relative;
  font-size: 16px;
}

.custom-breadcrumb .breadcrumb {
  margin: 0;
  padding: 0;
  background-color: transparent !important;
}

.custom-breadcrumb .breadcrumb-item.active {
    color: #6c757d;
    text-decoration: none;
}

/* ตกแต่ง container */
.container {
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  margin-top: 50px;
    background-image: url('img/BG-UsedCar.png');
}

/* ตกแต่งหัวข้อเมนูค้นหา */
.collapsible-header {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  padding: 10px 20px;
  background-color: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.collapsible-header .toggle-arrow {
  font-size: 18px;
  transition: transform 0.3s ease;
}

/* เปลี่ยนทิศทางของลูกศรเมื่อเปิด */
.collapsible-header[aria-expanded="true"] .toggle-arrow {
  transform: rotate(180deg);
}

/* ตกแต่งส่วนของ checkbox */
.custom-checkbox {
  margin-bottom: 15px;
}

.custom-checkbox input[type="checkbox"] {
  margin-right: 10px;
  cursor: pointer;
}

.custom-checkbox label {
  font-size: 14px;
  color: #555;
  cursor: pointer;
  transition: color 0.2s ease;
}

/* เปลี่ยนสีเมื่อ hover บน label */
.custom-checkbox label:hover {
  color: #007bff;
}

/* ตกแต่งส่วนที่แสดงผลเมื่อเลือกตัวเลือก */
.collapse {
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin-top: 10px;
  height: 0;
  overflow: hidden;
  transition: height 0.3s ease-out; /* เพิ่มการ transition เพื่อขยาย/ยุบเมนู */
}
/* เมื่อเมนูถูกขยาย */
.collapse.show {
  height: auto; /* ปล่อยให้ความสูงขยายเต็มที่ */
}

/* เพิ่มช่องว่างระหว่างหัวข้อ */
h5 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

/* เพิ่มขอบและสีให้การ์ด */
.custom-checkbox .filter-checkbox:checked + label {
  color: #0056b3;  /* เปลี่ยนสีของ label เมื่อเลือก */
  font-weight: bold;
}

/* การแสดงผลข้อมูลรถในรูปแบบการ์ด */
#carResults {
  display: grid; /* ใช้ grid แทน flex */
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* กำหนดให้การ์ดมีขนาดขั้นต่ำ 200px */
  gap: 10px; /* ระยะห่างระหว่างการ์ด */
  justify-items: center; /* จัดตำแหน่งการ์ดให้อยู่ตรงกลาง */
  margin-top: 20px; /* เพิ่มระยะห่างจากด้านบน */
}

/* การ์ดรถ */
.car-card {
  font-family: 'Kanit';font-size: 24px;
  width: 250px; /* กำหนดความกว้างเป็น 100% เพื่อให้การ์ดขยายเต็มที่ */
  height: 350px; /* ความสูงของการ์ด */
  background-color: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px;
  transition: box-shadow 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.car-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.car-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

.car-info h4 {
  font-size: 18px;
  margin: 10px 0;
}

.car-info p {
  color: #666;
  font-size: 14px;
}
/* สำหรับหน้าจอขนาดมือถือ (Mobile) */
@media (max-width: 768px) {
  .advertisement-fixed-left {
    display: none;
  }
  .custom-breadcrumb {
    font-size: 12px;
    padding: 10px 15px;
  }

  .custom-breadcrumb .breadcrumb-item {
    display: inline-block;
    max-width: 90vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* สำหรับหน้าจอที่มีขนาดใหญ่ขึ้น (แท็บเล็ตหรือเดสก์ท็อป) */
@media (min-width: 768px) {
  #carResults {
    grid-template-columns: repeat(4, 1fr); /* จัดการให้แสดงการ์ด 4 ตัวในแต่ละแถว */
  }
}
