/**
 * ASR Mega Menu: mobile category drawer. Slides from the start side; levels slide in from the end side.
 */

.asrmm-d {
  position: fixed;
  inset: 0;
  z-index: 99999;
}
.asrmm-d[hidden] {
  display: none !important;
}
.asrmm-d ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.asrmm-d a {
  text-decoration: none;
}

.asrmm-d__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s;
}
.asrmm-d__panel {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  display: flex;
  flex-direction: column;
  inline-size: min(88vw, 380px);
  background: var(--asrmm-bg);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.18);
  translate: -100% 0;
  transition: translate 0.28s ease;
}
[dir="rtl"] .asrmm-d__panel {
  translate: 100% 0;
}
.asrmm-d.is-open .asrmm-d__backdrop {
  opacity: 1;
}
.asrmm-d.is-open .asrmm-d__panel {
  translate: none;
}

.asrmm-d__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  padding-block-start: calc(14px + env(safe-area-inset-top));
  border-block-end: 1px solid var(--asrmm-line);
}
.asrmm-d__head strong {
  color: var(--asrmm-heading);
  font-size: 18px;
  font-weight: 700;
}
.asrmm-d .asrmm-d__close {
  margin: 0;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--asrmm-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

/* Screens: one per level */
.asrmm-d__screens {
  position: relative;
  flex: 1;
  overflow: hidden;
}
.asrmm-d__screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 14px calc(24px + env(safe-area-inset-bottom));
  background: var(--asrmm-bg);
  visibility: hidden;
  translate: 100% 0;
  transition:
    translate 0.25s ease,
    visibility 0.25s;
}
[dir="rtl"] .asrmm-d__screen {
  translate: -100% 0;
}
.asrmm-d__screen.is-active {
  visibility: visible;
  translate: none;
}
.asrmm-d__screen.is-past {
  translate: -25% 0;
}
[dir="rtl"] .asrmm-d__screen.is-past {
  translate: 25% 0;
}

/* Rows */
.asrmm-d .asrmm-d__item {
  display: flex;
  align-items: center;
  gap: 12px;
  inline-size: 100%;
  min-block-size: 58px;
  margin: 0;
  padding: 8px 6px;
  border: 0;
  border-block-end: 1px solid var(--asrmm-line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--asrmm-heading);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  text-align: start;
  cursor: pointer;
}
.asrmm-d .asrmm-d__item:active {
  background: var(--asrmm-tint);
}
.asrmm-d__img {
  flex: 0 0 auto;
  inline-size: 42px;
  block-size: 42px;
  border-radius: 10px;
  background: var(--asrmm-img-bg);
  object-fit: cover;
  font-size: 17px;
}
.asrmm-d__name {
  flex: 1;
  min-inline-size: 0;
}

.asrmm-d .asrmm-d__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 0;
  padding: 10px 6px;
  border: 0;
  background: none;
  color: var(--asrmm-accent);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.asrmm-d__back::before {
  /* chevron pointing to the inline start */
  content: "";
  inline-size: 7px;
  block-size: 7px;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  rotate: 45deg;
}
[dir="rtl"] .asrmm-d__back::before {
  rotate: -135deg;
}

.asrmm-d__title {
  display: block;
  padding: 6px 6px 12px;
  border-block-end: 1px solid var(--asrmm-line);
  color: var(--asrmm-heading);
  font-size: 19px;
  font-weight: 700;
}
.asrmm-d__all {
  display: block;
  margin-block-start: 16px;
  padding: 13px;
  border: 1.5px solid var(--asrmm-accent);
  border-radius: 999px;
  color: var(--asrmm-accent);
  font-weight: 700;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .asrmm-d__backdrop,
  .asrmm-d__panel,
  .asrmm-d__screen {
    transition: none;
  }
}
