/* =======================================
   sidebar.css - styles chung cho các box sidebar
======================================= */

/* --- Cấu trúc chung cho sidebar box --- */
.sidebar-box {
  width: 90%;
  max-width: 90%;
  box-sizing: border-box;
  border: 1px solid #e6e6e6;
  background: #fff;
  border-radius: 8px;
  margin: 0 auto 12px;
  overflow: hidden;
  transition: box-shadow 0.18s ease;
}

/* Header */
.sidebar-box .sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f7fafc;
  cursor: pointer;
  font-weight: 600;
}

.sidebar-box .sidebar-header .title { font-size: 14px; }

.sidebar-box .sidebar-header .toggle-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 12px;
}

/* Nội dung */
.sidebar-box .sidebar-content {
  padding: 10px 12px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Danh sách link */
.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-list li { margin-bottom: 8px; }

.sidebar-list a {
  text-decoration: none;
  color: #222;
  display: inline-block;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.12s ease, color 0.12s ease;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-list a:hover {
  background: #f1f5ff;
  color: #0a7fff;
}

/* collapsed state */
.sidebar-box.collapsed .sidebar-content { display: none; }

/* Màu nền khác nhau cho từng box */
.sidebar-box[data-box="price"] .sidebar-header { background: #fffaf0; }
.sidebar-box[data-box="location"] .sidebar-header { background: #f0fff4; }
.sidebar-box[data-box="type"] .sidebar-header { background: #f0f7ff; }
.sidebar-box[data-box="recent"] .sidebar-header { background: #fff7fb; }

/* Đảm bảo mọi phần tử con không tràn */
.sidebar-box * {
  box-sizing: border-box;
  max-width: 100%;
}

/* BOX lọc theo giá */
.sidebar-box[data-box="price"] {
  width: 90%;
  max-width: 90%;
  margin: 0 auto;
  overflow: hidden;
}

.sidebar-box[data-box="price"] .sidebar-content {
  padding: 10px 12px;
  overflow-x: hidden;
}

.sidebar-box[data-box="price"] input[type="range"],
.sidebar-box[data-box="price"] .price-slider {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar-box .sidebar-header { padding: 10px; }
  .sidebar-box .sidebar-content { padding: 8px; }
}


/* ===============================
   Sidebar Recent - BĐS gần đây
   =============================== */

.sidebar-box[data-box="recent"] .sidebar-recent-item {
    display: block;
    text-decoration: none;
    color: #333;
    padding: 6px 10px;
    transition: background 0.2s;
}

.sidebar-box[data-box="recent"] .sidebar-recent-item:hover {
    background: #f8f8f8;
}

/* Khối chứa ảnh + tiêu đề */
.sidebar-recent-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Ảnh thumbnail nhỏ */
.sidebar-thumb-wrap {
    flex: 0 0 60px;
}
.sidebar-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

/* Tiêu đề: chỉ hiển thị 1 dòng, có dấu "..." */
.sidebar-recent-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    font-size: 14px;
}

/* Màu nhạt cho thông báo trống */
.sidebar-box[data-box="recent"] .muted {
    color: #999;
    font-style: italic;
}

