/* Navbar search (Hyper Creative style): collapsed = icon only, expanded = input overlays left */

.navbar-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 40px;
  min-width: 40px;
  flex-shrink: 0;
  overflow: visible;
}

/* Search icon: primary (theme) color */
.navbar-search-toggle,
.navbar-search-toggle i,
.navbar-search-submit,
.navbar-search-submit i {
  color: #00abc1 !important;
}

.navbar-search-toggle:hover,
.navbar-search-submit:hover {
  color: #1f4f51 !important;
}

.navbar-search-toggle {
  flex-shrink: 0;
  line-height: 1;
  padding: 0.25rem;
}

/* Bar overlays to the left; does not take navbar space */
.navbar-search-bar {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 220px;
  align-items: center;
  min-width: 0;
  background: #fff;
  border: 1px solid #dee2e6;
  border-bottom: none;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  gap: 0.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1051;
}

.navbar-search-wrapper[data-search-open="true"] .navbar-search-bar {
  display: flex;
}

.navbar-search-wrapper[data-search-open="true"] .navbar-search-toggle {
  display: none;
}

.navbar-search-input {
  border: none !important;
  padding: 0.2rem 0.25rem !important;
  font-size: 0.9rem;
  min-width: 0;
  box-shadow: none !important;
}

.navbar-search-input:focus {
  outline: none;
}

.navbar-search-submit {
  flex-shrink: 0;
  line-height: 1;
}

/* Suggestions dropdown: same width as search bar, right-aligned (wrapper is 40px so we set explicit width) */
.navbar-search-dropdown {
  position: absolute;
  top: 100%;
  left: auto;
  right: 0;
  width: 220px;
  min-width: 220px;
  margin-top: 1.25rem;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1051;
  display: none;
}

.navbar-search-dropdown.is-open {
  display: block;
}

.navbar-search-dropdown[aria-hidden="true"] {
  display: none;
}

.navbar-search-dropdown[aria-hidden="false"] {
  display: block;
}

.navbar-search-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: #212529;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.navbar-search-item:hover,
.navbar-search-item.navbar-search-item-active {
  background-color: rgba(0, 171, 193, 0.12);
  color: #00abc1;
}

.navbar-search-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 0.2rem;
  flex-shrink: 0;
}

.navbar-search-item-text {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
}

.navbar-search-empty {
  padding: 0.75rem 1rem;
  color: #6c757d;
  font-size: 0.9rem;
}

/* Mobile: search in header (navbar-mobile-actions). Bar expands wider, dropdown full width. */
@media (max-width: 767.98px) {
  .navbar-search-mobile.navbar-search-wrapper {
    width: 40px;
    min-width: 40px;
  }

  .navbar-search-mobile .navbar-search-bar {
    width: calc(100vw - 2rem);
    max-width: 12.5rem;
    right: 0;
    left: auto;
  }

  .navbar-search-mobile .navbar-search-dropdown {
    width: calc(100vw - 2rem);
    max-width: 15.5rem;
    min-width: 0;
    right: 0;
    left: auto;
  }
}
