/**
 * 顶栏语言 / 会员 / 询盘篮 — anputidepepsupply（白底黑图标）
 * 参考母版 gtranslate 美化，选择器改为 .web_head / .head_right
 */

:root {
  --xy-member-nav-avatar-bg: #222;
  --xy-member-nav-avatar-color: #fff;
  --xy-member-nav-icon-size: 24px;
  --xy-basket-nav-icon-size: 24px;
  --xy-basket-badge-bg: #ec1c28;
  --xy-skin-primary: #ec1c28;
}

.web_head .head_right {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  vertical-align: middle !important;
  overflow: visible !important;
  background-color: transparent !important;
}

.web_head .head_right .xy-header-extra-nav {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  vertical-align: middle !important;
  overflow: visible !important;
}

.web_head .head_right .xy-header-extra-nav > li {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  overflow: visible !important;
  line-height: 1 !important;
}

.web_head .head_right .xy-header-extra-nav .xy-member-nav,
.web_head .head_right .xy-header-extra-nav .xy-basket-nav,
.web_head .head_right .xy-header-extra-nav .xy-wishlist-nav {
  --xy-member-nav-icon-size: 24px;
  --xy-basket-nav-icon-size: 24px;
  --xy-member-nav-avatar-bg: #222;
  color: #222 !important;
  opacity: 1 !important;
}

.web_head .head_right .xy-header-extra-nav a {
  color: #222 !important;
}

.web_head .head_right .xy-header-extra-nav .xy-member-nav-login,
.web_head .head_right .xy-header-extra-nav .xy-basket-nav > a,
.web_head .head_right .xy-header-extra-nav .xy-basket-nav .icon,
.web_head .head_right .xy-header-extra-nav .xy-basket-nav .icon > i,
.web_head .head_right .xy-header-extra-nav .xy-basket-nav .icon > svg {
  color: #222 !important;
  fill: currentColor !important;
}

/* 系统若已注入搜索，隐藏样板搜索钮，避免双份 */
.web_head .head_right:has(.xy-header-search) > .btn--search {
  display: none !important;
}

/* —— gtranslate（对齐母版布局，配色适配红底） —— */
.web_head .xy-header-lang {
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
  line-height: 1 !important;
  overflow: visible !important;
}

.web_head .xy-header-lang-switcher {
  line-height: 1 !important;
  overflow: visible !important;
}

.web_head .xy-header-lang-switcher #gt_float_wrapper {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  height: auto !important;
  z-index: 20 !important;
  display: block !important;
  overflow: visible !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher {
  position: relative !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px !important;
  border-radius: 0 !important;
  overflow: visible !important;
  line-height: 1 !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt-selected {
  background: transparent !important;
  float: none !important;
  cursor: pointer !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 2px 0 6px !important;
  min-height: 40px !important;
  color: #222 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  text-transform: uppercase !important;
  letter-spacing: 0.02em !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  line-height: 1.2 !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang:hover {
  color: #ec1c28 !important;
  opacity: 1 !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang .gt-lang-code {
  position: static !important;
  top: auto !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  letter-spacing: 0.02em;
}

.web_head .xy-header-lang-switcher .gt_float_switcher img {
  width: 22px !important;
  height: 15px !important;
  max-width: 22px !important;
  max-height: 15px !important;
  margin: 0 !important;
  border-radius: 2px !important;
  vertical-align: middle !important;
  object-fit: cover !important;
  object-position: center !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
  background: transparent !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang span.gt_float_switcher-arrow {
  height: 14px !important;
  width: 14px !important;
  background-size: 10px !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 285 285'><path d='M282 76.5l-14.2-14.3a9 9 0 0 0-13.1 0L142.5 174.4 30.3 62.2a9 9 0 0 0-13.2 0L3 76.5a9 9 0 0 0 0 13.1l133 133a9 9 0 0 0 13.1 0l133-133a9 9 0 0 0 0-13z' style='fill:%23222222'/></svg>") !important;
  opacity: 0.95 !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  left: auto !important;
  width: 420px !important;
  max-width: min(420px, calc(100vw - 24px)) !important;
  max-height: min(70vh, calc(100vh - 110px)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 10px 8px !important;
  margin: 0 !important;
  background: #fff !important;
  border: 1px solid #e5e5e5 !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14) !important;
  z-index: 9999 !important;
  float: none !important;
  white-space: normal !important;
  display: none !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-rows: min-content !important;
  align-content: start !important;
  justify-items: stretch !important;
  text-align: left !important;
  box-sizing: border-box !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options.gt-open {
  display: grid !important;
  opacity: 1 !important;
  transform: none !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options a {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 7px 8px !important;
  margin: 0 !important;
  color: #444 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  text-decoration: none !important;
  float: none !important;
  background: transparent !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options a:hover {
  background: #f5f5f5 !important;
  color: #ec1c28 !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options a img {
  flex-shrink: 0 !important;
  width: 18px !important;
  height: 12px !important;
  max-width: 18px !important;
  max-height: 12px !important;
  margin: 1px 0 0 !important;
  background: #e8eef1 !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options.gt-expanded {
  width: 560px !important;
  max-width: min(560px, calc(100vw - 24px)) !important;
  max-height: min(78vh, calc(100vh - 96px)) !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options a.gt-lang-extra {
  display: none !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options.gt-expanded a.gt-lang-extra {
  display: flex !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options a.gt-lang-more {
  grid-column: 1 / -1 !important;
  justify-content: center !important;
  align-items: center !important;
  display: flex !important;
  gap: 6px !important;
  color: #ec1c28 !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  border-top: 1px solid #eee !important;
  margin-top: 6px !important;
  padding: 10px 12px 4px !important;
  text-decoration: none !important;
  word-break: normal !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options a.gt-lang-more:hover {
  background: transparent !important;
  color: #333 !important;
}

.web_head,
.web_head .layout,
.web_head .head_right {
  overflow: visible !important;
}

.web_head:has(.gt_options.gt-open) {
  z-index: 1001;
  overflow: visible !important;
}

@media only screen and (max-width: 950px) {
  /* 与手机顶栏断点一致；压过系统 xy-member-nav.css */
  body .web_head .head_right .xy-header-extra-nav > li.xy-header-lang,
  body .web_head .head_right .xy-header-extra-nav > li.xy-header-search,
  body .web_head .head_right > .btn--search,
  body .web_head li.xy-header-lang,
  body .web_head li.xy-header-search,
  body .web_head .btn--search {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    max-width: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
  }
}

@media screen and (max-width: 980px) {
  .web_head .xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang {
    padding-left: 4px !important;
    font-size: 12px !important;
    min-height: 36px !important;
  }
  .web_head .xy-header-lang-switcher .gt_float_switcher img {
    width: 18px !important;
    height: 12px !important;
    max-width: 18px !important;
    max-height: 12px !important;
  }
  .web_head .xy-header-lang-switcher .gt_float_switcher .gt_options,
  .web_head .xy-header-lang-switcher .gt_float_switcher .gt_options.gt-expanded {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none !important;
    top: 72px !important;
    max-height: calc(100vh - 96px) !important;
    z-index: 10050 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* 手机顶栏翻译侧栏 */
.xy-mobile-lang-panel{padding:4px 2px 12px;}
.xy-mobile-lang-panel .xy-mobile-lang-hd{
  margin:0 0 14px;padding:0 4px 10px;border-bottom:1px solid #eee;
  font-size:15px;font-weight:600;color:#222;text-transform:uppercase;letter-spacing:.04em;
}
.xy-mobile-lang-panel .xy-mobile-lang-empty{margin:12px 4px;color:#888;font-size:13px;}
.xy-mobile-lang-panel .xy-mobile-lang-list{list-style:none;margin:0;padding:0;}
.xy-mobile-lang-panel .xy-mobile-lang-list li{margin:0;padding:0;border-bottom:1px solid #f0f0f0;}
.xy-mobile-lang-panel .xy-mobile-lang-list a{
  display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;
  gap:10px;padding:12px 6px;color:#333;text-decoration:none;font-size:14px;line-height:1.3;
}
.xy-mobile-lang-panel .xy-mobile-lang-list a:active,
.xy-mobile-lang-panel .xy-mobile-lang-list a:hover{background:#f7f7f7;color:#ec1c28;}
.xy-mobile-lang-panel .xy-mobile-lang-list img{
  width:22px;height:15px;object-fit:cover;border-radius:2px;-webkit-flex-shrink:0;flex-shrink:0;
}
.xy-mobile-lang-panel .xy-mobile-lang-list span{min-width:0;}

/* 手机汉堡：白底黑图标触发器（抽屉仍在 .mobile-head-items） */
@media only screen and (max-width: 950px) {
  /* 黑条只保留翻译/搜索；导航已迁到顶栏汉堡 */
  .mobile-head-items .mobile-head-item.mobile-head-home {
    display: none !important;
  }
  .mobile-head-items .mobile-head-item.mobile-head-nav.xy-mobile-nav-slot {
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    float: none !important;
  }
  .mobile-head-items .xy-mobile-nav-slot > .title {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  .web_head .head_right .xy-mobile-nav-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    width: 32px !important;
    height: 32px !important;
    margin: 0 0 0 4px !important;
    padding: 0 !important;
    color: #222 !important;
    cursor: pointer !important;
    font-family: 'fontawesome', FontAwesome !important;
    line-height: 32px !important;
    text-align: center !important;
    position: relative !important;
    z-index: 20 !important;
  }
  .web_head .head_right .xy-mobile-nav-trigger:before {
    content: '\f0c9' !important;
    font-size: 24px !important;
    color: #222 !important;
    line-height: 32px !important;
  }
}
