/* === header.css: Header, Navigation, Navbar, Hamburger, Mobile Menu, Top Tabs === */

header {
  background-color: #fff;
  color: #333;
  padding: 25px 0;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: #3617ce;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo span {
  font-weight: 700;
  color: #333;
  font-size: 1.2rem;
  margin-left: 10px;
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 2rem;
}

.nav-links a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

.hamburger {
  display: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: #3617ce;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 85px;
  left: 0;
  width: 100%;
  background: white;
  padding: 1rem 0;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  z-index: 99;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu ul {
  list-style: none;
}

.mobile-menu li {
  padding: 0.8rem 2rem;
  border-bottom: 1px solid #eee;
}

.mobile-menu a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  display: block;
}

/* Breadcrumb 스타일 */
.breadcrumb {
  background: #f8f9fa;
  padding: 10px 0;
  margin-top: 80px;
  border-bottom: 1px solid #e9ecef;
}

.breadcrumb-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.breadcrumb-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  flex-wrap: wrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: ">";
  margin: 0 8px;
  color: #666;
  font-size: 0.9rem;
}

.breadcrumb-link {
  color: #3617ce;
  text-decoration: none;
  font-size: clamp(0.6rem, 2vw, 0.9rem);
  transition: color 0.3s ease;
}

.breadcrumb-link:hover {
  color: #2b10b0;
  text-decoration: underline;
}

.breadcrumb-current {
  color: #666;
  font-size: clamp(0.6rem, 2vw, 0.9rem);
  font-weight: 500;
}

/* 카카오 버튼 (햄버거 옆 위치 - 네모 모양, 검정배경, 노란텍스트) */
.mobile-kakao-btn {
  position: fixed;
  top: 15px; /* 헤더와 같은 높이 */
  right: 60px; /* 햄버거 메뉴 왼쪽 */
  width: auto;
  height: auto;
  padding: 8px 16px;
  background-color: #fee500; /* 노란색 배경 */
  color: #000000; /* 검정색 텍스트 */
  border-radius: 6px; /* 네모 모양 */
  display: none;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 999; /* 헤더보다 위에 */
  border: 2px solid #fee500; /* 노란색 테두리 */
}

.mobile-kakao-btn:hover {
  background-color: #1a1a1a; /* 호버시 약간 밝은 검정 */
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(254, 229, 0, 0.4);
}

.mobile-kakao-btn:hover {
  background-color: #fdd835;
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(254, 229, 0, 0.4);
}

/* 상단 탭 네비게이션 스타일 - 전국페이지와 동일 */
.top-tabs-wrapper {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e0e0e0;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.top-tabs-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 8px 20px;
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.top-tabs-container::-webkit-scrollbar {
  display: none;
}

.tab-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  text-decoration: none;
  color: #555;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 20px;
  transition: all 0.3s ease;
  white-space: nowrap;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.8);
}

.tab-item:hover {
  background: #3617ce;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(54, 23, 206, 0.3);
}

.tab-item i {
  font-size: 0.85rem;
}

/* 상단 탭 네비게이션 배경 하얀, 폰트/아이콘 검정 - 로고는 제외 */
.top-tabs-wrapper {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.top-tabs-container .tab-item {
  background: transparent !important;
  color: #333 !important;
  border: none !important;
}

.top-tabs-container .tab-item i {
  color: #333 !important;
}

.top-tabs-container .tab-item:hover {
  background: rgba(54, 23, 206, 0.1) !important;
  color: #3617ce !important;
}

.top-tabs-container .tab-item:hover i {
  color: #3617ce !important;
}

/* 데스크톱에서 상단 탭 네비게이션 숨김 */
@media (min-width: 1201px) {
  .top-tabs-wrapper {
    display: none !important;
  }
}

/* 기본 모바일 반응형 (768px 이하) */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hamburger {
    display: block;
  }

  /* 기본값: 탭 없는 경우 (모바일) */
  .breadcrumb {
    margin-top: 70px !important; /* header만 */
  }

  /* 탭 있을 때 (모바일) */
  .top-tabs-wrapper + .breadcrumb {
    margin-top: 110px !important; /* header + tab */
  }

  /* 모바일 breadcrumb 스타일 */
  .breadcrumb {
    margin-top: 70px;
    padding: 8px 0;
  }

  .breadcrumb-container {
    padding: 0 5px;
  }

  .breadcrumb-link,
  .breadcrumb-current {
    font-size: 0.8rem;
  }

  .breadcrumb-item + .breadcrumb-item::before {
    margin: 0 6px;
    font-size: 0.8rem;
  }

  header {
    padding: 15px 0;
  }

  .logo span {
    font-size: 1rem;
  }

  /* 모바일 카카오 버튼 */
  .mobile-kakao-btn {
    display: flex;
  }

  /* 탭 네비게이션 모바일 반응형 */
  .top-tabs-wrapper {
    top: 60px;
  }

  .top-tabs-container {
    padding: 6px 15px;
    gap: 3px;
    justify-content: flex-start;
  }

  .tab-item {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-width: auto;
  }

  .tab-item i {
    font-size: 0.75rem;
  }
}

/* 데스크톱 기본 (769px 이상) - mobile menu 숨김 */
@media (min-width: 769px) {
  .mobile-menu {
    display: none !important;
  }

  .mobile-kakao-btn {
    top: 15px !important;
    right: 60px !important;
    padding: 8px 16px !important;
    font-size: 0.9rem !important;
    border-width: 2px !important;
  }
}

/* 태블릿 및 모바일 (768px 이하) */
@media (max-width: 768px) {
  .mobile-kakao-btn {
    top: 18px !important;
    right: 55px !important;
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    border-width: 1.5px !important;
  }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
  .mobile-kakao-btn {
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
    right: 50px !important;
    top: 18px !important;
  }
}

/* 매우 작은 모바일 (320px 이하) */
@media (max-width: 320px) {
  .breadcrumb {
    margin-top: 60px !important;
    padding: 5px 0 !important;
    background: #f8f9fa !important;
  }

  .breadcrumb-container {
    width: 95% !important;
    padding: 0 5px !important;
  }

  .breadcrumb-link,
  .breadcrumb-current {
    font-size: 0.7rem !important;
    line-height: 1.2 !important;
  }

  .breadcrumb-item + .breadcrumb-item::before {
    margin: 0 4px !important;
    font-size: 0.7rem !important;
  }

  /* 헤더 최적화 */
  header {
    padding: 8px 0 !important;
  }

  .logo {
    font-size: 1.2rem !important;
  }

  .logo span {
    font-size: 0.8rem !important;
    margin-left: 5px !important;
  }

  .mobile-kakao-btn {
    padding: 4px 8px !important;
    font-size: 0.7rem !important;
    right: 45px !important;
    top: 16px !important;
  }
}

/* 탭이 있을 때만 적용 (데스크톱) */
.top-tabs-wrapper + .breadcrumb {
  margin-top: 140px; /* header + tab 높이 */
}

/* 기본값: 탭 없는 경우 (데스크톱) */
@media (max-width: 768px) {
  .breadcrumb {
    margin-top: 90px; /* header 높이만큼 */
  }

  /* 탭이 있을 때만 적용 (데스크톱) */
  .top-tabs-wrapper + .breadcrumb {
    margin-top: 140px; /* header + tab 높이 */
  }
}
