/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

.header--transparent {
  background-color: transparent;
}

.header--solid {
  background-color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.header--solid .header__logo-img {
  content: url('../images/s3/cmt-logo-blue.png');
}

.header--solid .nav__link {
  color: var(--color-text);
}

.header--solid .nav__link:hover,
.header--solid .nav__link--active {
  color: var(--color-primary);
}

.header--solid .header__icon svg {
  stroke: var(--color-text);
}

.header--solid .header__contact-btn {
  color: var(--color-white);
}

.header__inner {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 27px;
}

.header__logo {
  flex-shrink: 0;
}

.header__logo-img {
  height: 70px;
  width: auto;
}

/* Navigation */
.nav__close {
  display: none;
}

.nav {
  display: flex;
  align-items: center;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 58px;
}

.nav__item {
  position: relative;
}

.nav__link {
  font-family: 'Heebo', sans-serif;
  color: #FFFFFF;
  font-size: 20px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--transition-fast);
}

.nav__link:hover,
.nav__link--active {
  color: var(--color-primary);
}

.nav__arrow {
  width: 12px;
  height: 8px;
  transition: transform var(--transition-fast);
}

.nav__item:hover .nav__arrow {
  transform: rotate(180deg);
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background-color: var(--color-white);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition-fast);
  z-index: var(--z-dropdown);
}

.nav__item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown__link {
  display: block;
  padding: 8px 24px;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 400;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.dropdown__link:hover {
  background-color: var(--color-bg-light);
  color: var(--color-primary);
}

.dropdown__link--sub {
  padding-left: 40px;
  font-size: 14px;
  color: var(--color-text-light);
}

/* Header right */
.header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header__icon {
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.header__icon:hover svg {
  stroke: var(--color-primary);
}

.header__icon svg {
  width: 24px;
  height: 24px;
  stroke: #FFFFFF;
  transition: stroke var(--transition-fast);
}

.header__contact-btn {
  width: 156px;
  height: 57px;
  background: #2AAAEC;
  border-radius: 71px;
  font-family: 'Heebo', sans-serif;
  font-size: 20px;
  font-weight: 400;
  color: #FFFFFF;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.header__contact-btn:hover {
  background: var(--color-primary-dark);
  transform: none;
  box-shadow: none;
}

/* Mobile hamburger */
.header__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.header__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #FFFFFF;
  transition: all var(--transition-base);
}

.header--solid .header__hamburger span {
  background-color: var(--color-text);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  height: var(--hero-height);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding-top: 260px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.2), rgba(0,0,0,0.2));
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--color-white);
}

.hero__title {
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-bold);
  color: var(--color-white);
  margin-bottom: 0;
  text-shadow: 0px 0px 23px #000000;
}

.hero__subtitle {
  font-size: 20px;
  opacity: 0.9;
  margin-bottom: var(--space-xl);
}

/* Home hero slider */
.hero--home {
  height: 1038px;
  padding-top: 420px;
}

.hero--home .hero__title {
  font-family: 'Heebo', sans-serif;
  font-size: 52px;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0px 0px 23px #000000;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}

.hero--home .hero__subtitle {
  font-family: 'Roboto', sans-serif;
  font-size: 28px;
  font-weight: 400;
  color: #FFFFFF;
  text-shadow: 0px 0px 23px #000000;
  opacity: 1;
  margin-bottom: 70px;
}

.hero__cta {
  background: #2AAAEC;
  font-family: 'Heebo', sans-serif;
  font-weight: 700;
  color: #FFFFFF;
  margin-top: 0;
}

.hero--manufacturing {
  height: 673px;
  padding-top: 290px;
}

.hero__content .btn {
  margin-top: 80px;
}

.hero__slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero__slide--active {
  opacity: 1;
}

.hero__dots {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 3;
}

.hero__dot {
  width: 16.4px;
  height: 16.4px;
  border-radius: 50%;
  border: 2px solid #2AAAEC;
  background: transparent;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  padding: 0;
}

.hero__dot--active {
  background: #2AAAEC;
}

/* Breadcrumb */
.breadcrumb {
  padding: 16px 0;
  font-size: 16px;
  color: var(--color-text-muted);
}

.breadcrumb a {
  color: var(--color-text-muted);
}

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

.breadcrumb__separator {
  margin: 0 8px;
}

/* Manufacturing sub-nav */
.subnav {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 24px 0;
  background-color: var(--color-white);
  border-bottom: 1px solid rgba(0,0,0,0.1);
  flex-wrap: wrap;
}

.subnav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--color-text-light);
  font-size: 13px;
  font-weight: 400;
  text-align: center;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all var(--transition-base);
  min-width: 100px;
}

.subnav__item:hover,
.subnav__item--active {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.subnav__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  border-radius: 8px;
  padding: 8px;
}

.subnav__icon svg {
  width: 24px;
  height: 24px;
}

/* Desktop: hide mobile-only nav elements */
.nav__logo-mobile,
.nav__contact-mobile {
  display: none;
}

.dropdown__link--active {
  color: var(--color-primary) !important;
  font-weight: 700;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header__inner {
    height: 60px;
    padding: 0 16px;
  }

  .header__logo-img {
    height: 35px;
  }

  .header__hamburger {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background-color: var(--color-white);
    flex-direction: column;
    align-items: flex-start;
    padding: 60px 24px;
    transition: right var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-overlay);
    overflow-y: auto;
  }

  .nav--open {
    right: 0;
  }

  .nav__list {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0;
  }

  .nav__link {
    color: var(--color-text);
    font-size: 16px;
    padding: 12px 0;
  }

  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding: 0;
    display: none;
  }

  .nav__item--open .dropdown {
    display: block;
  }

  .header__actions {
    display: none;
  }

  .nav__close {
    display: block;
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text);
  }

  .nav__logo-mobile {
    display: block;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #E0E0E0;
    width: 100%;
  }

  .nav__logo-mobile img {
    height: 40px;
    width: auto;
  }

  .nav__contact-mobile {
    display: block;
    width: 100%;
    background: #2AAAEC;
    color: #FFFFFF;
    text-align: center;
    border-radius: 71px;
    padding: 12px;
    margin-top: 20px;
    font-family: 'Heebo', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
  }

  .hero__title {
    font-size: 28px;
  }

  .hero--home .hero__title {
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 24px;
  }

  .hero--home .hero__subtitle {
    font-size: 16px;
  }

  /* ===== MOBILE HERO OVERRIDE ===== */
  .hero {
    /* 推翻桌面版 flex-start + padding-top 的設定 */
    align-items: center;
    padding-top: 0;
    min-height: 600px;
    height: auto;
  }

  .hero--home {
    height: 600px;
    padding-top: 0;
  }

  .hero--manufacturing {
    height: 500px;
    padding-top: 0;
  }

  .hero__content {
    padding: 0 20px;
    text-align: center;
  }

  .hero--home .hero__subtitle {
    margin-bottom: 30px;
  }

  .hero__content .btn {
    margin-top: 30px;
  }

  .subnav {
    gap: 8px;
    padding: 16px;
  }

  .subnav__item {
    min-width: auto;
    font-size: 0.65rem;
    padding: 4px;
  }

  .subnav__icon {
    width: 36px;
    height: 36px;
  }
}
