/*
 * Inline header search state.
 * Desktop: Figma node 658:2120
 * Mobile:  Figma node 658:2150
 * Scoped to .vt-site-header / .vt-header-search only.
 */

.vt-header-search .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reveal from search-icon side (right) → left. No vertical motion. */
@keyframes vt-header-search-in {
  from {
    opacity: 0;
    clip-path: inset(0 0 0 100% round 34px);
    transform: translateX(8px);
  }

  to {
    opacity: 1;
    clip-path: inset(0 0 0 0 round 34px);
    transform: translateX(0);
  }
}

@keyframes vt-header-search-out {
  from {
    opacity: 1;
    clip-path: inset(0 0 0 0 round 34px);
    transform: translateX(0);
  }

  to {
    opacity: 0;
    clip-path: inset(0 0 0 100% round 34px);
    transform: translateX(8px);
  }
}

/* Single outer pill — only this surface has fill. */
.vt-header-search {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-sizing: border-box;
  min-width: 0;
  height: 45px;
  margin: 0;
  padding: 5px 5px 5px 30px;
  position: relative;
  background-color: var(--vt-color-neutral-100);
  border: 0;
  border-radius: 34px;
  box-shadow: none;
  overflow: hidden;
  outline: none;
  transform-origin: right center;
  transition: background-color 200ms ease;
}

.vt-site-header--search-active .vt-header-search,
.vt-site-header--search-closing .vt-header-search {
  display: flex;
}

.vt-site-header--search-active:not(.vt-site-header--search-closing) .vt-header-search {
  animation: vt-header-search-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.vt-site-header--search-closing .vt-header-search {
  animation: vt-header-search-out 200ms cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: none;
}

/* External search trigger — fade near the expand origin. */
.vt-site-header__actions {
  position: relative;
}

.vt-site-header__search {
  transition: opacity 120ms ease;
}

.vt-site-header--search-active .vt-site-header__search,
.vt-site-header--search-closing .vt-site-header__search {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.vt-header-search:focus-within {
  background-color: #eef2f7;
  outline: none;
  box-shadow: none;
}

/* Desktop 658:2120 — logo left, search 816 + language grouped right, gap 16px */
@media (min-width: 1025px) {
  .vt-site-header__nav {
    transition:
      opacity 140ms ease,
      transform 180ms ease;
  }

  .vt-site-header--search-active .vt-site-header__nav,
  .vt-site-header--search-closing .vt-site-header__nav {
    opacity: 0;
    transform: translateX(-8px);
    pointer-events: none;
    position: absolute;
    visibility: hidden;
  }

  .vt-site-header--search-active .vt-site-header__container,
  .vt-site-header--search-closing .vt-site-header__container {
    gap: 16px;
  }

  .vt-site-header--search-active .vt-header-search,
  .vt-site-header--search-closing .vt-header-search {
    flex: 0 1 816px;
    width: 816px;
    max-width: 816px;
    margin-left: auto;
  }

  /* Keep trigger origin near language cluster (search sits left of language). */
  .vt-site-header--search-active .vt-site-header__search,
  .vt-site-header--search-closing .vt-site-header__search {
    right: auto;
    left: 0;
  }
}

/*
 * Input is glass — no own fill, border, or outline.
 * High specificity to beat theme/Kadence input defaults.
 */
.vt-site-header .vt-header-search__field,
.vt-site-header .vt-header-search__field:hover,
.vt-site-header .vt-header-search__field:focus,
.vt-site-header .vt-header-search__field:focus-visible,
.vt-site-header .vt-header-search__field:active {
  box-sizing: border-box;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--vt-color-neutral-800);
  font-family: var(--vt-font-sans);
  font-size: var(--vt-text-card-size);
  font-weight: var(--vt-font-weight-regular);
  line-height: var(--vt-text-card-line-height);
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  outline-offset: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.vt-site-header .vt-header-search__field::placeholder {
  color: var(--vt-color-neutral-500);
  opacity: 1;
}

.vt-site-header .vt-header-search__field::-webkit-search-decoration,
.vt-site-header .vt-header-search__field::-webkit-search-cancel-button,
.vt-site-header .vt-header-search__field::-webkit-search-results-button,
.vt-site-header .vt-header-search__field::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.vt-header-search__submit {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 8px;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: var(--vt-radius-full);
  box-shadow: none;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.vt-header-search__submit:hover {
  color: var(--vt-color-neutral-700);
  background-color: rgb(15 23 42 / 0.04);
}

.vt-header-search__submit:active {
  color: var(--vt-color-neutral-800);
  background-color: rgb(15 23 42 / 0.06);
}

.vt-header-search__submit:focus {
  outline: none;
}

.vt-header-search__submit:focus-visible {
  color: var(--vt-color-neutral-700);
  background-color: rgb(15 23 42 / 0.06);
  outline: none;
  box-shadow: none;
}

.vt-header-search__submit-icon {
  display: block;
  width: 20px;
  height: 20px;
  color: inherit;
}

.vt-header-search__submit-icon circle,
.vt-header-search__submit-icon path {
  stroke: currentColor;
}

/* Mobile 658:2150 — search flex:1 + hamburger, gap 16px, logo fades */
@media (max-width: 1024px) {
  .vt-site-header__logo {
    transition: opacity 140ms ease;
  }

  .vt-site-header--search-active .vt-site-header__logo,
  .vt-site-header--search-closing .vt-site-header__logo {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
  }

  .vt-site-header--search-active .vt-site-header__container,
  .vt-site-header--search-closing .vt-site-header__container {
    gap: 16px;
  }

  .vt-site-header--search-active .vt-header-search,
  .vt-site-header--search-closing .vt-header-search {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    margin-left: 0;
  }

  .vt-site-header--search-active:not(.vt-site-header--search-closing) .vt-header-search {
    animation-duration: 220ms;
  }

  .vt-site-header--search-closing .vt-header-search {
    animation-duration: 180ms;
  }

  /* Trigger sits left of hamburger; keep origin on the right cluster. */
  .vt-site-header--search-active .vt-site-header__search,
  .vt-site-header--search-closing .vt-site-header__search {
    right: 28px;
    left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vt-header-search,
  .vt-header-search__submit,
  .vt-site-header__search,
  .vt-site-header__nav,
  .vt-site-header__logo {
    transition: none;
  }

  .vt-site-header--search-active:not(.vt-site-header--search-closing) .vt-header-search,
  .vt-site-header--search-closing .vt-header-search {
    animation: none;
    clip-path: none;
    transform: none;
    opacity: 1;
  }

  .vt-site-header--search-closing .vt-header-search {
    opacity: 0;
  }
}
