/* ==========================================================================
   WUC Technologies — Mobile Navigation Drawer Fix
   Target: .wuc-v5-drawer (mega-menu mobile navigation)
   Version: 1.0.0 | Date: 2026-04-12

   Problem: The drawer's height collapses to 64px (header-only) because
   a higher-specificity rule overrides `bottom: 0` on `.wuc-v5-drawer`.
   The `max-width: 384px` also prevents full-width on phones < 384px.

   Ownership: daemon:daemon | Permissions: 644
   ========================================================================== */

/* ── 1. Force full viewport height on the drawer ── */
.wuc-v5-drawer {
  height: 100vh !important;
  height: 100dvh !important;        /* Dynamic viewport height for mobile browsers */
}

/* ── 2. Full-width on small phones (< 430px) ── */
@media (max-width: 429px) {
  .wuc-v5-drawer {
    max-width: 100vw !important;
    width: 100vw !important;
  }
}

/* ── 3. Ensure drawer content scrolls properly ── */
.wuc-v5-drawer.is-open {
  display: flex;
  flex-direction: column;
}

.wuc-v5-drawer .wuc-v5-drawer-header {
  flex-shrink: 0;
}

.wuc-v5-drawer .wuc-v5-mobile-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;      /* Prevent scroll chaining to body */
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

/* ── 4. Improve mobile trigger buttons for touch targets ── */
@media (max-width: 1023px) {
  .wuc-v5-mobile-trigger {
    min-height: 48px;                /* WCAG 2.2 minimum touch target */
    padding-top: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  }

  .wuc-v5-mobile-trigger:last-of-type {
    border-bottom: none;
  }

  /* Accordion body links */
  .wuc-v5-accordion-body a {
    display: block;
    min-height: 44px;
    padding: 10px 16px 10px 8px;
    line-height: 1.4;
  }
}

/* ── 5. Close button — ensure reachable on all screen sizes ── */
.wuc-v5-close-btn {
  min-width: 44px;
  min-height: 44px;
}

/* ── 6. Safe area insets for notched phones (iPhone X+) ── */
@supports (padding: env(safe-area-inset-top)) {
  .wuc-v5-drawer {
    padding-top: env(safe-area-inset-top);
  }
}

/* ── 7. Body scroll lock reinforcement when drawer is open ── */
body.wuc-nav-open,
html.wuc-nav-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

/* ── 8. Overlay — ensure it covers full viewport ── */
.wuc-v5-mobile-overlay.is-open {
  position: fixed;
  inset: 0;
  z-index: 199;
}

/* ── 9. Smooth open/close animation ── */
@media (prefers-reduced-motion: no-preference) {
  .wuc-v5-drawer {
    transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wuc-v5-drawer {
    transition: none;
  }
}
