/**
 * 汽车产品展示组件 - 前端样式
 * 全屏展示设计，适用于汽车配置界面
 */

/* 基础容器样式 */
.wd-product-showcase-container {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  position: relative;
  overflow: hidden;
  user-select: none;
  transition: all 0.3s ease;
}

/* 可拖拽容器 */
.wd-product-showcase-container.wd-draggable {
  cursor: grab;
}

.wd-product-showcase-container.wd-draggable:active {
  cursor: grabbing;
}

/* 购物车卡片样式 */
.wd-product-showcase-container .cart-card {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: none;
  transition: all 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.wd-product-showcase-container .cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.wd-product-showcase-container .cart-title {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
}

.wd-product-showcase-container .cart-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: all 0.3s ease;
  line-height: 1;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wd-product-showcase-container .cart-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 品牌栏样式 - 屏幕底部 */
.wd-product-showcase-container .brand-bar {
  background: rgba(65, 65, 65, 1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); */
  padding: 0 20px;
}

.wd-product-showcase-container .brand-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  animation: pulse 2s infinite;
}

.wd-product-showcase-container .brand-list {
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.wd-product-showcase-container .brand-list::-webkit-scrollbar {
  display: none;
}

.wd-product-showcase-container .brand-scroll-container {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 20px;
  min-width: max-content;
  padding: 10px 0;
}

.wd-product-showcase-container .brand-item {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  position: relative;
}

/* 移除所有悬停和选中效果 */

.wd-product-showcase-container .brand-item img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

.wd-product-showcase-container .brand-name {
  font-size: 10px;
  margin-top: 4px;
  text-align: center;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 76px;
}

/* 返回按钮样式 */
.wd-product-showcase-container .back-to-brands-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  transition: all 0.3s ease;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.9);
}

.wd-product-showcase-container .back-to-brands-btn:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: #00d4ff;
  transform: scale(1.05);
}

/* 产品加载提示 */
.wd-product-showcase-container .product-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  animation: pulse 2s infinite;
}

/* 产品网格区域样式 */
.wd-product-showcase-container .product-grid-area {
  min-height: 150px;
  max-height: 400px;
}

/* 产品滚动容器 */
.wd-product-showcase-container .product-scroll-container::-webkit-scrollbar {
  display: none;
}

.wd-product-showcase-container .product-scroll-container {
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  cursor: grab;
  /* 触控屏优化 */
  touch-action: pan-y; /* 只允许垂直滚动 */
  -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
}

.wd-product-showcase-container .product-scroll-container:active,
.wd-product-showcase-container .product-scroll-container.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.wd-product-showcase-container
  .product-scroll-container.dragging
  .product-item {
  pointer-events: none;
}

/* 产品网格容器横向布局 */
.wd-product-showcase-container .product-grid-container {
  min-height: 100%;
}

/* 网格样式布局 */
.wd-product-showcase-container .product-grid-container.grid-style {
  display: grid !important;
  grid-template-columns: repeat(
    auto-fit,
    minmax(var(--product-image-size, 120px), var(--product-image-size, 120px))
  ) !important;
  gap: var(--product-item-spacing, 15px) !important;
  justify-content: start !important;
  grid-auto-rows: var(--product-image-size, 120px) !important;
}

/* 列表样式布局 - 使用inline-block，最大兼容性版本 */
.wd-product-showcase-container .product-grid-container.list-style {
  display: block !important;
  width: 100% !important; /* 确保容器占满宽度 */
  min-width: 800px !important; /* 设置最小宽度确保有足够空间 */
  padding: 10px !important;
  text-align: left !important;
  font-size: 0 !important; /* 消除inline-block间隙 */
  /* 重置所有现代CSS属性 */
  grid-template-columns: none !important;
  grid-auto-rows: none !important;
  gap: initial !important;
  flex-direction: initial !important;
  flex-wrap: initial !important;
  justify-content: initial !important;
  align-content: initial !important;
  /* 强制重置可能影响布局的属性 */
  max-width: none !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

/* 通用产品项样式 */
.wd-product-showcase-container .product-item {
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  /* 触控屏优化 */
  touch-action: manipulation; /* 禁用双击缩放，优化触摸响应 */
  -webkit-user-select: none; /* 禁用文字选择 */
  user-select: none;
  -webkit-tap-highlight-color: transparent; /* 移除iOS触摸高亮 */
}

/* 所有产品项都不显示选中状态 */

/* 网格样式产品项 - 只显示图片 */
.wd-product-showcase-container .product-item.grid-item {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: var(--product-image-size, 120px);
  height: var(--product-image-size, 120px);
  aspect-ratio: 1;
}

/* 列表样式产品项 - 使用inline-block，最大兼容性版本 */
.wd-product-showcase-container .product-item.list-item {
    display: inline-block !important;
    width: 23% !important; /* 与您的修改保持一致 */
    min-width: 200px !important; /* 设置最小宽度确保不会太小 */
    height: 70px !important; /* 与您的修改保持一致 */
    vertical-align: top !important;
    background-color: transparent !important;
    border-radius: 0 !important; /* 设置为0 */
    cursor: pointer !important;
    position: relative !important;
    padding: 0px !important; /* 与您的修改保持一致 */
    margin-right: 20px !important; /* 与您的修改保持一致 */
    margin-bottom: 5px !important; /* 与您的修改保持一致 */
    font-size: 14px !important; /* 恢复字体大小 */
    box-sizing: border-box !important;
    border-bottom: 2px solid rgba(99, 92, 92, 0.3) !important; /* 添加下边框 */
    /* 强制重置可能影响宽度的属性 */
    max-width: none !important;
    flex-basis: auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
}

/* 列表项内部元素清理浮动 */
.wd-product-showcase-container .product-item.list-item:after {
  content: "";
  display: table;
  clear: both;
}

/* 强制宽度设置 - 更高优先级 */
.wd-product-showcase-container
  .product-grid-container.list-style
  .product-item.list-item {
  width: 23% !important;
  min-width: 200px !important;
  height: 70px !important;
  display: inline-block !important;
  box-sizing: border-box !important;
  margin-right: 20px !important;
  margin-bottom: 5px !important;
  padding: 0px !important;
  vertical-align: top !important;
  border-radius: 0 !important;
  border-bottom: 2px solid rgba(99, 92, 92, 0.3) !important;
}

.wd-product-showcase-container .product-item.list-item:hover {
  background-color: transparent;
  transform: none;
}

.wd-product-showcase-container .product-item.list-item:hover .product-name {
  color: rgba(0, 212, 255, 0.9);
}

/* 列表样式中的图片容器 - 优化版本 */
.wd-product-showcase-container .list-item .product-image-container {
  float: left !important;
  width: 60px !important; /* 调整图片尺寸适应新高度 */
  height: 60px !important;
  margin: 5px 10px 5px 5px !important; /* 调整边距适应0内边距 */
  border-radius: 4px !important;
  overflow: hidden !important;
  background: rgba(255, 255, 255, 0.1) !important;
  text-align: center !important;
  line-height: 60px !important;
  display: block !important; /* 确保显示 */
}

/* 列表样式中的文字容器 - 优化版本 */
.wd-product-showcase-container .list-item .product-text-container {
  overflow: hidden !important; /* 创建BFC，避免被浮动影响 */
  padding-top: 25px !important; /* 调整垂直居中，适应70px高度 */
  padding-left: 5px !important; /* 添加左内边距 */
  height: 60px !important; /* 与图片高度一致 */
  display: block !important;
}

/* 列表样式中的产品名称 - 优化版本 */
.wd-product-showcase-container .list-item .product-name {
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important; /* 自然行高 */
  text-overflow: ellipsis !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  max-width: 100% !important;
}

/* 2K和4K分辨率优化 - 列表样式 */
/* 2K分辨率 (2560x1440) */
@media (min-width: 2560px) and (max-width: 3839px) {
    .wd-product-showcase-container .product-item.list-item {
        width: 23% !important; /* 保持您设置的23%宽度 */
        height: 80px !important; /* 2K下稍微增加高度 */
        margin-right: 20px !important; /* 保持您设置的边距 */
        margin-bottom: 5px !important; /* 保持下边距 */
        padding: 2px !important; /* 2K下稍微增加内边距 */
    }

  .wd-product-showcase-container .list-item .product-name {
    font-size: 16px !important; /* 2K下增大字体 */
    line-height: 1.3 !important;
  }

  .wd-product-showcase-container .list-item .product-image-container {
    width: 70px !important; /* 2K下增大图片尺寸 */
    height: 70px !important;
    line-height: 70px !important;
    margin: 5px 12px 5px 5px !important; /* 调整边距适应2K */
  }

  .wd-product-showcase-container .list-item .product-text-container {
    padding-top: 28px !important; /* 调整垂直对齐适应80px高度 */
    padding-left: 5px !important; /* 添加左内边距 */
    height: 70px !important;
  }
}

/* 4K分辨率 (3840x2160及以上) */
@media (min-width: 3840px) {
    .wd-product-showcase-container .product-item.list-item {
        width: 23% !important; /* 保持您设置的23%宽度 */
        height: 90px !important; /* 4K下适度增加高度 */
        margin-right: 25px !important; /* 4K下增加边距 */
        margin-bottom: 8px !important; /* 4K下增加下边距 */
        padding: 4px !important; /* 4K下适度增加内边距 */
    }

  .wd-product-showcase-container .list-item .product-name {
    font-size: 18px !important; /* 4K下进一步增大字体 */
    line-height: 1.4 !important;
  }

  .wd-product-showcase-container .list-item .product-image-container {
    width: 85px !important; /* 4K下进一步增大图片尺寸 */
    height: 85px !important;
    line-height: 85px !important;
    margin: 5px 15px 5px 5px !important; /* 调整边距适应4K */
  }

  .wd-product-showcase-container .list-item .product-text-container {
    padding-top: 35px !important; /* 调整垂直对齐适应90px高度 */
    padding-left: 5px !important; /* 添加左内边距 */
    height: 85px !important;
  }
}

/* 产品图片样式 - 填满容器 */
.wd-product-showcase-container .product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 品牌列表横向滚动 */
.wd-product-showcase-container .brand-scroll-container::-webkit-scrollbar {
  display: none;
}

.wd-product-showcase-container .brand-scroll-container {
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

/* 新的横向产品项样式在上面已定义 */

/* 购物车内容样式 */
.wd-product-showcase-container .cart-content .product-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  color: inherit;
  line-height: 1.3;
}

.wd-product-showcase-container .cart-content .product-description {
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.7);
}

.wd-product-showcase-container .cart-content .product-price {
  margin-bottom: 25px;
}

.wd-product-showcase-container .cart-content .original-price {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: line-through;
  margin-bottom: 8px;
}

.wd-product-showcase-container .cart-content .current-price {
  font-size: 24px;
  font-weight: bold;
}

.wd-product-showcase-container .cart-controls {
  display: flex;
  flex-direction: column;
}

.wd-product-showcase-container .bottom-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.wd-product-showcase-container .quantity-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.wd-product-showcase-container .qty-minus,
.wd-product-showcase-container .qty-plus {
  width: 35px;
  height: 35px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.wd-product-showcase-container .qty-minus:hover,
.wd-product-showcase-container .qty-plus:hover {
  background: rgba(255, 255, 255, 0.1);
}

.wd-product-showcase-container .qty-input {
  width: 50px;
  height: 35px;
  text-align: center;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: bold;
  outline: none;
  transition: all 0.3s ease;
}

.wd-product-showcase-container .qty-input:focus {
  background: rgba(255, 255, 255, 0.05);
}

.wd-product-showcase-container .add-to-cart-btn {
  flex: 1;
  height: 35px;
  background: #ffffff;
  color: #000;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.wd-product-showcase-container .add-to-cart-btn:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
}

.wd-product-showcase-container .add-to-cart-btn:disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

/* 视角切换器样式 */
.wd-product-showcase-container .view-switcher-card {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.wd-product-showcase-container .view-switcher-icon {
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wd-product-showcase-container .view-switcher-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.wd-product-showcase-container .view-number-btn {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid transparent;
  box-sizing: border-box;
}

.wd-product-showcase-container .view-number-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.wd-product-showcase-container .view-number-btn.active {
  background: rgba(255, 255, 255, 1) !important;
  color: #000000 !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 2K和4K显示优化 */
@media (min-width: 2560px) {
  .wd-product-showcase-container .product-grid-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
  }

  .wd-product-showcase-container .brand-item {
    width: 100px;
    height: 100px;
  }

  .wd-product-showcase-container .brand-item img {
    width: 70px;
    height: 70px;
  }

  .wd-product-showcase-container .brand-name {
    font-size: 14px;
    max-width: 96px;
  }
}

@media (min-width: 3840px) {
  .wd-product-showcase-container .product-grid-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 32px;
  }

  .wd-product-showcase-container .brand-item {
    width: 120px;
    height: 120px;
  }

  .wd-product-showcase-container .brand-item img {
    width: 90px;
    height: 90px;
  }

  .wd-product-showcase-container .brand-name {
    font-size: 16px;
    max-width: 116px;
  }

  .wd-product-showcase-container .product-name {
    font-size: 18px;
  }

  .wd-product-showcase-container .product-price {
    font-size: 20px;
  }
}

/* 无障碍和减少动画 */
@media (prefers-reduced-motion: reduce) {
  .wd-product-showcase-container *,
  .wd-product-showcase-container *::before,
  .wd-product-showcase-container *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .wd-product-showcase-container .product-item {
    border-color: rgba(255, 255, 255, 0.8);
  }

  .wd-product-showcase-container .product-item:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.3);
  }

  .wd-product-showcase-container .cart-card {
    border-color: rgba(255, 255, 255, 0.8);
  }
}

/* 动画定义 */
@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes bounce {
  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  40%,
  43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

.wd-product-showcase-container .add-to-cart-btn.success {
  animation: bounce 1s ease;
}

/* 错误状态 */
.wd-product-showcase-container .error-message {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  margin: 20px;
}

/* 加载状态 */
.wd-product-showcase-container .loading-spinner {
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top: 2px solid #00d4ff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 隐藏车型与场景列表面板右侧滚动条 */
.wd-product-showcase-container .car-list-panel,
.wd-product-showcase-container .scene-list-panel {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.wd-product-showcase-container .car-list-panel::-webkit-scrollbar,
.wd-product-showcase-container .scene-list-panel::-webkit-scrollbar {
  display: none;
}

/* 隐藏品牌列表滚动条 */
.wd-product-showcase-container .brand-list-panel {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.wd-product-showcase-container .brand-list-panel::-webkit-scrollbar {
  display: none;
}

/* 品牌个性化区域按钮排列调整为4*1横向布局 */
.wd-product-showcase-container .brand-customization-area .selection-grid {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
}
/* 确保文字块宽度自适应 */
.wd-product-showcase-container .brand-customization-area .current-car-name,
.wd-product-showcase-container .brand-customization-area .current-scene-name {
  flex: 1 1 auto !important;
}

/* 弹窗品牌字母索引 */
.modal-content .modal-alphabet-index{
  position:absolute;
  top:20px;
  left: 300px;
  bottom:20px;
  width:24px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
}
.modal-alphabet-item{
  width:20px;
  height:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:600;
  color:rgba(255,255,255,0.6);
  cursor:pointer;
  border-radius:50%;
  transition:all 0.3s ease;
}
.modal-alphabet-item:hover,
.modal-alphabet-item.active{
  color:#00d4ff;
  background:rgba(0,212,255,0.2);
  transform:scale(1.2);
}

.wd-product-showcase-container .list-item.long-image .product-image-container {
  width: 150px !important;
  height: 60px !important;
  line-height: 60px !important;
}

.wd-product-showcase-container .product-item.list-item.long-image {
  height: 80px !important;
}

/* 品牌LOGO区 */
.wd-brand-icon {
  height: 100px;
  overflow: hidden;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}
