/* product-detail.css - Auto-split from styles.css */

/* 商品详情页面：与 header Logo 左对齐（.wrap 已有 40px 左内边距，此处左侧不再加 padding） */
.product-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 40px 20px 0;
}

/* 商品详情加载状态 */
.detail-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  font-size: 18px;
  color: #666;
}


.detail-header {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid #ebebeb;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  padding: 0;
  flex-shrink: 0;
}

.detail-search-btn:hover {
  background: #f5f5f5;
  border-color: #d5d5d5;
}

.detail-search-btn svg {
  width: 18px;
  height: 18px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  padding: 8px 0;
  transition: opacity 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.back-button:hover {
  opacity: 0.7;
}

.back-icon {
  width: 20px;
  height: 20px;
}

.detail-content {
  display: grid;
  grid-template-columns: 560px 1fr;
  gap: 80px;
  margin-bottom: 40px;
  position: relative;
}

.detail-content::before {
  content: '';
  position: absolute;
  left: 600px;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: #ebebeb;
  z-index: 1;
}

/* 左侧图片区域 */
.detail-left {
  position: sticky;
  top: 20px;
  height: fit-content;
}

.image-gallery {
  background: #f4f4f4;
  border-radius: 10px;
  overflow: hidden;
}

.main-image-container {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f4f4;
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-thumbnails {
  display: flex;
  gap: 8px;
  padding: 16px;
  overflow-x: auto;
}

.thumbnail {
  width: 60px;
  height: 60px;
}

.thumbnail {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.thumbnail:hover,
.thumbnail.active {
  border-color: #222;
}

/* 图片加载状态 */
.image-loader,
.thumbnail-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f4f4;
  border-radius: 8px;
  min-height: 100px;
}

.thumbnail-loader {
  min-height: 60px;
  border-radius: 6px;
}

.image-error {
  color: #999;
  font-size: 12px;
  text-align: center;
}

.thumbnail-container {
  position: relative;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #ebebeb;
  transition: border-color 0.2s;
}

.thumbnail-container:hover,
.thumbnail-container.active {
  border-color: #222;
}

/* 右侧信息区域 */
.detail-right {
  padding-top: 0;
  padding-left: 0;
}

.detail-right .product-info {
  padding: 0;
  margin: 0;
}

.product-title {
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.product-subtitle {
  font-size: 14px;
  color: var(--sub);
  margin: 0 0 8px 0;
  font-weight: 400;
  transition: color 0.2s ease;
}

.product-subtitle:hover {
  color: #3366cc;
  text-decoration: underline;
}

.product-dewu-title {
  margin: 0 0 8px 0;
}

/* 货号、30日得物销量：标签药丸形背景 */
.dewu-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 0;
}
.dewu-meta-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--chip-bg, #f4f4f4);
  color: var(--chip-text, #222);
  font-size: 12px;
  font-weight: 500;
  margin-right: 4px;
}

/* 商品详情页：副标题与分类同一行 */
.subtitle-with-category {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px 0;
}
.product-category-row {
  display: none;
}
.product-category-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--chip-bg, #f4f4f4);
  color: var(--chip-text, #222);
  font-size: 13px;
  font-weight: 500;
}

.rating-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rating-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.star-icon {
  width: 16px;
  height: 16px;
}

.review-count {
  font-size: 13px;
  color: var(--sub);
}

.wish-count {
  font-size: 13px;
  color: var(--sub);
}

.transaction-count {
  font-size: 13px;
  color: var(--sub);
}

.price-section {
  margin-bottom: 16px;
}

.current-price {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.price-label {
  font-size: 14px;
  color: var(--sub);
}

.price-amount {
  font-size: 27px;
  font-weight: 700;
  color: var(--text);
}

.product-details-table {
  margin-bottom: 12px;
  margin-left: 0;
  padding-left: 0;
}

/* 商品详情容器 */
.product-details {
  margin-bottom: 12px;
}

/* 🆕 尺码价格显示区域 */
.size-prices-section {
  margin-top: 30px;
  margin-bottom: 20px;
}

.size-prices-section .section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #333;
}

.size-prices-body {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.size-price-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.size-price-row:last-child {
  border-bottom: none;
}

.size-price-row:hover {
  background-color: #fafafa;
}

.size-price-cell {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.size-price-cell.size-cell {
  font-weight: 600;
  color: #222;
  min-width: 60px;
  flex: 0 0 60px; /* 固定宽度 */
}

.size-price-cell.price-cell {
  justify-content: flex-start;
  flex: 1; /* 价格单元格平均分配剩余空间 */
}

.size-price-cell .price-label {
  font-size: 13px;
  color: #777;
  min-width: 50px;
  white-space: nowrap;
}

.size-price-cell .price-value {
  font-size: 15px;
  font-weight: 600;
  color: #222;
}

.sales-header {
  display: table;
  width: 100%;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.sales-header .sales-cell {
  display: table-cell;
  width: 20%;
  padding: 10px 8px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  text-align: center;
  border-right: 1px solid #e0e0e0;
  vertical-align: middle;
  box-sizing: border-box;
  min-height: 40px;
  line-height: 1.4;
}

.sales-header .sales-cell:last-child {
  border-right: none;
}

.sales-body {
  max-height: 300px;
  overflow-y: auto;
  display: table;
  width: 100%;
}

.sales-row {
  display: table-row;
  border-bottom: 1px solid #f0f0f0;
}

.sales-row:last-child {
  border-bottom: none;
}

.sales-row:hover {
  background: #f8f9fa;
}

.sales-row .sales-cell {
  display: table-cell;
  width: 20%;
  padding: 10px 8px;
  font-size: 14px;
  color: #333;
  text-align: center;
  border-right: 1px solid #f0f0f0;
  vertical-align: middle;
  box-sizing: border-box;
  word-break: break-word;
  overflow: hidden;
  min-height: 48px;
  line-height: 1.4;
}

.sales-row .sales-cell:last-child {
  border-right: none;
}

.sales-row .sales-cell:first-child {
  font-weight: 600;
  color: #222;
  line-height: 1.3;
}

.sales-row .sales-cell:first-child .eu-size {
  color: #666;
  font-size: 11px;
  font-weight: 400;
}

/* 商品详情行样式 */
.detail-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 4px;
}

.detail-row .detail-label {
  min-width: 60px;
  flex-shrink: 0;
}

.detail-row .detail-value {
  flex: 1;
}

.details-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.details-content {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.detail-item {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 0;
  height: auto;
  flex: none;
}

.detail-item:not(:first-child)::before {
  content: '|';
  color: #d3d3d3;
  margin: 0 10px;
  font-size: 12px;
}

.detail-label {
  font-size: 12px;
  color: #999;
  letter-spacing: -0.33px;
  line-height: 1.4;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.detail-value {
  font-size: 12px;
  color: #222;
  margin: 0;
  padding: 0;
  line-height: 1.4;
  max-width: 16ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 🆕 货号点击复制样式（支持手机和电脑） */
.detail-value.copy-article-number {
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
  border-radius: 4px;
  padding: 2px 6px;
  margin: -2px -6px;
}

.detail-value.copy-article-number:hover {
  color: #2196F3;
  background-color: rgba(33, 150, 243, 0.08);
}

.detail-value.copy-article-number:active {
  color: #1976D2;
  background-color: rgba(33, 150, 243, 0.15);
}

/* 货号需要完整显示 */
#modelNumber {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

/* 商品详情展开按钮 */
.details-expand-btn {
  margin-left: 10px;
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  transition: color 0.2s;
  padding: 0 4px;
  flex-shrink: 0;
  z-index: 2;
}

.details-expand-btn:hover {
  color: #222;
}

/* 商品详情模态框 */
.product-details-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.product-details-modal-content {
  background: var(--bg);
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.product-details-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #ebebeb;
}

.product-details-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.product-details-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.product-details-modal-close:hover {
  background: #f4f4f4;
  color: #222;
}

.product-details-modal-body {
  padding: 24px;
}

.modal-detail-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f4f4f4;
}

.modal-detail-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.modal-detail-label {
  font-size: 12px;
  color: #999;
  font-weight: 500;
}

.modal-detail-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  word-wrap: break-word;
}

/* 发售价单行显示 */
#releasePrice {
  line-height: 1.4;
  white-space: nowrap;
}

/* 最近成交价字体大小 */
#recentPrice {
  font-size: 14px;
}

/* 价格历史区域 */
.price-history-section {
  margin-top: 15px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 20px 0;
}

.price-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #ebebeb;
}

.tab-button {
  padding: 12px 20px;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-button.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.tab-button:hover {
  color: var(--text);
}

.price-table-container {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #ebebeb;
}

/* 手机版在 responsive-mobile.css 中改为 overflow: auto 并限制高度以显示滚动条 */

.price-table {
  width: 100%;
  border-collapse: collapse;
}

.price-table th {
  background: #f8f8f8;
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  border-bottom: 1px solid #ebebeb;
}

.price-table th.align-right {
  text-align: right;
}

.price-table td {
  padding: 16px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid #f0f0f0;
}

/* 尺码信息区域样式 */
.size-info-section {
  margin-top: 24px;
  border-top: 1px solid #ebebeb;
  padding-top: 20px;
}

.size-info-title {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  margin-bottom: 12px;
}

/* 尺码信息表格样式 */
.size-table-container {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #ebebeb;
  margin-top: 0;
}

.size-table-wrapper {
  overflow-x: auto;
  position: relative;
}

.size-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.size-table th {
  background: #f8f8f8;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  border-bottom: 1px solid #ebebeb;
  border-right: 1px solid #f0f0f0;
  white-space: nowrap;
  min-width: 40px;
  vertical-align: middle;
}

.size-table th.pin {
  background: #f5f5f5;
  font-weight: 700;
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 60px;
  color: #333;
}

.size-table th.column_header {
  background: #f8f8f8;
  font-size: 12px;
  padding: 8px 4px;
}

.size-table td {
  padding: 8px 4px;
  font-size: 12px;
  color: var(--text);
  border-bottom: 1px solid #f5f5f5;
  border-right: 1px solid #f5f5f5;
  text-align: center;
  white-space: nowrap;
  min-width: 40px;
  vertical-align: middle;
}

.size-table th.row_header {
  background: #f0f0f0;
  font-weight: 600;
  font-size: 13px;
  padding: 12px 8px;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 60px;
  vertical-align: middle;
}

.size-table th.row_header,
.size-table td {
  border-right: 1px solid #f0f0f0;
}

.size-table th.row_header:last-child,
.size-table td:last-child {
  border-right: none;
}

.size-table tbody tr:hover {
  background-color: #f8f9fa;
}

/* EU行高亮显示 */
.size-table tbody tr.highlight-eu {
  background-color: #f5f5f5;
  font-weight: 600;
}

.size-table tbody tr.highlight-eu:hover {
  background-color: #eeeeee;
}


.price-table td.align-right {
  text-align: right;
}

.price-table tbody tr:last-child td {
  border-bottom: none;
}

/* ==================== 我的库存信息卡片 ==================== */
.my-stock-section {
  margin: 16px 0 0;
  border: 1px solid #e2e6ec;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.my-stock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f0f2f8 0%, #e6eaf2 100%);
  border-bottom: 1px solid #e2e6ec;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.my-stock-header:hover {
  background: linear-gradient(135deg, #e8ebf4 0%, #dde2ee 100%);
}

.my-stock-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.my-stock-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #5b6abf;
  color: #fff;
  border-radius: 6px;
}

.my-stock-title {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.my-stock-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #5b6abf;
  color: #fff;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.my-stock-badge.transit {
  background: #f57c00;
}

.my-stock-badge.sold {
  background: #43a047;
}

.my-stock-chevron {
  font-size: 11px;
  color: #aaa;
  transition: transform 0.25s;
}

.my-stock-section.collapsed .my-stock-chevron {
  transform: rotate(-90deg);
}

.my-stock-section.collapsed .my-stock-body {
  display: none;
}

.my-stock-body {
  padding: 10px 12px 12px;
}

.my-stock-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.my-stock-stat {
  flex: 1;
  min-width: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7px 6px;
  background: #f5f7fb;
  border-radius: 8px;
  border: 1px solid #eaecf2;
}

.my-stock-stat.transit {
  background: #fff8e1;
  border-color: #ffe0b2;
}

.my-stock-stat-label {
  font-size: 10px;
  color: #999;
  margin-bottom: 2px;
  font-weight: 500;
}

.my-stock-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: #333;
}

.my-stock-stat-value.positive {
  color: #e53935;
}

.my-stock-stat-value.negative {
  color: #1976d2;
}

.my-stock-divider {
  height: 1px;
  background: #eef0f4;
  margin: 10px 0;
}

.my-stock-detail-title {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.my-stock-detail-title .count {
  color: #aaa;
  font-weight: 400;
  font-size: 10px;
}

/* 库存表格 */
.my-stock-table {
  border: 1px solid #eaecf2;
  border-radius: 8px;
  overflow: hidden;
}

.my-stock-table-head {
  display: flex;
  background: #f5f7fb;
  border-bottom: 1px solid #eaecf2;
  padding: 5px 0;
  font-size: 10px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.my-stock-table-head.sold {
  background: #f0faf0;
  border-color: #d6ecd6;
}

.my-stock-table-row {
  display: flex;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}

.my-stock-table-row:last-child {
  border-bottom: none;
}

.my-stock-table-row:hover {
  background: #fafbfe;
}

.my-stock-table-head span,
.my-stock-table-row span {
  text-align: center;
}

.col-size {
  flex: 0 0 20%;
  font-weight: 600;
  color: #333;
}

.col-qty {
  flex: 0 0 15%;
  color: #666;
}

.col-cost {
  flex: 0 0 22%;
  color: #666;
}

.col-sell {
  flex: 0 0 22%;
  color: #444;
}

.col-profit {
  flex: 0 0 21%;
  font-weight: 700;
}

.col-profit.positive {
  color: #e53935;
}

.col-profit.negative {
  color: #1976d2;
}

.col-sell .waiting {
  color: #ccc;
  font-size: 10px;
  font-style: italic;
}

@media (max-width: 768px) {
  .my-stock-section {
    margin: 12px 0 0;
  }
  .my-stock-summary {
    gap: 4px;
  }
  .my-stock-stat {
    min-width: 60px;
    padding: 5px 4px;
  }
  .my-stock-stat-value {
    font-size: 13px;
  }
  .col-size { flex: 0 0 18%; }
  .col-qty { flex: 0 0 14%; }
  .col-cost { flex: 0 0 22%; }
  .col-sell { flex: 0 0 22%; }
  .col-profit { flex: 0 0 24%; }
}
