* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #e84a5f;
  --secondary-color: #ff847c;
  --accent-color: #fecea8;
  --text-dark: #2a363b;
  --text-light: #666666;
  --bg-light: #faf8f5;
  --bg-white: #ffffff;
  --border-color: #eeeeee;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --transition: all 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.8;
  font-size: 16px;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

/* Header Styles */
.header {
  background: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top {
  background: var(--primary-color);
  color: white;
  padding: 8px 0;
  font-size: 14px;
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-main {
  padding: 16px 0;
}

.header-main .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 2px;
}

.logo span {
  color: var(--text-dark);
  font-weight: 400;
}

.search-box {
  flex: 1;
  max-width: 500px;
  margin: 0 40px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 50px 12px 20px;
  border: 2px solid var(--border-color);
  border-radius: 30px;
  font-size: 15px;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-box button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.search-box button:hover {
  background: var(--secondary-color);
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text-dark);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--primary-color);
  color: white;
}

/* Navigation */
.main-nav {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
}

.main-nav .container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0;
}

.main-nav a {
  padding: 14px 24px;
  color: var(--text-dark);
  font-size: 15px;
  position: relative;
  transition: var(--transition);
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--primary-color);
  transition: var(--transition);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

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

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #fff5f5 0%, #fff9f0 100%);
  padding: 60px 0;
  margin-bottom: 40px;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text h1 {
  font-size: 42px;
  color: var(--text-dark);
  margin-bottom: 20px;
  line-height: 1.3;
}

.hero-text h1 span {
  color: var(--primary-color);
}

.hero-text p {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 30px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-top: 40px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  font-size: 14px;
  color: var(--text-light);
  margin-top: 4px;
}

.hero-image {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.hero-image img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.hero-image img:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.hero-image img:nth-child(1) {
  grid-column: span 2;
}

/* Section Styles */
.section {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 32px;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-light);
  font-size: 16px;
}

/* Category Cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.category-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.category-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #fff5f5 0%, #fff9f0 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.category-card h3 {
  font-size: 18px;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.category-card p {
  font-size: 13px;
  color: var(--text-light);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.product-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.product-image {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
  background: #f5f5f5;
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.product-info {
  padding: 20px;
}

.product-title {
  font-size: 15px;
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.price-current {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-color);
}

.price-original {
  font-size: 14px;
  color: var(--text-light);
  text-decoration: line-through;
}

.product-reviews {
  font-size: 13px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.review-stars {
  color: #ffc107;
}

/* Review Card */
.review-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: var(--transition);
}

.review-card:hover {
  box-shadow: var(--shadow-hover);
}

.review-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.reviewer-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.reviewer-info h4 {
  font-size: 15px;
  color: var(--text-dark);
}

.reviewer-info span {
  font-size: 13px;
  color: var(--text-light);
}

.review-rating {
  margin-left: auto;
  color: #ffc107;
}

.review-content {
  font-size: 15px;
  color: var(--text-dark);
  line-height: 1.8;
  margin-bottom: 16px;
}

.review-product {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-light);
  border-radius: 8px;
}

.review-product img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.review-product span {
  font-size: 14px;
  color: var(--text-dark);
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
}

/* Tab Navigation */
.tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 24px;
  border: 2px solid var(--border-color);
  background: var(--bg-white);
  border-radius: 30px;
  font-size: 14px;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
}

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

/* Footer */
.footer {
  background: var(--text-dark);
  color: white;
  padding: 60px 0 30px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-about h3 {
  font-size: 24px;
  margin-bottom: 16px;
}

.footer-about h3 span {
  color: var(--primary-color);
}

.footer-about p {
  color: #999;
  line-height: 1.8;
  font-size: 14px;
}

.footer-links h4 {
  font-size: 16px;
  margin-bottom: 20px;
  color: white;
}

.footer-links ul li {
  margin-bottom: 12px;
}

.footer-links a {
  color: #999;
  font-size: 14px;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--primary-color);
}

.footer-bottom {
  border-top: 1px solid #444;
  padding-top: 30px;
  text-align: center;
  color: #666;
  font-size: 14px;
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, #fff5f5 0%, #fff9f0 100%);
  padding: 60px 0;
  text-align: center;
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: 36px;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.page-header p {
  color: var(--text-light);
  font-size: 16px;
}

/* Product Detail */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.product-gallery {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 15px;
}

.gallery-thumbs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-thumb {
  width: 100%;
  padding-top: 100%;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

.gallery-thumb.active,
.gallery-thumb:hover {
  border-color: var(--primary-color);
}

.gallery-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  background: #f5f5f5;
}

.gallery-main img {
  width: 100%;
  height: auto;
}

.product-meta h1 {
  font-size: 28px;
  color: var(--text-dark);
  margin-bottom: 20px;
  line-height: 1.4;
}

.product-price-detail {
  display: flex;
  align-items: baseline;
  gap: 15px;
  margin-bottom: 24px;
  padding: 20px;
  background: #fff5f5;
  border-radius: var(--radius);
}

.price-detail-current {
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-color);
}

.price-detail-original {
  font-size: 18px;
  color: var(--text-light);
  text-decoration: line-through;
}

.product-description {
  font-size: 15px;
  color: var(--text-dark);
  line-height: 1.8;
  margin-bottom: 30px;
}

.product-highlights {
  background: var(--bg-light);
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 30px;
}

.product-highlights h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.product-highlights ul {
  list-style: disc;
  padding-left: 20px;
}

.product-highlights li {
  margin-bottom: 8px;
  color: var(--text-dark);
  font-size: 14px;
}

.product-actions {
  display: flex;
  gap: 15px;
}

.product-actions .btn {
  flex: 1;
  text-align: center;
  padding: 16px;
}

/* User Reviews Section */
.user-reviews {
  margin-top: 60px;
}

.review-form {
  background: var(--bg-white);
  padding: 30px;
  border-radius: var(--radius);
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

.review-form h3 {
  font-size: 20px;
  margin-bottom: 20px;
  color: var(--text-dark);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form-group textarea {
  width: 100%;
  padding: 15px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  transition: var(--transition);
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.reviews-list {
  display: grid;
  gap: 20px;
}

/* Breadcrumb */
.breadcrumb {
  padding: 15px 0;
  font-size: 14px;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--text-light);
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.breadcrumb span {
  margin: 0 8px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination a,
.pagination span {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-dark);
  transition: var(--transition);
}

.pagination a {
  background: var(--bg-white);
  box-shadow: var(--shadow);
}

.pagination a:hover,
.pagination span.active {
  background: var(--primary-color);
  color: white;
}

/* Sidebar */
.content-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
}

.sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.sidebar-card h3 {
  font-size: 18px;
  color: var(--text-dark);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

.sidebar-category li {
  margin-bottom: 8px;
}

.sidebar-category a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-dark);
  font-size: 14px;
  transition: var(--transition);
}

.sidebar-category a:hover,
.sidebar-category a.active {
  background: #fff5f5;
  color: var(--primary-color);
}

.sidebar-category span {
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-stats {
    justify-content: center;
  }
  
  .hero-image {
    max-width: 500px;
    margin: 0 auto;
  }
  
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .content-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .product-detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-main .container {
    flex-wrap: wrap;
  }
  
  .search-box {
    order: 3;
    max-width: 100%;
    margin: 16px 0 0;
  }
  
  .nav-links {
    display: none;
  }
  
  .main-nav a {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .hero {
    padding: 40px 0;
  }
  
  .hero-text h1 {
    font-size: 28px;
  }
  
  .hero-stats {
    gap: 20px;
  }
  
  .stat-number {
    font-size: 28px;
  }
  
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .product-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .sidebar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  
  .hero-text h1 {
    font-size: 24px;
  }
  
  .section-header h2 {
    font-size: 24px;
  }
  
  .category-grid {
    grid-template-columns: 1fr;
  }
  
  .product-actions {
    flex-direction: column;
  }
  
  .gallery-thumbs {
    flex-direction: row;
    order: 2;
  }
  
  .product-gallery {
    grid-template-columns: 1fr;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading Animation */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}

.loading::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 20px;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.empty-state p {
  color: var(--text-light);
  font-size: 15px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--text-dark);
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: var(--shadow-hover);
  z-index: 9999;
  animation: slideIn 0.3s ease;
}

.toast.success {
  background: #4caf50;
}

.toast.error {
  background: #f44336;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
