:root {
  --primary: #99AF8F;
  --primary-dark: #7a9170;
  --primary-light: #b5c9ad;
  --primary-bg: #f0f4ee;
  --text: #333;
  --text-light: #666;
  --text-muted: #999;
  --white: #fff;
  --border: #e8e8e8;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --transition: 0.3s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

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

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-link img {
  height: 128px;
  width: auto;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-text .zh {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark);
  line-height: 1.3;
}

.logo-text .en {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.header-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--primary);
  color: var(--white);
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.header-contact:hover {
  background: var(--primary-dark);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary-bg) 0%, var(--white) 100%);
  padding: 60px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 28px;
  font-weight: 300;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

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

/* Homepage Category Cards */
.category-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.category-card {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

/* Carousel */
.category-card .carousel {
  position: absolute;
  inset: 0;
}

.category-card .carousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.category-card .carousel img.active {
  opacity: 1;
}

/* Overlay */
.category-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: white;
}

.category-card .card-overlay h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.category-card .card-overlay .count {
  font-size: 14px;
  opacity: 0.9;
}

/* Category Page */
.category-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

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

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Category Section (legacy, kept for reference) */
.category-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.category-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-title .badge {
  font-size: 12px;
  background: var(--primary);
  color: var(--white);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 400;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

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

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

.product-card .card-img {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--primary-bg);
}

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

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

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

.product-card .card-name {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.product-card .card-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark);
}

.product-card .card-price::before {
  content: '$';
  font-size: 12px;
}

/* Product Page */
.product-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

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

.gallery-main {
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--primary-bg);
  margin-bottom: 12px;
}

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

.gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 4px;
}

.gallery-thumbs img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  flex-shrink: 0;
}

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

/* Product Info */
.product-info h1 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.product-info .model-no {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.product-info .price {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.product-info .price::before {
  content: '$';
  font-size: 16px;
}

.product-info .category-badge {
  display: inline-block;
  font-size: 12px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 12px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.product-info .category-badge:hover {
  background: var(--primary-dark);
  color: var(--white);
  transform: translateY(-1px);
}

/* Color Selector */
.color-selector {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--primary-bg);
  border-radius: var(--radius);
}

.color-selector .label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.color-selector .colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-selector .color-link {
  font-size: 13px;
  padding: 4px 14px;
  border-radius: 16px;
  background: var(--white);
  color: var(--text-light);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
}

.color-selector .color-link:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.color-selector .color-link.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* Specs */
.specs {
  margin-bottom: 24px;
}

.specs h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.specs table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.specs table tr {
  border-bottom: 1px solid var(--border);
}

.specs table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--primary-bg);
  color: var(--text-light);
  font-weight: 500;
  width: 80px;
  white-space: nowrap;
}

.specs table td {
  padding: 10px 12px;
  color: var(--text);
}

/* Description */
.description {
  margin-bottom: 24px;
}

.description h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.description .desc-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-light);
}

.description .desc-content img {
  max-width: 100%;
  margin: 12px auto;
  border-radius: var(--radius);
}

/* CTA Button */
.cta-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.cta-btn:hover {
  background: var(--primary-dark);
}

/* Footer */
.footer {
  background: var(--primary-bg);
  padding: 40px 20px;
  text-align: center;
}

.footer-inner {
  max-width: 600px;
  margin: 0 auto;
}

.footer .company-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.footer .company-name-en {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer .contact-item {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 6px;
}

.footer .contact-item strong {
  color: var(--text);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  line-height: 1;
}

.modal h2 {
  font-size: 20px;
  color: var(--primary-dark);
  margin-bottom: 20px;
  text-align: center;
}

.modal .contact-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 14px;
}

.modal .contact-line .icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.modal .contact-line .label {
  font-weight: 600;
  color: var(--text);
  min-width: 40px;
}

.modal .contact-line .value {
  color: var(--text-light);
}

/* Contact Links */
.contact-link {
  color: var(--primary-dark);
  text-decoration: none;
  transition: var(--transition);
}

.contact-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer .contact-link {
  color: var(--text-light);
}

.footer .contact-link:hover {
  color: var(--primary-dark);
}

/* Responsive */
@media (max-width: 768px) {
  .category-cards {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .product-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .gallery {
    position: static;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .header-inner {
    padding: 10px 16px;
  }

  .logo-link img {
    height: 128px;
  }

  .logo-text .zh {
    font-size: 14px;
  }

  .logo-text .en {
    font-size: 10px;
  }

  .header-contact span {
    display: none;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

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

  .product-card .card-name {
    font-size: 12px;
  }

  .product-card .card-price {
    font-size: 14px;
  }
}
