/* 销售页面样式 */
.sales-container {
  display: flex;
  gap: 1rem;
  height: calc(100vh - 120px);
}

.sales-left-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.sales-right-panel {
  width: 350px;
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 商品分类导航 */
.category-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.category-item {
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.category-item:hover,
.category-item.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* 商品网格 */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.product-item {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.product-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.product-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 0.5rem;
}

.product-item .name {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  word-break: break-word;
}

.product-item .price {
  color: var(--success-color);
  font-weight: bold;
  font-size: 0.9rem;
}

/* 销售清单 */
.sale-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #dee2e6;
}

.sale-items-title {
  font-size: 1.2rem;
  font-weight: 600;
}

.clear-sale-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.sale-items-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
  max-height: 300px;
}

.sale-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.sale-item:last-child {
  border-bottom: none;
}

.sale-item-info {
  flex: 1;
}

.sale-item-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.sale-item-price {
  color: var(--secondary-color);
  font-size: 0.85rem;
}

.sale-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.quantity-btn {
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dee2e6;
  background: white;
  border-radius: 4px;
  cursor: pointer;
}

.quantity-btn:hover {
  background: #f8f9fa;
}

.sale-item-quantity {
  width: 40px;
  text-align: center;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 0.25rem;
}

/* 销售总计 */
.sale-summary {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 2px solid #dee2e6;
}

.sale-summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.sale-summary-total {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--dark-color);
  border-top: 1px solid #dee2e6;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

/* 折扣设置 */
.discount-section {
  margin: 1rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.discount-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.discount-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
}

.discount-btn {
  padding: 0.5rem 1rem;
  background: var(--warning-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.discount-btn:hover {
  background: #e0a800;
}

/* 支付方式 */
.payment-section {
  margin: 1rem 0;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.payment-method {
  padding: 1rem;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.payment-method:hover,
.payment-method.selected {
  border-color: var(--primary-color);
  background-color: rgba(13, 110, 253, 0.05);
}

.payment-method i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* 结算按钮 */
.checkout-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--success-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 1rem;
}

.checkout-btn:hover {
  background: #157347;
}

.checkout-btn:disabled {
  background: var(--secondary-color);
  cursor: not-allowed;
}

/* 响应式设计 - 销售页面 */
@media (max-width: 575.98px) {
  .sales-container {
    flex-direction: column;
    height: auto;
    gap: 0.5rem;
  }
  
  .sales-left-panel,
  .sales-right-panel {
    width: 100%;
    min-width: auto;
    padding: 0.75rem;
  }
  
  .sales-right-panel {
    max-height: none;
    min-height: auto;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.5rem;
    padding: 0.25rem;
  }
  
  .product-item {
    padding: 0.5rem;
    min-height: auto;
  }
  
  .product-item img {
    width: 40px;
    height: 40px;
  }
  
  .product-item .name {
    font-size: 0.7rem;
    margin-bottom: 0.125rem;
  }
  
  .product-item .price {
    font-size: 0.75rem;
  }
  
  .sale-items-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
  }
  
  .sale-items-title {
    font-size: 1rem;
  }
  
  .clear-sale-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
  }
  
  .sale-items-list {
    max-height: 200px;
    margin-bottom: 0.5rem;
  }
  
  .sale-item {
    padding: 0.25rem 0;
    gap: 0.25rem;
  }
  
  .sale-item-name {
    font-size: 0.8rem;
  }
  
  .quantity-btn {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.7rem;
  }
  
  .sale-item-quantity {
    width: 2rem;
    padding: 0.125rem;
    font-size: 0.8rem;
  }
  
  .discount-section {
    margin: 0.5rem 0;
    padding: 0.5rem;
  }
  
  .discount-controls {
    flex-direction: column;
    gap: 0.25rem;
    align-items: stretch;
  }
  
  .payment-methods {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .payment-method {
    padding: 0.75rem;
  }
  
  .checkout-btn {
    padding: 0.75rem;
    font-size: 1rem;
    margin-top: 0.5rem;
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .sales-container {
    flex-direction: column;
    height: auto;
  }
  
  .sales-right-panel {
    width: 100%;
    max-height: 400px;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
  
  .payment-methods {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .sales-right-panel {
    width: 300px;
  }
  
  .payment-methods {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .sales-right-panel {
    width: 350px;
  }
  
  .payment-methods {
    grid-template-columns: repeat(3, 1fr);
  }
}