/* Custom styles to complement Tailwind; adheres to design3.json */
:root {
  --primary: #F09937;
  /* Orange */
  --secondary: #fef7f0;
  /* Light Orange/White for backgrounds and cards */
  --neutralDark: #374151;
  /* Dark Gray for text */
  --neutralLight: #f3f4f6;
  /* Light Gray for borders and backgrounds */
  --accent: #ff8c00;
  /* Bright Orange for interactive elements */
  --linkText: #F09937;
  /* Orange for links */
  --cardBackground: #ffffff;
  /* White for cards */
  --borderColor: #e5e7eb;
  /* Light Gray for borders */
  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --orange-200: #fed7aa;
  --orange-300: #fdba74;
  --orange-400: #fb923c;
  --orange-500: #F09937;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --orange-800: #9a3412;
  --orange-900: #7c2d12;

  /* 优化：统一商品展示区域样式变量 */
  --product-card-height: 400px;
  --product-card-gap-mobile: 16px;
  --product-card-gap-tablet: 24px;
  --product-card-gap-desktop: 24px;
  --product-card-border-radius: 16px;
  --product-card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --product-card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
  font-family: 'Inter', 'Roboto', system-ui, -apple-system, Segoe UI, Helvetica, Arial, sans-serif;
}

.input {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  width: 100%;
  transition: border-color 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(240, 153, 55, 0.1);
}

/* Custom button styles */
.btn-primary {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: #ea580c;
  /* Darker shade of primary */
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #e67e00;
  /* Darker shade of accent */
  transform: translateY(-1px);
}

/* Card styles */
.card {
  background: var(--cardBackground);
  border: 1px solid var(--borderColor);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Navigation styles */
.nav-link {
  color: var(--neutralDark);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

/* Background utilities */
.bg-primary {
  background-color: var(--primary);
}

.bg-secondary {
  background-color: var(--secondary);
}

.bg-neutral {
  background-color: var(--neutralLight);
}

/* Text utilities */
.text-primary {
  color: var(--primary);
}

.text-secondary {
  color: var(--neutralDark);
}

.text-accent {
  color: var(--accent);
}

/* Border utilities */
.border-primary {
  border-color: var(--primary);
}

.border-neutral {
  border-color: var(--borderColor);
}

/* Swiper styles - 优化：确保商品卡片高度一致 */
.swiper-container {
  width: 100%;
  height: auto;
  overflow: hidden;
  position: relative;
  margin: 0;
  padding: 10px 0;
}

.swiper-wrapper {
  display: flex;
  align-items: stretch;
}

.swiper-slide {
  text-align: center;
  font-size: 18px;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: stretch;
  flex-shrink: 0;
  height: 100%;
}

/* 优化：统一商品卡片高度，确保等高显示 */
.swiper-slide product-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.swiper-slide product-card>div {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.swiper-slide product-card .p-4 {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 优化：统一商品展示区域样式，确保视觉一致性 */
#new-products-grid product-card,
.swiper-slide product-card {
  height: var(--product-card-height);
  /* 使用固定高度而非min-height */
  border-radius: var(--product-card-border-radius);
  box-shadow: var(--product-card-shadow);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* 优化：移动端商品卡片高度调整 */
@media (max-width: 767px) {

  #new-products-grid product-card,
  .swiper-slide product-card {
    height: 320px;
    /* 移动端固定高度 */
  }
}

#new-products-grid product-card:hover,
.swiper-slide product-card:hover {
  box-shadow: var(--product-card-shadow-hover);
  transform: translateY(-4px);
}

/* 优化：确保商品卡片内容单行显示，不溢出 */
#new-products-grid product-card h4,
.swiper-slide product-card h4 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
  height: 1.4em;
  /* 固定高度确保单行 */
}

/* 优化：变体信息单行显示 */
#new-products-grid product-card .variants-info,
.swiper-slide product-card .variants-info {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  height: 1.2em;
  /* 固定高度确保单行 */
}

/* 优化：商品卡片内容区域布局控制 */
#new-products-grid product-card .p-4,
.swiper-slide product-card .p-4 {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 1rem;
}

/* 优化：商品卡片顶部信息区域对齐 */
#new-products-grid product-card .category-rating,
.swiper-slide product-card .category-rating {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  height: 2rem;
  /* 固定高度确保对齐 */
}

/* 优化：商品卡片价格区域对齐 */
#new-products-grid product-card .price-section,
.swiper-slide product-card .price-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  height: 1.5rem;
  /* 固定高度确保对齐 */
}

/* 优化：商品卡片按钮区域对齐 */
#new-products-grid product-card .button-section,
.swiper-slide product-card .button-section {
  margin-top: auto;
  /* 推到底部 */
  height: 2.5rem;
  /* 固定高度确保对齐 */
}

/* 优化：统一间距和响应式设计 */
@media (max-width: 767px) {
  #new-products-grid {
    gap: var(--product-card-gap-mobile);
  }

  .swiper-container {
    --swiper-navigation-size: 0;
  }

  /* 优化：移动端商品卡片内容区域调整 */
  #new-products-grid product-card .p-4,
  .swiper-slide product-card .p-4 {
    padding: 0.75rem;
    /* 移动端减少内边距 */
  }

  #new-products-grid product-card .category-rating,
  .swiper-slide product-card .category-rating {
    height: 1.75rem;
    /* 移动端减少高度 */
    margin-bottom: 0.5rem;
  }

  #new-products-grid product-card .price-section,
  .swiper-slide product-card .price-section {
    height: 1.25rem;
    /* 移动端减少高度 */
    margin-bottom: 0.75rem;
  }

  #new-products-grid product-card .button-section,
  .swiper-slide product-card .button-section {
    height: 2.25rem;
    /* 移动端减少高度 */
  }

  /* 优化：移动端Header适配 */
  header .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* 优化：移动端Logo和按钮尺寸调整 */
  header .logo img {
    width: 40px;
    height: 40px;
  }

  header .logo span {
    font-size: 1.125rem;
  }

  /* 优化：移动端按钮间距 */
  header .action-buttons {
    gap: 8px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  #new-products-grid {
    gap: var(--product-card-gap-tablet);
  }
}

@media (min-width: 1024px) {
  #new-products-grid {
    gap: var(--product-card-gap-desktop);
  }
}

/* Mobile styles for Featured Horizontal Scroll */
@media (max-width: 767px) {
  .swiper-slide .group {
    /* transform: scale(0.9); */
    transform-origin: center;
  }

  .swiper-slide .group img {
    /* height: 240px !important; */
    aspect-ratio: 5/4;
    object-fit: cover;
  }

  .swiper-slide .group h4 {
    font-size: 0.875rem;
  }

  .swiper-slide .group .text-lg {
    font-size: 1rem;
  }

  .swiper-slide .group .text-sm {
    font-size: 0.75rem;
  }

  .swiper-slide .group button {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Mobile styles for New Products Grid */
@media (max-width: 767px) {
  #new-products-grid .group {
    /* transform: scale(0.9); */
    transform-origin: center;
  }

  #new-products-grid .group img {
    /* height: 280px !important; */
    aspect-ratio: 5/4;
    object-fit: cover;
  }

  #new-products-grid .group h4 {
    font-size: 0.875rem;
  }

  #new-products-grid .group .text-lg {
    font-size: 1rem;
  }

  #new-products-grid .group .text-sm {
    font-size: 0.75rem;
  }

  #new-products-grid .group button {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
  }

  /* 移动端网格间距已通过CSS变量控制 */
}

.swiper-pagination {
  position: relative;
  margin-top: 20px;
  text-align: center;
}

.swiper-pagination-bullet {
  background: var(--borderColor);
  opacity: 0.5;
}

.swiper-pagination-bullet-active {
  background: var(--primary);
  opacity: 1;
}

/* Line clamp utility for text truncation */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Enhanced shadow utilities */
.shadow-orange-lg {
  box-shadow: 0 10px 25px 0 rgba(240, 153, 55, 0.2);
}

.shadow-orange-xl {
  box-shadow: 0 20px 40px 0 rgba(240, 153, 55, 0.25);
}

/* Enhanced hover effects */
.hover\:shadow-orange-lg:hover {
  box-shadow: 0 10px 25px 0 rgba(240, 153, 55, 0.2);
}

.hover\:shadow-orange-xl:hover {
  box-shadow: 0 20px 40px 0 rgba(240, 153, 55, 0.25);
}

/* ===== UI优化：商品查看按钮和Shop页面重构 ===== */

/* 1. 商品查看按钮优化 */
.product-view-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(240, 153, 55, 0.3);
  overflow: hidden;
}

.product-view-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.product-view-btn:hover::before {
  left: 100%;
}

.product-view-btn:hover {
  background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(240, 153, 55, 0.4);
}

.product-view-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(240, 153, 55, 0.3);
}

.product-view-btn .icon {
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.product-view-btn:hover .icon {
  transform: scale(1.1);
}

/* 2. Shop页面标题样式重构 */
.shop-page-title {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

.shop-page-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

/* 3. 创新筛选按钮样式 */
.filter-btn {
  position: relative;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--borderColor);
  border-radius: 2rem;
  background: white;
  color: var(--neutralDark);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  z-index: 1;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.filter-btn:hover::before {
  width: 100%;
}

.filter-btn:hover {
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(240, 153, 55, 0.3);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 15px rgba(240, 153, 55, 0.3);
}

/* 4. 筛选区域背景优化 */
.filters-container {
  background: linear-gradient(135deg, #fef7f0 0%, #fff7ed 100%);
  border: 1px solid rgba(240, 153, 55, 0.1);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(240, 153, 55, 0.08);
  position: relative;
  overflow: hidden;
}

.filters-container::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(240, 153, 55, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* 5. 商品计数样式优化 */
.product-count {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 4px 15px rgba(240, 153, 55, 0.3);
}

/* 6. 响应式设计优化 */
@media (max-width: 767px) {
  .shop-page-title {
    font-size: 2rem;
  }

  .product-view-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
  }

  .filter-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
  }

  .filters-container {
    padding: 1rem;
  }

  .product-count {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .shop-page-title {
    font-size: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .shop-page-title {
    font-size: 2.75rem;
  }

  .product-view-btn {
    padding: 0.875rem 1.75rem;
    font-size: 0.9375rem;
  }

  .filter-btn {
    padding: 0.875rem 1.75rem;
    font-size: 0.9375rem;
  }
}

/* 7. 动画增强 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shop-page-title,
.filters-container,
.product-count {
  animation: fadeInUp 0.6s ease-out;
}

.filters-container {
  animation-delay: 0.2s;
}

.product-count {
  animation-delay: 0.4s;
}