/* ============================================================================
   Account area sidebar (#user-menu / .vrool-ua-*)
   ----------------------------------------------------------------------------
   Extracted from the inline <style> in footer.php on 2026-09-07.

   These rules must load from <head>. While they lived in the footer they applied
   only after the browser had already painted the sidebar using style.css, where
   .vrool-ua-menu is display:flex with a 4px gap and has no card background or
   border. The late switch to display:block plus the card styling relaid the whole
   list out — measured at 2035px -> 1898px tall, with items shifting up to 58px —
   which showed as a ~1s flicker on every account page load.

   Enqueued in head.php right after search-enhanced.css so the cascade order that
   the footer block relied on (after style.css and responsive.css) is unchanged.

   Anything added here is render-blocking, so keep it to the sidebar.
   ============================================================================ */

#user-menu {
  margin-bottom: 20px;
}

#user-menu .vrool-ua-menu {
  display: none;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  margin-top: -1px;
  overflow: hidden;
}

#user-menu .vrool-ua-menu a {
  display: flex !important;
  align-items: center !important;
  padding: 12px 18px !important;
  color: #111827 !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05) !important;
  transition: all 0.2s ease;
  line-height: 1.2 !important;
  margin: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#user-menu .vrool-ua-menu a:last-child {
  border-bottom: none !important;
}

#user-menu .vrool-ua-menu a:active,
#user-menu .vrool-ua-menu a.active {
  background: #f1f5f9 !important;
  color: #7648a8 !important;
}

#user-menu .vrool-ua-menu a.active .vrool-ua-icon img {
  filter: brightness(0.8) sepia(1) hue-rotate(250deg) saturate(5);
}

#user-menu .vrool-ua-menu a {
  background: #fff !important;
}

#user-menu .vrool-ua-menu .vrool-ua-icon {
  width: 24px !important;
  height: 24px !important;
  margin-right: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

#user-menu .vrool-ua-menu .vrool-ua-icon img,
#user-menu .vrool-ua-menu .vrool-ua-icon i {
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

#user-menu .vrool-ua-menu .vrool-ua-label {
  flex: 1 !important;
}

#user-menu .vrool-ua-menu .counter {
  background: #ef4444 !important;
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 2px 6px !important;
  border-radius: 20px !important;
  margin-left: 8px !important;
}

#user-menu .vrool-ua-section-title {
  background: #f8fafc;
  padding: 8px 18px;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(17, 24, 39, 0.5);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

body[data-theme="dark"] #user-menu .vrool-ua-menu {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] #user-menu .vrool-ua-menu a {
  color: #f1f5f9 !important;
  border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

body[data-theme="dark"] #user-menu .vrool-ua-section-title {
  background: rgba(15, 23, 42, 0.3);
  color: rgba(229, 231, 235, 0.5);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

#user-menu.is-open .vrool-ua-menu {
  display: block;
}

#user-menu.is-open #epsUaMenuToggle {
  border-radius: 12px 12px 0 0;
  border-bottom-color: transparent;
}

#user-menu.is-open #epsUaMenuToggle .chevron {
  transform: rotate(180deg);
}

/* Menu toggle: mobile only (desktop keeps sidebar always visible; no dropdown tab) */
@media screen and (max-width: 980px) {
  #epsUaMenuToggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    color: #111827;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  #epsUaMenuToggle .chevron {
    font-size: 12px;
    opacity: 0.5;
    transition: transform 0.2s ease;
  }
}

@media (min-width: 981px) {
  #epsUaMenuToggle,
  .vrool-ua-menu-toggle {
    display: none !important;
  }

  #user-menu {
    width: 280px !important;
    flex: 0 0 280px !important;
    margin-left: 0;
    position: sticky;
    /* Must stay 0 — see the note on #user-menu in css/style.css. body is the
       scrollport and already clears the fixed header, so a non-zero top here shows up
       as the sidebar sitting permanently below the content column. */
    top: 0;
    align-self: flex-start;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  #user-menu::-webkit-scrollbar {
    display: none;
  }

  #user-menu .vrool-ua-menu {
    display: block !important;
    border-radius: 12px;
    margin-top: 0;
    box-shadow: none;
    border: 1px solid rgba(15, 23, 42, 0.08);
  }
}
