/* ==========================================================================
   Protel / PPS - Modern Corporate Static Website Stylesheet
   ========================================================================== */

:root {
  --primary-color: #042670;
  --primary-dark: #021847;
  --primary-light: #0d42a8;
  --accent-color: #0055a0;
  --accent-hover: #0072d6;
  --text-main: #333333;
  --text-muted: #666666;
  --text-light: #888888;
  --heading-color: #1e394b;
  --bg-main: #f8f9fa;
  --bg-card: #ffffff;
  --bg-dark: #0f1c2e;
  --border-color: #e2e8f0;
  --border-focus: #3b82f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --container-max-width: 1220px;
}

/* 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, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans TC", sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

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

ul {
  list-style: none;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Header & Top Bar */
.top-bar {
  background-color: var(--primary-dark);
  color: #d1d5db;
  font-size: 0.875rem;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.top-contact {
  display: flex;
  gap: 20px;
}

.top-contact span, .top-contact a {
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-contact a:hover {
  color: #ffffff;
}

.top-links {
  display: flex;
  gap: 15px;
}

.top-links a {
  color: #94a3b8;
}

.top-links a:hover {
  color: #ffffff;
}

/* Main Navigation */
.header-main {
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.brand-logo {
  display: flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
}

.brand-logo img {
  height: 80px;
  max-height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: #4b5563;
  padding: 8px 14px;
  height: 40px;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  line-height: 1;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-color);
  background-color: #eff6ff;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--primary-color);
  font-size: 1.5rem;
}

/* Hero Page Headers (Subpages) */
.page-hero {
  background: linear-gradient(135deg, rgba(4, 38, 112, 0.92) 0%, rgba(2, 24, 71, 0.95) 100%), url('../assets/images/header_subpages.jpg') center/cover no-repeat;
  color: #ffffff;
  padding: 60px 0 50px;
  text-align: center;
  position: relative;
}

.page-hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  color: #ffffff;
}

.page-hero-subtitle {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-width: 600px;
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.875rem;
  color: #94a3b8;
}

.breadcrumb a {
  color: #cbd5e1;
}

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

/* Hero Slider (Homepage) */
.hero-slider {
  position: relative;
  width: 100%;
  height: 440px;
  background-color: var(--primary-dark);
  overflow: hidden;
}

.slide-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}

.slide-item.active {
  opacity: 1;
  visibility: visible;
}

.slide-content {
  background: rgba(2, 24, 71, 0.75);
  backdrop-filter: blur(4px);
  padding: 35px 45px;
  border-radius: var(--radius-md);
  max-width: 580px;
  color: #ffffff;
  border-left: 4px solid #3b82f6;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.8s ease forwards;
}

.slide-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.2;
}

.slide-desc {
  font-size: 1.05rem;
  margin-bottom: 25px;
  color: #e2e8f0;
}

.slide-buttons {
  display: flex;
  gap: 12px;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: background var(--transition-fast);
  z-index: 10;
}

.slider-btn:hover {
  background: rgba(4, 38, 112, 0.9);
}

.slider-btn.prev { left: 20px; }
.slider-btn.next { right: 20px; }

.slider-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.slider-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.slider-dot.active {
  background: #ffffff;
  width: 28px;
  border-radius: 6px;
}

/* Common Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-outline:hover {
  background-color: #ffffff;
  color: var(--primary-color);
}

.btn-secondary {
  background-color: #e2e8f0;
  color: #334155;
}

.btn-secondary:hover {
  background-color: #cbd5e1;
  color: #0f172a;
}

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

.section-alt {
  background-color: #ffffff;
}

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

.section-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--heading-color);
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-muted);
  margin-top: 10px;
  font-size: 1rem;
}

/* Cards & Grid Layouts */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

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

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

/* Feature Cards */
.feature-card {
  background: var(--bg-card);
  padding: 30px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  text-align: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.feature-icon {
  font-size: 2.5rem;
  color: var(--accent-color);
  margin-bottom: 16px;
}

.feature-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--heading-color);
  margin-bottom: 10px;
}

.feature-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Product & Gallery Cards */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

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

.product-thumb-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  background-color: #f1f5f9;
  overflow: hidden;
}

.product-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary-color);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.product-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 8px;
}

.product-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-grow: 1;
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tag {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* Filter Controls */
.filter-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 35px;
}

.filter-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: #475569;
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #ffffff;
}

/* Manufacturing Services List */
.service-item {
  display: flex;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.service-item:nth-child(even) {
  flex-direction: row-reverse;
}

.service-img {
  width: 45%;
  min-height: 280px;
  object-fit: cover;
}

.service-content {
  width: 55%;
  padding: 35px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.service-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 12px;
}

.service-text {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.7;
  margin-bottom: 18px;
}

.service-features {
  list-style: none;
}

.service-features li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  color: #475569;
  font-size: 0.92rem;
}

.service-features li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: bold;
}

/* Downloads Box */
.download-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.download-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.download-icon {
  font-size: 2.8rem;
  color: #dc2626;
  flex-shrink: 0;
}

.download-info {
  flex-grow: 1;
}

.download-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 4px;
}

.download-meta {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Contact Form & Info */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 40px;
  background: #ffffff;
  padding: 40px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.contact-item-icon {
  font-size: 1.3rem;
  color: var(--accent-color);
  background: #eff6ff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-item-title {
  font-weight: 700;
  color: var(--heading-color);
  margin-bottom: 4px;
}

.contact-item-detail {
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

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

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  background-color: #f8f9fa;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

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

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

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

.lightbox-content {
  position: relative;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.lightbox-caption {
  color: #ffffff;
  margin-top: 12px;
  font-size: 1rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #ffffff;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
}

/* Footer */
.footer {
  background-color: var(--bg-dark);
  color: #94a3b8;
  padding: 50px 0 25px;
}

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

.footer-brand h3 {
  color: #ffffff;
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1.05rem;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 8px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--accent-color);
}

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

.footer-links a {
  color: #94a3b8;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #ffffff;
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 10px;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .service-item, .service-item:nth-child(even) {
    flex-direction: column;
  }
  .service-img, .service-content {
    width: 100%;
  }
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .top-bar-inner {
    flex-direction: column;
    text-align: center;
  }
  .mobile-toggle {
    display: block;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: #ffffff;
    flex-direction: column;
    padding: 15px 20px;
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--border-color);
  }
  .nav-menu.active {
    display: flex;
  }
  .nav-link {
    width: 100%;
    padding: 12px;
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .hero-slider {
    height: 380px;
  }
  .slide-content {
    padding: 20px;
    margin: 0 15px;
  }
  .slide-title {
    font-size: 1.6rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
