/* CSS Variables */
:root {
  --color-primary: #1a1a1a;
  --color-accent: #D4AF37;
  --color-accent-hover: #b89628;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f8f8;
  --color-text: #333333;
  --color-text-muted: #888888;
  --color-border: #e5e5e5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
  --radius: 8px;
  --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

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

/* Header */
.header {
  background: #F4F1F0;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: inline-block;
  line-height: 1;
}

.logo-image {
  height: 40px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  gap: 20px;
}

.nav a {
  font-size: 0.95rem;
  color: var(--color-text);
  padding: 8px 12px;
  border-radius: var(--radius);
}

.nav a:hover,
.nav a.active {
  color: var(--color-accent);
  background: var(--color-bg-alt);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--color-primary);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, #fff 100%);
  padding: 80px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.hero p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 30px;
}

.btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 14px 32px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-outline:hover {
  background: var(--color-accent);
  color: #fff;
}

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

.section-title {
  font-size: 1.8rem;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: 15px auto 0;
}

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

.category-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  transition: var(--transition);
}

.category-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.category-card h3 {
  font-size: 1.3rem;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.category-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

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

.product-card {
  background: var(--color-bg);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--color-border);
}

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

.product-card-image {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.product-card-info {
  padding: 15px;
}

.product-card-name {
  font-size: 1rem;
  color: var(--color-primary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.product-card-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 12px;
}

.product-card-btn {
  width: 100%;
  padding: 10px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: var(--transition);
}

.product-card-btn:hover {
  background: var(--color-accent);
}

/* Product Page */
.product-page {
  padding: 40px 0;
}

.breadcrumb {
  padding: 15px 0;
  margin-bottom: 20px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

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

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

.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  margin-bottom: 60px;
}

/* Gallery */
.gallery {
  position: sticky;
  top: 100px;
}

.gallery-main {
  aspect-ratio: 1;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 15px;
  cursor: zoom-in;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  overflow-x: visible;
  padding-bottom: 10px;
  justify-content: flex-start;
}

.gallery-thumb {
  width: 70px;
  height: 70px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: var(--transition);
}

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

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product Info Panel */
.product-info h1 {
  font-size: 1.8rem;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.product-model {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.product-price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--color-border);
}

.product-specs {
  margin-bottom: 30px;
}

.product-specs h3 {
  font-size: 1.1rem;
  color: var(--color-primary);
  margin-bottom: 15px;
}

.product-specs-content {
  background: var(--color-bg-alt);
  padding: 20px;
  border-radius: var(--radius);
  white-space: pre-line;
  line-height: 2;
}

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

.product-cta .btn {
  flex: 1;
  text-align: center;
}

/* Related Products */
.related-products {
  border-top: 1px solid var(--color-border);
  padding-top: 40px;
}

/* Contact Section */
.contact-section {
  background: var(--color-bg-alt);
  padding: 60px 0;
}

.contact-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--color-bg);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.contact-card h2 {
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: 30px;
}

.contact-item {
  margin-bottom: 25px;
}

.contact-item-label {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 5px;
}

.contact-item-value {
  font-size: 1.3rem;
  color: var(--color-primary);
  font-weight: 600;
}

.contact-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-bg);
  border-radius: var(--radius);
  padding: 30px;
  max-width: 450px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(-20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--color-primary);
}

.modal h3 {
  font-size: 1.4rem;
  color: var(--color-primary);
  margin-bottom: 25px;
  text-align: center;
}

.modal-content {
  text-align: center;
}

.modal-item {
  margin-bottom: 25px;
}

.modal-item-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 5px;
}

.modal-item-value {
  font-size: 1.2rem;
  color: var(--color-primary);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 30px;
}

.modal-actions .btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 0.9rem;
}

/* Footer */
.footer {
  background: var(--color-primary);
  color: #fff;
  padding: 40px 0 20px;
}

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

.footer-section h4 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--color-accent);
}

.footer-section p {
  color: rgba(255,255,255,0.8);
  line-height: 1.8;
  font-size: 0.95rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 20px;
  text-align: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}

/* Category Page Header */
.page-header {
  background: var(--color-bg-alt);
  padding: 40px 0;
  text-align: center;
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.page-header p {
  color: var(--color-text-muted);
}

/* 404 Page */
.error-page {
  text-align: center;
  padding: 100px 20px;
}

.error-page h1 {
  font-size: 4rem;
  color: var(--color-accent);
  margin-bottom: 20px;
}

.error-page p {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  margin-bottom: 30px;
}

/* Responsive */
@media (max-width: 900px) {
  .category-grid,
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .product-detail {
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
  
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    flex-direction: column;
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);
    gap: 5px;
  }
  
  .nav.active {
    display: flex;
  }
  
  .logo-image {
    height: 32px;
  }
  
  .hero {
    padding: 50px 20px;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .product-detail {
    grid-template-columns: 1fr;
  }
  
  .gallery {
    position: static;
  }
  
  .gallery-thumb {
    width: 55px;
    height: 55px;
    min-width: 48px;
    min-height: 48px;
  }
  
  .gallery-thumbs {
    flex-wrap: wrap;
    gap: 6px;
    overflow-x: visible;
    justify-content: flex-start;
  }
  
  .product-info h1 {
    font-size: 1.4rem;
  }
  
  .product-model {
    font-size: 0.8rem;
  }
  
  .product-price {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 20px;
  }
  
  .product-specs h3 {
    font-size: 1rem;
    margin-bottom: 12px;
  }
  
  .product-specs-content {
    font-size: 0.9rem;
    padding: 15px;
  }
  
  .product-cta {
    flex-direction: column;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .contact-actions,
  .modal-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
  
  .section {
    padding: 40px 0;
  }
  
  .contact-card {
    padding: 25px 20px;
  }
}

/* Image Zoom Modal */
.zoom-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.zoom-modal.active {
  opacity: 1;
  visibility: visible;
}

.zoom-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.zoom-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  z-index: 1001;
}

/* Loading State */
.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.product-card.skeleton {
  pointer-events: none;
}

.product-card.skeleton .product-card-image {
  background: #e0e0e0;
}

.product-card.skeleton .product-card-name,
.product-card.skeleton .product-card-price,
.product-card.skeleton .product-card-btn {
  background: #e0e0e0;
  border-radius: var(--radius);
}

.product-card.skeleton .product-card-image,
.product-card.skeleton .product-card-name,
.product-card.skeleton .product-card-price,
.product-card.skeleton .product-card-btn {
  color: transparent !important;
}

.product-card.skeleton .product-card-name {
  min-height: 2.8em;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
