/* Navigation Drawer — light theme matching the site palette
   (white / mint-cream surfaces, emerald accents, Playfair logo). */

.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.nav-drawer {
  position: fixed;
  left: -300px;
  top: 0;
  width: 272px;
  height: 100vh;
  background: var(--surface);
  z-index: 1000;
  overflow-y: auto;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--platinum);
  box-shadow: 0 0 30px var(--black_25);
}

.nav-drawer.open {
  left: 0;
}

/* Header */
.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--platinum);
  background: var(--mint-cream);
}

.nav-drawer-logo {
  font-family: var(--ff-playfair-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--russian-violet);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.nav-drawer-logo-span {
  color: var(--emerald);
}

.nav-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sonic-silver);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.nav-drawer-close:hover {
  color: var(--emerald);
  background: var(--surface);
}

/* User pill */
.nav-drawer-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 14px;
  padding: 10px 12px;
  background: var(--mint-cream);
  border-radius: 10px;
  border: 1px solid var(--platinum);
}

.user-pill-icon {
  font-size: 28px;
  color: var(--emerald);
  flex-shrink: 0;
}

.user-pill-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-pill-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--eerie-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-pill-email {
  font-size: 1.76rem;
  color: var(--sonic-silver);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Drawer Content */
.nav-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-drawer-section {
  padding: 4px 0;
}

/* Items */
.nav-drawer-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 18px;
  color: var(--gunmetal-2);
  text-decoration: none;
  font-size: 1.35rem;
  font-family: var(--ff-roboto);
  font-weight: 400;
  transition: color 0.2s, background 0.2s;
  border-radius: 0;
  position: relative;
}

.nav-drawer-item ion-icon {
  font-size: 18px;
  flex-shrink: 0;
  color: var(--sonic-silver);
  transition: color 0.2s;
}

.nav-drawer-item span {
  flex: 1;
}

.nav-drawer-item:hover {
  color: var(--emerald);
  background: var(--mint-cream);
}

.nav-drawer-item:hover ion-icon {
  color: var(--emerald);
}

.nav-drawer-item.active {
  color: var(--emerald);
  background: var(--mint-cream);
  font-weight: 600;
}

.nav-drawer-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--emerald);
}

.nav-drawer-item.active ion-icon {
  color: var(--emerald);
}

/* Badge */
.nav-drawer-badge {
  background: var(--emerald);
  color: var(--on-primary);
  font-size: 1.6rem;
  font-weight: 700;
  border-radius: 20px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Divider — a 1px rule, nothing more. It must stay EMPTY: it is only 1px tall,
   so anything nested inside paints outside its own box and overlaps whatever
   follows. Wrapping a section needs .nav-drawer-role-group below. */
.nav-drawer-divider {
  height: 1px;
  background: var(--platinum);
  margin: 6px 18px;
}

/* Role groups (Vendor Hub / Staff Panel) — hidden until authGuard.js reveals them.
   Unlike .nav-drawer-divider these WRAP a section, so they take their natural
   height and draw the separator with a pseudo-element instead. Nesting a section
   in a .nav-drawer-divider made the Vendor Hub and Staff Panel paint on top of
   each other, leaving only the last one clickable. The ::before keeps the rule
   inset 18px like a real divider while the items stay full-width. */
.nav-drawer-role-group {
  position: relative;
  margin-top: 6px;
  padding-top: 6px;
}

.nav-drawer-role-group::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 1px;
  background: var(--platinum);
}

/* Footer */
.nav-drawer-footer {
  padding: 12px 14px 20px;
  border-top: 1px solid var(--platinum);
  background: var(--mint-cream);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-drawer-footer-link {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 4px;
  color: var(--gunmetal-2);
  text-decoration: none;
  font-size: 1.35rem;
  transition: color 0.2s;
}

.nav-drawer-footer-link ion-icon {
  font-size: 18px;
  color: var(--sonic-silver);
  transition: color 0.2s;
}

.nav-drawer-footer-link:hover,
.nav-drawer-footer-link:hover ion-icon {
  color: var(--emerald);
}

/* Sign out / Sign in button */
.nav-drawer-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--surface);
  color: var(--emerald);
  border: 1px solid var(--emerald);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1.3rem;
  font-family: var(--ff-roboto);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.nav-drawer-logout:hover {
  background: var(--emerald);
  color: var(--on-primary);
}

.nav-drawer-logout ion-icon {
  font-size: 18px;
}

/* Hamburger — carries the emerald theme of the removed .nav-open-btn.
   !important beats the .header-action-btn base styles it shares. */
.nav-hamburger-btn {
  background-color: var(--emerald) !important;
  color: var(--on-primary) !important;
  border: none;
  cursor: pointer;
  font-size: 24px;
  padding: 8px;
  border-radius: var(--radius-4, 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.nav-hamburger-btn:hover {
  background-color: var(--green-pigment, #14a05a) !important;
  color: var(--on-primary) !important;
}

/* Scrollbar */
.nav-drawer::-webkit-scrollbar { width: 4px; }
.nav-drawer::-webkit-scrollbar-track { background: transparent; }
.nav-drawer::-webkit-scrollbar-thumb { background: var(--light-gray); border-radius: 4px; }
.nav-drawer::-webkit-scrollbar-thumb:hover { background: var(--surface-inverse); }

/* Responsive */
@media (max-width: 768px) {
  .nav-drawer { width: 256px; }
  .nav-drawer-item { padding: 10px 16px; }
}

/* ---------------------------------------------------------------------------
   Light/dark switch (drawer footer)

   Sits above the Settings link so it reads as a display preference rather than
   a navigation item. Colours come from assets/css/colors.css, so the control
   themes itself along with everything else.
   --------------------------------------------------------------------------- */

.nav-drawer-theme {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 10px 4px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--ff-roboto);
  font-size: 1.35rem;
  color: var(--on-surface);
  text-align: left;
  transition: color 0.2s;
}

.nav-drawer-theme:hover {
  color: var(--primary);
}

.nav-drawer-theme ion-icon {
  font-size: 18px;
  color: var(--on-surface-variant);
  transition: color 0.2s;
  flex-shrink: 0;
}

.nav-drawer-theme:hover ion-icon,
.nav-drawer-theme.is-dark ion-icon {
  color: var(--primary);
}

/* The switch itself is pushed to the far edge; the label takes the slack. */
.nav-drawer-theme span[data-theme-label] {
  flex: 1;
}

.nav-drawer-theme-track {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--outline);
  transition: background 0.22s ease;
}

.nav-drawer-theme.is-dark .nav-drawer-theme-track {
  background: var(--primary);
}

.nav-drawer-theme-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--constant-light);
  box-shadow: 0 1px 3px var(--black_25);
  transition: transform 0.22s ease;
}

.nav-drawer-theme.is-dark .nav-drawer-theme-thumb {
  transform: translateX(16px);
}

/* Keyboard users must be able to see what is focused. */
.nav-drawer-theme:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}
