/* Mobile side drawer — left 80% panel + right dimmed close area */

.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .nav-main,
  .header-actions {
    display: none !important;
  }

  .nav-toggle {
    display: flex !important;
    margin-left: auto;
  }

  .mobile-nav {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10000;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
  }

  .mobile-nav.is-open {
    visibility: visible;
    pointer-events: auto;
  }

  body.nav-open {
    overflow: hidden !important;
  }

  .mobile-nav-scrim {
    position: absolute;
    inset: 0;
    z-index: 1;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.25s ease;
  }

  .mobile-nav.is-open .mobile-nav-scrim {
    opacity: 1;
  }

  .mobile-nav-panel {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 80%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: #fff;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.18);
    transform: translate3d(-100%, 0, 0);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
    backface-visibility: hidden;
  }

  .mobile-nav.is-open .mobile-nav-panel {
    transform: translate3d(0, 0, 0);
  }

  .mobile-nav-panel-inner {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    height: 100%;
    min-height: 100%;
    padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 종료 버튼: 왼쪽 패널 바깥(오른쪽 가장자리) */
  .mobile-nav-close {
    position: absolute;
    top: 0.65rem;
    left: 100%;
    right: auto;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-nav-close span {
    display: block;
    margin-top: -0.15rem;
  }

  /* Nickname + bell + logout (one row) */
  .mobile-nav-userbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.15rem 0 0.85rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .mobile-nav-user {
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.3;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-userbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
  }

  .mobile-nav-logout-form {
    display: inline-flex;
    margin: 0;
  }

  .mobile-nav-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    min-width: 5.5rem;
    padding: 0 1.1rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #555;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 0.35rem;
    cursor: pointer;
    white-space: nowrap;
  }

  .mobile-nav-userbar .header-notice-bell {
    width: 2rem;
    height: 2rem;
  }

  .mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
  }

  .mobile-nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0.15rem;
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .mobile-nav-links a::after {
    content: "";
    width: 0.42rem;
    height: 0.42rem;
    margin-left: auto;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0.35;
  }

  .mobile-nav-links a.is-active {
    color: #8f3f38;
  }
}

/* 발주 알림 모달은 사이드 메뉴(10000)보다 위에 */
.notice-modal {
  z-index: 11000;
}
