:root {
  --ink: #0f172a;
  --muted: #6b7280;
  --line: #e9edf3;
  --white: #fff;
  --blue: #2563eb;
  --bg-dark: #0b0b0c;
  --container: 1400px;
  /* Added clover theme colors */
  --clover-green: #2d5f3f;
  --clover-light: #4ade80;
  --clover-dark: #1e4a2f;
}

/* SR 전용 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 헤더 */
.site-header-wrap {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff;
  color: #fff;
  border-bottom: 1px solid rgba(190, 195, 192, 0.2);
  backdrop-filter: saturate(150%) blur(6px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
}

.header-container {
  max-width: var(--container);
  padding: 0px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.nav-container {
  display: flex;
}

.nav-detail {
  display: flex;
  gap: 40px;
  align-items: center;
}

.site-header {
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
}

.header-inner {
  justify-content: space-between;
  gap: 50px;
  padding: 10px 0;
}

/* 로고 */
.logo img {
  width: 50px;
  height: 50px;
}

@media (max-width: 1024px) {
  .logo img {
    height: 50px;
    display: block;
  }
}
@media (max-width: 800px) {
  .logo img {
    height: 40px;
    display: block;
  }
}
/* 검색 (PC) */
/* .search-wrap {
  position: relative;
  display: flex;
  width: 60%;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(182, 186, 184, 0.3);
  padding: 12px 4px 12px 12px;
  border-radius: 10px;
  min-width: 320px;
  margin: auto;
  transition: all 0.3s ease;
} */

.search-wrap {
  position: relative;
}
.search-wrap:focus-within {
  background: rgba(245, 245, 245, 0.425);
  border-color: rgba(245, 245, 245, 0.425);
  box-shadow: 0 0 0 3px rgba(245, 245, 245, 0.425);
}
.search-wrap img {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
}
.search-wrap input {
  /* display: flex;
  min-width: 250px;
  height: 36px;
  padding: 0 12px;
  justify-content: flex-end;
  align-items: center;
  border: 1px solid rgba(182, 186, 184, 0.3);
  border-radius: 10px;
  font-size: 13px; */

  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0);
  background: #f3f3f5;
  display: flex;
  width: 256px;
  height: 36px;
  padding: 4px 12px 4px 40px;
  align-items: center;
}

.search-wrap input::placeholder {
  /* color: rgb(0, 0, 0); */
  color: #717182;
}

.search-ic {
  position: absolute;
  right: 12px;
  opacity: 0.7;
  font-size: 16px;
}

/* 유저 박스/버튼 */
.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.path {
  color: #000000;
  font-weight: 600;
  white-space: nowrap;
  width: fit-content;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 5px;
  text-decoration: none;
  background: #ffffff;
  border: 1px solid rgb(0, 0, 0);
  transition: all 0.3s ease;
  cursor: pointer;
}

/* .user-name {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 24px;
  cursor: pointer;
  background: rgba(74, 222, 128, 0.2);
  border: 1.5px solid rgba(74, 222, 128, 0.4);
  transition: all 0.3s ease;
}

.user-name:hover {
  background: rgba(74, 222, 128, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(74, 222, 128, 0.3);
  border-color: rgba(74, 222, 128, 0.6);
} */

/* .user-logout {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 24px;
  cursor: pointer;
  background: rgba(239, 68, 68, 0.15);
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  transition: all 0.3s ease;
}

.user-logout:hover {
  background: rgba(239, 68, 68, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
  border-color: rgba(239, 68, 68, 0.8);
} */

.login-btn,
.user-name,
.signup-btn,
.user-logout {
  color: #000000;
  font-size: 14px;
  padding: 10px;
  white-space: nowrap;
  width: fit-content;
  border-radius: 5px;
  text-decoration: none;
  background: #ffffff;
  transition: all 0.3s ease;
  cursor: pointer;
}

.signup-btn:hover,
.user-logout:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

/* 카테고리 내비 */
.cat-nav {
  max-width: 100%;
  background: #ffffff;
  padding: 10px 0px;
}

.cat-nav ul {
  display: flex;
  gap: 35px;
  list-style: none;
  align-items: center;
}

.cat-nav a {
  color: #0a0a0a;
  font-size: 16px;
  padding: 10px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: -0.312px;
}

/* .cat-nav a:hover {
  background: rgba(74, 222, 128, 0.15);
  color: #fff;
}

.cat-nav .active a {
  /* background: rgba(74, 222, 128, 0.25); */
/* border: 1px solid rgba(74, 222, 128, 0.4); */
/* color: #fff;
  font-weight: 600;
}  */

#mypageMenu {
  display: none;
  border: none;
  background: none;
  padding: 8px 14px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
}
/* =========================
   Header Responsive Fix Pack
   (기존 CSS 아래에 추가)
========================= */

/* 컨테이너 폭/패딩 안정화 */
.site-header {
  max-width: var(--container);
}

/* header-inner: 좁아지면 줄바꿈 허용 */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px; /* 기존 50px 같은 큰 gap 제거 */
  padding: 12px 0; /* 살짝 여유 */
  flex-wrap: wrap; /* ✅ 핵심 */
}

/* header-container도 중앙정렬만 하고, justify는 header-inner가 담당 */
.header-container {
  justify-content: center;
  padding: 0 16px;
}

/* 로고 크기: clamp로 화면에 따라 커졌다 작아졌다 */
.logo img {
  width: clamp(40px, 4vw, 100px);
  height: clamp(40px, 4vw, 100px);
  display: block;
  object-fit: contain;
}

/* nav 영역이 공간을 유연하게 쓰도록 */
.cat-nav {
  flex: 1;
  min-width: 0; /* ✅ flex overflow 방지 필수 */
  padding: 0;
}

/* 카테고리 메뉴: 기본은 한 줄 유지 + 공간 부족 시 안전장치 */
.cat-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 28px);
  padding: 0;
  margin: 0;
  min-width: 0;
}

/* nav-detail도 너무 큰 gap 쓰지 않게 */
.nav-detail {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* 검색 input 폭도 clamp로 유연하게 */
.search-wrap input {
  width: clamp(180px, 22vw, 256px);
}

/* 유저 버튼들 살짝 컴팩트 */
.login-btn,
.user-name,
.signup-btn,
.user-logout,
.path {
  padding: 8px 10px;
  font-size: 14px;
}

/* =========================
   태블릿/모바일: 2줄 레이아웃
   1줄: 로고 + 유저
   2줄: 카테고리(가로스크롤)
========================= */
@media (max-width: 768px) {
  /* 로고가 너무 작게 느껴지면 모바일에서 좀 더 키움 */
  .logo img {
    width: 44px;
    height: 44px;
  }

  /* 순서 재배치 */
  .site-header-wrap .logo {
    order: 1;
  }

  .nav-detail {
    order: 2;
    margin-left: auto;
  }

  .cat-nav {
    order: 3;
    width: 100%;
  }

  /* 카테고리: 줄바꿈 대신 가로 스크롤로 안전하게 */
  .cat-nav ul {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 6px 2px;
  }
  .cat-nav ul::-webkit-scrollbar {
    display: none;
  }

  /* 메뉴 글씨 살짝 줄이기 */
  .cat-nav a {
    font-size: 14px;
    padding: 8px 10px;
    white-space: nowrap;
  }

  /* 유저 영역도 줄바꿈 방지 */
  .user-box {
    gap: 8px;
    flex-wrap: nowrap;
  }
}

/* =========================
   900px 이하에서 검색 숨기는 로직은 유지하되
   레이아웃이 덜 흔들리게만
========================= */
@media (max-width: 900px) {
  .search-wrap {
    display: none;
  }

  .nav-detail {
    gap: 12px;
  }
}
/* 반응형: 900 이하에서 헤더 내 검색 숨김 */
@media (max-width: 800px) {
  .cat-nav ul {
    gap: 0px;
  }
}

@media (min-width: 800px) {
  #mypageMenu {
    display: none;
  }
}
@media (max-width: 900px) {
  .search-wrap {
    display: none;
  }
}
