/* BASIC css start */
/* ============================================================
   THE LAB CHEMICAL — Header CSS (header-top.css)
============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --header-h: 68px;
  --navy: #0C025B;
  --navy-dark: #080140;
  --accent: #a78bfa;
  --wrap: 1400px;
}

body {
  font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
  background: #f8fafc;
  padding-top: var(--header-h);
}

/* 로그인·가입 등 MakeShop 기본 페이지 레이아웃 보정 */
#loginWrap,
#joinWrap,
#findWrap {
  padding-top: 40px;
  padding-bottom: 60px;
}

/* aside 숨김 */
#aside { display: none !important; }
/* contentWrapper margin만 제거 — padding-top은 common.css에서 header-h로 관리 */
#contentWrapper { margin-left: 0 !important; width: 100% !important; }
#contentWrap    { margin-left: 0 !important; width: 100% !important; padding: 0 !important; }

/* ── 헤더 ── */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.head_inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 32px;
  max-width: var(--wrap);
  margin: 0 auto;
  gap: 0;
}

/* ── 로고 ── */
.header_left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  margin-right: 32px;
}
.header_logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.header_logo img {
  height: 32px;
  width: auto;
  display: block;

}

/* ── 네비게이션 ── */
.header_nav {
  display: flex;
  align-items: stretch;
  height: var(--header-h);
  flex-shrink: 0;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-link, .nav-link-plain {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 18px;
  height: 100%;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -.1px;
  transition: color .15s, border-color .15s, background .15s;
}
.nav-link:hover,
.nav-link-plain:hover,
.mega-trigger.is-open > .nav-link {
  color: #fff;
  border-bottom-color: var(--accent);
  background: rgba(255,255,255,.04);
}
.nav-arrow {
  font-style: normal;
  font-size: 10px;
  opacity: .5;
  transition: transform .2s;
  margin-left: 2px;
}
.mega-trigger.is-open .nav-arrow { transform: rotate(180deg); opacity: .8; }

/* ── 메가메뉴 ── */
.megamenu {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: #fff;
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid #e2e8f0;
  z-index: 999;
  box-shadow: 0 12px 40px rgba(12,2,91,.12);
}
.mega-trigger.is-open .megamenu { display: block; }
.mega-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 28px 32px 22px;
}
.mega-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 14px;
}
.mega-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 3px 6px;
  margin-bottom: 18px;
}
.mega-brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.mega-brand-link::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
  transition: background .12s;
}
.mega-brand-link:hover { background: #f0f4ff; color: var(--navy); }
.mega-brand-link:hover::before { background: var(--navy); }
.mega-footer {
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
  display: flex;
  gap: 8px;
}
.mega-btn {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 16px;
  border-radius: 6px; font-size: 12px; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: all .15s;
}
.mega-btn-primary { background: var(--navy); color: #fff; }
.mega-btn-primary:hover { background: #1a0a8c; }
.mega-btn-ghost { border: 1px solid #e2e8f0; color: #374151; background: #fff; }
.mega-btn-ghost:hover { border-color: var(--navy); color: var(--navy); }

/* ── 검색 ── */
.header_center { flex: 1; padding: 0 24px; min-width: 0; }
.header_search_box { width: 100%; }
.header_search_box form { margin: 0; padding: 0; }
.header_search_box fieldset {
  border: none; padding: 0; margin: 0;
  display: flex; align-items: center;
  background: #fff;
  border: none;
  border-radius: 8px; height: 40px; overflow: hidden;
  box-shadow: 0 0 0 2px rgba(255,255,255,.2);
  transition: box-shadow .2s;
}
.header_search_box fieldset:focus-within {
  box-shadow: 0 0 0 2px #a78bfa;
}
/* MakeShop 실제 input 클래스 타겟 */
.header_search_box input,
.header_search_box .MS_search_word,
.header_search_box .search_auto_completion {
  flex: 1; background: transparent !important;
  border: none !important; outline: none !important;
  box-shadow: none !important;
  padding: 0 14px; font-size: 13px;
  color: #0f172a !important; font-family: inherit;
  height: 40px; width: 100%;
}
.header_search_box input::placeholder,
.header_search_box .MS_search_word::placeholder {
  color: #94a3b8;
}
/* MakeShop 검색 버튼 — <a class="search_btn"> */
.header_search_box .search_btn,
a.search_btn {
  display: flex !important; align-items: center; justify-content: center;
  width: 44px; height: 40px; flex-shrink: 0;
  background-color: #0C025B !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  border-left: none;
  cursor: pointer; text-decoration: none;
  transition: background-color .15s;
}
.header_search_box .search_btn:hover,
a.search_btn:hover {
  background-color: #1a0a8c !important;
}

/* ── 유저 버튼 ── */
.header_user {
  display: flex; align-items: center; gap: 2px;
  flex-shrink: 0; margin-left: 16px;
}
.user_icon_btn {
  display: inline-flex; align-items: center;
  padding: 0 10px; height: 32px;
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,.55);
  text-decoration: none; border-radius: 5px; white-space: nowrap;
  transition: color .15s, background .15s;
}
.user_icon_btn:hover { color: #fff; background: rgba(255,255,255,.07); }

/* 장바구니 강조 */
.user_icon_btn[href*="basket"] {
  color: rgba(255,255,255,.75);
  background: rgba(167,139,250,.15);
  border: 1px solid rgba(167,139,250,.2);
}
.user_icon_btn[href*="basket"]:hover {
  background: rgba(167,139,250,.25);
  color: #fff;
}

/* ── 모바일 햄버거 ── */
.mobile-menu-btn {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.mobile-menu-btn span {
  display: block; width: 20px; height: 2px;
  background: rgba(255,255,255,.75); border-radius: 2px; transition: all .2s;
}

/* ── 모바일 드로어 ── */
.mobile-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 1200;
}
.mobile-overlay.is-open { display: block; }
.mobile-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 300px;
  background: #fff; z-index: 1300;
  transform: translateX(-100%); transition: transform .28s ease;
  display: flex; flex-direction: column;
}
.mobile-drawer.is-open { transform: translateX(0); }
.mobile-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 60px;
  background: var(--navy); flex-shrink: 0;
}
.mobile-drawer-title { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: -.2px; }
.mobile-drawer-close {
  background: none; border: none; color: rgba(255,255,255,.6);
  font-size: 20px; cursor: pointer; padding: 0; line-height: 1;
}
.mobile-drawer-body { flex: 1; overflow-y: auto; }
.mobile-brand-list { display: flex; flex-direction: column; }
.mobile-brand-item {
  display: flex; align-items: center;
  padding: 13px 20px; font-size: 14px; font-weight: 600;
  color: #374151; text-decoration: none;
  border-bottom: 1px solid #f8fafc;
  transition: background .12s, color .12s;
}
.mobile-brand-item:hover { background: #f0f4ff; color: var(--navy); }
.mobile-drawer-links {
  padding: 16px 20px; border-top: 1px solid #f1f5f9;
  display: flex; flex-direction: column; gap: 4px;
}
.mobile-drawer-links a {
  font-size: 13px; color: #64748b; text-decoration: none; padding: 10px 0;
  border-bottom: 1px solid #f8fafc; font-weight: 600;
}
.mobile-drawer-links a:hover { color: var(--navy); }

/* ── 유틸 ── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── 반응형 ── */
@media (max-width: 1023px) {
  :root { --header-h: 60px; }
  .header_nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .header_center { padding: 0 14px; }
  .user_icon_btn { padding: 0 8px; font-size: 11px; }
}
@media (max-width: 767px) {
  .head_inner { padding: 0 16px; }
  .header_logo img { height: 26px; }
  .header_user .user_icon_btn:not(:nth-child(-n+2)) { display: none; }
}

/* ══ 로고 최고 우선순위 ══ */
#header .header_logo a,
#header .header_logo a:link,
#header .header_logo a:visited,
#header .header_logo a:hover {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  text-decoration: none !important;
  color: #fff !important;
}
#header .header_logo a > div:first-child {
  font-size: 18px !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  letter-spacing: -.4px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  font-family: 'Pretendard', 'Noto Sans KR', sans-serif !important;
}
#header .header_logo a > div:first-child span {
  color: #a78bfa !important;
}
#header .header_logo a > div:last-child {
  font-size: 10px !important;
  font-weight: 500 !important;
  color: rgba(255,255,255,.4) !important;
  letter-spacing: .04em !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  font-family: 'Pretendard', 'Noto Sans KR', sans-serif !important;
}
/* BASIC css end */

