/* ============================================
   友林旅游网站 - 头部样式 (header.css)
   ============================================ */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

/* 主标题区域 - 橙色渐变 */
.header-main {
  background: linear-gradient(90deg, #ffb380 0%, #ff8c42 50%, #FB5F00 100%);
  padding: 16px 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-logo img {
  height: 48px;
  width: auto;
}

/* 搜索栏 - 白底圆角，右侧搜索按钮 */
.header-search-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 400px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  min-width: 0;
  align-self: center;
}

/* 全站头部搜索栏「搜索」按钮统一（橙底白图标，与主站 common/head 一致） */
.header-search-btn,
.header-search-yueche button,
.header-search-yoyaku button,
.header-search-terms button,
.header-search-about button,
.header-search-guide button,
.header-search-cart button,
.td-search button,
.hs-search button {
  background: #fb5f00;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, opacity 0.2s ease;
  flex-shrink: 0;
  box-sizing: border-box;
  min-width: 44px;
  align-self: stretch;
}

.header-search-btn:hover,
.header-search-yueche button:hover,
.header-search-yoyaku button:hover,
.header-search-terms button:hover,
.header-search-about button:hover,
.header-search-guide button:hover,
.header-search-cart button:hover,
.td-search button:hover,
.hs-search button:hover {
  background: #e55500;
}

.header-search-btn:focus-visible,
.header-search-yueche button:focus-visible,
.header-search-yoyaku button:focus-visible,
.header-search-terms button:focus-visible,
.header-search-about button:focus-visible,
.header-search-guide button:focus-visible,
.header-search-cart button:focus-visible,
.td-search button:focus-visible,
.hs-search button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* 旧版用 <img> 做搜索图标时，在橙底上显示为白色 */
.header-search-yueche button img,
.header-search-yoyaku button img,
.header-search-terms button img,
.header-search-about button img,
.header-search-guide button img,
.header-search-cart button img,
.td-search button img,
.hs-search button img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.header-search-btn svg,
.header-search-yueche button svg,
.header-search-yoyaku button svg,
.header-search-terms button svg,
.header-search-about button svg,
.header-search-guide button svg,
.header-search-cart button svg,
.td-search button svg,
.hs-search button svg {
  display: block;
  flex-shrink: 0;
}

/* 右侧：电话、登录、购物车 */
.header .header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto; /* 整组按钮整体靠右，与菜单并排 */
}

.header .header-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.3s;
}

.header .header-phone:hover {
  color: #fff;
  opacity: 0.9;
}

.header .btn-header {
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.3s ease;
  display: inline-block;
}

.header .btn-login,
.header .btn-cart {
  background: #1a1a1a;
  color: #fff !important;
  width: 98px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header .btn-login:hover,
.header .btn-cart:hover {
  background: #333;
  color: #fff !important;
  transform: translateY(-1px);
}

/* Main Navigation 白色导航栏 */
.main-nav {
  background: #fff;
  border-top: 1px solid #eee;
}

.nav-list {
  display: flex;
  justify-content: center;
  gap: 0;
}

.nav-item {
  position: relative;
}

.nav-item > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 500;
  color: #333;
  transition: all 0.3s ease;
  position: relative;
}

.nav-arrow {
  font-size: 18px;
  opacity: 0.8;
}

.nav-item > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  /* background: #FB5F00; */
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-item:hover > a::after,
.nav-item > a.active::after {
  width: 60%;
}

.nav-item:hover > a,
.nav-item > a.active {
  color: #FB5F00;
}

/* 下拉菜单 */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 140px;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  border-radius: 6px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.25s ease;
  z-index: 100;
}

.nav-item-dropdown:hover .nav-dropdown,
.nav-item-lang:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown li a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  color: #333;
  transition: all 0.2s;
  text-align: center;
}

.nav-dropdown li a:hover {
  background: #FB5F00;
  color: #fff;
}

.nav-lang-dropdown {
  right: 0;
  left: auto;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #333;
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Header & Nav Mobile */
@media (max-width: 768px) {
  .header-main { padding: 12px 0; }
  .header-top {
    gap: 6px;
    flex-wrap: nowrap;
    min-height: 44px;
    align-items: center;
  }
  .header-logo img { height: 40px; }
  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }
  .menu-toggle span {
    width: 22px;
    margin: 3px 0;
  }
  .header-search-wrap {
    max-width: 180px;
    flex: 0 1 auto;
    min-width: 0;
  }
  .header-search-input {
    padding: 8px 12px;
    font-size: 13px;
  }
  .header-search-btn,
  .header-search-yueche button,
  .header-search-yoyaku button,
  .header-search-terms button,
  .header-search-about button,
  .header-search-guide button,
  .header-search-cart button,
  .td-search button,
  .hs-search button {
    padding: 8px 12px;
  }
  .header .header-actions {
    gap: 6px;
    flex-shrink: 0;
    margin-right: 0;
  }
  .header .header-phone {
    padding: 8px 10px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }
  .header .header-phone span { display: none; }
  .header .header-phone svg { width: 20px; height: 20px; }
  .header .btn-header {
    padding: 8px 14px;
    font-size: 12px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .header .btn-login,
  .header .btn-cart {
    width: 78px;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  .main-nav.active { display: block; }
  .nav-list {
    flex-direction: column;
  }
  .nav-item > a,
  .nav-item a {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
  }
  .nav-dropdown { display: none; }
  .nav-item-dropdown:hover .nav-dropdown,
  .nav-item-lang:hover .nav-dropdown {
    display: block;
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-radius: 0;
    margin-left: 20px;
  }
}

@media (max-width: 480px) {
  .header-main { padding: 10px 0; }
  .header-top { gap: 4px; }
  .header-logo img { height: 36px; }
  .header-search-wrap { display: none; }
  .header .header-actions {
    gap: 10px;
    margin-right: 0;
  }
  .header .btn-header {
    padding: 6px 12px;
    font-size: 11px;
    min-height: 38px;
  }
  .header .btn-login,
  .header .btn-cart {
    width: 72px;
  }
  .header .header-phone {
    min-width: 40px;
    min-height: 40px;
    padding: 6px;
  }
  .header .header-phone svg { width: 18px; height: 18px; }
  .menu-toggle {
    min-width: 40px;
    min-height: 40px;
    padding: 10px;
  }
  .menu-toggle span { width: 20px; margin: 2px 0; }
}
