/*
 * Kent & Hudson Frontend - Header Styles
 * 头部导航 - 参考 Kent & Hudson 风格
 */

/* ========== 顶部公告栏 ========== */
.header-top-bar {
  background: #fff;
  border-bottom: 1px solid var(--style-border);
  text-align: center;
  padding: 8px 15px;
  font-size: 12px;
  color: var(--style-muted);
  letter-spacing: 0.05em;
}

.header-top-bar strong { color: var(--style-color-gold); font-weight: 700; letter-spacing: 0.1em; }

/* ========== 主导航 ========== */
.header {
  width: 100%;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 2px solid var(--style-color);
  transition: box-shadow 0.25s ease;
}

.header.shadow { box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06); }

/* 通知栏：fixed 头部下方 */
.header.has-topbar {
  top: 33px;
}

.header .daohangzong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 75px;
  padding: 0 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Logo */
.header .daohang1 { flex-shrink: 0; }
.header .daohang1 a {
  display: flex;
  align-items: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--style-color);
}

.header .daohang1 a:hover { color: var(--style-color-gold); }

.header .daohang1 .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.header .daohang1 .logo-text-main {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.header .daohang1 .logo-text-sub {
  font-size: 10px;
  letter-spacing: 0.3em;
  margin-top: 4px;
  color: var(--style-muted);
  font-family: 'Helvetica Neue', sans-serif;
  text-transform: uppercase;
}

/* 中部桌面导航 */
.header .daohang2 {
  display: none;
  flex: 1;
  justify-content: center;
  align-items: center;
}

.header .daohang2-1 {
  position: relative;
}

.header .daohang2-1 > a:not(.pulldown-a) {
  display: flex;
  align-items: center;
  padding: 26px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--style-color);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.25s;
}

.header .daohang2-1 > a:not(.pulldown-a):hover,
.header .daohang2-1.active > a { color: var(--style-color-gold); }

/* Pulldown item — uses :has() to detect inner .pulldown element */
.header .daohang2-1:has(.pulldown) .pulldown-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 26px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--style-color);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.25s;
}

.header .daohang2-1:has(.pulldown) .pulldown-trigger a {
  color: inherit;
  text-decoration: none;
  padding: 0;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  display: inline;
}

.header .daohang2-1:has(.pulldown):hover .pulldown-trigger,
.header .daohang2-1:has(.pulldown).is-open .pulldown-trigger {
  color: var(--style-color-gold);
}

.header .daohang2-1:has(.pulldown):hover .pulldown-trigger a,
.header .daohang2-1:has(.pulldown).is-open .pulldown-trigger a {
  color: var(--style-color-gold);
}

.header .daohang2-1:has(.pulldown) .pulldown-trigger i {
  font-size: 10px;
  transition: transform 0.25s;
}

.header .daohang2-1:has(.pulldown):hover .pulldown-trigger i {
  transform: rotate(180deg);
}

/* 下拉菜单（小下拉） — 距导航更远，保持视觉透气感 */
.header .pulldown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 220px;
  background: #fff;
  border-top: 2px solid var(--style-color);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 100;
}

.header .daohang2-1:hover .pulldown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Invisible hover bridge — prevents dropdown from closing when moving from nav to dropdown */
.header .daohang2-1:has(.pulldown)::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
  display: block;
}

.header .pulldown-inner a {
  display: block;
  padding: 12px 22px;
  font-size: 13px;
  color: var(--style-color);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.01em;
  border-bottom: 1px solid #f5f5f5;
  text-align: center;
  background: #fff;
  text-decoration: none;
}

.header .pulldown-inner a:last-child { border-bottom: none; }
.header .pulldown-inner a:hover {
  background: var(--style-color);
  color: #fff;
}

/* Fallback when no inner wrapper (legacy pages) */
.header .pulldown > a {
  display: block;
  padding: 12px 22px;
  font-size: 13px;
  color: var(--style-color);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.01em;
  border-bottom: 1px solid #f5f5f5;
  text-align: center;
  background: #fff;
  text-decoration: none;
}

.header .pulldown > a:last-child { border-bottom: none; }
.header .pulldown > a:hover {
  background: var(--style-color);
  color: #fff;
}

/* 右侧操作 */
.header .daohang3 {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header .daohang3 > div { cursor: pointer; }

.header .daohang3 i {
  font-size: 18px;
  color: #1a1a1a;
  transition: color 0.25s;
}

.header .daohang3 > div:hover i { color: var(--style-muted); }

.header .daohang3-2 { position: relative; }
.header .daohang3-2 span {
  position: absolute;
  top: -5px;
  right: -8px;
  background: var(--style-color);
  color: #fff;
  font-size: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* 搜索图标文字 */
.header .daohang3 .icon-label {
  display: none;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 汉堡按钮 */
.header .daohang4 { cursor: pointer; padding: 6px; }
.hamburger {
  display: inline-block;
  cursor: pointer;
  width: 22px;
  height: 14px;
  position: relative;
}

.hamburger-inner {
  display: block;
  top: 50%;
  margin-top: -1px;
  width: 22px;
  height: 1.5px;
  background-color: #1a1a1a;
  position: absolute;
  transition: all 0.3s ease;
}

.hamburger-inner::before,
.hamburger-inner::after {
  content: '';
  display: block;
  width: 22px;
  height: 1.5px;
  background-color: #1a1a1a;
  position: absolute;
  transition: all 0.3s ease;
}

.hamburger-inner::before { top: -6px; }
.hamburger-inner::after { bottom: -6px; }

.hamburger.is-active .hamburger-inner { background-color: transparent; }
.hamburger.is-active .hamburger-inner::before { top: 0; transform: rotate(45deg); }
.hamburger.is-active .hamburger-inner::after { bottom: 0; transform: rotate(-45deg); }

/* ========== 手机端导航遮罩 ========== */
.header .shoujizhezhao {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.header .shoujizhezhao.zhankai {
  opacity: 1;
  visibility: visible;
}

/* ========== 手机端导航抽屉 ========== */
.header .shoujidaohang {
  position: fixed;
  top: 0;
  right: 0;
  transform: translateX(100%);
  width: 320px;
  max-width: 90%;
  height: 100%;
  background: #fff;
  z-index: 999;
  overflow-y: auto;
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
}

.header .shoujidaohang.zhankai {
  transform: translateX(0);
}

.header .shoujidaohang .shoujidaohang-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--style-border);
}

.header .shoujidaohang .shoujidaohang-close {
  cursor: pointer;
  font-size: 20px;
  color: #1a1a1a;
}

.header .shoujidaohang .shoujidaohang-close:hover { color: var(--style-muted); }

.header .shoujidaohang .shoujidaohang-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
}

.header .shoujidaohang1 {
  border-bottom: 1px solid var(--style-border);
}

.header .shoujidaohang1 > a,
.header .shoujidaohang1 .js-hasdrop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  font-size: 13px;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.header .shoujidaohang1 .js-hasdrop i {
  transition: transform 0.3s;
  font-size: 12px;
}

.header .shoujidaohang1 .js-hasdrop.active i {
  transform: rotate(90deg);
}

.header .shoujidaohang1 .dropdown {
  display: none;
  background: #fafafa;
  padding: 8px 24px 16px 40px;
}

.header .shoujidaohang1 .dropdown a {
  display: block;
  padding: 10px 0;
  font-size: 13px;
  color: #555;
  border-bottom: 1px solid #eee;
  text-transform: none;
  letter-spacing: 0;
}

.header .shoujidaohang1 .dropdown a:last-child { border-bottom: none; }
.header .shoujidaohang1 .dropdown a:hover { color: var(--style-color); }

/* ========== 搜索弹窗 ========== */
.header .sousuo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.header .sousuo.active { display: flex; }

.header .sousuoguan {
  position: absolute;
  top: 30px;
  right: 30px;
  cursor: pointer;
  font-size: 24px;
  color: #1a1a1a;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.25s;
}

.header .sousuoguan:hover { background: #f5f5f5; }

.header .sousuo1 {
  width: 100%;
  max-width: 600px;
  padding: 0 30px;
}

.header .sousuo1 form {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #1a1a1a;
}

.header .search-text {
  flex: 1;
  background: transparent;
  border: none;
  padding: 16px 0;
  font-size: 22px;
  color: #1a1a1a;
  outline: none;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
}

.header .search-text::placeholder {
  color: #999;
  font-style: italic;
}

.header .sousuo1-1 {
  padding: 16px;
  cursor: pointer;
  color: #1a1a1a;
}

.header .sousuo1-1 button {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #1a1a1a;
}

/* ========== Breadcrumb 面包屑 ========== */
.breadcrumb {
  background: #fff;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--style-border);
  font-size: 12px;
  color: var(--style-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.breadcrumb .container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.breadcrumb a {
  color: var(--style-muted);
  text-decoration: none;
  transition: color 0.25s;
  display: inline-flex;
  align-items: center;
}

.breadcrumb a:hover { color: #1a1a1a; }

.breadcrumb .sep {
  color: #ccc;
  margin: 0 10px;
}

.breadcrumb .home-icon {
  margin-right: 4px;
}

.breadcrumb .current {
  color: var(--style-color);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== 桌面端响应式 ========== */
@media (min-width: 992px) {
  .header .daohangzong {
    height: 85px;
    padding: 0 40px;
  }

  .header .daohang2 {
    display: flex;
  }

  .header .daohang2-1 > a:not(.pulldown-a) {
    padding: 32px 22px;
  }
  .header .daohang2-1:has(.pulldown) .pulldown-trigger {
    padding: 32px 22px;
  }

  .header .daohang4 { display: none; }
}

@media (min-width: 1200px) {
  .header .daohangzong { padding: 0 50px; }
  .header .daohang2-1 > a:not(.pulldown-a) { padding: 32px 28px; }
  .header .daohang2-1:has(.pulldown) .pulldown-trigger { padding: 32px 28px; }
}

@media (max-width: 767px) {
  .header .daohangzong { height: 60px; padding: 0 16px; }
  .header .daohang1 a { font-size: 20px; }
  .header .daohang1 .logo-text-main { font-size: 20px; }
  .header .daohang1 .logo-text-sub { font-size: 8px; letter-spacing: 0.25em; }
  .header .daohang3 { gap: 12px; }
  .header .daohang3 i { font-size: 16px; }
}
