/* ================================================================
   B2B 알림 시스템 CSS
   mypageHead.php에서 로드
   ================================================================ */

/* ── 벨 아이콘 래퍼 ── */
.noti-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
}
.noti-bell {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  position: relative;
  line-height: 1;
  color: #495057;
  transition: background .15s, border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.noti-bell:hover {
  background: #f1f3f5;
  border-color: #adb5bd;
}
.noti-bell svg {
  display: block;
}

/* ── 뱃지 ── */
.noti-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e03131;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  font-family: 'Noto Sans KR', sans-serif;
}

/* ── 드롭다운 ── */
.noti-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: #fff;
  border: 1px solid #e6e7e9;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 1050;
  overflow: hidden;
}
.noti-dropdown.show {
  display: block;
  animation: noti-fadeIn .15s ease;
}
@keyframes noti-fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.noti-header {
  padding: 14px 16px 10px;
  font-size: 14px;
  font-weight: 700;
  color: #1a1f36;
  border-bottom: 1px solid #f1f3f5;
}

.noti-list {
  max-height: 320px;
  overflow-y: auto;
}

/* ── 알림 항목 ── */
.noti-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: #868e96;
  transition: background .1s;
  border-bottom: 1px solid #f8f9fa;
}
.noti-item:last-child {
  border-bottom: none;
}
.noti-item:hover {
  background: #f8f9fa;
  text-decoration: none;
  color: #868e96;
}
.noti-item.has-count {
  color: #1a1f36;
}

.noti-item-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f1f3f5;
  color: #adb5bd;
  flex-shrink: 0;
}
.noti-item.has-count .noti-item-icon {
  background: #e7f5ff;
  color: #1971c2;
}

.noti-item-body {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
}
.noti-item-label {
  font-size: 13px;
  font-weight: 500;
}
.noti-item-count {
  font-size: 12px;
  font-weight: 600;
  color: #ced4da;
  flex-shrink: 0;
}
.noti-item.has-count .noti-item-count {
  color: #e03131;
}

/* ── 알림 카드 (가운데 등장 → 우하단 이동) ── */
.noti-card-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s;
}
.noti-card-overlay.show {
  opacity: 1;
  pointer-events: none;
}
.noti-card-overlay.show .noti-card {
  pointer-events: auto;
}
.noti-card-overlay.fade-out {
  opacity: 0;
  transition: opacity .4s;
}

.noti-card {
  position: fixed;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,.18);
  width: 320px;
  overflow: hidden;
  /* JS가 top/left를 직접 세팅, transform으로 부드럽게 전환 */
  transition: transform .8s cubic-bezier(.32,.72,.35,1),
              box-shadow .6s,
              border-radius .6s;
}

/* 카드 헤더 */
.noti-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f1f3f5;
}
.noti-card-header svg {
  color: #f59f00;
  flex-shrink: 0;
}
.noti-card-header span {
  font-size: 15px;
  font-weight: 700;
  color: #1a1f36;
}

/* 카드 항목 */
.noti-card-body {
  padding: 6px 0;
}
.noti-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  text-decoration: none;
  color: #495057;
  transition: background .15s;
}
.noti-card-row:hover {
  background: #f8f9fa;
  text-decoration: none;
}
.noti-card-row-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e7f5ff;
  color: #1971c2;
  flex-shrink: 0;
}
.noti-card-row-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #1a1f36;
}
.noti-card-row-count {
  font-size: 14px;
  font-weight: 700;
  color: #e03131;
}

@media (max-width: 768px) {
  .noti-card {
    width: 280px;
  }
}

/* ── 모바일 헤더 벨 (햄버거 옆) ── */
.noti-mobile-only {
  display: none;
}
.header-mo-right {
  display: contents;
}
@media (max-width: 768px) {
  .noti-mobile-only {
    display: inline-flex;
    margin-right: -8px;
  }
  .noti-mobile-only .noti-bell {
    border: none;
    padding: 4px;
  }
  /* 검색·벨·햄버거 오른쪽 모으기 */
  .header_right {
    gap: 0 !important;
  }
  .header_right > .btn_icon_search {
    margin-left: auto;
  }
  .header-mo-right {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  #noti-dropdown-mo.show {
    position: fixed;
    top: var(--header-height, 56px);
    bottom: auto;
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(70vh - var(--header-height, 56px));
    overflow-y: auto;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    z-index: 10001;
  }
  #noti-toast-container {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .noti-toast {
    white-space: normal;
  }
}

/* ================================================================
   마이페이지 사이드바 통일 (reset.css 미로드 대응)
   reset.css에 정의된 sidebar 스타일을 mypage에서도 사용
   ================================================================ */
.sidebar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border, #e5e5e2);
}
.logo_text {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-primary, #111);
}
.sidebar_bottom {
  padding-top: 24px;
  border-top: 1px solid var(--color-border, #e5e5e2);
}
.user_info {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--color-bg-warm, #f7f7f5);
  border-radius: var(--radius-md, 12px);
  font-size: 14px;
  color: var(--color-text-sub, #666);
}
.user_info strong {
  color: var(--color-primary, #111);
  font-weight: 700;
}
.btn_grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.btn_black,
.btn_gray,
.btn_outline {
  padding: 12px 16px;
  border-radius: var(--radius-sm, 8px);
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
  border: none;
  cursor: pointer;
}
.btn_black {
  background: var(--color-primary, #111);
  color: #fff;
}
.btn_black:hover {
  background: #333;
}
.btn_gray {
  background: var(--color-bg-warm, #f7f7f5);
  color: var(--color-text, #111);
}
.btn_gray:hover {
  background: var(--color-border, #e5e5e2);
}
.btn_outline {
  background: #fff;
  color: var(--color-text, #111);
  border: 1.5px solid var(--color-border, #e5e5e2);
}
.btn_outline:hover {
  border-color: var(--color-primary, #111);
}
