/* =========================================================
   DENTAL SOURCE NOW SHARED BACKDROP
   Matches the AmalgamAIQ backdrop without depending on or
   modifying the assistant's implementation.
   ========================================================= */

:root {
  --dsn-backdrop-duration: 820ms;
  --dsn-backdrop-ease: cubic-bezier(.16, 1, .3, 1);
}

.dsn-global-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--dsn-backdrop-z, 8000);
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  background: rgba(5, 8, 13, .62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition:
    opacity var(--dsn-backdrop-duration) var(--dsn-backdrop-ease),
    visibility 0s linear var(--dsn-backdrop-duration);
}

.dsn-global-backdrop.is-open {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transition:
    opacity var(--dsn-backdrop-duration) var(--dsn-backdrop-ease),
    visibility 0s linear 0s;
}

/*
 * Existing overlay elements remain in the DOM so old selectors and endpoint
 * fragments continue to work. Once the shared controller is ready, they are
 * transparent interaction shims and the shared backdrop owns the visual.
 */
html.dsn-backdrop-ready #mega-menu-overlay,
html.dsn-backdrop-ready #slider-overlay,
html.dsn-backdrop-ready .qo-backdrop,
html.dsn-backdrop-ready .hkx-customer-admin--standalone .hkx-admin-overlay {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  pointer-events: none !important;
}

html.dsn-backdrop-ready .quick-tools-slider.has-detail::before {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  pointer-events: none !important;
}

html.dsn-backdrop-ready .cart-page .cart-action-overlay {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/*
 * The customer dashboard can itself be loaded inside the global account
 * drawer. That nested mobile sidebar needs a second interaction plane while
 * the outer drawer backdrop is already active, so it stays local but consumes
 * this same visual contract instead of defining another look and timing.
 */
@media (max-width: 900px) {
  html.dsn-backdrop-ready .hkx-customer-admin--panel .hkx-admin-overlay {
    display: block !important;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    background: rgba(5, 8, 13, .62) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    backdrop-filter: blur(2px) !important;
    transition:
      opacity var(--dsn-backdrop-duration) var(--dsn-backdrop-ease),
      visibility 0s linear var(--dsn-backdrop-duration);
  }

  html.dsn-backdrop-ready .hkx-customer-admin--panel .hkx-admin-overlay.open {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
    transition:
      opacity var(--dsn-backdrop-duration) var(--dsn-backdrop-ease),
      visibility 0s linear 0s;
  }
}
