/* DOCHIFOOD PUBLIC V5.2.5 — SEARCH DOCK SLIDES AS ONE UNIT
   Closed: only icon at right edge.
   Open: whole dock widens to the left, carrying icon left while input appears. */

.v522-search-dock {
  position: fixed;
  right: 14px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 90;
  width: 48px;
  height: 48px;
  overflow: visible;
  transition: width .28s cubic-bezier(.22,.8,.2,1);
  will-change: width;
}

.v522-search-form {
  position: relative;
  width: 100%;
  height: 48px;
  display: block;
}

/* icon is pinned to LEFT of the dock. As dock width grows leftward
   because the dock itself is right-anchored, the icon physically slides left. */
.v522-search-toggle {
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  margin: 0;
  z-index: 2;
  transform: translateX(0) !important;
  transition: border-radius .2s ease, background-color .2s ease;
}

.v522-search-field {
  position: absolute;
  left: 56px;
  right: 0;
  top: 0;
  width: auto !important;
  height: 48px;
  opacity: 0;
  overflow: hidden;
  transform: translateX(14px);
  pointer-events: none;
  transition: opacity .14s ease, transform .28s cubic-bezier(.22,.8,.2,1);
}

.v522-search-dock.is-open {
  width: min(336px, calc(100vw - 28px));
}

.v522-search-dock.is-open .v522-search-field {
  width: auto !important;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

@media (max-width: 420px) {
  .v522-search-dock.is-open {
    width: calc(100vw - 28px);
  }
}

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

/* V5.2.6 FIX — force search dock visibility from the actual active tab.
   This avoids relying on JS timing when switching/swiping to Discover. */
.v522-search-dock { display: none; }
body:has(#v5Nav [data-view="discover"].active) .v522-search-dock { display: block; }
body:has(#v5Detail:not([hidden])) .v522-search-dock,
body:has(#v5LeadModal:not([hidden])) .v522-search-dock { display: none !important; }
