:root {
  --ems-drawer-bg: #0f4c47;
  --ems-drawer-head: #0b3d39;
  --ems-drawer-border: rgba(255, 255, 255, 0.12);
  --ems-drawer-card: rgba(255, 255, 255, 0.1);
  --ems-drawer-card-hover: rgba(255, 255, 255, 0.2);
}

body.ems-drawer-locked {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.ems-catalog-drawer {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  left: 0 !important;
  right: auto !important;
  width: min(86vw, 300px) !important;
  max-width: 300px !important;
  height: 100dvh !important;
  z-index: 100011 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  background: var(--ems-drawer-bg) !important;
  color: #fff !important;
  border: 0 !important;
  border-left: 0 !important;
  border-right: 1px solid var(--ems-drawer-border) !important;
  border-radius: 0 !important;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.38) !important;
  transform: translate3d(-105%, 0, 0) !important;
  transition: transform 0.28s ease !important;
  visibility: hidden;
  overflow: hidden !important;
  text-align: left;
  will-change: transform;
}

.ems-catalog-drawer.open {
  transform: translate3d(0, 0, 0) !important;
  visibility: visible;
}

.ems-catalog-drawer .drawer-header,
.ems-catalog-drawer .ems-drawer-header {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: max(16px, env(safe-area-inset-top)) 8px 16px 18px !important;
  min-height: 78px;
  background: var(--ems-drawer-head) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ems-drawer-border) !important;
  border-radius: 0 !important;
  color: #fff !important;
}

.ems-catalog-drawer .ems-drawer-brand {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  color: #fff;
  font: 900 16px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.5px;
}

.ems-catalog-drawer .ems-drawer-heading {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ems-catalog-drawer .drawer-header h3,
.ems-catalog-drawer .ems-drawer-title,
.ems-catalog-drawer .ems-drawer-heading > :first-child {
  margin: 0 !important;
  color: #fff !important;
  font: 700 16px/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ems-catalog-drawer .ems-drawer-subtitle {
  color: rgba(255, 255, 255, 0.54);
  font: 500 11px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ems-catalog-drawer .close-btn,
.ems-catalog-drawer .ems-drawer-close {
  flex: 0 0 38px !important;
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  font-size: 1.35rem !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

.ems-catalog-drawer .drawer-content,
.ems-catalog-drawer .ems-drawer-content {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 10px 14px calc(22px + env(safe-area-inset-bottom)) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.ems-catalog-drawer .ems-drawer-section {
  margin: 0 !important;
  padding: 6px 4px !important;
  color: rgba(255, 255, 255, 0.3) !important;
  font: 700 10px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: 1.2px !important;
  text-transform: uppercase;
}

.ems-catalog-drawer .drawer-footer {
  flex: 0 0 auto !important;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom)) !important;
  border: 0 !important;
  border-top: 1px solid var(--ems-drawer-border) !important;
  background: var(--ems-drawer-head) !important;
}

.ems-catalog-drawer .drawer-link,
.ems-catalog-drawer .drawer-btn,
.ems-catalog-drawer .ems-drawer-link,
.ems-catalog-drawer .ems-drawer-content > a,
.ems-catalog-drawer .ems-drawer-content > button {
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 54px !important;
  margin: 0 !important;
  padding: 10px 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: #fff !important;
  box-shadow: none !important;
  text-align: left !important;
  text-decoration: none !important;
  font: 500 14px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  cursor: pointer !important;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease !important;
}

.ems-catalog-drawer .ems-drawer-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin-right: 12px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  font-size: 17px;
  line-height: 1;
}

.ems-catalog-drawer .ems-drawer-label {
  min-width: 0;
  flex: 1 1 auto;
  color: inherit;
}

.ems-catalog-drawer .ems-drawer-chevron {
  flex: 0 0 auto;
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.24);
  font-size: 20px;
  line-height: 1;
}

.ems-catalog-drawer .drawer-link:hover,
.ems-catalog-drawer .drawer-btn:hover,
.ems-catalog-drawer .ems-drawer-link:hover,
.ems-catalog-drawer .ems-drawer-content > a:hover,
.ems-catalog-drawer .ems-drawer-content > button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: transparent !important;
}

.ems-catalog-drawer .drawer-link:active,
.ems-catalog-drawer .drawer-btn:active,
.ems-catalog-drawer .ems-drawer-link:active {
  transform: scale(0.985);
}

.ems-catalog-drawer a[href*="logout"],
.ems-catalog-drawer .drawer-link-danger {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: transparent !important;
  color: #fecaca !important;
}

.ems-catalog-drawer a[href*="logout"] .ems-drawer-icon,
.ems-catalog-drawer .drawer-link-danger .ems-drawer-icon {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
}

.ems-catalog-drawer-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100010 !important;
  display: block !important;
  background: rgba(0, 0, 0, 0.55) !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0.24s ease !important;
  backdrop-filter: blur(1.5px);
}

.ems-catalog-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.ems-catalog-drawer .lang-switch,
.ems-catalog-drawer .ems-drawer-language {
  border-color: var(--ems-drawer-border) !important;
  background: rgba(0, 0, 0, 0.12) !important;
}

.desktop-sidebar-handle {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .ems-catalog-drawer,
  .ems-catalog-drawer-overlay {
    transition-duration: 0.01ms !important;
  }
}
