/* ===================================================
   冀九洲官网 - 商品商城页面样式
   复用官网主题变量，风格统一
   =================================================== */

/* ---------- 商城页面布局 ---------- */
.shop-page {
  min-height: 100vh;
  background: var(--bg-light);
}

/* 商城导航链接高亮 */
.nav-shop-link {
  position: relative;
  font-weight: 600 !important;
}
.header.scrolled .nav-shop-link.active {
  color: var(--primary) !important;
}

/* ---------- 商城顶部横幅 ---------- */
.shop-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 60px 0 40px;
  position: relative;
  overflow: hidden;
}
.shop-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.shop-banner::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: 5%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.shop-banner-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
}
.shop-banner-content h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 2px;
}
.shop-banner-content p {
  font-size: 16px;
  opacity: 0.85;
  margin-bottom: 0;
}

/* ---------- 搜索栏 ---------- */
.shop-search-bar {
  background: #fff;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 72px;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.shop-search-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
}
.shop-search-input {
  flex: 1;
  height: 44px;
  border: 2px solid var(--primary-bg-dark);
  border-radius: 22px;
  padding: 0 20px;
  font-size: 15px;
  outline: none;
  transition: var(--transition);
  color: var(--text);
  font-family: var(--font-cn);
}
.shop-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}
.shop-search-input::placeholder {
  color: var(--text-muted);
}
.shop-search-btn {
  height: 44px;
  padding: 0 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 22px;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-cn);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.shop-search-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ---------- 主体内容区 ---------- */
.shop-body {
  display: flex;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 400px);
}

/* ---------- 分类侧栏 ---------- */
.shop-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 137px;
  height: calc(100vh - 137px);
  overflow-y: auto;
}
.shop-sidebar-title {
  padding: 0 20px 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.shop-sidebar-title i {
  color: var(--primary);
}
.shop-cat-item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-light);
  font-size: 14px;
  gap: 8px;
  position: relative;
}
.shop-cat-item:hover {
  background: var(--primary-bg);
  color: var(--primary-dark);
}
.shop-cat-item.active {
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-weight: 600;
}
.shop-cat-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
.shop-cat-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: var(--primary-light);
}
.shop-cat-item .cat-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-light);
  padding: 1px 8px;
  border-radius: 10px;
}
.shop-cat-sub {
  padding-left: 24px;
}
.shop-cat-sub .shop-cat-item {
  padding: 8px 20px 8px 28px;
  font-size: 13px;
}

/* ---------- 商品列表区 ---------- */
.shop-main {
  flex: 1;
  padding: 24px;
  min-width: 0;
}

/* 面包屑 & 筛选条 */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.shop-breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
}
.shop-breadcrumb a {
  color: var(--primary);
}
.shop-breadcrumb span {
  color: var(--text);
  font-weight: 500;
}
.shop-result-info {
  font-size: 13px;
  color: var(--text-muted);
}
.shop-sort-bar {
  display: flex;
  gap: 8px;
}
.shop-sort-btn {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: var(--text-light);
  transition: var(--transition);
  font-family: var(--font-cn);
}
.shop-sort-btn:hover,
.shop-sort-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

/* 商品网格 */
.shop-goods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

/* 商品卡片 */
.shop-goods-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
}
.shop-goods-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-bg-dark);
}
.shop-goods-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-light);
  display: block;
}
.shop-goods-card-info {
  padding: 14px 16px 16px;
}
.shop-goods-card-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  height: 42px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 8px;
}
.shop-goods-card-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.shop-goods-card-price {
  font-size: 20px;
  font-weight: 700;
  color: #e74c3c;
}
.shop-goods-card-price .price-symbol {
  font-size: 13px;
  font-weight: 600;
}
.shop-goods-card-price .price-original {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 400;
  margin-left: 6px;
}
.shop-goods-card-sales {
  font-size: 12px;
  color: var(--text-muted);
}
.shop-goods-card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 1;
}

/* ---------- 加载更多 ---------- */
.shop-load-more {
  text-align: center;
  padding: 32px 0;
}
.shop-load-more-btn {
  padding: 10px 40px;
  border: 2px solid var(--primary);
  border-radius: 24px;
  font-size: 14px;
  color: var(--primary);
  background: #fff;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-cn);
}
.shop-load-more-btn:hover {
  background: var(--primary);
  color: #fff;
}
.shop-load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- 空状态 ---------- */
.shop-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.shop-empty i {
  font-size: 48px;
  color: var(--border);
  margin-bottom: 16px;
  display: block;
}
.shop-empty p {
  font-size: 15px;
}

/* ---------- 加载状态 ---------- */
.shop-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.shop-loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: shop-spin 0.8s linear infinite;
}
@keyframes shop-spin {
  to { transform: rotate(360deg); }
}

/* ---------- 商品详情遮罩层 ---------- */
.shop-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.shop-detail-overlay.visible {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  overflow-y: auto;
}
.shop-detail-overlay.show {
  opacity: 1;
}

/* ---------- 商品详情面板 ---------- */
.shop-detail-panel {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.shop-detail-overlay.show .shop-detail-panel {
  transform: translateY(0);
}
.shop-detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-light);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-light);
  z-index: 2;
  transition: var(--transition);
}
.shop-detail-close:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

/* 详情顶部：图片+基本信息 */
.shop-detail-top {
  display: flex;
  gap: 28px;
  padding: 28px;
}
.shop-detail-gallery {
  width: 380px;
  flex-shrink: 0;
}
.shop-detail-main-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg-light);
}
.shop-detail-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
}
.shop-detail-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.shop-detail-thumb:hover,
.shop-detail-thumb.active {
  border-color: var(--primary);
}
.shop-detail-info {
  flex: 1;
  min-width: 0;
}
.shop-detail-name {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 12px;
}
.shop-detail-brief {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 16px;
}
.shop-detail-price-box {
  background: linear-gradient(135deg, #fef5f5 0%, #fff5f0 100%);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.shop-detail-price {
  font-size: 32px;
  font-weight: 700;
  color: #e74c3c;
}
.shop-detail-price .price-symbol {
  font-size: 18px;
}
.shop-detail-price .price-original {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 400;
  margin-left: 10px;
}
.shop-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.shop-detail-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.shop-detail-meta i {
  color: var(--primary);
}

/* 规格选择 */
.shop-detail-specs {
  margin-bottom: 20px;
}
.shop-detail-spec-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.shop-detail-spec-label {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 60px;
  padding-top: 6px;
}
.shop-detail-spec-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shop-detail-spec-opt {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text);
  background: #fff;
}
.shop-detail-spec-opt:hover {
  border-color: var(--primary);
}
.shop-detail-spec-opt.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary-dark);
}

/* 购买按钮 */
.shop-detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.shop-detail-buy-btn {
  flex: 1;
  height: 48px;
  border: none;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-cn);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.shop-detail-buy-btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
}
.shop-detail-buy-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.3);
}
.shop-detail-buy-btn.cart {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border: 1px solid var(--primary-bg-dark);
}
.shop-detail-buy-btn.cart:hover {
  background: var(--primary-bg-dark);
}

/* 详情底部Tab切换 */
.shop-detail-tabs {
  border-top: 1px solid var(--border);
}
.shop-detail-tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.shop-detail-tab-btn {
  padding: 14px 28px;
  font-size: 14px;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  background: none;
  font-family: var(--font-cn);
}
.shop-detail-tab-btn:hover {
  color: var(--primary);
}
.shop-detail-tab-btn.active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}
.shop-detail-tab-content {
  padding: 24px 28px;
}
.shop-detail-tab-pane {
  display: none;
}
.shop-detail-tab-pane.active {
  display: block;
}

/* 商品参数表 */
.shop-detail-params table {
  width: 100%;
  border-collapse: collapse;
}
.shop-detail-params td {
  padding: 10px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.shop-detail-params td:first-child {
  color: var(--text-muted);
  width: 140px;
  background: var(--bg-light);
}

/* 商品评价 */
.shop-comment-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.shop-comment-item:last-child {
  border-bottom: none;
}
.shop-comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.shop-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}
.shop-comment-user {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.shop-comment-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}
.shop-comment-stars {
  color: #f5a623;
  font-size: 12px;
  margin-bottom: 6px;
}
.shop-comment-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}
.shop-comment-images {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.shop-comment-images img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}

/* 商品描述富文本 */
.shop-detail-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}
.shop-detail-desc img {
  max-width: 100%;
  border-radius: 8px;
  margin: 10px 0;
}

/* ---------- 二维码弹窗 ---------- */
.shop-qr-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.shop-qr-modal.visible {
  display: flex;
  opacity: 1;
}
.shop-qr-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}
.shop-qr-modal.visible .shop-qr-card {
  transform: scale(1);
}
.shop-qr-icon {
  width: 56px;
  height: 56px;
  background: var(--primary-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.shop-qr-icon i {
  font-size: 24px;
  color: var(--primary);
}
.shop-qr-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.shop-qr-desc {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.5;
}
.shop-qr-img {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
}
.shop-qr-tip {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 20px;
}
.shop-qr-close {
  padding: 10px 40px;
  border: 1px solid var(--border);
  border-radius: 22px;
  font-size: 14px;
  color: var(--text-light);
  background: #fff;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-cn);
}
.shop-qr-close:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---------- 推荐商品 ---------- */
.shop-recommend {
  padding: 48px 0;
  background: #fff;
}
.shop-recommend-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 32px;
}
.shop-recommend-title i {
  color: var(--primary);
  margin-right: 8px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .shop-sidebar {
    width: 200px;
  }
  .shop-detail-top {
    flex-direction: column;
  }
  .shop-detail-gallery {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .shop-banner-content h1 {
    font-size: 24px;
  }
  .shop-body {
    flex-direction: column;
  }
  .shop-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    overflow-x: auto;
    padding: 8px 12px;
    gap: 0;
  }
  .shop-sidebar-title {
    display: none;
  }
  .shop-cat-item {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 13px;
  }
  .shop-cat-item.active::before {
    display: none;
  }
  .shop-cat-item .cat-count {
    display: none;
  }
  .shop-cat-sub {
    display: none;
  }
  .shop-main {
    padding: 16px;
  }
  .shop-goods-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .shop-goods-card-price {
    font-size: 17px;
  }
  .shop-detail-top {
    padding: 16px;
    gap: 16px;
  }
  .shop-detail-name {
    font-size: 18px;
  }
  .shop-detail-price {
    font-size: 26px;
  }
  .shop-detail-tab-btn {
    padding: 10px 16px;
    font-size: 13px;
  }
  .shop-detail-tab-content {
    padding: 16px;
  }
  .shop-qr-card {
    padding: 28px 20px;
  }
}
