/* ================================================================
   product-detail.css — 产品详情页专属样式
   ================================================================ */

/* ----- 页面整体背景白色 ----- */
.product-detail-page {
  background: #ffffff;
}

/* ----- 面包屑导航 (背景 #FBE6E3) ----- */
.product-breadcrumb {
  background: #FBE6E3;
  padding: 14px 2rem;
  width: 100%;
}
.product-breadcrumb .breadcrumb-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 0;
  font-size: 0.9rem;
  color: #666;
}
.product-breadcrumb .breadcrumb-inner a {
  color: #e00505;
  text-decoration: none;
  transition: color 0.2s;
}
.product-breadcrumb .breadcrumb-inner a:hover {
  color: #b00404;
  text-decoration: underline;
}
.product-breadcrumb .breadcrumb-inner .separator {
  color: #ccc;
  margin: 0 6px;
  font-weight: 300;
}
.product-breadcrumb .breadcrumb-inner .current {
  color: #666;
}

/* ============================================================
   产品主体区域：左侧分类 + 右侧详情
   ============================================================ */
.product-detail-main {
	width:100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 2rem 60px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
  background: #ffffff;
}

/* ----- 左侧分类菜单 ----- */
.product-detail-sidebar {
  flex: 0 0 240px;
  background: #ffffff;
  border: 1px solid #e8ecf0;
  padding: 6px 0;
}

.sidebar-category {
  border-bottom: 1px solid #f0f2f5;
}
.sidebar-category:last-child {
  border-bottom: none;
}

.sidebar-category .cat-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.sidebar-category .cat-title:hover {
  color: #e00505;
}
.sidebar-category .cat-title .arrow {
  color: #ccc;
  font-size: 0.7rem;
  transition: transform 0.3s;
}
.sidebar-category .cat-title .arrow.open {
  transform: rotate(90deg);
}

.sidebar-category .sub-menu {
  list-style: none;
  padding: 0 0 8px 0;
  margin: 0;
  display: none;
}
.sidebar-category .sub-menu.open {
  display: block;
}

.sidebar-category .sub-menu li {
  padding: 6px 18px 6px 32px;
  font-size: 0.88rem;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.sidebar-category .sub-menu li::before {
  content: '›';
  position: absolute;
  left: 18px;
  color: #ccc;
  font-size: 1rem;
}
.sidebar-category .sub-menu li:hover {
  color: #e00505;
}
.sidebar-category .sub-menu li.active {
  color: #e00505;
  font-weight: 500;
}
.sidebar-category .sub-menu li.active::before {
  color: #e00505;
}

.sidebar-category.active-cat .cat-title {
  color: #e00505;
}
.sidebar-category.active-cat .cat-title .arrow {
  color: #e00505;
}


.sidebar-category .sub-menu li a{
  color: #555;
}
.sidebar-category .sub-menu li a::before {
  content: '›';
  position: absolute;
  left: 18px;
  color: #ccc;
  font-size: 1rem;
}
.sidebar-category .sub-menu li a:hover {
  color: #e00505;
}
.sidebar-category .sub-menu li a.active {
  color: #e00505;
  font-weight: 500;
}
.sidebar-category .sub-menu li a.active::before {
  color: #e00505;
}


/* ----- 右侧详情区域（大边框围住） ----- */
.product-detail-content {
  flex: 1;
  min-width: 0;
  border: 2px solid #e8ecf0;
  background: #ffffff;
  padding: 30px 30px 24px;
  position: relative;
}

/* ===== 顶部：大图 + 小图轮播 + 产品信息 ===== */
.product-detail-top {
  display: flex;
  gap: 32px;
  padding-bottom: 30px;
  border-bottom: 2px solid #f0f2f5;
}

/* --- 左侧：大图（带放大镜） + 小图轮播 --- */
.product-detail-gallery {
  flex: 0 0 420px;
  max-width: 420px;
  width: 100%;
  position: relative;
}

/* 大图容器 */
.product-detail-gallery .main-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid #e8ecf0;
  background: #fafbfc;
  position: relative;
  cursor: none;
}
.product-detail-gallery .main-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 放大镜跟随层 */
.product-detail-gallery .main-image-wrap .magnifier-lens {
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: 100px;
  border: 2px solid #e00505;
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
  display: none;
  z-index: 5;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(224, 5, 5, 0.2);
}
.product-detail-gallery .main-image-wrap .magnifier-lens.show {
  display: block;
}

/* 放大结果 — 独立浮动层（仅桌面显示） */
.product-detail-gallery .magnifier-result {
  position: absolute;
  top: 0;
  left: calc(100% + 20px);
  width: 350px;
  height: 350px;
  border: 2px solid #e8ecf0;
  background: #ffffff;
  overflow: hidden;
  display: none;
  z-index: 50;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}
.product-detail-gallery .magnifier-result.show {
  display: block;
}
.product-detail-gallery .magnifier-result img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 小图轮播 */
.product-detail-gallery .thumb-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  position: relative;
}
.product-detail-gallery .thumb-slider .thumb-track {
  display: flex;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}
.product-detail-gallery .thumb-slider .thumb-track .thumb-item {
  flex: 0 0 80px;
  aspect-ratio: 1 / 1;
  border: 2px solid #e8ecf0;
  background: #fafbfc;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.3s;
}
.product-detail-gallery .thumb-slider .thumb-track .thumb-item:hover,
.product-detail-gallery .thumb-slider .thumb-track .thumb-item.active {
  border-color: #e00505;
}
.product-detail-gallery .thumb-slider .thumb-track .thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-detail-gallery .thumb-slider .thumb-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #ffffff;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
  font-size: 0.7rem;
}
.product-detail-gallery .thumb-slider .thumb-btn:hover {
  border-color: #e00505;
  color: #e00505;
}
.product-detail-gallery .thumb-slider .thumb-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* --- 右侧：产品标题 + 简介 --- */
.product-detail-info {
  flex: 1;
  min-width: 0;
}
.product-detail-info .product-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.4;
  margin-bottom: 12px;
}
.product-detail-info .product-subtitle {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f2f5;
}
.product-detail-info .product-params {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
  margin-bottom: 16px;
}
.product-detail-info .product-params .param-item {
  font-size: 0.88rem;
  color: #555;
  display: flex;
  gap: 6px;
}
.product-detail-info .product-params .param-item .label {
  color: #999;
  min-width: 60px;
}
.product-detail-info .product-params .param-item .value {
  color: #1a1a1a;
}
.product-detail-info .product-price {
  font-size: 1.2rem;
  font-weight: 600;
  color: #e00505;
  margin-top: 8px;
}

/* ===== 底部：产品详情介绍 ===== */
.product-detail-bottom {
  padding-top: 24px;
}

.product-detail-bottom .detail-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8ecf0;
}

.product-detail-bottom .detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.product-detail-bottom .detail-table tr {
  border-bottom: 1px solid #f0f2f5;
}
.product-detail-bottom .detail-table tr:last-child {
  border-bottom: none;
}
.product-detail-bottom .detail-table td {
  padding: 10px 16px;
  color: #444;
}
.product-detail-bottom .detail-table td:first-child {
  font-weight: 500;
  color: #1a1a1a;
  width: 120px;
  background: #f8f9fa;
}
.product-detail-bottom .detail-table td:last-child {
  color: #555;
}


.detail-table {
  width: 100%;color: #555; line-height:1.7;
}

.detail-table table{
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.detail-table table tr {
  border-bottom: 1px solid #f0f2f5;
}
.detail-table table tr:last-child {
  border-bottom: none;
}
.detail-table table td {
  padding: 10px 16px;
  color: #444;
}
.detail-table table td:first-child {
  font-weight: 500;
  color: #1a1a1a;
  width: 120px;
  background: #f8f9fa;
}
.detail-table td:last-child {
  color: #555;
}

/* ============================================================
   响应式
   ============================================================ */

/* 平板 (1024px) */
@media (max-width: 1024px) {
  .product-detail-main {
    flex-direction: column;
    gap: 30px;
    padding: 30px 1.5rem 50px;
  }

  /* 左侧分类：改为横向滚动网格 */
  .product-detail-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    width: 100%;
    max-width: 100%;
    border: none;
    padding: 0;
    gap: 4px;
    flex: 1 1 auto;
  }
  .sidebar-category {
    border: 1px solid #e8ecf0;
    border-radius: 4px;
    margin-bottom: 0;
    width: 100%;
  }

  .product-detail-content {
    padding: 24px 20px 20px;
  }
  .product-detail-top {
    flex-direction: column;
    gap: 24px;
  }

  .product-detail-gallery {
    flex: 1 1 auto;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
  }

  .product-detail-gallery .magnifier-result {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 1 / 1;
    margin-top: 12px;
    display: none;
  }
  .product-detail-gallery .magnifier-result.show {
    display: block;
  }
  .product-detail-gallery .main-image-wrap {
    cursor: default;
  }
  .product-detail-gallery .main-image-wrap .magnifier-lens {
    display: none !important;
  }
}

/* 小屏平板/大手机 (820px) */
@media (max-width: 820px) {
  .product-breadcrumb {
    padding: 12px 1.5rem;
  }
  .product-breadcrumb .breadcrumb-inner {
    font-size: 0.8rem;
  }

  .product-detail-main {
    padding: 24px 1.5rem 40px;
    gap: 24px;
  }

  .product-detail-sidebar {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 4px;
    max-width: 100%;
  }

  .product-detail-content {
    padding: 18px 16px 16px;
  }

  .product-detail-gallery {
    max-width: 380px;
  }
  .product-detail-gallery .magnifier-result {
    max-width: 300px;
  }

  .product-detail-info .product-title {
    font-size: 1.1rem;
  }
  .product-detail-info .product-params {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .product-detail-bottom .detail-table td {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  .product-detail-bottom .detail-table td:first-child {
    width: 80px;
  }
}

/* ============================================================
   手机端 (520px) — 左侧分类完全隐藏
   ============================================================ */
@media (max-width: 520px) {
  /* ===== 左侧分类：完全隐藏 ===== */
  .product-detail-sidebar {
    display: none !important;
  }

  .product-breadcrumb {
    padding: 10px 1rem;
  }
  .product-breadcrumb .breadcrumb-inner {
    font-size: 0.7rem;
    flex-wrap: wrap;
  }
  .product-breadcrumb .breadcrumb-inner .separator {
    margin: 0 4px;
  }

  .product-detail-main {
    padding: 16px 1rem 30px;
    gap: 16px;
    max-width: 100%;
  }

  /* 右侧详情占满宽度 */
  .product-detail-content {
    padding: 12px 10px 12px;
    border-width: 1.5px;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    width: 100%;
  }

  .product-detail-top {
    flex-direction: column;
    gap: 16px;
    padding-bottom: 16px;
    max-width: 100%;
  }

  /* 图库：完全自适应 */
  .product-detail-gallery {
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  .product-detail-gallery .thumb-slider .thumb-track .thumb-item {
    flex: 0 0 56px;
  }
  .product-detail-gallery .thumb-slider .thumb-btn {
    width: 22px;
    height: 22px;
    font-size: 0.55rem;
    flex-shrink: 0;
  }

  /* 手机端完全隐藏放大镜 */
  .product-detail-gallery .magnifier-result {
    display: none !important;
  }
  .product-detail-gallery .main-image-wrap .magnifier-lens {
    display: none !important;
  }
  .product-detail-gallery .main-image-wrap {
    cursor: default;
  }

  .product-detail-info {
    max-width: 100%;
  }
  .product-detail-info .product-title {
    font-size: 0.9rem;
    word-break: break-word;
  }
  .product-detail-info .product-subtitle {
    font-size: 0.8rem;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }
  .product-detail-info .product-params {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .product-detail-info .product-params .param-item {
    font-size: 0.75rem;
  }
  .product-detail-info .product-price {
    font-size: 0.95rem;
  }

  .product-detail-bottom {
    max-width: 100%;
  }
  .product-detail-bottom .detail-title {
    font-size: 0.9rem;
  }
  .product-detail-bottom .detail-table {
    font-size: 0.72rem;
    max-width: 100%;
  }
  .product-detail-bottom .detail-table td {
    padding: 5px 8px;
    word-break: break-word;
  }
  .product-detail-bottom .detail-table td:first-child {
    width: 50px;
    padding: 5px 6px;
    font-size: 0.7rem;
  }
}

/* 超小手机 (400px) */
@media (max-width: 400px) {
  .product-detail-sidebar {
    display: none !important;
  }

  .product-detail-content {
    padding: 8px 6px 10px;
  }

  .product-detail-gallery .thumb-slider .thumb-track .thumb-item {
    flex: 0 0 44px;
  }
  .product-detail-gallery .thumb-slider .thumb-btn {
    width: 18px;
    height: 18px;
    font-size: 0.45rem;
  }

  .product-detail-info .product-title {
    font-size: 0.82rem;
  }

  .product-detail-bottom .detail-table td {
    font-size: 0.65rem;
    padding: 4px 6px;
  }
  .product-detail-bottom .detail-table td:first-child {
    width: 36px;
    font-size: 0.62rem;
    padding: 4px 4px;
  }
}