/* ================================================
   紫来集运 PC端 - 代购商城页样式
   ================================================ */

/* ---- 分类侧边栏 ---- */
.shopping-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.shopping-sidebar {
  background: var(--bg-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: fit-content;
}

.shopping-sidebar-title {
  padding: 10px var(--space-md);
  background: var(--p-lighter);
  font-size: 1rem;
  font-weight: 700;
  color: var(--p);
  display: flex;
  align-items: center;
  border-bottom:1px solid #ddd;
  gap: 8px;
}

.shopping-sidebar-title i {
  font-size: 0.875rem;
}

.shopping-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--space-md);
  font-size: 0.85rem;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s; 
}

.shopping-sidebar-item:last-child {
  border-bottom: none;
}

.shopping-sidebar-item:hover {
  background: var(--p-lighter);
  color: var(--p);
}

.shopping-sidebar-item.active {
  background: var(--p-lighter);
  color: var(--p);
  font-weight: 600;
}

.shopping-sidebar-item .count {
  font-size: 0.75rem;
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text3);
}

/* ---- 商品网格 ---- */
.shopping-main {
  min-width: 0;
}

.shopping-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-md);
}

.shopping-toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.shopping-toolbar-left span {
  font-size: 0.9375rem;
  color: var(--text2);
  white-space: nowrap;
}

.shopping-sort {
  padding: 6px 12px;
  font-size: 0.875rem;
  border: 1.5px solid var(--p-border);
  border-radius: var(--r-sm);
  cursor: pointer;
  background: var(--bg-white);
  color: var(--text2);
  min-width: 130px;
}

.shopping-sort:focus {
  border-color: var(--p);
  outline: none;
}

.shopping-view-toggle {
  display: flex;
  gap: 4px;
}

.shopping-view-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text3);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
}

.shopping-view-btn:hover,
.shopping-view-btn.active {
  background: var(--p-lighter);
  color: var(--p);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

/* 商品卡片 */
.product-card {
  background: var(--bg-white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-card-img {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-gray);
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.product-card:hover .product-card-img img {
  transform: scale(1.05);
}

.product-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: white;
}

.product-card-badge.pink {
  background: linear-gradient(135deg, #EC4899, #F472B6);
}

.product-card-badge.orange {
  background: linear-gradient(135deg, #F59E0B, #FBBF24);
}

.product-card-badge.purple {
  background: linear-gradient(135deg, #7B3FF2, #A855F7);
}

.product-card-actions {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s;
}

.product-card:hover .product-card-actions {
  opacity: 1;
  transform: translateY(0);
}

.product-card-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-white);
  color: var(--p);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.product-card-action-btn:hover {
  background: var(--p);
  color: white;
}

.product-card-body {
  padding: var(--space-sm);
}

.product-card-brand {
  font-size: 0.75rem;
  color: var(--text3);
  margin-bottom: 4px;
}

.product-card-title {
  font-size: 0.8rem;
  color: var(--text1);
  font-weight: 500;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.product-card-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
}

.product-card-price .yen {
  font-size: 0.875rem;
  color: var(--p);
  font-weight: 600;
}

.product-card-price .amount {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--p);
}

.product-card-price .original {
  font-size: 0.8125rem;
  color: var(--text3);
  text-decoration: line-through;
}

.product-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text3);
}

.product-card-meta .rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.product-card-meta .rating i {
  color: #FBBF24;
}

/* ---- 侧边悬浮购物车 ---- */
.shopping-cart-float {
  position: fixed;
  right: 24px;
  bottom: 100px;
  z-index: 100;
}

.shopping-cart-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-p);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 20px rgba(123, 63, 242, 0.4);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.shopping-cart-btn:hover {
  transform: scale(1.08);
}

.shopping-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  background: var(--danger);
  color: white;
  border-radius: 11px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

/* ---- 响应式 ---- */
@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .shopping-layout {
    grid-template-columns: 1fr;
  }
  
  .shopping-sidebar {
    display: none;
  }
  
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
}
/* ===== 交互增强 ===== */

/* 侧边栏可点击 */
.shopping-sidebar-item {
  cursor: pointer;
}

/* 收藏成功（红心） */
.product-card-action-btn.favorited i.fa-heart {
  color: #EF4444;
}

/* 列表视图 */
.products-grid.list-view {
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.product-card.list-view {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: var(--space-sm);
}

.product-card.list-view .product-card-img {
  width: 160px;
  min-height: 120px;
  flex-shrink: 0;
  margin-bottom: 0;
  margin-right: var(--space-md);
}

.product-card.list-view .product-card-body {
  flex: 1;
}

/* Toast 提示 */
.shopping-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text1);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--r-lg);
  font-size: 0.9375rem;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
}

.shopping-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 分页按钮可点击 */
.shopping-pagination .btn {
  cursor: pointer;
}

/* 加购按钮反馈动画 */
.product-card-action-btn.cart-added {
  color: var(--p) !important;
  transform: scale(1.3);
  transition: all 0.2s ease;
}

/* 悬浮购物车按钮鼠标手势 */
.shopping-cart-btn {
  cursor: pointer;
}
