/* ============================================
   昕恩科技 — 自訂樣式設計系統
   ============================================ */

/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700;900&display=swap');

/* Accessibility: Visible focus indicators for keyboard navigation */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

/* === CSS Variables === */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 150px;
}

:root {
  --color-primary: #1a1a2e;
  --color-primary-light: #2a2a4e;
  --color-accent: #c9a84c;
  --color-accent-hover: #b8962f;
  --color-surface: #fdfaf5;
  --color-surface-alt: #f7f2ea;
  /* Slightly deeper for better layering */
  --color-text: #2d2d2d;
  --color-text-light: #ffffff;
  --color-text-muted: #5a5a5a;
  --color-border: #e8e0d5;
  --color-success: #27ae60;
  --color-error: #e74c3c;
  --font-family: 'Noto Sans TC', sans-serif;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .04);
  --shadow-md: 0 8px 24px rgba(26, 26, 46, .06);
  --shadow-lg: 0 16px 48px rgba(26, 26, 46, .1);
  --shadow-xl: 0 24px 64px rgba(26, 26, 46, .15);
  --shadow-xl: 0 24px 64px rgba(26, 26, 46, .15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --transition: all .4s cubic-bezier(.4, 0, .2, 1);
}

/* === Utility Classes === */
.mb-1 {
  margin-bottom: 0.5rem !important;
}

.mb-2 {
  margin-bottom: 1rem !important;
}

.mb-3 {
  margin-bottom: 1.5rem !important;
}

.mb-4 {
  margin-bottom: 2rem !important;
}

.mb-6 {
  margin-bottom: 3rem !important;
}

.mt-2 {
  margin-top: 1rem !important;
}

.mt-4 {
  margin-top: 2rem !important;
}

.w-full {
  width: 100% !important;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* === Base Reset === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-text-light);
  margin: 0;
  line-height: 1.7;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: rgba(138, 132, 63, 0.825);
}

/* === Focus Indicators (A11y) === */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.2);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Root Layout Wrapper for Mobile Stability */
.site-wrapper {
  overflow-x: clip; /* Fix for position:sticky on iOS Safari */
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* === Animations === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Navigation === */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(253, 250, 245, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}


.main-nav.scrolled {
  background: rgba(253, 250, 245, .98);
  box-shadow: var(--shadow-lg);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  min-height: 78px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: .5px;
}

.nav-logo-img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
  align-items: center;
}

.nav-item {
  position: relative;
}

.nav-links a {
  color: var(--color-text-muted);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Dropdown specific styles */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #ffffff;
  min-width: 220px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(26, 26, 46, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.1);
  padding: 0.75rem 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
}

.nav-item.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  display: block !important;
  color: var(--color-text) !important;
  padding: 0.8rem 1.5rem !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  background: transparent !important;
  border-radius: 0 !important;
  transition: all 0.2s ease !important;
}

.dropdown-menu a:hover {
  color: var(--color-accent) !important;
  background: rgba(201, 168, 76, 0.05) !important;
  padding-left: 1.8rem !important;
}

.dropdown-arrow {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
  opacity: 0.6;
}

.nav-item.dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-accent);
  background: rgba(201, 168, 76, .1);
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  z-index: 1001;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition);
  border-radius: 2px;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(253, 250, 245, .98);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  padding: 2rem;
  z-index: 999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.open {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  animation: fadeIn .3s ease;
}

.mobile-menu a {
  color: var(--color-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 500;
  border: 1px solid rgba(0, 0, 0, .05);
  transition: var(--transition);
}

.mobile-menu a:hover,
.mobile-menu a.active {
  background: rgba(201, 168, 76, .15);
  color: var(--color-accent);
  border-color: rgba(201, 168, 76, .3);
}

/* Mobile Dropdowns */
.mobile-nav-item {
  display: flex !important;
  flex-direction: column !important;
}

.mobile-dropdown-toggle {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.mobile-submenu {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  display: flex; /* Always flex but hidden by height */
  flex-direction: column;
  padding-left: 1.5rem;
  margin-top: 0;
  margin-bottom: 0;
  background: rgba(201, 168, 76, 0.03);
  border-radius: var(--radius-md);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none; /* Disable clicks when closed */
}

.mobile-nav-item.open .mobile-submenu {
  max-height: 500px; /* Large enough for content */
  opacity: 1;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  pointer-events: auto;
}

.mobile-nav-item.open .mobile-dropdown-toggle i {
  transform: rotate(180deg);
  color: var(--color-accent);
}

#personSubCertsTrigger {
  width: 280px;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(135deg, var(--color-accent), #dbbc6a);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.3);
}

#personSubCertsTrigger:hover {
  filter: brightness(1.1);
}

.mobile-submenu a {
  font-size: 0.95rem !important;
  padding: 0.75rem 1.25rem !important;
  border: none !important;
  border-left: 2px solid rgba(201, 168, 76, 0.2) !important;
  border-radius: 0 !important;
}

.mobile-submenu a:hover {
  border-left-color: var(--color-accent) !important;
  background: transparent !important;
}

/* === Hero Section === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: radial-gradient(circle at top right, #fff, var(--color-surface));
  overflow: hidden;
  padding-top: 72px;
  padding-left: 5%;
  padding-right: 5%;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
}

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 168, 76, .02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 168, 76, .02) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: .3;
}

/* === Hero Two Column Layout === */
.hero-container {
  display: grid;
  grid-template-columns: 1fr;
  /* Mobile default */
  align-items: center;
  padding-top: 2rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  gap: 2rem;
  z-index: 2;
  position: relative;
}

@media (min-width: 992px) {
  .hero-container {
    grid-template-columns: 1fr 1.3fr;
    /* Image even wider */
    gap: 6rem;
  }
}

@media (max-width: 991px) {
  .hero-container {
    gap: 3rem;
    padding-top: 1rem;
    grid-template-columns: 1fr;
  }
}

.hero-right-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

@media (min-width: 992px) {
  .hero-right-col {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-top: 1rem;
    animation: fadeInUp 1s ease forwards;
  }
}

/* === Hero Slider Wrapper === */
.hero-slider-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  /* Fill the grid column */
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 16 / 10;
  /* Wider and flatter than 5:4 */
  border-radius: 16px;
  overflow: visible;
  margin-bottom: 1.5rem;
}

.hero-slide {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 4px solid rgba(255, 255, 255, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-slide .hero-slider-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* === Hero Nav Arrows (centered on image) === */
.hero-nav-btn {
  display: none;
  /* 手機版隱藏 */
}

@media (min-width: 992px) {
  .hero-nav-btn {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(201, 168, 76, 0.25);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    color: var(--color-primary);
    font-size: 1.2rem;
    z-index: 10;
    transition: var(--transition);
  }

  .hero-nav-btn:hover {
    background: var(--color-accent);
    color: #fff;
    box-shadow: var(--shadow-lg);
  }

  .hero-prev {
    left: -50px;
  }

  .hero-next {
    right: -50px;
  }
}

/* === Hero Action Buttons === */
.hero-action-btns {
  display: flex;
  justify-content: center;
}

.hero-action-btns .hero-action {
  display: none;
}

.hero-action-btns .hero-action.active {
  display: inline-flex;
}

.hero-slider-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-scan-btn {
  font-size: 1.1rem !important;
  padding: 0.8rem 2rem !important;
  min-width: 210px;
  justify-content: center;
  border-width: 2px !important;
  background: rgba(253, 250, 245, 0.9) !important;
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.2);
  color: var(--color-accent-hover) !important;
  border-color: var(--color-accent) !important;
  text-decoration: none;
  font-weight: 700;
  border-radius: 50px;
}

.hero-scan-btn:hover {
  background: rgba(201, 168, 76, 0.15) !important;
  transform: translateY(-2px);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: left;
  padding: 2rem 0;
  /* Remove horizontal padding since it is restricted by grid */
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(201, 168, 76, .15);
  border: 1px solid rgba(201, 168, 76, .3);
  color: var(--color-accent);
  padding: .5rem 1.25rem;
  border-radius: 50px;
  font-size: 14.5px;
  font-weight: 500;
  margin-bottom: 2rem;
  animation: fadeInUp .8s ease;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1.2;
  margin: 0 0 1.5rem;
  animation: fadeInUp .8s ease .2s both;
}

.hero h1 .accent {
  color: var(--color-accent);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.8;
  animation: fadeInUp .8s ease .4s both;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  animation: fadeInUp .8s ease .6s both;
}

.hero-buttons .btn {
  min-width: 160px;
  justify-content: center;
}

@media (max-width: 991px) {
  .hero-content {
    padding: 1rem 1.5rem !important;
  }

  .hero-badge {
    margin-bottom: 1rem !important;
  }

  .hero h1 {
    margin-bottom: 1rem !important;
  }

  .hero-subtitle {
    margin-bottom: 1.5rem !important;
  }
}

.btn {
  padding: .875rem 2rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
}

.btn-primary {
  background: #d9c485;
  color: #705128;
  box-shadow: 0 8px 24px rgba(158, 133, 63, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);

}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid rgba(26, 26, 46, .15);

}

.btn-outline:hover {
  border-color: rgba(26, 26, 46, .15);
  color: var(--color-accent);
  background: rgba(201, 168, 76, .05);
  transform: translateY(-2px);
}

/* === Stats Bar === */
.stats-bar {
  background: transparent;
  /* 改為透明，避免產生明顯的色塊邊界 */
  padding: 4rem 1.5rem;
  /* 增加內部間距，讓排版有呼吸感 */
  margin-top: 0;
  /* 移除外部間距，消除「脫離感」 */
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-top: 1px solid rgba(26, 26, 46, 0.05);
  /* 保留這條極淡的線 */
}

.stats-bar::before {
  display: none;
}

.stats-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
}

.stat-label {
  font-size: 16px;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: .5rem;
}

/* === Sections === */
.section {
  padding: 3rem 1.5rem;
}

.section-dark {
  background: #242424;
  /* Adjusted from pure midnight to a deep gray */
  color: var(--color-text-light);
}

.section-light {
  background: #fffcf7;
  /* Purest surface */
}

.section-alt {
  background: rgb(220 204 162 / 47%);
  /* Clearer gray contrast for alternating sections */
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  margin: 0 0 1rem;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: .75rem auto 0;
  border-radius: 2px;
}

.section-header p {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.section-dark .section-header p {
  color: rgba(255, 255, 255, .6);
}

#services {
  padding-bottom: 1rem;
}

#brands {
  padding-top: 1rem;
}

#timeline {
  padding-top: 3rem;
  padding-bottom: 3.5rem;
}

/* === Timeline === */
.timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  padding-left: 2.5rem;
  text-align: left;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-accent);
  border-radius: 2px;
  opacity: 0.3;
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: .9rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-surface-alt);
  transform: translateX(-5.5px);
}

.timeline-year {
  color: #a97c00;
  font-weight: 700;
  font-size: 25px;
  margin-bottom: .25rem;
}

.timeline-title {
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: .25rem;
}

.timeline-desc {
  color: var(--color-text-muted);
  font-size: 17px;
}

/* === Services Grid === */
.services-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.service-card {
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  border: 1px solid rgba(201, 168, 76, 0.2);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

@media (max-width: 1023px) {
  .service-card {
    grid-template-columns: 1fr;
    padding: 2.25rem 2rem;
  }
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent), #dbbc6a);
  transform: scaleX(0);
  transition: transform 0.4s ease;
  transform-origin: left;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(184, 160, 74, 0.15);
  border-color: var(--color-accent);
  background: #fff;
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  width: 56px;
  height: 56px;
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  border: 1px solid var(--color-border);
  transition: var(--transition);
  color: var(--color-accent);
}

.service-icon i,
.service-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-card:hover .service-icon {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 .75rem;
  color: var(--color-primary);
}

.service-card p {
  color: var(--color-text-muted);
  font-size: 16.5px;
  line-height: 1.7;
  margin: 0 0 1.5rem;
  flex-grow: 1;
}

.service-card .btn {
  display: block;
  width: max-content;
  margin-left: auto;
}

/* === Brands === */
#brands {
  padding-top: 40px !important;
  scroll-margin-top: 120px;
}

#brands {
  background-color: #FDFBF7;
  padding-top: 4rem;
  padding-bottom: 4rem;
  overflow-anchor: none; /* Prevent scroll jumps during category switching */
}

#brands .section-header {
  margin-bottom: 1rem;
}

/* Responsive utility classes */
.mobile-only {
  display: none;
}
.desktop-only {
  display: flex;
}
@media (max-width: 1023px) {
  .mobile-only {
    display: block;
  }
  .desktop-only {
    display: none !important;
  }
}

.brands-section {
  overflow: hidden;
}

/* --- Desktop Layout (Pager) --- */
.brands-pager-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  padding: 0 60px; /* Space for the arrows */
}

.brands-pager-container {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.brands-page {
  min-width: 100%;
  flex-shrink: 0;
  display: flex !important;
  flex-direction: column;
  gap: 0;
  padding: 0 1rem;
}

.brand-category {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  background: transparent;
  padding: 0 0 0.5rem 0;
  margin-bottom: 0.5rem;
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08); /* Faint line between categories */
}

.brand-category:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.category-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
  padding-bottom: 0;
  border-bottom: none;
  text-align: left;
}

.brand-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}

.brand-item {
  width: 160px;
  height: 55px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem; /* Reduced from 0.5rem to make logos larger */
}

[data-category="privilege"] .brand-item {
  padding: 0;
  overflow: hidden;
}

[data-category="privilege"] .brand-item img:not(.logo-v-small) {
  transform: scale(1.3);
}

[data-category="privilege"] .brand-item img.logo-v-small {
  transform: scale(1.1);
}

[data-category="assets"] .brand-item:nth-child(n+2) {
  padding: 0;
  overflow: hidden;
}

[data-category="assets"] .brand-item:nth-child(n+2) img {
  transform: scale(1.15);
}

.brand-item img {
  max-width: 95%; /* Increased from 90% */
  max-height: 95%; /* Increased from 90% */
  object-fit: contain;
}

.logo-v-small {
  max-width: 75% !important;
  max-height: 75% !important;
}

/* --- Mobile Layout (Tabs) --- */
@media (max-width: 1023px) {
  .brands-tabs-wrapper {
    margin: 0 -1rem 1.5rem;
    padding: 0 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .brands-tabs-nav {
    display: flex;
    gap: 0.75rem;
    width: max-content;
    padding: 0.5rem 0;
  }

  .brand-tab-btn {
    padding: 0.6rem 1.25rem;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-text-muted);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-tap-highlight-color: transparent;
  }

  .brand-tab-btn.active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(184, 153, 94, 0.2);
  }

  .brands-pager-container {
    display: block !important;
    transform: none !important;
    min-height: 260px;
  }

  .brands-page {
    display: contents;
  }

  .brand-category {
    display: none; /* Controlled by JS */
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
  }

  .brand-category.active {
    display: flex;
    animation: fadeIn 0.4s ease forwards;
  }

  .brand-category:hover {
    transform: none;
    box-shadow: none;
  }

  .category-title {
    display: none; /* Tabs serve as titles */
  }

  .brand-item {
    width: calc(50% - 0.5rem);
    height: 60px;
  }

  [data-category="privilege"] .brand-item {
    padding: 0;
    overflow: hidden;
  }

  [data-category="privilege"] .brand-item img:not(.logo-v-small) {
    transform: scale(1.3);
  }

  [data-category="privilege"] .brand-item img.logo-v-small {
    transform: scale(1.1);
  }

  [data-category="assets"] .brand-item:nth-child(n+2) {
    padding: 0;
    overflow: hidden;
  }

  [data-category="assets"] .brand-item:nth-child(n+2) img {
    transform: scale(1.15);
  }
}

/* --- Pager Controls --- */
.brands-pager-controls {
  position: static; /* Let buttons reference the relative wrapper */
}

.brands-p-btn {
  background: #fff;
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

#brandsPagePrev {
  left: 0;
}

#brandsPageNext {
  right: 0;
}

.brands-p-btn:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  transform: translateY(-50%) scale(1.05);
}

.brands-pager-dots {
  display: none;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: var(--color-accent);
  transform: scale(1.3);
}

.pager-btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

@media (max-width: 767px) {

  .pager-btn,
  .brands-pager-nav {
    display: none !important;
    /* Hide only on mobile */
  }
}

.pager-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* === Brand Slider === */
.brand-slider-container {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  margin: 0 -1rem;
  padding: 0 1rem 1rem;
  scrollbar-width: none;
}

.brand-slider-container::-webkit-scrollbar {
  display: none;
}

.brand-slider-container .brand-list {
  flex-wrap: nowrap;
  width: max-content;
  display: flex;
  gap: 1rem;
}

.brand-slider-container .brand-tag {
  scroll-snap-align: center;
}

.brand-slider-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: -0.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  transition: var(--transition);
}

.dot.active {
  background: var(--color-accent);
  width: 20px;
  border-radius: 4px;
}

/* === Image Styles === */
.cert-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cert-img-zoom {
  transform: scale(1.1);
}

.map-img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.brand-tag {
  background: var(--color-text-light);
  border: 1px solid var(--color-border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 60px;
  flex: 0 0 auto;
}

.brand-tag img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: var(--transition);
}

@media (max-width: 767px) {
  .brand-tag {
    width: 160px;
    /* Slightly wider for mobile */
    height: 70px;
    padding: 10px;
    scroll-snap-align: start;
    /* Standard snap position */
  }

  .brand-tag img {
    height: 35px !important;
    /* Normalize logo visual weight */
    width: auto !important;
  }
}

.brand-tag img.brand-hpe {
  transform: none;
  /* Removed manual scaling to maintain uniformity */
}

/* Specific scaling and hover effects removed as per user request */

/* === Tabs === */
.tabs-container {
  max-width: 1000px;
  margin: 0 auto;
}

.tabs-nav {
  display: flex;
  flex-wrap: nowrap;
  /* Prevent wrapping by default */
  overflow-x: auto;
  gap: .5rem;
  margin-bottom: 2rem;
  padding-bottom: .5rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  /* Ensure it doesn't stretch parent */
}

/* Centered tabs on desktop, scrolling on mobile */
.tabs-nav-centered {
  justify-content: center;
}

@media (max-width: 767px) {
  .tabs-nav-centered {
    justify-content: flex-start;
  }
}

.tab-btn {
  flex: 0 0 auto;
  /* Prevent button from shrinking in flex container */
  padding: .75rem 1.5rem;
  background: #fff;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  font-family: inherit;
  
  /* Improve swipe experience on touch devices */
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn:hover {
  background: rgba(201, 168, 76, .15);
  color: #fff;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--color-accent), #dbbc6a);
  color: #fff;
  border-color: var(--color-accent);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.2);
}

/* Light theme tabs */
.tabs-light .tab-btn {
  background: var(--color-text-light);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.tabs-light .tab-btn:hover {
  background: rgba(201, 168, 76, .1);
  color: var(--color-accent-hover);
}

.tabs-light .tab-btn.active {
  background: linear-gradient(135deg, var(--color-accent), #dbbc6a);
  color: #fff;
  border-color: var(--color-accent);
}

.tab-panel {
  display: none;
  animation: fadeIn .4s ease;
}

.tab-panel.active {
  display: block;
}

.fixed-height-tabs {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  /* CRITICAL: Prevent content from stretching grid */
  width: 100%;
}

.fixed-height-tabs>.tab-panel {
  grid-area: 1 / 1;
  display: block !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.fixed-height-tabs>.tab-panel.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.tab-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 2.5rem;
  box-shadow: var(--shadow-sm);
}

/* === Concerns Redesign === */
#concerns {
  background-color: #f2ece1;
  padding: 4.5rem 1.5rem;
}

#concerns .section-header {
  margin-bottom: 2rem;
}

#concerns .section-header h2 {
  font-weight: 800;
  margin-bottom: 1rem;
}

#concerns .section-header p {
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: 0;
}


#concerns .tabs-nav {
  margin-bottom: 2rem;
}

#concerns .concern-card {
  background: #fff;
  border-radius: 20px;
  padding: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  max-width: 920px;
  margin: 0 auto;
  border: 1px solid var(--color-border);
}


#concerns .concern-title {
  color: var(--color-accent);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.01em;
}

#concerns .concern-intro {
  color: var(--color-text);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0 0 0.75rem 0;
  font-weight: 400;
}

#concerns .suggestion-title {
  color: var(--color-accent);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem 0;
}

#concerns .suggestion-text {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 400;
  margin: 0;
}

.concern-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--color-border);
  gap: 1rem;
}

.footer-note {
  font-size: 0.9rem;
  color: var(--color-primary);
  font-weight: 500;
  line-height: 1.4;
  opacity: 0.85;
}

.concern-footer .btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

@media (max-width: 767px) {
  .concern-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
  
  .concern-footer .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1.5rem;
  }
}

@media (max-width: 991px) {
  #concerns .tabs-nav {
    width: 100%;
    border-radius: 15px;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0.4rem;
  }
  
  #concerns .tab-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
  }
  
  #concerns .concern-card {
    padding: 2.5rem 1.5rem;
    min-height: 480px;
    display: flex;
    flex-direction: column;
  }
  
  #concerns .concern-content {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  #concerns .concern-footer {
    margin-top: auto;
  }
}


/* Fix excessive mobile gap in fixed-height-tabs */
@media (max-width: 767px) {
  .fixed-height-tabs {
    display: block !important;
  }

  .fixed-height-tabs>.tab-panel {
    display: none !important;
    /* Hide inactive tabs to reclaim space */
    grid-area: auto !important;
    position: static !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
  }

  .fixed-height-tabs>.tab-panel.active {
    display: block !important;
    /* show only active tab */
    animation: fadeIn 0.4s ease;
  }

  /* Specific fixed height for Personnel Certificates to avoid jumping */
  .cert-fixed-height-tabs {
    min-height: 480px;
  }
}

@media (max-width: 767px) {
  .tab-card {
    padding: 1.25rem;
  }
}

.tab-card h3 {
  color: var(--color-accent);
  font-size: 1.2rem;
  margin: 0 0 .75rem;
}

.tab-card p {
  color: var(--color-text-muted);
  line-height: 1.8;
  margin: 0;
}

.cert-list-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}

@media (max-width: 767px) {
  .cert-list-grid {
    grid-template-columns: 1fr;
  }
}

.data-table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  font-size: 16px;
}

.data-table thead th {
  background: #caba8d;
  color: #605020;
  padding: .875rem 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .5px;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(245, 240, 232, .5);
}

.data-table tbody tr:hover {
  background: rgba(201, 168, 76, .08);
}

.price {
  font-weight: 600;
  color: var(--color-accent-hover);
  text-align: center;
}

.loading-text {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  background: #fff;
}

.hardware-scroll-container {
  max-height: 600px;
  overflow-y: auto;
  position: relative;
}

/* Ensure sticky header works inside scroll container */
.hardware-scroll-container .data-table thead th {
  top: 0;
}

/* === Contact Form === */
.contact-section {
  background: #fef5e7;
  color: #000000;
}

.contact-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

.contact-info {
  order: 2;
}

.contact-info h3 {
  font-size: 1.5rem;
  color: #000000;
  margin: 0 0 1rem;
}

.contact-info-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.contact-info-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: #fffcf7;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-border);
  color: #000000;
  transition: var(--transition);
}

.contact-info-icon i,
.contact-info-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5px;
}

.contact-info-text strong {
  display: block;
  font-size: .85rem;
  color: #000000;
  margin-bottom: .15rem;
}

.contact-info-text span,
.contact-info-text address,
.contact-info-text a {
  font-weight: 500;
  color: #000000;
}

.contact-section .section-header h2 {
  color: #000000;
}

.contact-map {
  margin-top: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.contact-map iframe {
  display: block;
  width: 100%;
}

.contact-form {
  background: var(--color-text-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  order: 1;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 1.5rem;
  }
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  margin-bottom: .4rem;
}

.form-group label .required {
  color: var(--color-error);
  margin-left: .25rem;
}

.form-input {
  width: 100%;
  padding: .75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  transition: var(--transition);
  background: #fffff7;
  color: #000000;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, .15);
  background: var(--color-text-light);
}

.form-input.error {
  border-color: var(--color-error);
}

.form-error {
  font-size: .8rem;
  color: var(--color-error);
  margin-top: .25rem;
  display: none;
}

.form-input.error+.form-error {
  display: block;
}

textarea.form-input {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  width: 100%;
  padding: 1rem;
  background: #f8df84;
  color: var(--color-primary);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.form-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(230, 200, 94, 0.4);
}

.form-submit:disabled {
  opacity: .7;
  cursor: not-allowed;
  transform: none;
}

/* Privacy Statement */
.privacy-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-accent);
  text-decoration: underline;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  cursor: pointer;
  display: inline;
  transition: color 0.3s ease;
}

.privacy-toggle-btn:hover {
  color: var(--color-accent-hover);
}

/* Privacy Modal */
.privacy-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 1.5rem;
}

.privacy-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.privacy-modal-container {
  background: var(--color-text-light);
  width: 100%;
  max-width: 650px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  transform: translateY(30px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.privacy-modal-overlay.active .privacy-modal-container {
  transform: translateY(0);
}

.privacy-modal-header {
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.privacy-modal-header h4 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--color-primary);
  font-weight: 700;
}

.privacy-modal-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: var(--color-text-muted);
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.privacy-modal-close:hover {
  color: var(--color-error);
}

.privacy-modal-content {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  text-align: justify;
}

.privacy-list {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  list-style: disc;
}

.privacy-list li {
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.privacy-list li .highlight {
  font-weight: 700;
  color: var(--color-text);
}

.privacy-warning {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(231, 76, 60, 0.05);
  border-left: 4px solid var(--color-error);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.privacy-warning .highlight-warn {
  font-weight: 700;
  color: var(--color-error);
}

.privacy-check {
  display: flex !important;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem !important;
}

.privacy-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 0.2rem;
  cursor: pointer;
  flex-shrink: 0;
}

.privacy-check label {
  font-size: 0.95rem;
  color: var(--color-text);
  cursor: pointer;
  line-height: 1.5;
  font-weight: 500 !important;
  margin-bottom: 0 !important;
}

.form-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  display: none;
  text-align: center;
}

.form-message.success {
  background: rgba(39, 174, 96, .1);
  color: var(--color-success);
  border: 1px solid rgba(39, 174, 96, .2);
  display: block;
}

.form-message.error {
  background: rgba(231, 76, 60, .1);
  color: var(--color-error);
  border: 1px solid rgba(231, 76, 60, .2);
  display: block;
}

/* === Footer === */
.main-footer {
  background: #ffffff;
  /* Distinct but harmonious color for footer */
  color: var(--color-text);
  padding: 3.5rem 1.5rem 2.5rem;
  /* Reduced padding for compactness */
  border-top: 1px solid var(--color-border);
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
  /* Reduced margin */
}

.footer-brand h3 {
  font-size: 1.25rem;
  margin: 0 0 .75rem;
  color: var(--color-primary);
}

.footer-brand p {
  color: var(--color-text-muted);
  font-size: .95rem;
  line-height: 1.7;
}

.footer-links h4 {
  color: var(--color-accent);
  font-size: 20px;
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin-bottom: .5rem;
}

.footer-links a {
  color: var(--color-text-muted);
  font-size: .95rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--color-accent);
}

.footer-contact-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  color: var(--color-text-muted);
  font-size: .95rem;
}

.footer-contact-item .icon {
  color: var(--color-accent);
  min-width: 20px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  /* Softer divider */
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

/* === Page Header (Sub-pages) === */
.page-header {
  background: var(--color-surface-alt);
  padding: 8rem 1.5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

.page-header::before {
  display: none;
}

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--color-primary);
  margin: 0 0 1rem;
  position: relative;
}

.page-header p {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

/* === Case Studies === */
.case-card {
  background: var(--color-text-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: var(--transition);
}

.case-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.case-card-header {
  background: var(--color-primary);
  padding: 1.5rem;
}

.case-card-header h3 {
  color: var(--color-accent);
  font-size: 1.1rem;
  margin: 0 0 .25rem;
}

.case-card-header span {
  color: rgba(255, 255, 255, .5);
  font-size: .85rem;
}

.case-card-body {
  padding: 1.5rem;
}

.case-card-body p {
  color: var(--color-text-muted);
  font-size: .9rem;
  line-height: 1.7;
  margin: 0;
}

/* === Security / ISO Section === */
.iso-badge {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: rgba(201, 168, 76, .1);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2.5rem;
  margin-bottom: 2rem;
}

.iso-badge-icon {
  font-size: 2.5rem;
}

.iso-badge-text {
  text-align: left;
}

.iso-badge-text strong {
  display: block;
  font-size: 1.2rem;
  color: var(--color-primary);
}

.iso-badge-text span {
  color: var(--color-text-muted);
  font-size: .9rem;
}

.policy-list {
  max-width: 800px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
}

.policy-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: var(--color-text-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}

.policy-item:hover {
  border-color: rgba(201, 168, 76, .3);
  box-shadow: var(--shadow-sm);
}

.policy-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--color-surface-alt);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: 1px solid var(--color-border);
}

.policy-item p {
  margin: 0;
  color: var(--color-text);
  font-size: .95rem;
  line-height: 1.7;
}

/* === Contract Info Card === */
.contract-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contract-info-left {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}


.contract-info-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(201, 168, 76, .1);
  border: 1px solid rgba(201, 168, 76, .2);
  padding: .5rem 1.2rem;
  border-radius: 50px;
  font-size: 17px;
  font-weight: 500;
  color: var(--color-accent-hover);
}

/* === Global Procurement Search === */
.global-search-section {
  display: none;
}


.search-box-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.procurement-search-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  width: 100%;
}

.procurement-search-container .search-results-summary {
  margin: 0;
  text-align: left;
}

.global-search-input {
  width: 280px;
  height: 45px;
  padding: .55rem .9rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: .9rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--color-surface-alt);
  color: var(--color-primary);
}

.global-search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-text-light);
  box-shadow: 0 0 0 2px rgba(201, 168, 76, .15);
}

.search-icon {
  display: none;
}

.search-results-summary {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  animation: fadeIn 0.4s ease;
  display: none;
}

.search-results-summary.active {
  display: block;
}


.results-found-msg {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  font-weight: 500;
}

.search-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.search-summary-pill {
  background: var(--color-surface-alt);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-summary-pill:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.search-summary-pill .match-count {
  background: rgba(201, 168, 76, 0.15);
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  color: var(--color-accent-hover);
}

.search-summary-pill:hover .match-count {
  background: rgba(0, 0, 0, 0.15);
  color: #fff;
}

.no-results-msg {
  color: var(--color-error);
  font-weight: 500;
  text-align: center;
}

/* === Responsive === */
@media (max-width: 639px) {
  .hero {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    justify-content: center;
  }
}

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 1.5fr;
    gap: 7rem;
  }
  
  .contact-info,
  .contact-form {
    order: 0;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}}

@media (max-width: 1023px) {
  .main-nav {
    height: 70px !important;
    min-height: 70px !important;
  }
  
  .nav-container {
    height: 70px !important;
    min-height: 70px !important;
    padding: 0 1rem;
  }
  
  .nav-logo-img {
    height: 44px !important;
  }
}

@media (min-width: 1024px) {
  .nav-container {
    max-width: 1600px;
    padding-right: 0;
  }

  .nav-links {
    display: flex;
    margin-left: auto;
  }

  .hamburger {
    display: none;
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* === Utility === */
.text-center {
  text-align: center !important;
}

.text-right {
  text-align: right !important;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* === Services Categories === */
.category-header {
  width: 100%;
  background-color: var(--color-surface);
  padding: 0;
  margin: 0;
  position: relative;
  display: block;
  scroll-margin-top: 135px; /* 桌機版位移 */
}

.category-header h2 {
  max-width: 1040px;
  /* Aligned with slider content width (1200 - 10rem padding) */
  width: calc(100% - 10rem);
  margin: 0 auto;
  padding: 1.5rem 0;
  /* Vertical padding restored, no horiz padding needed since fixed width */
  background: #cfb89f75;
  /* The actual beige bar */
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #756464;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1.5rem;
}

@media (max-width: 991px) {
  .category-header {
    scroll-margin-top: 180px; /* 手機版位移 (兩層黏性選單) */
  }

  .category-header h2 {
    width: calc(100% - 2rem);
    font-size: 1.75rem;
    padding: 1rem 0;
    border-radius: 20px;
    margin-bottom: 1.5rem;
  }
}

.category-header h2::before {
  content: attr(data-index);
  font-family: serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-accent);
  opacity: 0.9;
}

/* === Services Carousel Section === */
.slider-section {
  padding: 0 0 3rem 0;
  background-color: var(--color-surface);
  position: relative;
  overflow: visible;
}

.slider-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  padding: 0 5rem;
}

.slider-track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2rem;
  -webkit-overflow-scrolling: touch;
}

.slider-track::-webkit-scrollbar {
  display: none;
}

.slider-card {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  transition: var(--transition);
  position: relative;
}



@media (min-width: 992px) {
  .slider-card:not(.instructor-section-bg) {
    display: grid;
    grid-template-columns: 330px 1fr;
    /* Slimmer title column */
    gap: 2rem;
    padding: 3rem 4rem;
    /* Reduced top/bottom padding */
    align-items: start;
    min-height: 380px;
    /* Reduced min-height */
    background: #fff;
    border-radius: 2px;
    border: 1px solid rgba(201, 168, 76, 0.1);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
  }
}

/* Background Image as a subtle editorial element */
.card-bg-image {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 45%;
  opacity: 0.08;
  /* Even more subtle for 'calm' */
  background-size: cover;
  background-position: center right;
  z-index: 0;
  filter: grayscale(1) contrast(0.8);
  mask-image: linear-gradient(to right, transparent, black);
  -webkit-mask-image: linear-gradient(to right, transparent, black);
  pointer-events: none;
}

/* Hide old slider-image div used as a side-bar */
.slider-image {
  display: none !important;
}

.card-title-col {
  z-index: 1;
  border-left: 2px solid var(--color-accent);
  padding-left: 2rem;
  /* Reduced padding */
  padding-top: 0.5rem;
}

.card-title-col::before {
  content: attr(data-case);
  display: block;
  font-family: serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

@media (min-width: 992px) {
  .case-title-flex {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
  }
}

.card-title-col h2 {
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--color-primary);
  margin: 0;
  margin-bottom: 0.75rem;
  white-space: nowrap;
}

@media (max-width: 991px) {
  .card-title-col h2 {
    white-space: normal;
    font-size: 1.5rem;
  }
}

.card-title-col .subtitle {
  font-size: 1.15rem;
  color: var(--color-accent);
  font-weight: 500;
  line-height: 1.5;
  opacity: 0.85;
}

.tech-tags {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tech-tag {
  font-size: 0.85rem;
  color: var(--color-accent-hover);
  background: rgba(201, 168, 76, 0.08);
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  border: 1px solid rgba(201, 168, 76, 0.2);
  font-weight: 500;
  transition: var(--transition);
  cursor: default;
}

.tech-tag:hover {
  background: rgba(201, 168, 76, 0.15);
  transform: translateY(-2px);
}

.card-content-col {
  z-index: 1;
  padding-left: 1rem;
}

/* Replaced by .card-bg-image logic above */

@media (max-width: 991px) {
  .slider-card {
    padding: 2rem 1.25rem;
    gap: 1.5rem;
    border-radius: 15px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    flex: 0 0 calc(100vw - 2rem);
    max-width: calc(100vw - 2rem);
    overflow: hidden;
  }

  .scroll-indicator-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
  }
  
  .scroll-indicator {
    display: flex;
    gap: 0.5rem;
  }
  
  .scroll-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s ease;
  }
  
  .scroll-dot.active {
    background: var(--color-accent);
    width: 18px;
    border-radius: 3px;
  }

  .slider-section {
    padding-bottom: 1rem !important;
  }

  .slider-container {
    padding: 0 1rem !important;
  }

  .slider-track {
    align-items: flex-start;
    padding-bottom: 0 !important;
  }

  .slider-btn {
    display: none;
  }

  .slider-image {
    display: none;
  }

  .slider-content {
    padding: 1.5rem 1.5rem;
    justify-content: flex-start !important;
  }

  .section {
    padding-top: 1.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .instructor-section-content {
    padding: 1.5rem 1rem !important;
    align-items: center !important;
  }

  .instructor-grid {
    margin-top: 0.5rem !important;
    gap: 1rem !important;
  }

  .slider-info-box {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  .slider-check-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .slider-content h2 {
    font-size: 1.6rem;
  }

  .slider-content .subtitle {
    margin-bottom: 1rem;
  }

  .slider-image::after {
    background: rgba(255, 255, 255, 0.4);
  }
}

.slider-content {
  flex: 1;
  padding: 0;
  display: block;
  /* Content col handles spacing */
}

.slider-content h2 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
  color: var(--color-primary);
}

.slider-content .subtitle {
  font-size: 18px;
  color: var(--color-accent);
  margin-bottom: 1rem;
  font-weight: 500;
}

.slider-info-box {
  background: #fdfaf5;
  padding: 1.5rem 2rem;
  border-radius: 2px;
  margin-bottom: 1.5rem;
  position: relative;
  border-top: 2px solid rgba(0, 0, 0, 0.03);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.01);
}

.slider-info-box:last-child {
  margin-bottom: 0;
}

.slider-info-box .info-header {
  display: flex;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  color: #b8a04a;
  margin-bottom: 0.5rem;
}

.slider-info-box .info-header i {
  margin-right: 0.5rem;
  font-size: 1.25rem;
  font-style: normal;
}

.slider-info-box p {
  color: #191919;
  line-height: 1.6;
  font-size: 16px;
  margin: 0;
}

.slider-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.slider-check-item {
  display: flex;
  align-items: center;
  color: var(--color-text);
  font-size: 17px;
}

.slider-check-box {
  width: 16px;
  height: 16px;
  background-color: var(--color-accent);
  border-radius: 3px;
  margin-right: 0.75rem;
  display: inline-block;
}

/* === Instructor Grid === */
.instructor-section-content {
  padding: 1.5rem 2rem 2.5rem;
  align-items: center;
}

.instructor-section-bg {
  background-color: #fff;
  position: relative;
  flex: 0 0 100%; /* Default mobile and desktop (unified) */
}

@media (min-width: 992px) {
  .instructor-slide-page-2 {
    display: none !important; /* Hide second slide on desktop */
  }
}

.instructor-overlay {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1497366216548-37526070297c?auto=format&fit=crop&q=80&w=1200');
  background-size: cover;
  background-position: center;
  opacity: 0.08;
  filter: grayscale(1) contrast(0.8);
  z-index: 0;
  pointer-events: none;
}

.instructor-section-content {
  flex: 1;
  z-index: 1;
}

.instructor-title-main {
  text-align: center;
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.instructor-subtitle {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--color-accent);
}

@media (min-width: 992px) {
  .u-desktop-hide {
    display: none !important;
  }
}

.instructor-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.instructor-header-area {
  min-height: 110px; /* Fixed height for alignment */
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  position: relative;
  z-index: 10;
}

@media (min-width: 992px) {
  .instructor-title-wrapper {
    width: 100%; /* Normal width on desktop unified card */
  }
  
  .instructor-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
  }
}

/* Hide 3rd and 4th teacher on mobile for Slide 1 */
@media (max-width: 991px) {
  .instructor-slide-page-1 .instructor-card:nth-child(n+3) {
    display: none !important;
  }
}

.instructor-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-left: 5px solid var(--color-accent);
  transition: all 0.3s ease;
}

.instructor-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.instructor-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--color-accent);
  flex-shrink: 0;
}

.instructor-name {
  margin: 0 0 0.25rem 0;
  font-size: 1.2rem;
  color: var(--color-primary);
}

.instructor-title {
  display: block;
  font-size: 0.85rem;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.instructor-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #666;
  margin: 0;
}

@media (max-width: 576px) {
  .instructor-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }
  .instructor-header {
    flex: 0 0 auto;
  }
}

.cta-section {
  background: var(--color-surface);
  padding: 1rem 0 2rem;
}

.cta-section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 1rem;
}

.cta-section p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.cta-section .btn {
  font-size: 1.05rem;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 218, 178, 0.8);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

.slider-btn:hover {
  background: #d6bd78;
  color: #000;
}

.slider-prev {
  left: 1rem;
}

.slider-next {
  right: 1rem;
}

@media (max-width: 991px) {
  .slider-btn {
    display: none;
  }

  .slider-container {
    padding: 0 1rem;
  }
}

/* === Back to Top === */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: #d9c485;
  color: var(--color-primary);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:not(.visible) {
  transform: translateY(20px);
}

.back-to-top:hover {
  background: var(--color-accent-hover);
  transform: translateY(-5px) !important;
  box-shadow: var(--shadow-xl);
}

/* --- Floating Bottom Navigation --- */
.floating-section-indicator {
  position: fixed;
  top: 67%;
  right: 0;
  /* Returning to the right side as requested */
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  padding: 1.4rem 1.6rem 1.4rem 1.0rem;
  /* Compact padding for the right edge */
  border-radius: 16px 0 0 16px;
  /* Rounded on the left side */
  box-shadow: -5px 10px 40px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-right: none;
  /* No border on the right edge */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  /* Compact gap */
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-70%);
  /* Consistent vertical offset */
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;

  /* Ensure it doesn't overflow */
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: none;
}

.floating-section-indicator::-webkit-scrollbar {
  display: none;
}

.floating-section-indicator.visible {
  opacity: 1;
  visibility: visible;
  right: -1.5rem;
  /* Peek out more than before (was -3rem) to stay visible while clearing buttons */
  transform: translateY(-70%);
}

.floating-section-indicator.visible:hover {
  right: 0;
  /* Fully reveal on hover */
  box-shadow: -10px 10px 40px rgba(0, 0, 0, 0.15);
}

.floating-nav-btn {
  font-size: 0.95rem;
  /* Larger font size as requested */
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  position: relative;
  padding: 0.2rem 0;
  /* Reduced vertical spacing */
  /* More vertical spacing */
  white-space: nowrap;
  transition: all 0.3s ease;
}

.floating-nav-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.3s ease;
}

.floating-nav-btn:hover {
  color: var(--color-accent);
}

.floating-nav-btn.active {
  color: var(--color-accent);
  font-weight: 700;
}

.floating-nav-btn.active::after {
  background: linear-gradient(135deg, var(--color-accent), #dbbc6a);
}

@media (max-width: 991px) {

  /* Hide the desktop style floating indicator by default on mobile, make it slide in on open */
  .floating-section-indicator {
    bottom: 130px;
    /* Above back-to-top and toggle */
    top: auto;
    right: -100%;
    /* Initially hidden off-screen */
    padding: 1rem 1.2rem;
    gap: 0.6rem;
    border-radius: 12px;
    border-right: 1px solid rgba(201, 168, 76, 0.25);
    /* Show right border to form a bubble */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.98);
    transform: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s, visibility 0.4s;
  }

  .floating-section-indicator.open {
    right: 1.5rem !important;
    /* Slide in */
    opacity: 1 !important;
    visibility: visible !important;
  }

  .floating-nav-btn {
    font-size: 0.85rem;
    padding: 0.2rem 0;
  }

  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}

/* Floating Toggle Button (Mobile Only) */
.floating-nav-toggle {
  display: none;
}

@media (max-width: 991px) {
  .floating-nav-toggle {
    display: flex;
    position: fixed;
    bottom: 74px;
    /* Above back-to-top (44px + 1.5rem = ~68px, slightly higher) */
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: #fff;
    color: var(--color-primary);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* When the page is scrolled past nav container, toggle becomes visible */
  .floating-nav-toggle.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .floating-nav-toggle:hover {
    background: var(--color-surface);
  }
}

/* === Procurement & Security === */
.procurement-search-container {
  margin-bottom: 2rem;
  position: relative;
}

.procurement-search-container .global-search-input {
  width: 350px;
  height: 50px;
  font-size: 1.1rem;
  padding-left: 1.5rem;
  padding-right: 2.5rem;
  box-shadow: var(--shadow-md);
  background: #fff;
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #999;
  cursor: pointer;
  display: none;
  padding: 5px;
  line-height: 0;
  transition: all 0.2s ease;
  z-index: 5;
}

.search-clear-btn i {
  width: 18px;
  height: 18px;
  display: block;
}

.search-clear-btn:hover {
  color: var(--color-accent);
  transform: translateY(-50%) scale(1.1);
}

.security-intro {
  text-align: center;
  margin-bottom: 4rem;
}

.security-p-justify {
  color: var(--color-text);
  line-height: 2.2;
  font-size: 1.05rem;
  text-align: justify;
  text-justify: inter-ideograph;
  padding: 0 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.security-motto-container {
  text-align: center;
  margin-bottom: 4rem;
}

.security-motto {
  font-size: clamp(1.1rem, 4.5vw, 25px);
  font-weight: bold;
  line-height: 2.2;
  color: #111;
  letter-spacing: 1px;
}

.policy-card {
  background: #ffffff;
  padding: 3rem 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
  border-bottom: 4px solid var(--color-accent);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.policy-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.policy-card-title {
  color: var(--color-primary);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  text-align: center;
  font-weight: 700;
}

.cert-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  max-width: 100%;
}

/* === Services Navigation Tab Bar (Centered + Static) === */
.service-nav-sticky {
  position: relative;
  z-index: 10;
  background: rgba(253, 250, 245, 0.98);
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

@media (max-width: 991px) {
  .service-nav-sticky {
    margin-bottom: 1.5rem;
  }
}

/* === Service Nav — tab bar horizontal scroll fix === */
#service-nav .tabs-nav {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#service-nav .tabs-nav::-webkit-scrollbar {
  display: none;
}

#service-nav .tab-btn {
  padding: 0.4rem 1.25rem;
}

@media (max-width: 991px) {
  #service-nav .tabs-nav {
    width: 100%;
    justify-content: flex-start;
    padding: 0.4rem;
  }

  #service-nav .tab-btn {
    padding: 0.35rem 1rem;
    font-size: 0.95rem;
  }
}

.service-nav-container {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  overflow-x: auto;
  gap: 0;
  padding: 0 5%;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.service-nav-container::-webkit-scrollbar {
  display: none;
}

.service-nav-btn {
  position: relative;
  padding: 1.25rem 1.75rem; /* Increased padding for better touch targets */
  font-size: 1.05rem; /* Slightly larger for clarity */
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: 0;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.3s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-nav-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  border-radius: 3px 3px 0 0;
  transition: background 0.3s ease;
}

.service-nav-btn:hover {
  color: var(--color-accent);
  transform: none;
  box-shadow: none;
}

.service-nav-btn.active {
  color: var(--color-accent);
  font-weight: 700;
  transform: none;
  box-shadow: none;
}

.service-nav-btn.active::after {
  background: linear-gradient(135deg, var(--color-accent), #dbbc6a);
}

@media (max-width: 991px) {
  .service-nav-container {
    justify-content: flex-start;
    padding: 0 0.5rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .service-nav-btn {
    font-size: 0.8rem;
    padding: 0.75rem 0.8rem;
    flex: 0 0 auto;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* === Certificate Section & Title Tabs === */
.title-tab-btn {
  opacity: 0.4;
  color: var(--text-color) !important;
  transition: all 0.3s ease;
  font-size: 2rem;
  font-weight: 700;
  background: transparent !important;
  box-shadow: none !important;
  border: none;
  padding: 0.5rem 1rem;
  line-height: 1.2;
}

.title-tabs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0;
}

.title-tabs span {
  font-size: 2rem;
}

/* 手機版適配：標題置中且縮小字體 */
@media (max-width: 767px) {
  .title-tabs {
    padding: 0 1rem;
  }

  .title-tab-btn {
    font-size: 1.3rem;
    padding: 0.25rem 0.5rem;
  }

  .title-tabs span {
    font-size: 1.3rem !important;
  }
}

.title-tab-btn.active {
  opacity: 1;
  color: var(--color-primary) !important;
}

.title-tab-btn:hover {
  opacity: 0.8;
}

/* 標題下拉選單樣式 */
.title-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #fff;
  min-width: 240px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.1);
  z-index: 100;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.dropdown-content button {
  color: var(--color-text);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: inherit;
}

.dropdown-content button:hover {
  background-color: var(--color-surface);
  color: var(--color-accent);
  padding-left: 20px;
}

.dropdown-content button.active {
  background-color: var(--color-accent);
  color: #fff !important;
  font-weight: 700;
  padding-left: 20px;
}

.title-dropdown:hover .dropdown-content {
  display: block;
  animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 疊加模式：確保完全不漏邊 */
.cert-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
  z-index: 1;
}

.cert-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

/* Only apply 2 columns to the top-level ul so nested lists aren't broken */
.tab-card>ul {
  columns: 2;
  column-gap: 1.5rem;
  margin-top: 1rem;
}

.tab-card>ul>li {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 0.6rem;
}

/* 手機版公司證照優化 */
@media (max-width: 767px) {
  .slider-outer-wrapper {
    padding: 0 10px !important;
  }

  .slider-container {
    aspect-ratio: 4/3 !important;
  }

  .slider-outer-wrapper .slider-btn {
    display: none !important;
  }

  #personSubCertsTrigger {
    width: 100% !important;
    padding: 0.6rem 1rem !important;
  }

  .sub-tabs-nav {
    justify-content: center !important;
    margin-bottom: 1.5rem !important;
  }

  .tab-card h3 {
    font-size: 1.2rem !important;
  }

  .tab-card p {
    font-size: 0.9rem !important;
  }

  .tab-card>ul {
    columns: 1 !important;
    column-gap: 0 !important;
    margin-top: 0.75rem !important;
  }

  .tab-card>ul>li {
    font-size: 0.95rem !important;
    line-height: 1.4 !important;
  }
}