/* ===== Search Suggest dropdown (autocomplete) ===== */
.ndc-suggest-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 9999;
  margin-top: 6px;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Nhóm (Bài viết / Dịch vụ) */
.ndc-suggest-group + .ndc-suggest-group {
  border-top: 1px solid #ececec;
}

.ndc-suggest-group-title {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #d4a017;
  background: #faf7ef;
  border-bottom: 1px solid #f0e9d6;
}

.ndc-suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: #333;
  transition: background 0.15s ease;
}

.ndc-suggest-group .ndc-suggest-item:last-child {
  border-bottom: none;
}

.ndc-suggest-item:last-child {
  border-bottom: none;
}

.ndc-suggest-item:hover,
.ndc-suggest-item:focus {
  background: #f7f7f7;
}

.ndc-suggest-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  background: #f0f0f0;
}

.ndc-suggest-title {
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ndc-suggest-title strong {
  color: #d4a017;
  font-weight: 700;
}

.ndc-suggest-empty {
  padding: 14px;
  text-align: center;
  font-size: 14px;
  color: #999;
}

/* ===== Hiệu ứng loading (khi dừng gõ) ===== */
.ndc-suggest-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 14px;
  font-size: 14px;
  color: #888;
}

.ndc-suggest-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e5e5;
  border-top-color: #d4a017;
  border-radius: 50%;
  animation: ndc-suggest-spin 0.7s linear infinite;
}

.ndc-suggest-loading-text {
  letter-spacing: 0.2px;
}

@keyframes ndc-suggest-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Hiệu ứng xổ xuống (slide-down) khi có kết quả ===== */
.ndc-suggest-box.is-open {
  animation: ndc-suggest-dropdown 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: top center;
}

@keyframes ndc-suggest-dropdown {
  from {
    opacity: 0;
    transform: translateY(-8px) scaleY(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scaleY(1);
  }
}

/* Trạng thái loading: không chạy animation xổ để giữ spinner ổn định */
.ndc-suggest-box.is-loading {
  animation: none;
}

/* Đảm bảo wrapper định vị tương đối để dropdown bám đúng */
.item-bar-search-header,
.box-bar-search {
  position: relative;
}
