/**
 * [통합 사이드 메뉴]
 * - 역할: 마이페이지·고객지원 데스크톱 메뉴와 모바일 하단 시트 공통 UI
 * - 작성/수정일: 2026-09-24
 */

.an-side-nav__toggle {
  display: none;
}

.an-side-nav__sheet,
.an-side-nav__panel {
  display: contents;
}

.an-side-nav__backdrop,
.an-side-nav__head {
  display: none;
}

.an-side-nav__nav {
  width: 100%;
}

.an-side-nav__group + .an-side-nav__group {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line-color, #eeeeee);
}

.an-side-nav__group-label {
  margin: 0 0 8px;
  color: var(--muted-color, #7c7c7c);
  font-size: var(--fs-xs, 11px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.an-side-nav__menu {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.an-side-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
  overflow: hidden;
  border-radius: 8px;
  color: var(--title-color, #171717);
  font-size: var(--fs-label, 14px);
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.an-side-nav__link:hover {
  background: rgba(0, 0, 0, 0.045);
  color: var(--title-color, #171717);
}

.an-side-nav__link.is-current {
  background: rgba(0, 0, 0, 0.065);
  font-weight: 700;
}

.an-side-nav__link.is-current::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--title-color, #171717);
  content: "";
}

.an-side-nav__icon {
  display: inline-flex;
  flex: 0 0 16px;
  align-items: center;
  justify-content: center;
  width: 16px;
  color: var(--muted-color, #777777);
  font-size: 16px;
  line-height: 1;
}

.an-side-nav__link.is-current .an-side-nav__icon {
  color: var(--title-color, #171717);
}

.an-side-nav__link-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.an-side-nav__badge {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--title-color, #171717);
  color: var(--on-dark, #ffffff);
  font-size: var(--fs-micro, 10px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}

.an-side-nav__link:focus-visible,
.an-side-nav__toggle:focus-visible,
.an-side-nav__close:focus-visible {
  outline: 2px solid var(--title-color, #171717);
  outline-offset: 2px;
}

html.dark .an-side-nav__group + .an-side-nav__group,
body.dark .an-side-nav__group + .an-side-nav__group {
  border-color: var(--border-color, #333333);
}

html.dark .an-side-nav__link:hover,
body.dark .an-side-nav__link:hover {
  background: rgba(255, 255, 255, 0.06);
}

html.dark .an-side-nav__link.is-current,
body.dark .an-side-nav__link.is-current {
  background: rgba(255, 255, 255, 0.1);
}

html.dark .an-side-nav__badge,
body.dark .an-side-nav__badge {
  background: var(--title-color, #f5f5f5);
  color: #171717;
}

@media (max-width: 991.98px) {
  .an-side-nav__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    margin: 0 0 12px;
    padding: 10px 14px;
    border: 1px solid var(--line-color, #e5e5e5);
    border-radius: 10px;
    background: var(--white-color, #ffffff);
    color: var(--title-color, #171717);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  /* [모바일 사이드 메뉴 토글] 역할: 전체 메뉴 햄버거와 구분되는 목록 아이콘으로 현재 영역 메뉴를 안내 · 작성/수정일: 2026-09-24 */
  .an-side-nav__toggle-icon {
    display: inline-flex;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--title-color, #171717);
    font-size: 18px;
    line-height: 1;
  }

  .an-side-nav__toggle-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    font-size: 15px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .an-side-nav__toggle-chevron {
    display: inline-flex;
    flex: 0 0 18px;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--muted-color, #7c7c7c);
    font-size: 14px;
    transition: transform 0.15s ease;
  }

  .an-side-nav__toggle[aria-expanded="true"] .an-side-nav__toggle-chevron {
    transform: rotate(180deg);
  }

  .an-side-nav__sheet {
    display: none;
  }

  .an-side-nav__sheet.is-open {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: stretch;
  }

  .an-side-nav__backdrop {
    position: absolute;
    inset: 0;
    display: block;
    background: rgba(23, 23, 23, 0.55);
  }

  .an-side-nav__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(88dvh, 100%);
    margin-top: auto;
    padding: 16px 16px max(20px, env(safe-area-inset-bottom));
    overflow: auto;
    border-radius: 16px 16px 0 0;
    background: var(--white-color, #ffffff);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.16);
  }

  .an-side-nav__head {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--line-color, #eeeeee);
  }

  .an-side-nav__title {
    margin: 0;
    color: var(--title-color, #171717);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
  }

  .an-side-nav__close {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted-color, #7c7c7c);
    font-size: 18px;
    cursor: pointer;
  }

  .an-side-nav__close:hover {
    background: rgba(0, 0, 0, 0.045);
  }

  .an-side-nav__nav {
    display: block;
    width: 100%;
  }

  .an-side-nav__group + .an-side-nav__group {
    margin-top: 18px;
    padding-top: 18px;
  }

  .an-side-nav__link {
    min-height: 44px;
    padding: 10px 12px;
  }

  .an-side-nav__sheet.is-open .an-mp__cta {
    margin-top: 20px;
  }

  body.an-side-nav-open {
    position: fixed;
    right: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
  }

  html.dark .an-side-nav__toggle,
  body.dark .an-side-nav__toggle,
  html.dark .an-side-nav__panel,
  body.dark .an-side-nav__panel {
    border-color: var(--border-color, #333333);
    background: var(--surface-1, #171717);
    color: var(--title-color, #f5f5f5);
  }

  html.dark .an-side-nav__head,
  body.dark .an-side-nav__head {
    border-color: var(--border-color, #333333);
  }

  html.dark .an-side-nav__close:hover,
  body.dark .an-side-nav__close:hover {
    background: rgba(255, 255, 255, 0.06);
  }
}
