/**
 * Menu drawer: trigger + fixed header + scrollable nestable body.
 */
.zrm-menu-drawer {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  --zrm-md-bar-width: 20px;
  --zrm-md-bar-height: 2px;
  --zrm-md-bar-gap: 4px;
  --zrm-md-bar-color: currentColor;
  --zrm-md-drawer-width: min(100vw, 420px);
  --zrm-md-backdrop: #000000;
  --zrm-md-backdrop-opacity: 0.45;
  --zrm-md-drawer-bg: #ffffff;
  --zrm-md-slide-duration: 0.42s;
  --zrm-md-slide-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --zrm-md-close-width: 2.75rem;
  --zrm-md-close-height: 2.75rem;
}

.zrm-menu-drawer__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  line-height: 1;
}

.zrm-menu-drawer__trigger:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.zrm-menu-drawer__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
}

.zrm-menu-drawer__bar {
  display: block;
  width: var(--zrm-md-bar-width);
  height: var(--zrm-md-bar-height);
  background-color: var(--zrm-md-bar-color);
  border-radius: 1px;
  transform-origin: center;
  transition: transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

.zrm-menu-drawer__bar + .zrm-menu-drawer__bar {
  margin-top: var(--zrm-md-bar-gap);
}

/* Hover: pinch top + bottom bars toward the middle (subtle "squish") */
@media (hover: hover) and (pointer: fine) {
  .zrm-menu-drawer__trigger:hover .zrm-menu-drawer__burger .zrm-menu-drawer__bar:nth-child(1) {
    transform: translateY(calc(var(--zrm-md-bar-gap, 4px) * 0.42));
  }

  .zrm-menu-drawer__trigger:hover .zrm-menu-drawer__burger .zrm-menu-drawer__bar:nth-child(3) {
    transform: translateY(calc(var(--zrm-md-bar-gap, 4px) * -0.42));
  }
}

.zrm-menu-drawer__label {
  white-space: nowrap;
}

/* Backdrop */
.zrm-menu-drawer__backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: var(--zrm-md-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--zrm-md-slide-duration) var(--zrm-md-slide-ease);
}

.zrm-menu-drawer--open .zrm-menu-drawer__backdrop {
  opacity: var(--zrm-md-backdrop-opacity);
  pointer-events: auto;
}

/* Drawer panel — translate3d keeps animation on the GPU */
.zrm-menu-drawer__layer {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  width: min(100vw, var(--zrm-md-drawer-width));
  max-width: 100vw;
  background: var(--zrm-md-drawer-bg);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  backface-visibility: hidden;
  transition: transform var(--zrm-md-slide-duration) var(--zrm-md-slide-ease);
  overflow: hidden;
  will-change: transform;
}

.zrm-menu-drawer[data-direction="right"] .zrm-menu-drawer__layer {
  right: 0;
  left: auto;
  transform: translate3d(100%, 0, 0);
}

.zrm-menu-drawer[data-direction="left"] .zrm-menu-drawer__layer {
  left: 0;
  right: auto;
  transform: translate3d(-100%, 0, 0);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

/* Same specificity as [data-direction] rules above (0,3,0) so open state wins */
.zrm-menu-drawer--open[data-direction="right"] .zrm-menu-drawer__layer,
.zrm-menu-drawer--open[data-direction="left"] .zrm-menu-drawer__layer {
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .zrm-menu-drawer__layer {
    transition-duration: 0.01ms;
  }

  .zrm-menu-drawer__backdrop {
    transition-duration: 0.01ms;
  }

  .zrm-menu-drawer__bar {
    transition-duration: 0.01ms;
  }

  .zrm-menu-drawer__trigger:hover .zrm-menu-drawer__burger .zrm-menu-drawer__bar {
    transform: none;
  }
}

.zrm-menu-drawer__layer[hidden] {
  display: none !important;
}

.zrm-menu-drawer__inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  height: 100%;
}

.zrm-menu-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.zrm-menu-drawer__title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 500;
  line-height: 1.4;
  color: inherit;
}

.zrm-menu-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  width: var(--zrm-md-close-width, 2.75rem);
  height: var(--zrm-md-close-height, 2.75rem);
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  line-height: 0;
  cursor: pointer;
}

/* Default close: two bars (same thickness as hamburger) forming an X */
.zrm-menu-drawer__close-bars {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
}

.zrm-menu-drawer__close-bars .zrm-menu-drawer__close-bar {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: min(var(--zrm-md-close-width), var(--zrm-md-close-height));
  height: var(--zrm-md-bar-height, 2px);
  margin: 0;
  background-color: currentColor;
  border-radius: 1px;
  transform-origin: center;
}

.zrm-menu-drawer__close-bars .zrm-menu-drawer__close-bar:nth-child(1) {
  transform: translate(-50%, -50%) rotate(45deg);
}

.zrm-menu-drawer__close-bars .zrm-menu-drawer__close-bar:nth-child(2) {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Bricks icon: size from the close box (not font-size, so 24x24 stays visible) */
.zrm-menu-drawer__close svg,
.zrm-menu-drawer__close .zrm-menu-drawer__close-icon {
  display: block;
  width: calc(min(var(--zrm-md-close-width), var(--zrm-md-close-height)) * 0.58);
  height: calc(min(var(--zrm-md-close-width), var(--zrm-md-close-height)) * 0.58);
  flex-shrink: 0;
}

.zrm-menu-drawer__close svg {
  fill: currentColor;
}

.zrm-menu-drawer__close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.zrm-menu-drawer__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.25rem;
}

.zrm-menu-drawer__nest {
  min-height: 100%;
}

.zrm-menu-drawer__body ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.zrm-menu-drawer-lock {
  overflow: hidden;
}

:where(.brxe-nav-menu) .bricks-nav-menu>li {
  margin: 0 !important;
}