/**
 * 高端灰配色方案 - 自定义样式和动效
 */

:root {
  /* 主色调 - 高端灰系列 */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* 强调色 */
  --accent-light: #60a5fa;
  --accent: #3b82f6;
  --accent-dark: #2563eb;
  
  /* 功能色 */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
}

/* 全局样式 */
body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--gray-700);
  background-color: var(--gray-50);
  transition: all 0.3s ease;
}

/* 导航栏美化 */
.navbar {
  background-color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.navbar-brand {
  font-weight: 700;
  color: var(--gray-800) !important;
}

.navbar .nav-link {
  color: var(--gray-600) !important;
  font-weight: 600;
  position: relative;
  transition: all 0.3s ease;
}

.navbar .nav-link:hover {
  color: var(--accent) !important;
}

/* 导航链接下划线动效 */
.navbar .nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--accent);
  transition: all 0.3s ease;
}

.navbar .nav-link:hover::after {
  width: 100%;
  left: 0;
}

/* 按钮样式 */
.btn {
  border-radius: 6px;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  transition: all 0.3s ease;
}

.btn-primary {
  background-color: var(--gray-800);
  border-color: var(--gray-800);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--gray-900);
  border-color: var(--gray-900);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.btn-outline-primary {
  color: var(--gray-800);
  border-color: var(--gray-800);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
  background-color: var(--gray-800);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

/* 卡片样式 */
.card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card-title {
  color: var(--gray-800);
  font-weight: 700;
}

.card-img-top {
  transition: all 0.5s ease;
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

/* 产品网格 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.product-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card .card-footer {
  background-color: transparent;
  border-top: 1px solid var(--gray-200);
  margin-top: auto;
}

/* 价格标签 */
.price-tag {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
}

.price-tag.sale {
  color: var(--danger);
}

.original-price {
  text-decoration: line-through;
  color: var(--gray-500);
  font-size: 0.9rem;
}

/* 徽章 */
.badge {
  font-weight: 600;
  padding: 0.35em 0.65em;
  border-radius: 6px;
}

/* 表单控件 */
.form-control, .form-select {
  border-radius: 6px;
  border-color: var(--gray-300);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

/* 分页 */
.pagination .page-link {
  color: var(--gray-700);
  border-color: var(--gray-200);
  margin: 0 3px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.pagination .page-link:hover {
  background-color: var(--gray-100);
  color: var(--gray-900);
  z-index: 1;
}

.pagination .page-item.active .page-link {
  background-color: var(--gray-800);
  border-color: var(--gray-800);
}

/* 面包屑导航 */
.breadcrumb {
  background-color: transparent;
}

.breadcrumb-item a {
  color: var(--gray-600);
  transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--gray-800);
  font-weight: 600;
}

/* 产品详情页 */
.product-detail-image {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.product-detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1rem;
}

.product-detail-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1.5rem;
}

.product-detail-description {
  color: var(--gray-600);
  line-height: 1.7;
  margin-bottom: 2rem;
}

/* 产品缩略图 */
.product-thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.product-thumbnail {
  width: 70px;
  height: 70px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.product-thumbnail:hover, .product-thumbnail.active {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 星级评分 */
.rating {
  display: inline-flex;
  color: var(--warning);
}

/* 页脚 */
footer {
  background-color: var(--gray-800);
  color: var(--gray-200);
  padding: 3rem 0;
}

footer h5 {
  color: white;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

footer a {
  color: var(--gray-400);
  transition: all 0.3s ease;
}

footer a:hover {
  color: white;
  text-decoration: none;
}

footer .social-icons {
  display: flex;
  gap: 1rem;
}

footer .social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: var(--gray-700);
  border-radius: 50%;
  transition: all 0.3s ease;
}

footer .social-icons a:hover {
  background-color: var(--accent);
  transform: translateY(-3px);
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.fade-in-delay-1 {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  animation-delay: 0.1s;
}

.fade-in-delay-2 {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  animation-delay: 0.2s;
}

.fade-in-delay-3 {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  animation-delay: 0.3s;
}

/* 加载动画 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .product-detail-image {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 576px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
} 

/* 产品标签样式 */
.ps-product__badge.new {
    background-color: #007bff;
    color: white;
    top: 10px;
}

.ps-product__badge.hot {
    background-color: #ff3a3a;
    color: white;
    top: 40px;
}

.ps-product__badge.recommend {
    background-color: #28a745;
    color: white;
    top: 70px;
}

/* 新品、热销和推荐产品在列表中的高亮 */
.ps-product.ps-product--new {
    border: 1px solid #007bff;
}

.ps-product.ps-product--hot {
    border: 1px solid #ff3a3a;
}

.ps-product.ps-product--recommended {
    border: 1px solid #28a745;
} 

/* 产品卡片样式 */
.ps-product {
    position: relative;
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background-color: #fff;
    transition: all 0.4s ease;
    height: 100%;
}

.ps-product:hover {
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.2);
    transform: translateY(-5px);
}

.ps-product__thumbnail {
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
}

.ps-product__thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    transition: all 0.4s ease;
}

.ps-product__thumbnail:hover img {
    transform: scale(1.05);
}

.ps-product__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    background-color: #ff5252;
    z-index: 10;
}

.ps-product__badge.new {
    background-color: #007bff;
    left: 10px;
    right: auto;
}

.ps-product__badge.hot {
    background-color: #ff9800;
    left: 10px;
    top: 40px;
    right: auto;
}

.ps-product__badge.recommend {
    background-color: #4caf50;
    left: 10px;
    top: 70px;
    right: auto;
}

.ps-product__actions {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    transform: translateY(100%);
    transition: all 0.4s ease;
    background-color: rgba(255, 255, 255, 0.9);
}

.ps-product__thumbnail:hover .ps-product__actions {
    transform: translateY(0);
}

.ps-product__actions li {
    margin: 0 5px;
}

.ps-product__actions li a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: white;
    color: #333;
    border-radius: 50%;
    transition: all 0.4s ease;
}

.ps-product__actions li a:hover {
    background-color: #007bff;
    color: white;
}

.ps-product__title {
    display: block;
    color: #333;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 10px;
    height: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ps-product__title:hover {
    color: #007bff;
    text-decoration: none;
}

.ps-product__rating {
    margin-bottom: 5px;
}

.ps-product__price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.price-tag {
    margin-right: 10px;
    font-weight: 600;
}

.price-tag.sale {
    color: #ff5252;
    font-size: 18px;
}

.price-tag.regular {
    color: #999;
    font-size: 14px;
}

/* 首页产品网格样式 */
.home-product-section {
    margin-bottom: 50px;
}

.home-product-section .section-title {
    position: relative;
    margin-bottom: 30px;
    padding-bottom: 15px;
    text-align: center;
    font-weight: 700;
}

.home-product-section .section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #007bff;
}

.home-product-row {
    margin-bottom: 30px;
}

/* 响应式调整 */
@media (max-width: 767px) {
    .ps-product__thumbnail img {
        height: 180px;
    }
}

@media (max-width: 575px) {
    .ps-product {
        padding: 15px;
    }
    
    .ps-product__thumbnail img {
        height: 160px;
    }
} 