/* Gated on the .has-vio-agent class that the injector adds to <html>
   once the feature flag resolves enabled. */
.has-vio-agent header.header .header__quick-search-bar {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.has-vio-agent header.header .header__quick-search-bar > .quick-search {
  flex: 1;
  min-width: 0;
  z-index: 2;
}

/* Hide the launcher while the search is open — it expands over the button. */
.has-vio-agent header.header .header__quick-search-bar > vio-launch-button {
  z-index: 1;
  transition: opacity 0.2s ease 0.2s;
}

.has-vio-agent header.header .header__quick-search-bar > .quick-search[data-quick-search-active='true'] ~ vio-launch-button {
  opacity: 0;
  pointer-events: none;
  transition-delay: 0s;
}

@media (max-width: 749px) {
  .has-vio-agent header.header .header__quick-search-bar {
    gap: 0.5rem;
  }
}

/* Hide Brando's Shopify Inbox chat launcher while something of ours occupies the
   bottom-right corner: the launch bar (only below 1756px) or the open/minimised drawer. */
@media (max-width: 1755px) {
  .vio-has-agent-launcher #shopify-chat,
  .vio-has-agent-launcher shopify-agent {
    display: none !important;
  }
}

.has-vio-agent:has(vio-agent-drawer:not([visibility='closed'])) #shopify-chat,
.has-vio-agent:has(vio-agent-drawer:not([visibility='closed'])) shopify-agent {
  display: none !important;
}

/* Lift Klaviyo's bottom-left teaser clear of the launcher bar. */
.has-vio-agent [class*="kl-teaser-"] {
  z-index: 40 !important;
}

@media (max-width: 1755px) {
  .vio-has-agent-launcher [class*="kl-teaser-"] {
    bottom: 110px !important;
    transition: opacity 0.2s ease !important;
  }

  .vio-has-agent-launcher:has(vio-launch-bar[hidden]) [class*="kl-teaser-"] {
    bottom: 0 !important;
  }

  .vio-has-agent-launcher [class*="kl-teaser-"]:has([style*="klaviyo-slidein"]) {
    opacity: 0 !important;
  }
}
