/* Ô địa điểm trên khung tìm kiếm trang chủ (phần còn lại dùng #frm-search-job trong theme/css/style.css) */
.home-location {
  position: relative;
}
.home-location .select-multi-location {
  align-items: center;
  background: none;
  border: 0;
  color: #212f3f;
  cursor: pointer;
  display: flex;
  gap: 8px;
  height: 48px;
  min-width: 240px;
  padding: 0 12px;
  width: 100%;
}
.home-location .select-multi-location__content-text {
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-location .select-multi-location__clear {
  color: #7f878f;
  padding: 4px;
}
.home-location .select-multi-location__clear:hover {
  color: #212f3f;
}
.home-location__dropdown {
  background: #fff;
  border-radius: 12px;
  box-shadow: 2px 4px 16px 0 rgba(1, 18, 34, 0.1);
  left: 0;
  padding: 12px;
  position: absolute;
  top: calc(100% + 16px);
  width: 320px;
  z-index: 20;
}
.home-location__search {
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 8px;
}
.home-location__options {
  max-height: 320px;
  overflow-y: auto;
}
.home-location__option {
  background: none;
  border: 0;
  border-radius: 6px;
  color: #212f3f;
  display: block;
  font-size: 14px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
}
.home-location__option:hover {
  background: #f2f4f5;
}
.home-location__option.active {
  color: #00b14f;
  font-weight: 600;
}
.home-location__option[hidden] {
  display: none;
}
.home-location__empty {
  color: #7f878f;
  font-size: 14px;
  padding: 8px 10px;
}

/* Không cho ô tìm kiếm kéo giãn lưới header ra ngoài màn hình */
#section-header .header-content > * {
  min-width: 0;
}

/* Hộp gợi ý */
[data-search-box] [hidden] {
  display: none !important;
}
[data-search-box] .list-keyword {
  flex: 1;
  min-width: 0;
}
[data-search-box] .job-suggest-area {
  flex: 1;
  min-width: 0;
}
[data-search-box] .search-autocomplete__item {
  color: inherit;
  text-decoration: none;
}
.home-search__company-logo img {
  border: 1px solid #e9eaec;
  border-radius: 6px;
  height: 32px;
  object-fit: contain;
  width: 32px;
}

/* Thanh ngành nghề (khung, kích thước, vị trí panel con lấy từ .header-content_category-family trong theme/css/style.css) */
[data-category-nav] {
  color: #212f3f;
  position: relative;
}
[data-category-nav] .category-level-1 {
  display: flex;
  flex-direction: column;
  padding: 8px 0 0 16px;
}
[data-category-nav] .category-level-1__options {
  display: flex;
  flex: 1;
  flex-direction: column;
}
[data-category-nav] .category-level-1__option[hidden] {
  display: none;
}
[data-category-nav] .category-level-1__option-text {
  align-items: center;
  border-radius: 8px;
  color: #212f3f;
  display: flex;
  font-size: 14px;
  font-weight: 500;
  gap: 8px;
  justify-content: space-between;
  text-decoration: none;
}
[data-category-nav] .lv1-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
[data-category-nav] .lv1-icon {
  color: #a6acb2;
  font-size: 12px;
}
[data-category-nav]
  .category-level-1__option:hover
  .category-level-1__option-text,
[data-category-nav] .category-level-1__option:hover .lv1-icon {
  color: #00b14f;
}
[data-category-nav] .category-level-1__header {
  align-items: center;
  border-top: 1px solid #f2f4f5;
  color: #7f878f;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  margin-right: 16px;
}
[data-category-nav] .category-level-1__header-pagination-action {
  display: flex;
  gap: 8px;
}
[data-category-nav] .category-level-1__header-pagination-action button {
  align-items: center;
  background: #fff;
  border: 1px solid #00b14f;
  border-radius: 50%;
  color: #00b14f;
  display: flex;
  height: 26px;
  justify-content: center;
  width: 26px;
}
[data-category-nav]
  .category-level-1__header-pagination-action
  button:disabled {
  border-color: #dee0e2;
  color: #c5c9cc;
}

/* Panel cấp 2/3: phủ lên banner, cao bằng thanh ngành */
[data-category-nav] .category-children {
  display: none;
  /* gap: 4px 24px; */
  /* grid-template-columns: repeat(2, minmax(0, 1fr)); */
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;

  position: absolute;
  top: 0;
  width: min(810px, calc(100vw - 400px));
  z-index: 30;
}
[data-category-nav] .category-children:before {
  content: "";
  height: 100%;
  left: -19px;
  position: absolute;
  top: 0;
}
[data-category-nav] .category-children-content {
  /* Lưới 2 cột cố định, danh mục dài thì cuộn dọc (columns + chiều cao cố định sẽ tràn sang ngang) */
  align-content: start;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);
  padding: 16px 20px;
  width: 100%;
  display: grid;
  gap: 4px 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
[data-category-nav] .category-level-1__option:hover .category-children {
  display: block;
}
[data-category-nav] .category-children__group {
  margin-bottom: 12px;
  min-width: 0;
}
[data-category-nav] .category-children__title {
  color: #212f3f;
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
[data-category-nav] .category-children__items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
[data-category-nav] .category-children__items a {
  background: #f2f4f5;
  border-radius: 16px;
  color: #424e5c;
  font-size: 13px;
  padding: 3px 10px;
  text-decoration: none;
}
[data-category-nav] .category-children a:hover {
  color: #00b14f;
}

/* Dưới 992px bỏ thanh ngành nghề, banner chiếm hết chiều ngang */
@media (max-width: 991px) {
  #section-header .header-content {
    grid-template-areas: "search-area" "suggest-keyword-area" "banner-area" "job-area";
    grid-template-columns: 1fr;
  }
  #section-header .header-content_category-family {
    display: none;
  }
}

/* Màn hình tìm kiếm toàn trang dưới 1200px (theme ẩn ô địa điểm từ cỡ này trở xuống) */
.home-search__mobile-head {
  display: none;
}

@media (max-width: 1199px) {
  .home-location .select-multi-location {
    min-width: 0;
  }
  .home-location__dropdown {
    width: calc(100vw - 32px);
  }

  body.home-search-open {
    overflow: hidden;
  }
  /* .header-content tạo stacking context (z-index: 1), phải nâng lên để màn hình tìm kiếm nằm trên header của site */
  body.home-search-open #section-header,
  body.home-search-open #section-header .header-content {
    z-index: 10000;
  }
  #section-header .header-content_search.is-mobile-open {
    background: #fff;
    inset: 0;
    overflow-y: auto;
    padding: 0 16px 24px;
    position: fixed;
    z-index: 10000;
  }
  .is-mobile-open .home-search__mobile-head {
    align-items: center;
    color: #212f3f;
    display: flex;
    font-size: 16px;
    font-weight: 600;
    gap: 8px;
    height: 52px;
  }
  .home-search__back {
    background: none;
    border: 0;
    color: #212f3f;
    font-size: 18px;
    padding: 8px 8px 8px 0;
  }
  .is-mobile-open #frm-search-job {
    border-radius: 0;
    box-shadow: none;
    display: block;
    margin: 0 0 8px;
    padding: 0;
  }
  .is-mobile-open #frm-search-job .group-search {
    flex-direction: column;
    gap: 8px;
  }
  .is-mobile-open #frm-search-job .group-search > .item {
    border: 1px solid #e9eaec;
    border-radius: 8px;
    display: flex !important;
    padding: 0 12px;
    width: 100%;
  }
  .is-mobile-open #frm-search-job .group-search > .item:after {
    display: none;
  }
  .is-mobile-open #frm-search-job .group-search .item .item-select-wrapper {
    display: block;
    width: 100%;
  }
  .is-mobile-open #frm-search-job .btn-search-job-wrapper,
  .is-mobile-open #frm-search-job .btn-search-job {
    width: 100%;
  }
  .is-mobile-open .home-location .select-multi-location {
    padding: 0;
  }
  .is-mobile-open .home-location__dropdown {
    left: -13px;
    top: calc(100% + 4px);
  }
  .is-mobile-open > [data-search-box] {
    border-radius: 0;
    box-shadow: none;
    max-height: none;
    overflow: visible;
    position: static;
    width: 100% !important;
  }
  .is-mobile-open > [data-search-box] .list-keyword,
  .is-mobile-open > [data-search-box] .job-suggest-area {
    border-left: 0;
    min-width: 0;
    padding: 8px 0;
  }
}
