.bv-header .right-menu .bv-global-search-menu-item > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--bv-create-trigger-size);
  height: var(--bv-create-trigger-size);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--bv-header-foreground);
  cursor: pointer;
}

.bv-header .right-menu .bv-global-search-menu-item > button svg {
  width: 22px;
  height: 22px;
}

.bv-header .right-menu .bv-global-search-menu-item > button:focus-visible {
  outline: 2px solid var(--bv-accent) !important;
  outline-offset: 2px;
}

.bv-global-search-panel {
  position: fixed;
  top: var(--bv-global-search-top, 110px);
  left: 50%;
  z-index: 9998;
  box-sizing: border-box;
  width: min(var(--bv-header-width), var(--bv-header-max-width));
  padding: 12px;
  border: 1px solid var(--bv-border-contrast-soft);
  border-radius: var(--bv-header-panel-radius);
  background: var(--bv-header-panel-bg);
  box-shadow: var(--bv-header-panel-shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -10px) scaleY(.88);
  transform-origin: top center;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}

.bv-global-search-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0) scaleY(1);
}

.bv-global-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--bv-input-border);
  border-radius: var(--bv-input-radius);
  background: var(--bv-input-bg);
  color: var(--bv-input-text);
}

.bv-global-search-form:focus-within {
  border-color: var(--bv-input-focus-ring);
}

.bv-global-search-form svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.bv-global-search-form input[type="search"] {
  display: block;
  flex: 1;
  box-sizing: border-box;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--bv-input-text);
  font: inherit;
  font-size: 16px;
  box-shadow: none;
}

.bv-global-search-form input[type="search"]::placeholder {
  color: var(--bv-placeholder-color);
  opacity: 1;
}

.bv-global-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.bv-global-search-panel .bv-search-suggestions {
  margin-top: 10px;
}

.bv-search-suggestions[hidden],
.bv-search-suggestions__list[hidden],
.bv-search-suggestions__empty[hidden] {
  display: none;
}

.bv-search-suggestions {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--bv-border-contrast-soft);
  border-radius: var(--bv-header-panel-radius);
  background: var(--bv-header-panel-bg);
  box-shadow: var(--bv-header-panel-shadow);
}

.bv-search-suggestions__list {
  min-height: 0;
  max-height: min(50vh, 420px);
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
}

.bv-search-suggestions__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: var(--bv-radius-sm);
  color: var(--bv-text-primary);
  text-decoration: none;
}

.bv-search-suggestions__item.is-active .bv-search-suggestions__link,
.bv-search-suggestions__link:hover,
.bv-search-suggestions__link:focus-visible {
  background: var(--bv-card-soft);
  color: var(--bv-text-primary);
}

.bv-search-suggestions__link:focus-visible,
.bv-search-suggestions__all:focus-visible {
  outline: 2px solid var(--bv-accent);
  outline-offset: -2px;
}

.bv-search-suggestions__image {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: var(--bv-radius-sm);
  object-fit: cover;
}

.bv-search-suggestions__content {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.bv-search-suggestions__type {
  color: var(--bv-text-muted);
  font-size: var(--bv-font-size-sm);
}

.bv-search-suggestions__title {
  overflow: hidden;
  font-size: var(--bv-font-size-base);
  font-weight: var(--bv-font-weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bv-search-suggestions__empty {
  margin: 0;
  padding: 14px;
  color: var(--bv-text-secondary);
}

.bv-search-suggestions__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.bv-search-suggestions__all {
  display: block;
  padding: 12px 14px;
  border-top: 1px solid var(--bv-border-subtle-strong);
  color: #fff;
  font-weight: var(--bv-font-weight-semibold);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.bv-search-suggestions__all:hover {
  background: var(--bv-card-soft);
}

@media (max-width: 1023px) {
  .bv-mobile-bottom-nav > button.bv-global-search-toggle {
    width: 100%;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
  }

  .bv-mobile-bottom-nav > button.bv-global-search-toggle[aria-expanded="true"] {
    color: var(--bv-mobile-nav-icon-active);
  }

  .bv-header .right-menu .bv-global-search-menu-item {
    display: none;
  }

  .bv-global-search-panel {
    top: auto;
    right: 0;
    bottom: calc(var(--bv-global-search-nav-height, 68px) + var(--bv-global-search-keyboard-offset, 0px));
    left: 0;
    width: 100%;
    padding: 10px max(12px, env(safe-area-inset-right, 0px)) 10px max(12px, env(safe-area-inset-left, 0px));
    border-radius: var(--bv-header-panel-radius) var(--bv-header-panel-radius) 0 0;
    transform: translateY(12px) scaleY(.88);
    transform-origin: bottom center;
    display: flex;
    flex-direction: column-reverse;
    max-height: var(--bv-global-search-available-height, 60vh);
  }

  .bv-global-search-panel .bv-global-search-form {
    flex: none;
  }

  .bv-global-search-panel .bv-search-suggestions {
    min-height: 0;
    margin: 0 0 10px;
  }

  .bv-global-search-panel .bv-search-suggestions__list {
    max-height: min(45vh, 360px);
  }

  .bv-global-search-panel.is-open {
    transform: translateY(0) scaleY(1);
  }

  body.bv-global-search-open .bv-mobile-bottom-nav {
    bottom: var(--bv-global-search-keyboard-offset, 0px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bv-global-search-panel {
    transition: none;
  }
}
