/* v5.1.3 — Mobile overlay cleanup */

@media (max-width: 782px) {
  /* Old personal shopper floating CTA: keep hidden by default so only the admin-enabled modern CTA can be used */
  body.vlg-theme .vlg-personal-shopper-fab {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* When mobile categories menu is open, hide bottom app bar so it doesn't cover menu content */
  body.vlg-theme.vlg-menu-open .vlg-mobile-appbar,
  body.vlg-theme .vlg-nav.is-open ~ .vlg-mobile-appbar {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(calc(100% + 24px)) !important;
  }

  /* Give open mobile menu more breathing room */
  body.vlg-theme .vlg-nav.is-open .vlg-nav-inner,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-nav-inner {
    padding-bottom: max(26px, env(safe-area-inset-bottom)) !important;
  }

  body.vlg-theme .vlg-nav.is-open .vlg-category-menu.is-open .vlg-category-dropdown > ul,
  body.vlg-theme .vlg-nav.is-open .vlg-category-menu.is-open .vlg-category-dropdown > .vlg-cat-dropdown-list,
  body.vlg-theme .vlg-nav.is-open .vlg-category-menu.is-open .vlg-cat-tree,
  body.vlg-theme .vlg-nav.is-open .vlg-category-button[aria-expanded="true"] + .vlg-category-dropdown > ul,
  body.vlg-theme .vlg-nav.is-open .vlg-category-button[aria-expanded="true"] + .vlg-category-dropdown > .vlg-cat-dropdown-list,
  body.vlg-theme .vlg-nav.is-open .vlg-category-button[aria-expanded="true"] + .vlg-category-dropdown .vlg-cat-tree,
  body.vlg-theme.vlg-mobile-auto-open-categories .vlg-nav.is-open .vlg-cat-tree {
    max-height: min(60vh, calc(100vh - 182px)) !important;
    padding-bottom: 18px !important;
    scroll-padding-top: 12px !important;
  }

  @supports (height: 100dvh) {
    body.vlg-theme .vlg-nav.is-open .vlg-category-menu.is-open .vlg-category-dropdown > ul,
    body.vlg-theme .vlg-nav.is-open .vlg-category-menu.is-open .vlg-category-dropdown > .vlg-cat-dropdown-list,
    body.vlg-theme .vlg-nav.is-open .vlg-category-menu.is-open .vlg-cat-tree,
    body.vlg-theme .vlg-nav.is-open .vlg-category-button[aria-expanded="true"] + .vlg-category-dropdown > ul,
    body.vlg-theme .vlg-nav.is-open .vlg-category-button[aria-expanded="true"] + .vlg-category-dropdown > .vlg-cat-dropdown-list,
    body.vlg-theme .vlg-nav.is-open .vlg-category-button[aria-expanded="true"] + .vlg-category-dropdown .vlg-cat-tree,
    body.vlg-theme.vlg-mobile-auto-open-categories .vlg-nav.is-open .vlg-cat-tree {
      max-height: min(60dvh, calc(100dvh - 182px)) !important;
    }
  }

  /* Keep the menu header readable and not visually crushed */
  body.vlg-theme .vlg-nav.is-open .vlg-mobile-nav-head,
  body.vlg-theme.vlg-menu-open .vlg-nav.is-open .vlg-mobile-nav-head {
    margin-bottom: 10px !important;
  }
}
