/* DOCHIFOOD PUBLIC V5.2.2 — HORIZONTAL SEARCH PILL */

.v522-search-dock {
  position: fixed;
  z-index: 90;
  right: 14px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  pointer-events: auto;
}

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

.v522-search-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.v522-search-toggle {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(8,126,88,.55);
  border-radius: 15px;
  background: rgba(255,255,255,.94);
  color: #087e58;
  box-shadow: none;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.v522-search-toggle svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.v522-search-field {
  position: relative;
  width: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateX(10px);
  transition:
    width .24s cubic-bezier(.22,.8,.2,1),
    opacity .16s ease,
    transform .24s cubic-bezier(.22,.8,.2,1);
}

.v522-search-dock.is-open .v522-search-field {
  width: min(270px, calc(100vw - 84px));
  opacity: 1;
  transform: translateX(0);
}

#v522SearchInput {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 16px;
  border: 1.5px solid #cfdcd6;
  border-radius: 15px;
  outline: 0;
  background: rgba(255,255,255,.97);
  color: #153f33;
  font: inherit;
  font-size: 15px;
  box-shadow: none;
}

#v522SearchInput:focus {
  border-color: #087e58;
}

#v522SearchInput::placeholder { color: #9aa7a2; }

.v522-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #76857f;
  font-size: 21px;
  line-height: 1;
}
.v522-search-clear[hidden] { display:none !important; }

/* Khi detail/modal mở thì tránh chồng UI. */
body:has(#v5Detail:not([hidden])) .v522-search-dock,
body:has(#v5LeadModal:not([hidden])) .v522-search-dock {
  display: none !important;
}

@media (min-width: 900px) {
  .v522-search-dock {
    right: 26px;
    bottom: 28px;
  }
  .v522-search-dock.is-open .v522-search-field {
    width: 340px;
  }
}
