/* ============================================
   产品导航下拉面板组件
   nav-product.css
   ============================================ */

/* 触发区域 */
.nav-product__trigger {
  position: relative;
  cursor: pointer;
}

.nav-product__trigger::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 5px;
  margin-left: 6px;
  vertical-align: middle;
  background: url("/image/productcenter/xiala_2.png") no-repeat center / contain;
  transition: transform 0.3s ease;
}

.nav-product__trigger:hover::after,
.nav-product__trigger.is-active::after {
  background: url("/image/productcenter/xiala.png") no-repeat center / contain;
}

/* 面板容器 */
.nav-product__panel {
  position: fixed;
  top: 78px;
  left: 50%;
  width: 1500px;
  max-width: calc(100vw - 32px);
  z-index: 1004;
  background: #ffffff;
  border-radius: 0 0 8px 8px;
  border-top: 1px solid rgba(111, 111, 111, 0.12);
  box-shadow: 0 8px 30px rgba(58, 72, 90, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-8px);
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease,
    transform 0.3s ease;
  pointer-events: none;
}

.user-layout-lang,
.user-layout-lang-menu {
  overflow: visible;
}

.nav-product__panel.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(-50%) translateY(0) !important;
  pointer-events: auto !important;
}

/* 面板内容 */
.nav-product__inner {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 20px 32px;
}

/* 顶部工具栏：查看全部 + 搜索 + 常用产品标签 同一行 */
.nav-product__toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

/* 左侧栏：查看全部 + 搜索 */
.nav-product__sidebar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.nav-product__view-all {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.25s ease;
  white-space: nowrap;
}

.nav-product__view-all:hover {
  color: #EE4E41;
}

.nav-product__view-all svg,
.nav-product__view-all .arrow-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 搜索框 */
.nav-product__search {
  position: relative;
  width: 280px;
  flex-shrink: 0;
}

.nav-product__search-input {
  width: 100%;
  height: 38px;
  padding: 0 36px 0 14px;
  border: 1px solid #e2e6ec;
  border-radius: 8px;
  font-size: 13px;
  color: #1a1a1a;
  background: #f7f8fb;
  outline: none;
  transition: border-color 0.25s ease, background 0.25s ease;
  box-sizing: border-box;
}

.nav-product__search-input::placeholder {
  color: #b8bcc4;
}

.nav-product__search-input:focus {
  border-color: #EE4E41;
  background: #ffffff;
}

.nav-product__search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #b8bcc4;
  pointer-events: none;
}

/* 右侧主区 */
.nav-product__main {
  margin-top: 0;
}

/* 分类标签 */
.nav-product__tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* "常用产品："前缀文字 */
.nav-product__tags-label {
  font-size: 13px;
  font-weight: 600;
  color: #3a485a;
  white-space: nowrap;
}

.nav-product__tag {
  padding: 5px 16px;
  border-radius: 0px 0px 0px 0px;
  font-size: 13px;
  color: #50565D;
  background: #f2f4f7;
  border: none;
  cursor: pointer;
  transition:
    background 0.25s ease,
    color 0.25s ease;
  white-space: nowrap;
}

.nav-product__tag:hover {
  background: #e8ecef;
}

.nav-product__tag.is-active {
  background: #EE4E41;
  color: #ffffff;
}

/* 产品网格 */
.nav-product__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 24px;
}

/* 产品卡片 */
.nav-product__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 8px;
  border: 1px solid #ECF4FF;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.22s ease;
}

.nav-product__item:hover {
  background: #F5F5F5;
  border-radius: 2px;
}

.nav-product__item.is-hidden {
  display: none;
}

/* 图标 */
.nav-product__item-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 优先使用图片图标，隐藏 emoji 占位 */
.nav-product__item-icon span {
  display: none;
}

.nav-product__item-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

/* 文字 */
.nav-product__item-info {
  min-width: 0;
  flex: 1;
}

.nav-product__item-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.22s ease;
}

.nav-product__item:hover .nav-product__item-name {
  color: #EE4E41;
}

.nav-product__item-desc {
  font-size: 12px;
  color: #9aa0ab;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 无搜索结果 */
.nav-product__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
  color: #b8bcc4;
  font-size: 14px;
  display: none;
}

.nav-product__empty.is-visible {
  display: block;
}

/* 响应式 */
@media screen and (max-width: 1400px) {
  .nav-product__panel {
    width: 95%;
  }
}

@media screen and (max-width: 1200px) {
  .nav-product__panel {
    width: 92%;
  }

  .nav-product__inner {
    max-width: none;
    padding: 20px 16px 28px;
  }

  .nav-product__toolbar {
    flex-wrap: wrap;
  }

  .nav-product__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 900px) {
  .nav-product__sidebar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav-product__search {
    width: 100%;
  }

  .nav-product__tags {
    width: 100%;
  }

  .nav-product__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 16px;
  }
}

@media screen and (max-width: 600px) {
  .nav-product__grid {
    grid-template-columns: 1fr;
  }

  .nav-product__item {
    padding: 12px 16px;
  }
}
