/* ============================================================
   忠昌貿易 ThreeUp — Styles
   版本: v=20260613
   ============================================================ */

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

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

body {
  font-family: 'PingFang TC', 'Microsoft JhengHei', '微軟正黑體', 'Heiti TC', 'Noto Sans TC', sans-serif;
  color: #333;
  background: #fff;
  line-height: 1.7;
}

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

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

/* === Header === */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  transition: box-shadow 0.3s;
}

.site-header.scrolled {
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

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

.brand img {
  height: 50px;
  width: auto;
}

/* Desktop Nav */
.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #444;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a.active {
  color: #c0202a;
  background: #fff0f1;
}

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #444;
  transition: all 0.3s;
  border-radius: 2px;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* === Mobile Nav === */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 8px 0;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 500;
  color: #444;
  border-bottom: 1px solid #f0f0f0;
  transition: color 0.2s, background 0.2s;
}

.mobile-nav a:last-child { border-bottom: none; }

.mobile-nav a:hover,
.mobile-nav a.active {
  color: #c0202a;
  background: #fff8f8;
}

/* === Page Wrapper (below fixed header) === */
.page-wrap {
  padding-top: 70px;
}

/* === Hero Section (index) === */
.hero-section {
  position: relative;
  height: calc(100vh - 70px);
  min-height: 500px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 30, 30, 0.52);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 32px 24px;
  background: rgba(60, 60, 60, 0.6);
  border-radius: 4px;
  max-width: 680px;
}

.hero-content h1 {
  font-size: 2.4rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: 14px;
  line-height: 1.3;
}

.hero-content p {
  font-size: 1rem;
  color: rgba(255,255,255,0.9);
  margin-bottom: 24px;
  line-height: 1.8;
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  border: 2px solid transparent;
}

.btn-primary {
  background: #c0202a;
  color: #fff;
  border-color: #c0202a;
}

.btn-primary:hover {
  background: #a01820;
  border-color: #a01820;
}

/* 首頁 hero CTA：透明白框（對齊原站） */
.btn-hero-outline {
  background: transparent;
  color: #fff;
  border-color: #fff;
}
.btn-hero-outline:hover {
  background: #fff;
  color: #333;
}

/* === Breadcrumb === */
.breadcrumb-wrap {
  padding: 12px 0;
  background: #f8f8f8;
  border-bottom: 1px solid #eee;
}

.breadcrumb {
  font-size: 0.88rem;
  color: #888;
}

.breadcrumb a {
  color: #888;
  transition: color 0.2s;
}

.breadcrumb a:hover { color: #c0202a; }

.breadcrumb span { margin: 0 6px; }

/* === Page Section === */
.page-section {
  padding: 60px 0;
}

.section-title {
  font-size: 2.1rem;
  font-weight: 500;
  color: #222;
  margin-bottom: 8px;
  line-height: 1.3;
}

.title-bar {
  width: 48px;
  height: 3px;
  background: #c0202a;
  margin-bottom: 28px;
}

/* about / service 為置中型版面（contact 維持靠左） */
.page-section--centered .section-title { text-align: center; }
.page-section--centered .title-bar { margin-left: auto; margin-right: auto; }
.page-section--centered .about-text {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.page-section--centered .service-intro,
.page-section--centered .service-note { text-align: center; }

/* === About Page === */
.about-text {
  font-size: 1rem;
  line-height: 2;
  color: #444;
  max-width: 820px;
  margin-bottom: 40px;
}

.about-banner {
  width: 100%;
  height: 420px;
  object-fit: cover;
  background: #ececec;
  border-radius: 4px;
}

/* === Service Page === */
.service-intro {
  color: #555;
  margin-bottom: 8px;
  font-size: 1rem;
}

.service-note {
  color: #888;
  font-size: 0.92rem;
  margin-bottom: 48px;
}

/* Product block */
.product-block {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid #f0f0f0;
  padding: 40px 0;
}

.product-block:last-child {
  border-bottom: none;
}

.product-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 60%;
  min-width: 0;
}

.product-images img {
  flex: 1 1 200px;
  max-width: calc(33.33% - 6px);
  min-width: 160px;
  height: 240px;
  object-fit: cover;
  background: #ececec;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.product-images img:hover { opacity: 0.88; }

/* 單圖產品塊 */
.product-images.single-img img {
  max-width: 320px;
  flex: none;
}

.product-info {
  flex: 0 0 260px;
  padding: 0 0 0 32px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.product-name {
  font-size: 1.3rem;
  font-weight: 500;
  color: #222;
  margin-bottom: 8px;
}

.product-name::after {
  content: '';
  display: block;
  width: 36px;
  height: 2px;
  background: #c0202a;
  margin-top: 6px;
}

.product-desc {
  font-size: 0.92rem;
  color: #666;
  line-height: 1.8;
}

/* === Contact Page === */
.contact-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  align-items: flex-start;
}

.contact-info-block {
  flex: 1 1 300px;
}

/* 公司資訊純文字行（對齊原站） */
.contact-lines p {
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: #444;
  line-height: 1.8;
}

.map-wrap {
  margin: 40px 0;
}

.map-wrap iframe {
  width: 100%;
  height: 380px;
  border: 0;
  border-radius: 4px;
  background: #ececec;
}

/* Contact Form */
.contact-form-block {
  flex: 1 1 360px;
}

.contact-form-block h2 {
  font-size: 1.2rem;
  font-weight: 500;
  color: #222;
  margin-bottom: 20px;
}

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

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #444;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #333;
  background: #fff;
  transition: border-color 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #c0202a;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.required-mark { color: #c0202a; margin-left: 2px; }

.form-submit {
  display: block;
  width: 100%;
  padding: 14px 36px;
  background: #c0202a;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.form-submit:hover { background: #a01820; }

/* === Footer === */
.site-footer {
  background: #2a2a2a;
  color: #ccc;
  text-align: center;
  padding: 32px 20px;
  font-size: 0.88rem;
  line-height: 2;
}

.site-footer a { color: #ccc; }
.site-footer a:hover { color: #fff; }

/* === LINE Float Button === */
.line-float {
  position: fixed;
  bottom: 24px;
  left: 16px;
  z-index: 200;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.line-float:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.line-float img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === Lightbox === */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.88);
  align-items: center;
  justify-content: center;
}

.lightbox-overlay.open {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  gap: 16px;
}

.lightbox-img {
  max-width: 82vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 2px;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  padding: 4px 8px;
}

.lightbox-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 4px;
  transition: background 0.2s;
  line-height: 1;
}

.lightbox-btn:hover { background: rgba(255,255,255,0.3); }

/* === Responsive === */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .nav-toggle { display: flex; }

  .hero-content h1 { font-size: 1.5rem; }
  .hero-content p { font-size: 0.92rem; }

  .section-title { font-size: 1.4rem; }

  .product-block {
    flex-direction: column;
  }

  .product-images img {
    max-width: calc(50% - 4px);
    height: 180px;
  }

  .product-info {
    flex: none;
    padding: 16px 0 0 0;
  }

  .contact-layout {
    flex-direction: column;
    gap: 32px;
  }

  .map-wrap iframe { height: 280px; }
}

@media (max-width: 480px) {
  .product-images img {
    max-width: 100%;
    height: 220px;
    flex: 1 1 100%;
  }

  .product-images.single-img img {
    max-width: 100%;
  }

  .hero-content { padding: 24px 16px; }
}
