@charset "utf-8";
/* ============================================================
   B2B 헤더 — B2C(mallHome) 헤더 디자인 이식 (2026-06-20)
   - B2C reset.css(ver_20251201)의 헤더/사이드바/드로어 영역만 추출
   - 전역 리셋(*, body, a 등)은 제외 (B2B reset.css와 충돌 방지)
   - 변수명(--c-primary 등)은 B2B reset.css에서 미사용이라 안전
   ============================================================ */
:root {
  --c-primary: #6ca041;
  --c-primary-light: #eaf3e2;
  --c-point: #fa622f;
  --c-gray: #888888;
  --c-dark: #444444;
  --c-border: #eeeeee;
  --w-container: 1380px;
  --h-header-top: 32px;
  --h-header-main: 90px;
  --h-nav: 50px;
}

.header-container .-frame,
.header-nav .-frame { width: 100%; max-width: var(--w-container); margin: 0 auto; position: relative; }

/* ================= HEADER LAYOUT ================= */
.header-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 1000;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.header-container.is-scrolled { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06); border-bottom: 1px solid transparent; }

/* 1. Header Top (얇은 띠) */
.header-top { height: var(--h-header-top); border-bottom: 1px solid #f0f0f0; font-size: 11px; color: var(--c-gray); background: #fafafa; }
.header-top .-frame { height: 100%; display: flex; justify-content: space-between; align-items: center; }
.top-left { display: flex; align-items: center; gap: 15px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.header-top a { transition: color 0.2s; }
.header-top a:hover { color: var(--c-primary); }
.header-top .divider { width: 1px; height: 10px; background: #ddd; display: inline-block; margin: 0 2px; }
.header-top .user-greeting strong { color: var(--c-primary); font-weight: 700; }
.header-top button.btn_txt { font-size: 11px; color: var(--c-gray); padding: 0; background: none; border: none; cursor: pointer; }
.header-top button.btn_txt:hover { color: var(--c-primary); }
/* 얇은 띠 떠리마켓 로고 (이미지) */
.tt-brand-link { display: inline-flex; align-items: center; }
.tt-brand-link img { height: 16px; width: auto; display: block; }
.tt-brand-link:hover img { opacity: 0.8; }

/* 헤더/사이드바 링크 밑줄 제거 (B2B reset의 a 기본 밑줄 방지) */
.header-container a, .header-nav a, .d1sidebar a, .popular-keywords a { text-decoration: none; }

/* 링크 색상 고정 — 방문(visited) 시 보라색/파란색 방지 */
.header-top a, .header-top a:visited { color: var(--c-gray); }
.gnb-menu a, .gnb-menu a:visited { color: #555; }
.popular-keywords a, .popular-keywords a:visited, .popular-keywords .pk-text { color: #333; }
.d1sidebar a, .d1sidebar a:visited { color: inherit; }

/* 2. Main Header */
.header-main { height: var(--h-header-main); display: flex; align-items: center; }
.header-main .-frame { width: 100%; display: flex; align-items: center; justify-content: space-between; }

/* Logo */
.header-main .logo a { display: flex; align-items: center; }
.header-main .logo img { height: 32px; width: auto; transition: opacity 0.2s; }
.header-main .logo a:hover img { opacity: 0.8; }

/* Search Bar */
.search-area { flex: 1; max-width: 540px; margin: 0 40px; position: relative; }
.search-box {
  width: 100%; height: 48px; border: 2px solid #e5e5e5; border-radius: 48px;
  display: flex; align-items: center; padding: 0 6px 0 22px; background: #f8f8f8;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.search-box:focus-within { border-color: var(--c-primary); background: #fff; box-shadow: 0 4px 16px rgba(108, 160, 65, 0.12); }
.inp-search { flex: 1; border: none; outline: none; font-size: 15px; color: #333; background: transparent; }
.inp-search::placeholder { color: #aaa; }
.btn-search-submit {
  width: 38px; height: 38px; border-radius: 50%; background: var(--c-primary); color: #fff; padding: 0;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0;
}
.btn-search-submit:hover { background: #5a8d37; transform: scale(1.05); }
.btn-search-submit svg { width: 20px; height: 20px; stroke-width: 2.5px; stroke: #fff; }

/* Icon Menu */
.icon-menu { display: flex; gap: 8px; align-items: center; }
.icon-link { color: #555; position: relative; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; transition: all 0.2s; background: none; border: none; cursor: pointer; }
.icon-link:hover { color: var(--c-primary); background: rgba(108, 160, 65, 0.08); }
.icon-link svg { width: 26px; height: 26px; stroke-width: 1.7px; }
.ico-box { position: relative; display: flex; }
.icon-menu .badge {
  position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px;
  background: var(--c-point); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid #fff;
}
/* 알림벨: 마이페이지 아이콘과 동일한 깔끔한 형태로(테두리/큰박스 제거, svg 축소) */
.icon-menu .noti-wrapper { margin-left: 0; }
.icon-menu .noti-bell.icon-link { border: none; padding: 0; }
.icon-menu .noti-bell.icon-link svg { width: 20px; height: 20px; }
.header-mo-right .noti-bell svg { width: 20px; height: 20px; }

/* 3. Navigation (GNB) — sticky */
.header-nav {
  height: var(--h-nav); border-bottom: 1px solid var(--c-border);
  background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 999; transition: box-shadow 0.3s;
}
.nav-container { height: 100%; display: flex; align-items: center; position: relative; }
/* 첫 메뉴 텍스트를 프레임 좌측끝(로고)과 정렬 — 첫 항목 좌패딩(16px) 상쇄 */
.nav-container > .gnb-menu { margin-left: -16px; }
.gnb-menu ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.gnb-menu a {
  font-size: 15px; font-weight: 600; color: #555; padding: 10px 16px; display: block;
  border-radius: 10px; transition: all 0.2s; position: relative;
}
.gnb-menu a:hover { color: var(--c-primary); background: rgba(108, 160, 65, 0.06); }
.gnb-menu a::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px; background: var(--c-primary); border-radius: 2px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.gnb-menu a:hover::after { width: 24px; }
.gnb-menu .highlight a { color: var(--c-primary); font-weight: 700; }
.gnb-menu .highlight a::after { width: 24px; }

/* Popular Keyword */
.popular-keyword-wrap { margin-left: auto; display: flex; align-items: center; font-size: 13px; color: #666; }

/* ================= MOBILE RESPONSIVE ================= */
.mo-menu-btn { display: none; }
.header-mo-right { display: none; align-items: center; gap: 2px; }

@media (max-width: 1024px) {
  :root { --h-header-main: 60px; --h-nav: 0px; }
  .header-top, .header-nav, .search-area { display: none; }
  .header-main .-frame { padding: 0 15px; }
  .icon-menu { display: none; }
  .header-mo-right { display: flex; }
  .mo-menu-btn { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 30px; height: 30px; margin-left: 6px; background: none; border: none; cursor: pointer; }
  .mo-menu-btn .bar { width: 100%; height: 2px; background: #333; border-radius: 2px; }
  .header-main .logo { margin-right: auto; }
}
.header-mo-right .noti-bell svg { width: 24px; height: 24px; }

/* ================= MOBILE SIDEBAR ================= */
.d1sidebar {
  position: fixed; top: 0; left: 0; width: 80%; max-width: 320px; height: 100vh; background: #fff;
  z-index: 3000; transform: translateX(-100%); transition: transform 0.3s ease-in-out;
  box-shadow: 5px 0 15px rgba(0,0,0,0.1); overflow-y: auto;
}
.d1sidebar.active { transform: translateX(0); }
body.no-scroll { overflow: hidden; }
.d1sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2999; }
.d1sidebar.active + .d1sidebar-overlay, body.no-scroll .d1sidebar-overlay { display: block; }

.sidebar-header { padding: 30px 20px 20px; background-color: #f8f9fa; position: relative; border-bottom: 1px solid #eee; }
.sidebar-header .user-info { font-size: 20px; font-weight: 700; color: #333; line-height: 1.4; margin-bottom: 15px; }
.sidebar-header .auth-links { display: flex; gap: 8px; }
.sidebar-header .btn-auth { font-size: 13px; padding: 6px 12px; border-radius: 4px; text-decoration: none; font-weight: 500; text-align: center; border: 1px solid #ddd; color: #555; background: #fff; flex: 1; }
.sidebar-header .btn-auth.login { background-color: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.sidebar-header .closebtn { position: absolute; top: 15px; right: 15px; font-size: 32px; line-height: 1; background: none; border: none; color: #333; cursor: pointer; padding: 0 10px; }

.sidebar-quick-icons { display: flex; border-bottom: 10px solid #f4f6f8; padding: 15px 0; }
.quick-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: #333; gap: 5px; font-size: 12px; }
.quick-item .ico svg { width: 24px; height: 24px; stroke: #333; }

.sidebar-popular { padding: 16px 18px; border-bottom: 10px solid #f4f6f8; }
.sidebar-popular-title { font-size: 14px; font-weight: 700; color: #222; margin-bottom: 10px; }
.sidebar-popular-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sidebar-popular-list li a { display: flex; align-items: center; gap: 10px; padding: 7px 4px; text-decoration: none; color: #333; font-size: 14px; }
.sidebar-popular-list .sp-rank { width: 20px; flex-shrink: 0; text-align: center; font-weight: 800; color: #ff2d55; font-size: 14px; }
.sidebar-popular-list .sp-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-popular-list li a:active { background: #f7f7f7; }
.sidebar-popular-list .sp-extra { display: none; }
.sidebar-popular.is-open .sidebar-popular-list .sp-extra { display: block; }
.sidebar-popular-toggle { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 8px; padding: 8px; background: #f7f7f7; border: 0; border-radius: 8px; font-size: 13px; font-weight: 600; color: #555; cursor: pointer; }
.sidebar-popular-toggle .spt-caret { transition: transform 0.2s ease; }
.sidebar-popular.is-open .sidebar-popular-toggle .spt-caret { transform: rotate(180deg); }

.sidebar-content { padding-bottom: 50px; }
.mobile-gnb { list-style: none; padding: 0; margin: 0; }
.mobile-gnb .divider { height: 10px; background-color: #f4f6f8; border-top: 1px solid #eee; border-bottom: 1px solid #eee; }
.mobile-gnb .menu-item { border-bottom: 1px solid #f5f5f5; }
.mobile-gnb .depth1-link { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; font-size: 15px; font-weight: 500; color: #333; text-decoration: none; position: relative; }

/* PC에서는 모바일 사이드바 숨김 */
@media (min-width: 1025px) {
  .d1sidebar, .d1sidebar-overlay { display: none !important; }
}

/* ================= 기존 고정헤더 보정 제거 =================
   기존 .header 는 position:fixed(64px)라 페이지들이 상단 여백을 줬으나,
   새 헤더(.header-container)는 흐름배치라 그 보정이 필요 없음(중복 여백 방지). */
.main_wrap { padding-top: 0; }
