/* Overlay tìm kiếm */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(4rem, 12vh, 7rem) 1.25rem 2rem;
  overflow-y: auto;
}

.search-overlay[hidden] {
  display: none !important;
}

body.search-open {
  overflow: hidden;
}

.search-overlay__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.search-overlay__panel {
  position: relative;
  width: min(560px, 100%);
  z-index: 1;
}

.search-overlay__close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  color: #fff;
  font-size: 1.35rem;
  opacity: 0.85;
}

.search-overlay__close:hover {
  opacity: 1;
}

.search-overlay__form {
  margin-bottom: 1.25rem;
}

.search-overlay__input {
  width: 100%;
  padding: 1rem 1.15rem;
  font-size: 1.125rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.12);
}

.search-overlay__input::placeholder {
  color: #9a9a9a;
}

.search-overlay__input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.search-menu {
  color: #fff;
  font-size: clamp(1.125rem, 3.2vw, 1.45rem);
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.search-menu__section {
  margin-bottom: 0.65rem;
}

.search-menu__toggle,
.search-menu__heading {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0.35rem 0;
  cursor: pointer;
}

.search-menu__heading {
  cursor: default;
  margin: 0 0 0.4rem;
}

.search-menu__bullet {
  flex-shrink: 0;
  opacity: 0.95;
}

.search-menu__children {
  display: none;
  padding: 0.25rem 0 0.65rem 1rem;
}

.search-menu__section.is-open .search-menu__children {
  display: block;
}

.search-menu__link {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  color: inherit;
  text-decoration: none;
  padding: 0.28rem 0;
  opacity: 0.94;
  font-size: 1em;
  line-height: 1.4;
}

.search-menu__link:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.search-menu__plus {
  flex-shrink: 0;
  font-weight: 500;
  opacity: 0.85;
}

/* Danh mục — màu riêng, dễ phân biệt */
.search-menu__section--category .search-menu__toggle {
  color: #ffe8dc;
}

.search-menu__section--category .search-menu__children {
  padding-left: 0;
}

.search-menu__section--category .search-menu__link {
  color: #fff8f4;
  background: rgba(241, 90, 36, 0.22);
  border: 1px solid rgba(255, 200, 170, 0.35);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  opacity: 1;
}

.search-menu__section--category .search-menu__link:hover {
  background: rgba(241, 90, 36, 0.38);
  text-decoration: none;
}

.search-menu__section--suggest .search-menu__heading {
  font-size: 0.95em;
  opacity: 0.92;
}

.search-menu__children--suggest .search-menu__link {
  font-size: 0.95em;
  line-height: 1.45;
  opacity: 0.9;
}

/* Mobile: lưới 2 cột (2 mục mỗi hàng) */
@media (max-width: 900px) {
  .search-overlay {
    padding: 4.5rem 1rem 1.5rem;
    align-items: stretch;
  }

  .search-overlay__panel {
    width: 100%;
  }

  .search-overlay__input {
    font-size: 1.0625rem;
    padding: 0.95rem 1rem;
  }

  .search-menu {
    font-size: 1.0625rem;
  }

  .search-menu__section.is-open .search-menu__children:not(.search-menu__children--suggest) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.55rem;
    padding-left: 0;
    padding-right: 0;
  }

  .search-menu__section--category.is-open .search-menu__children {
    gap: 0.5rem;
  }

  .search-menu__children:not(.search-menu__children--suggest) .search-menu__link {
    padding: 0.45rem 0.5rem;
    font-size: 0.9375rem;
    align-items: center;
    min-height: 2.5rem;
  }

  .search-menu__section--category .search-menu__link {
    font-size: 0.9375rem;
    text-align: left;
  }

  .search-menu__children--suggest {
    display: block !important;
    grid-template-columns: 1fr;
  }

  .search-menu__children--suggest .search-menu__link {
    font-size: 0.9375rem;
    padding: 0.4rem 0;
  }

  .search-menu__plus {
    display: none;
  }

  .header-actions .btn-outline {
    display: none;
  }
}

@media (min-width: 901px) {
  .search-menu__section.is-open .search-menu__children:not(.search-menu__children--suggest) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 1rem;
    max-width: 28rem;
  }
}
