/* ==========================================================================
   星亞電子有限公司 (Shingyaa Electronics Co., Ltd.) - Modern Corporate CSS
   ========================================================================== */

:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-light: #e0f2fe;
  --success: #10b981;
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --transition: all 0.25s ease;
  --font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

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

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

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #ffffff;
}

.brand-logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  border-radius: var(--radius-sm);
}

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

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: #cbd5e1;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--primary-light);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 0.5rem 0;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  list-style: none;
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item a {
  display: block;
  padding: 0.6rem 1.2rem;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.dropdown-item a:hover {
  background-color: var(--accent);
  color: #ffffff;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0369a1 100%);
  color: #ffffff;
  padding: 4rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 80% 20%, rgba(2, 132, 199, 0.25) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-tag {
  display: inline-block;
  background: rgba(2, 132, 199, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
}

.hero-desc {
  font-size: 1.15rem;
  color: #94a3b8;
  max-width: 750px;
  margin: 0 auto 2rem auto;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
}

.btn-outline {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

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

/* ==========================================================================
   Main Layout & Containers
   ========================================================================== */

.main-content {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 4px;
  background: var(--accent);
  margin: 0.5rem auto 0 auto;
  border-radius: 2px;
}

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

/* ==========================================================================
   Brand Cards & Grid
   ========================================================================== */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.brand-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.brand-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
}

.brand-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  min-height: 60px;
}

.brand-card-logo {
  height: 48px;
  max-width: 180px;
  width: auto;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.brand-badge {
  background: var(--accent-light);
  color: var(--accent-hover);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 50px;
  text-transform: uppercase;
}

.brand-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.brand-card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  flex: 1;
}

.brand-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.tag {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Values & Features
   ========================================================================== */

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.value-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.value-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.value-icon {
  width: 60px;
  height: 60px;
  background: var(--accent-light);
  color: var(--accent-hover);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
  font-size: 1.5rem;
  font-weight: bold;
}

.value-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

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

/* ==========================================================================
   Page Headers (Subpages)
   ========================================================================== */

.page-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 3rem 1.5rem;
  text-align: center;
}

.page-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.page-breadcrumb {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  color: #94a3b8;
  font-size: 0.9rem;
}

.page-breadcrumb a {
  color: #cbd5e1;
}

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

/* ==========================================================================
   Product Detail Page & Specs Table
   ========================================================================== */

.filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  background: #f1f5f9;
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

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

.search-box {
  position: relative;
  min-width: 250px;
}

.search-input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border: 1px solid var(--border-color);
  border-radius: 50px;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Product Section Block */
.product-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.product-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 0.75rem;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.925rem;
}

.spec-table th, .spec-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.spec-table th {
  background-color: #f8fafc;
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}

.spec-table tbody tr:hover {
  background-color: #f1f5f9;
}

.spec-table .pn-code {
  font-weight: 700;
  color: var(--accent-hover);
  font-family: monospace, monospace;
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #dc2626;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  border: 1px solid #fecaca;
  text-decoration: none;
  transition: all 0.2s;
}

.pdf-link:hover {
  background: #dc2626;
  color: #ffffff;
}

.pdf-disabled,
.pdf-link.disabled {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.82rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  cursor: not-allowed;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.85;
}

/* ==========================================================================
   Contact Form & Info
   ========================================================================== */

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2.5rem;
}

.contact-info-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-info-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #38bdf8;
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.85rem;
  color: #94a3b8;
  display: block;
}

.contact-val {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
}

.contact-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

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

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background-color: var(--primary);
  color: #94a3b8;
  padding: 3rem 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.footer-brand {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

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

.footer-title {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

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

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

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Responsive Mobile Rules */
@media (max-width: 992px) {
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
  .footer-container {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  .nav-menu {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background: var(--primary-light);
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    gap: 0.5rem;
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav-menu.active {
    display: flex;
  }
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding-left: 1rem;
    display: none;
  }
  .nav-item.open .dropdown-menu {
    display: block;
  }
  .mobile-toggle {
    display: block;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .footer-container {
    grid-template-columns: 1fr;
  }
}
