.category-drawer {
  --drawer-line: #e5dde0;
  --drawer-ink: #251c21;
  --drawer-accent: #9f1c31;
  position: fixed;
  inset: 0 0 0 auto;
  width: max-content;
  max-width: 100vw;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #fff;
  color: var(--drawer-ink);
  direction: rtl;
}
.category-drawer[open] {
  animation: category-drawer-enter 220ms ease-out;
}
.category-drawer::backdrop {
  background: rgb(16 10 14 / 42%);
}
@keyframes category-drawer-enter {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.category-drawer__panels {
  display: flex;
  height: 100%;
  overflow-x: auto;
}
.category-drawer__panel {
  flex: 0 0 min(360px, 30vw);
  width: min(360px, 30vw);
  overflow: auto;
  border-inline-end: 1px solid var(--drawer-line);
  overscroll-behavior: contain;
}
.category-drawer__panel[hidden] {
  display: none;
}
.category-drawer__heading {
  position: sticky;
  inset-block-start: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 8px 16px 8px 52px;
  border-block-end: 1px solid var(--drawer-line);
  background: #fff;
  z-index: 1;
}
.category-drawer__heading h2 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.category-drawer__close,
.category-drawer__back {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f6eef1;
  color: var(--drawer-ink);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.category-drawer__close {
  position: absolute;
  inset: 13px auto auto 10px;
  z-index: 2;
}
.category-drawer__list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 8px;
  list-style: none;
}
.category-drawer__row {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--drawer-ink);
  font: 400 14px/1.5 ArtinSharpFN, sans-serif;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.category-drawer__row span:first-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.category-drawer__catalog-item .category-drawer__row span:first-child::before {
  content: "";
  display: inline-block;
  width: 17px;
  height: 17px;
  margin-inline-end: 9px;
  background: var(--drawer-accent);
  mask: url("../icons/cat-icon.svg") center / contain no-repeat;
  vertical-align: -4px;
}
.category-drawer__link-arrow {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("../icons/arrow-left-up.svg") center / contain no-repeat;
}
.category-drawer__row:is(:hover, [aria-expanded="true"], [aria-current="page"]) {
  background: #faedf1;
  color: var(--drawer-accent);
}
@media (max-width: 767px) {
  .category-drawer {
    width: min(100vw, 380px);
  }
  .category-drawer__panel {
    flex-basis: 100%;
    width: 100%;
    border-inline-end: 0;
  }
  .category-drawer__panel:not(.is-current) {
    display: none;
  }
  .category-drawer__heading {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    padding-inline: 10px;
  }
  .category-drawer__heading h2 {
    grid-column: 2;
    text-align: center;
  }
  .category-drawer__row {
    background: #f7f3f5;
  }
}
@media (prefers-reduced-motion: reduce) {
  .category-drawer[open] { animation: none; }
}
.category-drawer__catalog-item .category-drawer__row span:first-child::before { content: none; }
.category-drawer__row { justify-content: flex-start; gap: 12px; }
.category-drawer__icon { width: 21px; height: 21px; flex: 0 0 21px; color: #8c6672; }
.category-drawer__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-drawer__chevron { width: 19px; height: 19px; flex: 0 0 19px; margin-inline-start: auto; transition: transform 180ms ease, color 180ms ease; transform-origin: center; color: #8b8086; }
.category-drawer__row[aria-expanded="true"] .category-drawer__chevron { transform: rotate(-90deg); color: var(--drawer-accent); }
.category-drawer__row[aria-expanded="true"] .category-drawer__icon { color: var(--drawer-accent); }
.category-drawer__back .category-drawer__chevron { transform: rotate(180deg); margin: 0; }
.category-drawer__row:focus-visible { outline: 2px solid #9f1c31; outline-offset: -2px; }
@media (prefers-reduced-motion: reduce) { .category-drawer__chevron { transition: none; } }
