/* SLS Mobile Hotfix P1 — 2026-09-20 v1.1.0
   Banner stack collapse + Ask-AI vs sticky ATC. Leaves WCSATT scheme-sync alone. */

/* Demote promo stack so header/hamburger win first-paint hit targets */
#sls-freebac2-banner,
#sls-nc3g1-banner,
.sp-ls-consumer-announcement,
.ruo-bar {
  position: relative !important;
  z-index: 20 !important;
}

.sp-ls-sticky-header-stack {
  z-index: 1200 !important;
  overflow: visible !important;
}
.sp-life-sciences-preview .site-header,
.sp-ls-sticky-header-stack .site-header,
header.site-header[data-site-header] {
  position: relative !important;
  z-index: 1210 !important;
}
.sp-life-sciences-preview .nav-toggle,
header.site-header .nav-toggle {
  position: relative !important;
  z-index: 1220 !important;
  pointer-events: auto !important;
}

@media (max-width: 900px) {
  .sp-ls-sticky-header-stack .site-header {
    position: relative !important;
    top: auto !important;
  }
  .sp-ls-sticky-header-stack {
    height: auto !important;
  }

  .sp-life-sciences-preview .primary-navigation.is-open {
    padding-top: 12px;
  }
  .sp-life-sciences-preview .primary-navigation.is-open .sp-ls-header-search-item {
    order: -1;
    width: 100%;
    margin: 8px 0 14px;
    padding: 0 4px;
    position: relative;
    z-index: 1;
  }
  .sp-life-sciences-preview .primary-navigation.is-open .sp-ls-header-search {
    width: 100%;
  }
  .sp-life-sciences-preview .primary-navigation.is-open .sp-ls-header-search input[type="search"] {
    width: 100%;
    max-width: none;
  }

  .sp-life-sciences-preview .nav-toggle[aria-expanded="true"] {
    position: relative;
  }
  .sp-life-sciences-preview .nav-toggle[aria-expanded="true"] span:not(.screen-reader-text) {
    position: absolute;
    left: 11px;
    width: 22px;
  }
  .sp-life-sciences-preview .nav-toggle[aria-expanded="true"] span:not(.screen-reader-text):nth-child(1) {
    top: 21px;
    transform: rotate(45deg);
  }
  .sp-life-sciences-preview .nav-toggle[aria-expanded="true"] span:not(.screen-reader-text):nth-child(2) {
    opacity: 0;
  }
  .sp-life-sciences-preview .nav-toggle[aria-expanded="true"] span:not(.screen-reader-text):nth-child(3) {
    top: 21px;
    transform: rotate(-45deg);
  }

  /* Shop with AI / Ryze / chat floats — hide on mobile product, sticky visible, nav open */
  body.single-product [class*="shop-with-ai" i],
  body.single-product [id*="shop-with-ai" i],
  body.woocommerce [class*="shop-with-ai" i],
  body.sls-nav-open [class*="shop-with-ai" i],
  html.sls-nav-open [class*="shop-with-ai" i],
  body.single-product iframe[src*="chat"],
  body.single-product [data-sls-ai-shop],
  #ryze-shop-with-ai,
  .ryze-shop-with-ai,
  .sls-shop-with-ai,
  body.single-product [class*="get-ryze" i],
  body.single-product [id*="get-ryze" i],
  body.single-product [class*="ryze-" i],
  body.sls-sticky-purchase-visible [class*="shop-with-ai" i],
  body.sls-sticky-purchase-visible .crisp-client,
  body.sls-sticky-purchase-visible #crisp-chatbox,
  body.sls-sticky-purchase-visible [id*="chat-widget" i],
  .sls-hf-hide-ai {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* —— Mobile promo stack: one primary promo + compact RUO —— */
@media (max-width: 760px) {
  /* Soften sticky purchase on first screen (mobile PDPs) */
  .sp-ls-sticky-purchase {
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
    padding-top: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    gap: 10px;
    z-index: 1300 !important;
  }
  .sp-ls-sticky-purchase.sls-sticky-soft-show:not([hidden]) {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .sp-ls-sticky-purchase button,
  .sp-ls-sticky-purchase a.button {
    min-height: 40px;
    font-size: 12px;
  }

  /* Compact RUO compliance — always visible, single slim line */
  .ruo-bar {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 10px !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    min-height: 0 !important;
  }
  .ruo-bar span + span::before {
    content: "·";
    margin-right: 6px;
    opacity: 0.7;
  }
  .ruo-bar.sls-ruo-compact span:nth-child(n+3) {
    display: none;
  }

  /* RUO must remain visible (compact). Override LS preview + any banner-collapse hide. */
  .ruo-bar,
  body .ruo-bar,
  .sp-life-sciences-preview .ruo-bar,
  body.sp-life-sciences-preview .ruo-bar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }


  /* Stack manager: only the active promo shows; others wait in session queue */
  #sls-freebac2-banner.sls-promo-parked,
  #sls-nc3g1-banner.sls-promo-parked,
  .sp-ls-consumer-announcement.sls-promo-parked,
  aside.sp-ls-consumer-announcement.sls-promo-parked {
    display: none !important;
  }

  /* Trust strip on PDP already large — keep but don't compete with sticky */
  body.single-product.sls-sticky-purchase-visible .sls-trust-strip {
    max-height: 36px;
    overflow: hidden;
  }

  /* Harden Ask-AI / get-ryze floats vs sticky CTA + primary ATC */
  body.single-product #ads-agent-host,
  body.single-product [id*="ryze" i],
  body.single-product [class*="ryze" i],
  body.single-product iframe[src*="get-ryze"],
  body.single-product iframe[src*="ryze"],
  body.sls-sticky-purchase-visible #ads-agent-host,
  body.sls-sticky-purchase-visible [id*="ryze" i],
  body.sls-sticky-purchase-visible [class*="get-ryze" i],
  body.sls-sticky-purchase-visible iframe[src*="ryze"],
  body.sls-sticky-purchase-visible [class*="ask-ai" i],
  body.sls-sticky-purchase-visible [id*="ask-ai" i],
  body.sls-hf-protect-atc #ads-agent-host,
  body.sls-hf-protect-atc [class*="shop-with-ai" i],
  body.sls-hf-protect-atc iframe[src*="ryze"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }
}
