/* Waterlily authoritative mobile search visibility fix.
   Supports the OLD Home wl50 header and NEW shared wl36 header.
   Written as explicit selectors to avoid previous conflicting mobile rules. */
@media screen and (max-width: 991.98px) {
  /* Old Home storefront: search form was never covered by earlier wl36 rules. */
  html body header#wl50-header form.wl50-search,
  html body header.wl50-header .wl50-search,
  html body header.wl50-header #wl50-search,
  html body header.wl50-header .wl-mobile-search-toggle,
  html body header.wl50-header .wl-mobile-search-panel,
  /* New unified header and account header. */
  html body header.wl36-header .wl-mobile-search-panel,
  html body header.wl36-header #wl36-mobile-search-panel,
  html body header.wl36-header form.wl36-search,
  html body header.wl36-header #wl-mobile-search-toggle,
  html body header.wl36-header .wl-mobile-search-toggle {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    height: 0 !important;
    width: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }
  /* Legacy Home: exactly-center wide wordmark; keep all existing drawer controls. */
  html body header.wl50-header .wl50-header-grid {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) minmax(0,auto) minmax(0,1fr) !important;
    grid-template-rows: auto auto !important;
    gap: 8px !important;
    align-items: center !important;
  }
  html body header.wl50-header a.wl50-brand {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    justify-self: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin-inline: auto !important;
    width: min(220px, 72vw) !important;
    max-width: min(220px, 72vw) !important;
    text-align: center !important;
  }
  html body header.wl50-header a.wl50-brand img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-height: 72px !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }
  html body header.wl50-header .wl50-dual-toggles {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    justify-content: space-between !important;
    width: 100% !important;
  }
  html body header.wl50-header .wl50-actions {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: center !important;
    width: auto !important;
    min-width: 0 !important;
  }
  /* When the old Home header renders buttons, ensure icon-only Website control. */
  html body header.wl50-header #wl-mobile-site-toggle {
    min-width: 44px !important;
    width: 48px !important;
    min-height: 44px !important;
    padding: 8px !important;
  }
  html body header.wl50-header #wl-mobile-site-toggle .wl-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
  }
  /* Unified header: retain centered-logo mobile design from previous patch. */
  html body header.wl36-header a.wl36-brand { justify-self: center !important; }
}
@media screen and (max-width: 375px) {
  html body header.wl50-header a.wl50-brand { width:min(190px, 65vw) !important; }
}

/* Final cascade guard: account and storefront mobile width, 2026-11-25. */
@media(max-width:991px){
html,body {max-width:100%;min-width:0!important;}
html body header.wl36-header .wl36-header-row {grid-template-columns:minmax(0,1fr) minmax(0,auto) minmax(0,1fr)!important;max-width:100%!important;width:100%!important;min-width:0!important;box-sizing:border-box!important;}
html body header.wl36-header a.wl36-brand {grid-column:1/-1!important;width:min(200px,70vw)!important;max-width:100%!important;min-width:0!important;}
html body header.wl36-header .wlb-hdr-actions {min-width:0!important;max-width:100%!important;gap:4px!important;}
html body header.wl36-header #wl-mobile-account-toggle,html body header.wl36-header .wl-mobile-signin-toggle {min-width:0!important;max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere;}
html body .wl36-account-content .wlb-bag {grid-template-columns:minmax(0,1fr)!important;}
html body .wlb-bag .wlb-item {grid-template-columns:minmax(0,84px) minmax(0,1fr)!important;}
html body .wlb-bag .wlb-item > * {min-width:0;}
html body .wlb-bag .wlb-item-img img {max-width:100%;height:auto;}
}
