/* =========================================================================
   Chip picker — radio + label (pháp lý, phòng ngủ, phòng tắm)
   Hoạt động không cần JS; JS chỉ thêm khả năng bấm lại để bỏ chọn.
   ========================================================================= */
.chip-picker {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.chip-picker__label,
.compass-picker__label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

.chip-picker__group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip-picker__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.chip-picker__chip {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: #f1f3f5;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.chip-picker__chip:hover {
  background: #e8ecf1;
}

.chip-picker__input:checked + .chip-picker__chip {
  background: #1e3a5f;
  color: #fff;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.22);
}

.chip-picker__input:focus-visible + .chip-picker__chip {
  outline: 2px solid #1e3a5f;
  outline-offset: 2px;
}

/* =========================================================================
   Compass picker — SVG tĩnh (8 cung cố định) + radio định vị tuyệt đối
   Tô màu cung đang chọn bằng :has(); chữ đậm bằng :checked + label.
   ========================================================================= */
.compass-picker {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: center;
}

.compass-picker--align-left {
  align-items: flex-start;
}

.compass-picker__wheel {
  position: relative;
  width: min(100%, 240px);
  aspect-ratio: 1;
  margin: 0 auto;
}

.compass-picker--align-left .compass-picker__wheel {
  margin: 0;
}

.compass-picker__svg {
  display: block;
  width: 100%;
  height: 100%;
}

.compass-picker__ring-bg {
  fill: #fff;
}

.compass-picker__segment {
  fill: #eef1f5;
  stroke: #fff;
  stroke-width: 1.5;
  transition: fill 0.15s ease;
}

.compass-picker__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.compass-picker__opt {
  position: absolute;
  left: var(--compass-x);
  top: var(--compass-y);
  transform: translate(-50%, -50%);
  padding: 0.15rem 0.35rem;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.compass-picker__opt:hover {
  color: #1e3a5f;
}

.compass-picker__input:checked + .compass-picker__opt {
  color: #1e3a5f;
  font-weight: 700;
  transform: translate(-50%, -50%) scale(1.05);
}

.compass-picker__input:focus-visible + .compass-picker__opt {
  outline: 2px solid #1e3a5f;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Tô màu cung tương ứng radio đang chọn (pure CSS, không cần JS). */
.compass-picker__wheel:has(.compass-picker__input--0:checked) .compass-picker__segment--0,
.compass-picker__wheel:has(.compass-picker__input--1:checked) .compass-picker__segment--1,
.compass-picker__wheel:has(.compass-picker__input--2:checked) .compass-picker__segment--2,
.compass-picker__wheel:has(.compass-picker__input--3:checked) .compass-picker__segment--3,
.compass-picker__wheel:has(.compass-picker__input--4:checked) .compass-picker__segment--4,
.compass-picker__wheel:has(.compass-picker__input--5:checked) .compass-picker__segment--5,
.compass-picker__wheel:has(.compass-picker__input--6:checked) .compass-picker__segment--6,
.compass-picker__wheel:has(.compass-picker__input--7:checked) .compass-picker__segment--7 {
  fill: #dbeafe;
}

@media (min-width: 901px) {
  .compass-picker__wheel {
    width: 220px;
  }

  .compass-picker__opt {
    font-size: 0.72rem;
  }
}

/* =========================================================================
   Layout: khối đặc điểm trong bộ lọc nâng cao
   ========================================================================= */
.search-advanced-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.search-advanced-features__legal {
  min-width: 0;
}

.search-advanced-features__counts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .search-advanced-features__counts {
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
  }
}

@media (min-width: 901px) {
  .search-advanced-features {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 1.25rem 2rem;
    align-items: start;
  }

  .search-advanced-features__compass {
    grid-row: span 2;
    display: flex;
    justify-content: center;
  }
}

/* =========================================================================
   Layout: picker trong form admin
   ========================================================================= */
.admin-property-pickers {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
}

.admin-property-pickers .chip-picker__label,
.admin-property-pickers .compass-picker__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
}

.admin-property-pickers .compass-picker__wheel {
  width: min(100%, 200px);
}

.admin-property-pickers .compass-picker__opt {
  font-size: 0.62rem;
}

@media (min-width: 1100px) {
  .admin-property-pickers {
    grid-column: 1 / -1;
  }
}
