/* ==========================================================================
   PLIXWIN sidebar – smooth open/close, mobile drawer fix
   Loaded after the other stylesheets, so these rules win.
   ========================================================================== */
:root {
  --sb-ease: cubic-bezier(.22, .8, .24, 1);
}

/* ---------- colours ----------
   Back to the earlier look: dark grey panel, grey text and icons, gold only as a
   small accent on the selected item (colours come from navigation.css). */
.gold-account .px-avatar { display: inline-grid !important; flex: 0 0 36px !important; width: 36px !important; height: 36px !important; padding: 0 !important; font-size: 15px; }
.gold-sidebar .sidebar-item { transition: background-color .16s ease, color .16s ease; }
.gold-sidebar .sidebar-item:focus-visible { outline: 2px solid #8a8d97; outline-offset: 2px; }

/* ---------- desktop: smooth collapse ----------
   Only the sidebar's own width animates; the page moves once, without
   re-laying-out every frame (that was the lag). */
@media (min-width: 901px) {
  .site-sidebar.gold-sidebar { transition: width .24s var(--sb-ease); will-change: width; }
  .gold-sidebar .sidebar-item span, .gold-sidebar .gold-label, .gold-account span, .gold-daily strong, .gold-daily small { white-space: nowrap; }
}

/* ---------- mobile: slide-in drawer ----------
   The drawer now sits ABOVE the dark backdrop (before, the backdrop covered the
   drawer too, so the whole site looked dim / transparent). */
@media (max-width: 900px) {
  html body .site-sidebar.gold-sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0 !important; bottom: 0 !important; left: 0 !important;
    width: min(292px, 86vw) !important;
    height: 100% !important;
    padding: 0 !important;
    z-index: 240 !important;
    transform: translate3d(-104%, 0, 0);
    visibility: hidden;
    box-shadow: none !important;
    transition: transform .3s var(--sb-ease), visibility 0s linear .3s;
    will-change: transform;
  }
  html body.nav-open .site-sidebar.gold-sidebar {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    box-shadow: 18px 0 50px rgba(0, 0, 0, .55) !important;
    transition: transform .3s var(--sb-ease), visibility 0s;
  }
  html body .mobile-nav-backdrop {
    display: block !important;
    position: fixed !important; inset: 0 !important;
    z-index: 235 !important;
    background: rgba(4, 4, 6, .5) !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    opacity: 0; pointer-events: none;
    transition: opacity .3s ease;
  }
  html body.nav-open .mobile-nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; touch-action: pan-y; }
  .gold-sidebar .navigation-scroll {
    padding: calc(16px + env(safe-area-inset-top, 0px)) 14px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    overscroll-behavior: contain;
  }
  .gold-sidebar .sidebar-item { height: 46px !important; min-height: 46px !important; font-size: 15px !important; }
  .navigation-collapse { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .site-sidebar.gold-sidebar, html body .site-sidebar.gold-sidebar, html body .mobile-nav-backdrop { transition: none !important; }
}
