/* BASIC css start */
/* ============================================================
   THE LAB CHEMICAL — PC 헤더 CSS  (header-top.css)
   ▸ common.css :root 토큰 사용
============================================================ */

/* ── Scope base ── */
#header, #header *,
aside#aside, aside#aside * {
  box-sizing: border-box;
  font-family: var(--font);
}
#header a, aside#aside a { color: inherit; text-decoration: none; }
#header ul, aside#aside ul { margin: 0; padding: 0; list-style: none; }
#header img, aside#aside img { max-width: 100%; height: auto; display: block; }

/* ══════════════════════════════
   ASIDE
══════════════════════════════ */
aside#aside,
aside:not([id]) {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--aside-w);
  height: 100vh;
  background: var(--bg);
  border-right: 1px solid var(--border-soft);
  z-index: 500;
  overflow-y: auto;
  overflow-x: visible;
  transition: transform .26s cubic-bezier(.4,0,.2,1);
}
aside#aside .asi_inner,
aside:not([id]) .asi_inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 20px 14px 28px;
}
aside#aside .aside-title,
aside:not([id]) .aside-title {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 800;
  padding: 6px 8px 0;
  line-height: 1.8;
  user-select: none;
}
aside#aside nav,
aside:not([id]) nav { margin-top: 16px; }
aside#aside nav li,
aside:not([id]) nav li { position: relative; }
aside#aside nav .main_m > li,
aside:not([id]) nav .main_m > li { margin-bottom: 3px; }
aside#aside nav a,
aside:not([id]) nav a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--ease), color var(--ease);
}
aside#aside nav li:hover > a,
aside:not([id]) nav li:hover > a { background: var(--bg-soft); }
aside#aside nav li.active > a,
aside:not([id]) nav li.active > a {
  background: var(--navy-lt);
  color: var(--navy);
  font-weight: 800;
  box-shadow: inset 3px 0 0 var(--navy);
}

/* Sub dropdown */
aside#aside nav .sub1_m,
aside:not([id]) nav .sub1_m,
aside#aside nav .sub2_m,
aside:not([id]) nav .sub2_m {
  display: none;
  position: fixed;
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 9999;
  margin-left: -8px;
  padding-left: 16px;
}
aside#aside nav .sub1_m.is-open:not(:empty),
aside:not([id]) nav .sub1_m.is-open:not(:empty),
aside#aside nav .sub2_m.is-open:not(:empty),
aside:not([id]) nav .sub2_m.is-open:not(:empty) { display: block; }

aside#aside nav .sub1_m a,
aside:not([id]) nav .sub1_m a,
aside#aside nav .sub2_m a,
aside:not([id]) nav .sub2_m a {
  font-size: 13px; font-weight: 500; color: var(--text-sub);
  padding: 8px 12px; border-radius: 8px;
}
aside#aside nav .sub1_m a:hover,
aside:not([id]) nav .sub1_m a:hover,
aside#aside nav .sub2_m a:hover,
aside:not([id]) nav .sub2_m a:hover { background: var(--bg-soft); color: var(--navy); }

/* Overlay */
.aside-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.38);
  z-index: 109;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.aside-overlay[hidden] { display: none; }

/* ══════════════════════════════
   HEADER SHELL
══════════════════════════════ */
#header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: var(--header-h);
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border-soft);
  z-index: 120;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── head_inner: 3열 그리드, 각 열 수동 패딩으로 수평 정렬 ── */
#header .head_inner {
  height: var(--header-h);            /* 80px */
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 24px;
  align-items: start;                 /* ✅ start + 각자 패딩으로 정확히 정렬 */
}

/* ── 왼쪽: 토글 + 로고 ── */
/* 로고 44px → (80-44)/2 = 18px 위에서 내려야 수직 중앙 */
#header .header_left {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
}
#header .aside-toggle {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
  flex-shrink: 0;
}
#header .aside-toggle:hover { background: var(--bg-soft); border-color: var(--navy); }
#header .header_logo a { display: flex; align-items: center; }
#header .header_logo img {
  height: 44px;       /* ✅ 헤더 높이에 맞게 조정 */
  max-width: 200px;
  width: auto;
  object-fit: contain;
}

/* ── 가운데: 검색 영역 ── */
/* fieldset 44px → (80-44)/2 = 18px 에서 시작해야 로고·유저와 수평 */
#header .header_center {
  display: flex;
  flex-direction: column;
  padding-top: 18px;
}
#header .header_search_box {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

/* 검색 폼 */
#header .header_search_box fieldset,
#header .header_search_box form > fieldset {
  display: flex;
  align-items: center;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--pill);
  background: var(--bg-soft);
  padding: 0 5px 0 18px;
  overflow: hidden;
  transition: border-color var(--ease), box-shadow var(--ease);
}
#header .header_search_box fieldset:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-lt);
  background: var(--bg);
}

/* 검색 input */
#header .header_search_box input,
#header .header_search_box input[type="text"],
#header .header_search_box input.MS_search_word,
#header .header_search_box input.search_auto_completion {
  flex: 1 !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 100% !important;
  width: 100% !important;
  max-width: none !important;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
}
#header .header_search_box input::placeholder { color: var(--text-muted); }

/* ── [핵심 수정] 검색 버튼 — SVG 아이콘으로 교체 ── */
#header .search_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: var(--pill);
  background: var(--navy);
  border: none;
  cursor: pointer;
  transition: background var(--ease), transform var(--ease);
  text-decoration: none;
  margin-left: 4px;
  /* ✅ SVG 돋보기 아이콘 — data URI */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' 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='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}
/* ::before 완전 제거 */
#header .search_btn::before { display: none !important; content: none !important; }
#header .search_btn:hover {
  background-color: var(--navy-dk);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' 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='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  transform: scale(1.05);
}

/* 서브 버튼 (제품문의 / 견적문의 / MSDS) */
#header .search_sub_buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
#header .search_sub_buttons a {
  display: inline-flex;
  align-items: center; justify-content: center;
  height: 28px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  background: transparent;
  border: 1px solid rgba(12,2,91,.2);
  border-radius: var(--pill);
  transition: all var(--ease);
  white-space: nowrap;
}
#header .search_sub_buttons a:hover {
  background: var(--navy-lt);
  border-color: var(--navy);
  transform: translateY(-1px);
}

/* ── 오른쪽: 유저 버튼 ── */
/* 버튼 높이 34px → (80-34)/2 = 23px 에서 시작해야 로고와 수평 */
#header .header_user {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding-top: 23px;
}
#header .user_icon_btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--pill);
  transition: all var(--ease);
  white-space: nowrap;
}
#header .user_icon_btn::before {
  content: '';
  display: inline-block;
  width: 16px; height: 16px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}
/* 아이콘별 SVG */
#header .user_icon_btn[href*="login"]::before,
#header .user_icon_btn[href*="logout"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='5' r='3'/%3E%3Cpath d='M2.5 14c0-3 2.5-4.5 5.5-4.5s5.5 1.5 5.5 4.5'/%3E%3C/svg%3E");
}
#header .user_icon_btn[href*="basket"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1h2l1.5 8h8L15 4H4'/%3E%3Ccircle cx='5.5' cy='13' r='1.2'/%3E%3Ccircle cx='11.5' cy='13' r='1.2'/%3E%3C/svg%3E");
}
#header .user_icon_btn[href*="order"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='1.5' width='10' height='13' rx='1.5'/%3E%3Cline x1='5.5' y1='5' x2='10.5' y2='5'/%3E%3Cline x1='5.5' y1='8' x2='10.5' y2='8'/%3E%3Cline x1='5.5' y1='11' x2='8.5' y2='11'/%3E%3C/svg%3E");
}
#header .user_icon_btn[href*="mypage"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='12' height='12' rx='2'/%3E%3Ccircle cx='8' cy='6.5' r='2'/%3E%3Cpath d='M4.5 13c0-2 1.5-3 3.5-3s3.5 1 3.5 3'/%3E%3C/svg%3E");
}
#header .user_icon_btn:hover {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--text);
}

/* ── Desktop 바디 offset ── */
.main_layout { padding-top: var(--header-h); }

@media (min-width: 1024px) {
  .main_layout { margin-left: var(--aside-w); }

  @media (max-width: 1120px) {
    #header .header_logo img { height: 38px; }
    #header .search_sub_buttons a { padding: 0 10px; }
  }
}

/* ══════════════════════════════
   Mobile
══════════════════════════════ */
@media (max-width: 1023px) {
  aside#aside,
  aside:not([id]) { transform: translateX(-100%); }
  aside#aside.is-open,
  aside:not([id]).is-open { transform: translateX(0); box-shadow: var(--shadow-md); }
  body.aside-open { overflow: hidden; touch-action: none; }

  #header { left: 0 !important; width: 100% !important; height: auto !important; }

  #header .head_inner {
    height: auto;
    padding: 10px 16px;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 10px;
    row-gap: 8px;
    max-width: 100%;
    margin: 0;
    align-items: center;
  }

  #header .header_left  { grid-column: 1; grid-row: 1; }
  #header .aside-toggle { display: inline-flex; }
  #header .header_logo img { height: 34px; max-width: 140px; }

  #header .header_user  { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  #header .user_icon_btn { height: 28px; font-size: 11px; padding: 0 9px; }

  #header .header_center { grid-column: 1 / 3; grid-row: 2; }
  #header .header_search_box fieldset { height: 42px; }

  #header .search_sub_buttons {
    grid-column: 1 / 3;
    grid-row: 3;
    justify-self: end;
  }
}

/* MakeShop 충돌 방지 */
#header { width: 100% !important; }
aside#aside,
aside:not([id]) { width: var(--aside-w) !important; margin: 0 !important; }
/* BASIC css end */

